2008-04-23 13:10:27 +00:00
|
|
|
#Hilscher netX 500 CPU
|
2008-11-30 22:25:43 +00:00
|
|
|
|
2009-09-21 18:48:22 +00:00
|
|
|
if { [info exists CHIPNAME] } {
|
2011-10-29 21:32:17 +00:00
|
|
|
set _CHIPNAME $CHIPNAME
|
2009-09-21 18:48:22 +00:00
|
|
|
} else {
|
2011-10-29 21:32:17 +00:00
|
|
|
set _CHIPNAME netx500
|
2008-11-30 22:25:43 +00:00
|
|
|
}
|
|
|
|
|
2009-09-21 18:48:22 +00:00
|
|
|
if { [info exists ENDIAN] } {
|
2011-10-29 21:32:17 +00:00
|
|
|
set _ENDIAN $ENDIAN
|
2009-09-21 18:48:22 +00:00
|
|
|
} else {
|
2011-10-29 21:32:17 +00:00
|
|
|
set _ENDIAN little
|
2008-11-30 22:25:43 +00:00
|
|
|
}
|
|
|
|
|
2011-10-29 21:32:17 +00:00
|
|
|
if { [info exists CPUTAPID] } {
|
2008-11-30 22:25:43 +00:00
|
|
|
set _CPUTAPID $CPUTAPID
|
|
|
|
} else {
|
2009-11-20 20:21:00 +00:00
|
|
|
set _CPUTAPID 0x07926021
|
2008-11-30 22:25:43 +00:00
|
|
|
}
|
|
|
|
|
2009-11-20 20:21:00 +00:00
|
|
|
# jtag scan chain
|
|
|
|
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
|
|
|
|
|
|
|
|
# that TAP is associated with a target
|
2009-09-04 05:17:03 +00:00
|
|
|
set _TARGETNAME $_CHIPNAME.cpu
|
2009-11-20 20:21:00 +00:00
|
|
|
target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME
|
2008-07-28 06:08:05 +00:00
|
|
|
|
2010-12-16 14:33:16 +00:00
|
|
|
proc mread32 {addr} {
|
|
|
|
set value(0) 0
|
|
|
|
mem2array value 32 $addr 1
|
|
|
|
return $value(0)
|
|
|
|
}
|
|
|
|
|
|
|
|
# This function must be called on netX100/500 right after halt
|
|
|
|
# If it is called later the needed register cannot be written anymore
|
|
|
|
proc sdram_fix { } {
|
|
|
|
|
|
|
|
set accesskey [mread32 0x00100070]
|
2011-10-29 21:32:17 +00:00
|
|
|
mww 0x00100070 [expr $accesskey]
|
|
|
|
mww 0x0010002c 0x00000001
|
2010-12-16 14:33:16 +00:00
|
|
|
|
|
|
|
if {[expr [mread32 0x0010002c] & 0x07] == 0x07} {
|
|
|
|
puts "SDRAM Fix was not executed. Probably your CPU halted too late and the register is already locked!"
|
|
|
|
} else {
|
|
|
|
puts "SDRAM Fix succeeded!"
|
|
|
|
}
|
|
|
|
}
|