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.
 
 
 
 
 
 

131 lines
3.7 KiB

  1. ######################################
  2. # Target: DIGI ConnectCore Wi-9C
  3. ######################################
  4. reset_config trst_and_srst
  5. # FIXME use some standard target config, maybe create one from this
  6. #
  7. # source [find target/...cfg]
  8. if { [info exists CHIPNAME] } {
  9. set _CHIPNAME $CHIPNAME
  10. } else {
  11. set _CHIPNAME ns9360
  12. }
  13. if { [info exists ENDIAN] } {
  14. set _ENDIAN $ENDIAN
  15. } else {
  16. # This config file was defaulting to big endian..
  17. set _ENDIAN big
  18. }
  19. # What's a good fallback frequency for this board if RCLK is
  20. # not available??
  21. jtag_rclk 1000
  22. if { [info exists CPUTAPID] } {
  23. set _CPUTAPID $CPUTAPID
  24. } else {
  25. set _CPUTAPID 0x07926031
  26. }
  27. set _TARGETNAME $_CHIPNAME.cpu
  28. jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id $_CPUTAPID
  29. adapter_nsrst_delay 200
  30. jtag_ntrst_delay 0
  31. ######################
  32. # Target configuration
  33. ######################
  34. target create $_TARGETNAME arm926ejs -endian $_ENDIAN -chain-position $_TARGETNAME
  35. $_TARGETNAME configure -event reset-init {
  36. mww 0x90600104 0x33313333
  37. mww 0xA0700000 0x00000001 ;# Enable the memory controller.
  38. mww 0xA0700024 0x00000006 ;# Set the refresh counter 6
  39. mww 0xA0700028 0x00000001 ;#
  40. mww 0xA0700030 0x00000001 ;# Set the precharge period
  41. mww 0xA0700034 0x00000004 ;# Active to precharge command period is 16 clock cycles
  42. mww 0xA070003C 0x00000001 ;# tAPR
  43. mww 0xA0700040 0x00000005 ;# tDAL
  44. mww 0xA0700044 0x00000001 ;# tWR
  45. mww 0xA0700048 0x00000006 ;# tRC 32 clock cycles
  46. mww 0xA070004C 0x00000006 ;# tRFC 32 clock cycles
  47. mww 0xA0700054 0x00000001 ;# tRRD
  48. mww 0xA0700058 0x00000001 ;# tMRD
  49. mww 0xA0700100 0x00004280 ;# Dynamic Config 0 (cs4)
  50. mww 0xA0700120 0x00004280 ;# Dynamic Config 1 (cs5)
  51. mww 0xA0700140 0x00004280 ;# Dynamic Config 2 (cs6)
  52. mww 0xA0700160 0x00004280 ;# Dynamic Config 3 (cs7)
  53. #
  54. mww 0xA0700104 0x00000203 ;# CAS latency is 2 at 100 MHz
  55. mww 0xA0700124 0x00000203 ;# CAS latency is 2 at 100 MHz
  56. mww 0xA0700144 0x00000203 ;# CAS latency is 2 at 100 MHz
  57. mww 0xA0700164 0x00000203 ;# CAS latency is 2 at 100 MHz
  58. #
  59. mww 0xA0700020 0x00000103 ;# issue SDRAM PALL command
  60. #
  61. mww 0xA0700024 0x00000001 ;# Set the refresh counter to be as small as possible
  62. #
  63. # Add some dummy writes to give the SDRAM time to settle, it needs two
  64. # AHB clock cycles, here we poke in the debugger flag, this lets
  65. # the software know that we are in the debugger
  66. mww 0xA0900000 0x00000002
  67. mww 0xA0900000 0x00000002
  68. mww 0xA0900000 0x00000002
  69. mww 0xA0900000 0x00000002
  70. mww 0xA0900000 0x00000002
  71. #
  72. mdw 0xA0900000
  73. mdw 0xA0900000
  74. mdw 0xA0900000
  75. mdw 0xA0900000
  76. mdw 0xA0900000
  77. #
  78. mww 0xA0700024 0x00000030 ;# Set the refresh counter to 30
  79. mww 0xA0700020 0x00000083 ;# Issue SDRAM MODE command
  80. #
  81. # Next we perform a read of RAM.
  82. # mw = move word.
  83. mdw 0x00022000
  84. # mw 0x00022000:P, r3 # 22000 for cas2 latency, 32000 for cas 3
  85. #
  86. mww 0xA0700020 0x00000003 ;# issue SDRAM NORMAL command
  87. mww 0xA0700100 0x00084280 ;# Enable buffer access
  88. mww 0xA0700120 0x00084280 ;# Enable buffer access
  89. mww 0xA0700140 0x00084280 ;# Enable buffer access
  90. mww 0xA0700160 0x00084280 ;# Enable buffer access
  91. #Set byte lane state (static mem 1)"
  92. mww 0xA0700220 0x00000082
  93. #Flash Start
  94. mww 0xA09001F8 0x50000000
  95. #Flash Mask Reg
  96. mww 0xA09001FC 0xFF000001
  97. mww 0xA0700028 0x00000001
  98. # RAMAddr = 0x00020000
  99. # RAMSize = 0x00004000
  100. # Set the processor mode
  101. reg cpsr 0xd3
  102. }
  103. $_TARGETNAME configure -work-area-phys 0x00000000 -work-area-size 0x1000 -work-area-backup 1
  104. #####################
  105. # Flash configuration
  106. #####################
  107. #M29DW323DB - not working
  108. #flash bank <name> cfi <base> <size> <chip width> <bus width> <target>
  109. set _FLASHNAME $_CHIPNAME.flash
  110. flash bank $_FLASHNAME cfi 0x50000000 0x0400000 2 2 $_TARGETNAME