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.
 
 
 
 
 
 

88 lines
2.4 KiB

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