Fix support for ADuC702x flash. Courtesy of Michael Ashton <data@gtf.org>
[openocd.git] / src / target / target / aduc702x.cfg
blobef1beb78d801fd3c4ee99a48ea17f7b4278bca56
1 ## -*- tcl -*-
2 ##
5 if { [info exists CHIPNAME] } { 
6    set  _CHIPNAME $CHIPNAME    
7 } else {         
8    set  _CHIPNAME s3c2410
11 if { [info exists ENDIAN] } {   
12    set  _ENDIAN $ENDIAN    
13 } else {         
14   # This config file was defaulting to big endian..
15    set  _ENDIAN little
18 if { [info exists CPUTAPID] } { 
19    set  _CPUTAPID $CPUTAPID    
20 } else {         
21    set  _CPUTAPID 0xffffffff
25 jtag_nsrst_delay 200
26 jtag_ntrst_delay 200
28 # This is for the case that TRST/SRST is not wired on your JTAG adaptor.
29 # Don't really need them anyways.  
30 reset_config none
32 ## JTAG scan chain
33 #format L IRC IRCM IDCODE (Length, IR Capture, IR Capture Mask, IDCODE)
34 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
37 ## Target configuration
39 set _TARGETNAME [format "%s.cpu" $_CHIPNAME]
40 target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME
42 # allocate the entire SRAM as working area
43 $_TARGETNAME configure -work-area-phys 0x10000 -work-area-size 0x2000
45 ## flash configuration
46 # only target number is needed
47 flash bank aduc702x 0 0 0 0 0
49 ## If you use the watchdog, the following code makes sure that the board
50 ## doesn't reboot when halted via JTAG.  Yes, on the older generation
51 ## AdUC702x, timer3 continues running even when the CPU is halted.
53 proc watchdog_service {} {
54     global watchdog_hdl
55     mww 0xffff036c 0
56 #    puts "watchdog!!"
57     set watchdog_hdl [after 500 watchdog_service]
60 $_TARGETNAME configure -event reset-halt-post {  watchdog_service }
61 $_TARGETNAME configure -event old-pre_resume { global watchdog_hdl; after cancel $watchdog_hdl }