digi_connectcore_wi-9c.cfg 3.8 KB

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