X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=tcl%2Ftarget%2Flpc2294.cfg;h=83d595deb57f8bb87e85a681e86781720a47740a;hb=d8e4a7370f439a5feb3948d5ed33f0884b8109f3;hp=d20f0d30ad7eed8def3b0e609aa770359f4d5197;hpb=ce89c7bf6588c7b2800c4ca453278b6f94795130;p=fw%2Fopenocd
diff --git a/tcl/target/lpc2294.cfg b/tcl/target/lpc2294.cfg
index d20f0d30a..83d595deb 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
+}