1 #Written by: Michael Schwingen <rincewind@discworld.dascon.de>
3 if { [info exists CHIPNAME] } {
4 set _CHIPNAME $CHIPNAME
6 set _CHIPNAME xba_reva3
9 if { [info exists ENDIAN] } {
12 # default to big endian
16 if { [info exists CPUTAPID ] } {
17 set _CPUTAPID $CPUTAPID
19 # force an error till we get a good number
20 set _CPUTAPID 0xffffffff
23 reset_config trst_and_srst separate
29 jtag newtap $_CHIPNAME cpu -irlen 7 -ircapture 0x1 -irmask 0x7f -expected-id $_CPUTAPID
31 set _TARGETNAME $_CHIPNAME.cpu
32 target create $_TARGETNAME xscale -endian $_ENDIAN -chain-position $_TARGETNAME -variant ixp42x
34 $_TARGETNAME configure -event reset-init {
35 #############################################################################
36 # setup expansion bus CS, disable external wdt
37 #############################################################################
38 mww 0xc4000000 0xbd113842 #CS0 : Flash, write enabled @0x50000000
39 mww 0xc4000004 0x94d10013 #CS1
40 mww 0xc4000008 0x95960003 #CS2
41 mww 0xc400000c 0x00000000 #CS3
42 mww 0xc4000010 0x80900003 #CS4
43 mww 0xc4000014 0x9d520003 #CS5
44 mww 0xc4000018 0x81860001 #CS6
45 mww 0xc400001c 0x80900003 #CS7
47 #############################################################################
48 # init SDRAM controller: 16MB, one bank, CL3
49 #############################################################################
50 mww 0xCC000000 0x2A # SDRAM_CFG: 64MBit, CL3
51 mww 0xCC000004 0 # disable refresh
52 mww 0xCC000008 3 # NOP
54 mww 0xCC000004 2100 # set refresh counter
55 mww 0xCC000008 2 # Precharge All Banks
57 mww 0xCC000008 4 # Auto Refresh
58 mww 0xCC000008 4 # Auto Refresh
59 mww 0xCC000008 4 # Auto Refresh
60 mww 0xCC000008 4 # Auto Refresh
61 mww 0xCC000008 4 # Auto Refresh
62 mww 0xCC000008 4 # Auto Refresh
63 mww 0xCC000008 4 # Auto Refresh
64 mww 0xCC000008 4 # Auto Refresh
65 mww 0xCC000008 1 # Mode Select CL3
67 #mww 0xc4000020 0xffffee # CFG0: remove expansion bus boot flash
79 $_TARGETNAME configure -work-area-phys 0x20010000 -work-area-size 0x8060 -work-area-backup 0
82 set _FLASHNAME $_CHIPNAME.flash
83 flash bank $_FLASHNAME cfi 0x50000000 0x400000 2 2 $_TARGETNAME