README.fsl-ddr 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374
  1. Table of interleaving modes supported in cpu/8xxx/ddr/
  2. ======================================================
  3. +-------------+---------------------------------------------------------+
  4. | | Rank Interleaving |
  5. | +--------+-----------+-----------+------------+-----------+
  6. |Memory | | | | 2x2 | 4x1 |
  7. |Controller | None | 2x1 lower | 2x1 upper | {CS0+CS1}, | {CS0+CS1+ |
  8. |Interleaving | | {CS0+CS1} | {CS2+CS3} | {CS2+CS3} | CS2+CS3} |
  9. +-------------+--------+-----------+-----------+------------+-----------+
  10. |None | Yes | Yes | Yes | Yes | Yes |
  11. +-------------+--------+-----------+-----------+------------+-----------+
  12. |Cacheline | Yes | Yes | No | No, Only(*)| Yes |
  13. | |CS0 Only| | | {CS0+CS1} | |
  14. +-------------+--------+-----------+-----------+------------+-----------+
  15. |Page | Yes | Yes | No | No, Only(*)| Yes |
  16. | |CS0 Only| | | {CS0+CS1} | |
  17. +-------------+--------+-----------+-----------+------------+-----------+
  18. |Bank | Yes | Yes | No | No, Only(*)| Yes |
  19. | |CS0 Only| | | {CS0+CS1} | |
  20. +-------------+--------+-----------+-----------+------------+-----------+
  21. |Superbank | No | Yes | No | No, Only(*)| Yes |
  22. | | | | | {CS0+CS1} | |
  23. +-------------+--------+-----------+-----------+------------+-----------+
  24. (*) Although the hardware can be configured with memory controller
  25. interleaving using "2x2" rank interleaving, it only interleaves {CS0+CS1}
  26. from each controller. {CS2+CS3} on each controller are only rank
  27. interleaved on that controller.
  28. For memory controller interleaving, identical DIMMs are suggested. Software
  29. doesn't check the size or organization of interleaved DIMMs.
  30. The ways to configure the ddr interleaving mode
  31. ==============================================
  32. 1. In board header file(e.g.MPC8572DS.h), add default interleaving setting
  33. under "CONFIG_EXTRA_ENV_SETTINGS", like:
  34. #define CONFIG_EXTRA_ENV_SETTINGS \
  35. "hwconfig=fsl_ddr:ctlr_intlv=bank" \
  36. ......
  37. 2. Run u-boot "setenv" command to configure the memory interleaving mode.
  38. Either numerical or string value is accepted.
  39. # disable memory controller interleaving
  40. setenv hwconfig "fsl_ddr:ctlr_intlv=null"
  41. # cacheline interleaving
  42. setenv hwconfig "fsl_ddr:ctlr_intlv=cacheline"
  43. # page interleaving
  44. setenv hwconfig "fsl_ddr:ctlr_intlv=page"
  45. # bank interleaving
  46. setenv hwconfig "fsl_ddr:ctlr_intlv=bank"
  47. # superbank
  48. setenv hwconfig "fsl_ddr:ctlr_intlv=superbank"
  49. # disable bank (chip-select) interleaving
  50. setenv hwconfig "fsl_ddr:bank_intlv=null"
  51. # bank(chip-select) interleaving cs0+cs1
  52. setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1"
  53. # bank(chip-select) interleaving cs2+cs3
  54. setenv hwconfig "fsl_ddr:bank_intlv=cs2_cs3"
  55. # bank(chip-select) interleaving (cs0+cs1) and (cs2+cs3) (2x2)
  56. setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1_and_cs2_cs3"
  57. # bank(chip-select) interleaving (cs0+cs1+cs2+cs3) (4x1)
  58. setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1_cs2_cs3"
  59. Memory controller address hashing
  60. ==================================
  61. If the DDR controller supports address hashing, it can be enabled by hwconfig.
  62. Syntax is:
  63. hwconfig=fsl_ddr:addr_hash=true
  64. Memory controller ECC on/off
  65. ============================
  66. If ECC is enabled in board configuratoin file, i.e. #define CONFIG_DDR_ECC,
  67. ECC can be turned on/off by hwconfig.
  68. Syntax is
  69. hwconfig=fsl_ddr:ecc=off
  70. Memory testing options for mpc85xx
  71. ==================================
  72. 1. Memory test can be done once U-boot prompt comes up using mtest, or
  73. 2. Memory test can be done with Power-On-Self-Test function, activated at
  74. compile time.
  75. In order to enable the POST memory test, CONFIG_POST needs to be
  76. defined in board configuraiton header file. By default, POST memory test
  77. performs a fast test. A slow test can be enabled by changing the flag at
  78. compiling time. To test memory bigger than 2GB, 36BIT support is needed.
  79. Memory is tested within a 2GB window. TLBs are used to map the virtual 2GB
  80. window to physical address so that all physical memory can be tested.
  81. Combination of hwconfig
  82. =======================
  83. Hwconfig can be combined with multiple parameters, for example, on a supported
  84. platform
  85. hwconfig=fsl_ddr:addr_hash=true,ctlr_intlv=cacheline,bank_intlv=cs0_cs1_cs2_cs3,ecc=on
  86. Table for dynamic ODT for DDR3
  87. ==============================
  88. For single-slot system with quad-rank DIMM and dual-slot system, dynamic ODT may
  89. be needed, depending on the configuration. The numbers in the following tables are
  90. in Ohms.
  91. * denotes dynamic ODT
  92. Two slots system
  93. +-----------------------+----------+---------------+-----------------------------+-----------------------------+
  94. | Configuration | |DRAM controller| Slot 1 | Slot 2 |
  95. +-----------+-----------+----------+-------+-------+--------------+--------------+--------------+--------------+
  96. | | | | | | Rank 1 | Rank 2 | Rank 1 | Rank 2 |
  97. + Slot 1 | Slot 2 |Write/Read| Write | Read |-------+------+-------+------+-------+------+-------+------+
  98. | | | | | | Write | Read | Write | Read | Write | Read | Write | Read |
  99. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  100. | | | Slot 1 | off | 75 | 120 | off | off | off | off | off | 30 | 30 |
  101. | Dual Rank | Dual Rank |----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  102. | | | Slot 2 | off | 75 | off | off | 30 | 30 | 120 | off | off | off |
  103. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  104. | | | Slot 1 | off | 75 | 120 | off | off | off | 20 | 20 | | |
  105. | Dual Rank |Single Rank|----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  106. | | | Slot 2 | off | 75 | off | off | 20 | 20 | 120 *| off | | |
  107. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  108. | | | Slot 1 | off | 75 | 120 *| off | | | off | off | 20 | 20 |
  109. |Single Rank| Dual Rank |----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  110. | | | Slot 2 | off | 75 | 20 | 20 | | | 120 | off | off | off |
  111. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  112. | | | Slot 1 | off | 75 | 120 *| off | | | 30 | 30 | | |
  113. |Single Rank|Single Rank|----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  114. | | | Slot 2 | off | 75 | 30 | 30 | | | 120 *| off | | |
  115. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  116. | Dual Rank | Empty | Slot 1 | off | 75 | 40 | off | off | off | | | | |
  117. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  118. | Empty | Dual Rank | Slot 2 | off | 75 | | | | | 40 | off | off | off |
  119. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  120. |Single Rank| Empty | Slot 1 | off | 75 | 40 | off | | | | | | |
  121. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  122. | Empty |Single Rank| Slot 2 | off | 75 | | | | | 40 | off | | |
  123. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  124. Single slot system
  125. +-------------+------------+---------------+-----------------------------+-----------------------------+
  126. | | |DRAM controller| Rank 1 | Rank 2 | Rank 3 | Rank 4 |
  127. |Configuration| Write/Read |-------+-------+-------+------+-------+------+-------+------+-------+------+
  128. | | | Write | Read | Write | Read | Write | Read | Write | Read | Write | Read |
  129. +-------------+------------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  130. | | R1 | off | 75 | 120 *| off | off | off | 20 | 20 | off | off |
  131. | |------------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  132. | | R2 | off | 75 | off | 20 | 120 | off | 20 | 20 | off | off |
  133. | Quad Rank |------------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  134. | | R3 | off | 75 | 20 | 20 | off | off | 120 *| off | off | off |
  135. | |------------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  136. | | R4 | off | 75 | 20 | 20 | off | off | off | 20 | 120 | off |
  137. +-------------+------------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  138. | | R1 | off | 75 | 40 | off | off | off |
  139. | Dual Rank |------------+-------+-------+-------+------+-------+------+
  140. | | R2 | off | 75 | 40 | off | off | off |
  141. +-------------+------------+-------+-------+-------+------+-------+------+
  142. | Single Rank | R1 | off | 75 | 40 | off |
  143. +-------------+------------+-------+-------+-------+------+
  144. Reference http://www.xrosstalkmag.com/mag_issues/xrosstalk_oct08_final.pdf
  145. http://download.micron.com/pdf/technotes/ddr3/tn4108_ddr3_design_guide.pdf
  146. Table for ODT for DDR2
  147. ======================
  148. Two slots system
  149. +-----------------------+----------+---------------+-----------------------------+-----------------------------+
  150. | Configuration | |DRAM controller| Slot 1 | Slot 2 |
  151. +-----------+-----------+----------+-------+-------+--------------+--------------+--------------+--------------+
  152. | | | | | | Rank 1 | Rank 2 | Rank 1 | Rank 2 |
  153. + Slot 1 | Slot 2 |Write/Read| Write | Read |-------+------+-------+------+-------+------+-------+------+
  154. | | | | | | Write | Read | Write | Read | Write | Read | Write | Read |
  155. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  156. | | | Slot 1 | off | 150 | off | off | off | off | 75 | 75 | off | off |
  157. | Dual Rank | Dual Rank |----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  158. | | | Slot 2 | off | 150 | 75 | 75 | off | off | off | off | off | off |
  159. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  160. | | | Slot 1 | off | 150 | off | off | off | off | 75 | 75 | | |
  161. | Dual Rank |Single Rank|----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  162. | | | Slot 2 | off | 150 | 75 | 75 | off | off | off | off | | |
  163. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  164. | | | Slot 1 | off | 150 | off | off | | | 75 | 75 | off | off |
  165. |Single Rank| Dual Rank |----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  166. | | | Slot 2 | off | 150 | 75 | 75 | | | off | off | off | off |
  167. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  168. | | | Slot 1 | off | 150 | off | off | | | 75 | 75 | | |
  169. |Single Rank|Single Rank|----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  170. | | | Slot 2 | off | 150 | 75 | 75 | | | off | off | | |
  171. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  172. | Dual Rank | Empty | Slot 1 | off | 75 | 150 | off | off | off | | | | |
  173. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  174. | Empty | Dual Rank | Slot 2 | off | 75 | | | | | 150 | off | off | off |
  175. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  176. |Single Rank| Empty | Slot 1 | off | 75 | 150 | off | | | | | | |
  177. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  178. | Empty |Single Rank| Slot 2 | off | 75 | | | | | 150 | off | | |
  179. +-----------+-----------+----------+-------+-------+-------+------+-------+------+-------+------+-------+------+
  180. Single slot system
  181. +-------------+------------+---------------+-----------------------------+
  182. | | |DRAM controller| Rank 1 | Rank 2 |
  183. |Configuration| Write/Read |-------+-------+-------+------+-------+------+
  184. | | | Write | Read | Write | Read | Write | Read |
  185. +-------------+------------+-------+-------+-------+------+-------+------+
  186. | | R1 | off | 75 | 150 | off | off | off |
  187. | Dual Rank |------------+-------+-------+-------+------+-------+------+
  188. | | R2 | off | 75 | 150 | off | off | off |
  189. +-------------+------------+-------+-------+-------+------+-------+------+
  190. | Single Rank | R1 | off | 75 | 150 | off |
  191. +-------------+------------+-------+-------+-------+------+
  192. Reference http://www.samsung.com/global/business/semiconductor/products/dram/downloads/applicationnote/ddr2_odt_control_200603.pdf
  193. Interactive DDR debugging
  194. ===========================
  195. For DDR parameter tuning up and debugging, the interactive DDR debugging can
  196. be activated by saving an environment variable "ddr_interactive". The value
  197. doesn't matter. Once activated, U-boot prompts "FSL DDR>" before enabling DDR
  198. controller. The available commands can be seen by typing "help".
  199. The example flow of using interactive debugging is
  200. type command "compute" to calculate the parameters from the default
  201. type command "print" with arguments to show SPD, options, registers
  202. type command "edit" with arguments to change any if desired
  203. type command "go" to continue calculation and enable DDR controller
  204. type command "reset" to reset the board
  205. type command "recompute" to reload SPD and start over
  206. Note, check "next_step" to show the flow. For example, after edit opts, the
  207. next_step is STEP_ASSIGN_ADDRESSES. After editing registers, the next_step is
  208. STEP_PROGRAM_REGS. Upon issuing command "go", DDR controller will be enabled
  209. with current setting without further calculation.
  210. The detail syntax for each commands are
  211. print [c<n>] [d<n>] [spd] [dimmparms] [commonparms] [opts] [addresses] [regs]
  212. c<n> - the controller number, eg. c0, c1
  213. d<n> - the DIMM number, eg. d0, d1
  214. spd - print SPD data
  215. dimmparms - DIMM paramaters, calcualted from SPD
  216. commonparms - lowest common parameters for all DIMMs
  217. opts - options
  218. addresses - address assignment (not implemented yet)
  219. regs - controller registers
  220. edit <c#> <d#> <spd|dimmparms|commonparms|opts|addresses|regs> <element> <value>
  221. c<n> - the controller number, eg. c0, c1
  222. d<n> - the DIMM number, eg. d0, d1
  223. spd - print SPD data
  224. dimmparms - DIMM paramaters, calcualted from SPD
  225. commonparms - lowest common parameters for all DIMMs
  226. opts - options
  227. addresses - address assignment (not implemented yet)
  228. regs - controller registers
  229. <element> - name of the modified element
  230. byte number if the object is SPD
  231. <value> - decimal or heximal (prefixed with 0x) numbers
  232. reset
  233. no arguement - reset the board
  234. recompute
  235. no argument - reload SPD and start over
  236. compute
  237. no argument - recompute from current next_step
  238. next_step
  239. no argument - show current next_step
  240. help
  241. no argument - print a list of all commands
  242. go
  243. no argument - program memory controller(s) and continue with U-boot
  244. Examples of debugging flow
  245. FSL DDR>compute
  246. Detected UDIMM UG51U6400N8SU-ACF
  247. SL DDR>print
  248. print [c<n>] [d<n>] [spd] [dimmparms] [commonparms] [opts] [addresses] [regs]
  249. FSL DDR>print dimmparms
  250. DIMM parameters: Controller=0 DIMM=0
  251. DIMM organization parameters:
  252. module part name = UG51U6400N8SU-ACF
  253. rank_density = 2147483648 bytes (2048 megabytes)
  254. capacity = 4294967296 bytes (4096 megabytes)
  255. burst_lengths_bitmask = 0C
  256. base_addresss = 0 (00000000 00000000)
  257. n_ranks = 2
  258. data_width = 64
  259. primary_sdram_width = 64
  260. ec_sdram_width = 0
  261. registered_dimm = 0
  262. n_row_addr = 15
  263. n_col_addr = 10
  264. edc_config = 0
  265. n_banks_per_sdram_device = 8
  266. tCKmin_X_ps = 1500
  267. tCKmin_X_minus_1_ps = 0
  268. tCKmin_X_minus_2_ps = 0
  269. tCKmax_ps = 0
  270. caslat_X = 960
  271. tAA_ps = 13125
  272. caslat_X_minus_1 = 0
  273. caslat_X_minus_2 = 0
  274. caslat_lowest_derated = 0
  275. tRCD_ps = 13125
  276. tRP_ps = 13125
  277. tRAS_ps = 36000
  278. tWR_ps = 15000
  279. tWTR_ps = 7500
  280. tRFC_ps = 160000
  281. tRRD_ps = 6000
  282. tRC_ps = 49125
  283. refresh_rate_ps = 7800000
  284. tIS_ps = 0
  285. tIH_ps = 0
  286. tDS_ps = 0
  287. tDH_ps = 0
  288. tRTP_ps = 7500
  289. tDQSQ_max_ps = 0
  290. tQHS_ps = 0
  291. FSL DDR>edit c0 opts ECC_mode 0
  292. FSL DDR>edit c0 regs cs0_bnds 0x000000FF
  293. FSL DDR>go
  294. 2 GiB left unmapped
  295. 4 GiB (DDR3, 64-bit, CL=9, ECC off)
  296. DDR Chip-Select Interleaving Mode: CS0+CS1
  297. Testing 0x00000000 - 0x7fffffff
  298. Testing 0x80000000 - 0xffffffff
  299. Remap DDR 2 GiB left unmapped
  300. POST memory PASSED
  301. Flash: 128 MiB
  302. L2: 128 KB enabled
  303. Corenet Platform Cache: 1024 KB enabled
  304. SERDES: timeout resetting bank 3
  305. SRIO1: disabled
  306. SRIO2: disabled
  307. MMC: FSL_ESDHC: 0
  308. EEPROM: Invalid ID (ff ff ff ff)
  309. PCIe1: disabled
  310. PCIe2: Root Complex, x1, regs @ 0xfe201000
  311. 01:00.0 - 8086:10d3 - Network controller
  312. PCIe2: Bus 00 - 01
  313. PCIe3: disabled
  314. In: serial
  315. Out: serial
  316. Err: serial
  317. Net: Initializing Fman
  318. Fman1: Uploading microcode version 101.8.0
  319. e1000: 00:1b:21:81:d2:e0
  320. FM1@DTSEC1, FM1@DTSEC2, FM1@DTSEC3, FM1@DTSEC4, FM1@DTSEC5, e1000#0 [PRIME]
  321. Warning: e1000#0 MAC addresses don't match:
  322. Address in SROM is 00:1b:21:81:d2:e0
  323. Address in environment is 00:e0:0c:00:ea:05
  324. Hit any key to stop autoboot: 0
  325. =>