1 # SPDX-License-Identifier: GPL-2.0-or-later
5 # FIXME use some standard target config, maybe create one from this
7 # source [find target/...cfg]
9 if { [info exists CHIPNAME] } {
10 set _CHIPNAME $CHIPNAME
12 set _CHIPNAME at91eb40a
15 if { [info exists ENDIAN] } {
21 if { [info exists CPUTAPID] } {
22 set _CPUTAPID $CPUTAPID
24 set _CPUTAPID 0x1f0f0f0f
28 #Atmel ties SRST & TRST together, at which point it makes
29 #no sense to use TRST, but use TMS instead.
31 #The annoying thing with tying SRST & TRST together is that
32 #there is no way to halt the CPU *before and during* the
33 #SRST reset, which means that the CPU will run a number
34 #of cycles before it can be halted(as much as milliseconds).
35 reset_config srst_only srst_pulls_trst
38 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
41 set _TARGETNAME $_CHIPNAME.cpu
42 target create $_TARGETNAME arm7tdmi -endian $_ENDIAN -chain-position $_TARGETNAME
44 # speed up memory downloads
45 arm7_9 fast_memory_access enable
46 arm7_9 dcc_downloads enable
49 set _FLASHNAME $_CHIPNAME.flash
50 flash bank $_FLASHNAME cfi 0x01000000 0x200000 2 2 $_TARGETNAME
52 # required for usable performance. Used for lots of
53 # other things than flash programming.
54 $_TARGETNAME configure -work-area-phys 0x00030000 -work-area-size 0x10000 -work-area-backup 0
56 $_TARGETNAME configure -event reset-init {
57 echo "Running reset init script for AT91EB40A"
58 # Reset script for AT91EB40a
61 mww 0xFFE00024 0x00000000
62 mww 0xFFE00000 0x01002539
63 mww 0xFFFFF124 0xFFFFFFFF
68 # This target is pretty snappy...