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.
 
 
 
 
 
 

182 lines
3.6 KiB

  1. # Board configuration file for Amazon Kindle Model No. D00701 and D00801
  2. # AKA Kindle 2nd generation and Kindle DX
  3. # using a Freescale MCIMX31LDVKN5D i.MX31 processor
  4. #
  5. # Pins at J9 40-Pin FFC-A:
  6. # 1 - GND
  7. # 16 - TRSTB
  8. # 17 - TDI
  9. # 18 - TMS
  10. # 19 - TCK
  11. # 20 - RTCK
  12. # 21 - TDO
  13. # 22 - DE
  14. # 25 - BOOT_MODE4
  15. # 27 - BOOT_MODE2
  16. source [find target/imx31.cfg]
  17. source [find target/imx.cfg]
  18. $_TARGETNAME configure -event reset-init { kindle2_init }
  19. $_TARGETNAME configure -event reset-start { adapter speed 1000 }
  20. # 8MiB NOR Flash
  21. set _FLASHNAME $_CHIPNAME.flash
  22. flash bank $_FLASHNAME cfi 0xa0000000 0x800000 2 2 $_TARGETNAME
  23. # 16kiB internal SRAM
  24. $_TARGETNAME configure -work-area-phys 0x1fffc000 \
  25. -work-area-size 0x4000 -work-area-backup 0
  26. # FIXME: currently SRST is not wired to the system
  27. reset_config trst_only
  28. jtag_ntrst_assert_width 10
  29. jtag_ntrst_delay 30
  30. # this is broken but enabled by default
  31. arm11 memwrite burst disable
  32. adapter speed 1000
  33. ftdi tdo_sample_edge falling
  34. proc kindle2_init {} {
  35. imx3x_reset
  36. kindle2_clock_setup
  37. disable_mmu_and_cache
  38. kindle2_misc_init
  39. kindle2_sdram_init
  40. arm core_state arm
  41. }
  42. proc kindle2_clock_setup {} {
  43. # CCMR: clock from FPM/CKIL
  44. mww 0x53f80000 0x074b0b7b
  45. # IPU_CONF
  46. mww 0x53fc0000 0x040
  47. # 398MHz
  48. mww 0x53f80004 0xff871650
  49. mww 0x53f80010 0x00331c23
  50. }
  51. proc kindle2_misc_init { } {
  52. # AIPS1
  53. mww 0x43f00040 0x0
  54. mww 0x43f00044 0x0
  55. mww 0x43f00048 0x0
  56. mww 0x43f0004c 0x0
  57. mww 0x43f00050 0x0
  58. mww 0x43f00000 0x77777777
  59. mww 0x43f00004 0x77777777
  60. # AIPS2
  61. mww 0x53f00040 0x0
  62. mww 0x53f00044 0x0
  63. mww 0x53f00048 0x0
  64. mww 0x53f0004c 0x0
  65. mww 0x53f00050 0x0
  66. mww 0x53f00000 0x77777777
  67. mww 0x53f00004 0x77777777
  68. # Start 16 bit NorFlash Initialization on CS0
  69. mww 0xb8002000 0x0000cc03
  70. mww 0xb8002004 0xa0330d01
  71. mww 0xb8002008 0x00220800
  72. }
  73. proc disable_mmu_and_cache {} {
  74. # Mode Supervisor, disable FIQ, IRQ and imprecise data aborts
  75. reg cpsr 0x1d3
  76. # flush entire BTAC
  77. arm mcr 15 0 7 5 6 0
  78. # invalidate instruction and data cache
  79. # MCR CP15, 0, R1, C7, C7, 0
  80. arm mcr 15 0 7 7 0
  81. # clean and invalidate cache
  82. arm mcr 15 0 7 15 0
  83. # disable MMU and caches
  84. arm mcr 15 0 1 0 0 0
  85. arm mcr 15 0 15 2 4 0
  86. # invalidate TLBs
  87. arm mcr 15 0 8 7 0 0
  88. # Drain the write buffer
  89. arm mcr 15 0 7 10 4 0
  90. # start from AIPS 2GB region
  91. arm mcr 15 0 15 2 4 0x40000015
  92. }
  93. proc kindle2_sdram_init {} {
  94. #--------------------------------------------
  95. # Samsung K4X1G323PC-8GC3 32Mx32 Mobile DDR SDRAM
  96. #--------------------------------------------
  97. # SDCLK
  98. mww 0x43fac26c 0
  99. # CAS
  100. mww 0x43fac270 0
  101. # RAS
  102. mww 0x43fac274 0
  103. # CS2 (CSD0)
  104. mww 0x43fac27c 0x1000
  105. # DQM3
  106. mww 0x43fac284 0
  107. # DQM2, DQM1, DQM0, SD31-SD0, A25-A0, MA10 (0x288..0x2dc)
  108. mww 0x43fac288 0
  109. mww 0x43fac28c 0
  110. mww 0x43fac290 0
  111. mww 0x43fac294 0
  112. mww 0x43fac298 0
  113. mww 0x43fac29c 0
  114. mww 0x43fac2a0 0
  115. mww 0x43fac2a4 0
  116. mww 0x43fac2a8 0
  117. mww 0x43fac2ac 0
  118. mww 0x43fac2b0 0
  119. mww 0x43fac2b4 0
  120. mww 0x43fac2b8 0
  121. mww 0x43fac2bc 0
  122. mww 0x43fac2c0 0
  123. mww 0x43fac2c4 0
  124. mww 0x43fac2c8 0
  125. mww 0x43fac2cc 0
  126. mww 0x43fac2d0 0
  127. mww 0x43fac2d4 0
  128. mww 0x43fac2d8 0
  129. mww 0x43fac2dc 0
  130. # ?
  131. mww 0xb8002000 0x00006602
  132. mww 0xb8002004 0x00000501
  133. mww 0xb8002008 0x00000000
  134. # LPDDR1 Initialization script
  135. mww 0xb8001010 0x00000002
  136. mww 0xb8001010 0x00000004
  137. # ESDCFG0: set timing parameters
  138. mww 0xb8001004 0x007fff7f
  139. # ESDCTL0: select Prechare-All mode
  140. mww 0xb8001000 0x92100000
  141. mww 0x80000f00 0x12344321
  142. # ESDCTL0: Auto Refresh
  143. mww 0xb8001000 0xa2100000
  144. mww 0x80000000 0x12344321
  145. mww 0x80000000 0x12344321
  146. # ESDCTL0: Load Mode Register
  147. mww 0xb8001000 0xb2100000
  148. mwb 0x80000033 0xda
  149. mwb 0x81000000 0xff
  150. # ESDCTL0: enable Auto-Refresh
  151. mww 0xb8001000 0x82226080
  152. mww 0x80000000 0xdeadbeef
  153. }