c6510c613810348d27e79cb000f264d927e1f43a
[fw/openocd] / tcl / target / hilscher_netx50.cfg
1 ################################################################################
2 # Author: Michael Trensch (MTrensch@googlemail.com)
3 ################################################################################
4
5 #Hilscher netX 50 CPU
6
7 if { [info exists CHIPNAME] } {
8    set _CHIPNAME $CHIPNAME
9 } else {
10    set _CHIPNAME netx50
11 }
12
13 if { [info exists ENDIAN] } {
14    set _ENDIAN $ENDIAN
15 } else {
16    set _ENDIAN little
17 }
18
19 if { [info exists CPUTAPID] } {
20    set _CPUTAPID $CPUTAPID
21 } else {
22    set _CPUTAPID 0x25966021
23 }
24
25 # jtag scan chain
26 jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
27
28 # that TAP is associated with a target
29 set _TARGETNAME $_CHIPNAME.cpu
30 target create $_TARGETNAME arm966e -endian $_ENDIAN -chain-position $_TARGETNAME
31
32 # On netX50 SDRAM is not accessible at offset 0xDEAD0-0xDEADF as it is busy from
33 # DMA controller at init. This function will setup a dummy DMA to free this ares
34 # and must be called before using SDRAM
35 proc sdram_fix { } {
36
37   mww 0x1c005830 0x00000001
38
39   mww 0x1c005104 0xBFFFFFFC
40   mww 0x1c00510c 0x00480001
41   mww 0x1c005110 0x00000001
42
43   sleep 100
44
45   mww 0x1c00510c 0
46   mww 0x1c005110 0
47   mww 0x1c005830 0x00000000
48
49         puts "SDRAM Fix executed!"
50 }