You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

48 lines
1.1 KiB

  1. #Hilscher netX 500 CPU
  2. if { [info exists CHIPNAME] } {
  3. set _CHIPNAME $CHIPNAME
  4. } else {
  5. set _CHIPNAME netx500
  6. }
  7. if { [info exists ENDIAN] } {
  8. set _ENDIAN $ENDIAN
  9. } else {
  10. set _ENDIAN little
  11. }
  12. if { [info exists CPUTAPID] } {
  13. set _CPUTAPID $CPUTAPID
  14. } else {
  15. set _CPUTAPID 0x07926021
  16. }
  17. # jtag scan chain
  18. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  19. # that TAP is associated with a target
  20. set _TARGETNAME $_CHIPNAME.cpu
  21. target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME
  22. proc mread32 {addr} {
  23. set value(0) 0
  24. mem2array value 32 $addr 1
  25. return $value(0)
  26. }
  27. # This function must be called on netX100/500 right after halt
  28. # If it is called later the needed register cannot be written anymore
  29. proc sdram_fix { } {
  30. set accesskey [mread32 0x00100070]
  31. mww 0x00100070 [expr $accesskey]
  32. mww 0x0010002c 0x00000001
  33. if {[expr [mread32 0x0010002c] & 0x07] == 0x07} {
  34. puts "SDRAM Fix was not executed. Probably your CPU halted too late and the register is already locked!"
  35. } else {
  36. puts "SDRAM Fix succeeded!"
  37. }
  38. }