X-Git-Url: https://review.openocd.org/gitweb?p=openocd.git;a=blobdiff_plain;f=tcl%2Ftarget%2Flpc2294.cfg;h=83d595deb57f8bb87e85a681e86781720a47740a;hp=399b11dfb7bdfa9fbfb2f7c99d8ba34311ab1189;hb=38030e011542a894237b517c065d22db97525954;hpb=71af49ca7fb11b0bd0c1ba9578826f49288b68ef
diff --git a/tcl/target/lpc2294.cfg b/tcl/target/lpc2294.cfg
index 399b11dfb7..83d595deb5 100644
--- a/tcl/target/lpc2294.cfg
+++ b/tcl/target/lpc2294.cfg
@@ -1,38 +1,23 @@
-if { [info exists CHIPNAME] } {
- set _CHIPNAME $CHIPNAME
-} else {
- set _CHIPNAME lpc2294
-}
-
-if { [info exists ENDIAN] } {
- set _ENDIAN $ENDIAN
-} else {
- set _ENDIAN little
-}
-
-if { [info exists CPUTAPID ] } {
- set _CPUTAPID $CPUTAPID
-} else {
- # force an error till we get a good number
- set _CPUTAPID 0xffffffff
-}
+# NXP LPC2294 ARM7TDMI-S with 256kB flash and 16kB SRAM, clocked with 12MHz crystal
-jtag_nsrst_delay 200
-jtag_ntrst_delay 200
+source [find target/lpc2xxx.cfg]
-#use combined on interfaces or targets that can't set TRST/SRST separately
-reset_config trst_and_srst srst_pulls_trst
+# parameters:
+# - core_freq_khz - frequency of core in kHz during flashing, usually equal to connected crystal or internal oscillator, e.g. 12000
+# - adapter_freq_khz - frequency of debug adapter in kHz, should be 8x slower than core_freq_khz, e.g. 1000
-#jtag scan chain
-jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
-
-set _TARGETNAME $_CHIPNAME.cpu
-target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME -variant arm7tdmi-s_r4
-$_TARGETNAME configure -work-area-virt 0 -work-area-phys 0x40000000 -work-area-size 0x4000 -work-area-backup 0
-
-#flash configuration
-#flash bank lpc2000 0 0
-flash bank lpc2000 0x0 0x40000 0 0 0 lpc2000_v1 14765 calc_checksum
+proc setup_lpc2294 {core_freq_khz adapter_freq_khz} {
+ # 256kB flash and 16kB SRAM
+ # setup_lpc2xxx
+
+ # !! TAPID unknown !!
+ setup_lpc2xxx lpc2294 0xffffffff 0x40000 lpc2000_v1 0x4000 $core_freq_khz $adapter_freq_khz
+}
-# For more information about the configuration files, take a look at:
-# openocd.texi
+proc init_targets {} {
+ # default to core clocked with 12MHz crystal
+ echo "Warning - assuming default core clock 12MHz! Flashing may fail if actual core clock is different."
+
+ # setup_lpc2294
+ setup_lpc2294 12000 1500
+}