sdram.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. /*
  2. * Timing and Organization details of the ddr device parts used in OMAP5
  3. * EVM
  4. *
  5. * (C) Copyright 2010
  6. * Texas Instruments, <www.ti.com>
  7. *
  8. * Aneesh V <aneesh@ti.com>
  9. * Sricharan R <r.sricharan@ti.com>
  10. *
  11. * See file CREDITS for list of people who contributed to this
  12. * project.
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public License
  25. * along with this program; if not, write to the Free Software
  26. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  27. * MA 02111-1307 USA
  28. */
  29. #include <asm/emif.h>
  30. #include <asm/arch/sys_proto.h>
  31. /*
  32. * This file provides details of the LPDDR2 SDRAM parts used on OMAP5
  33. * EVM. Since the parts used and geometry are identical for
  34. * evm for a given OMAP5 revision, this information is kept
  35. * here instead of being in board directory. However the key functions
  36. * exported are weakly linked so that they can be over-ridden in the board
  37. * directory if there is a OMAP5 board in the future that uses a different
  38. * memory device or geometry.
  39. *
  40. * For any new board with different memory devices over-ride one or more
  41. * of the following functions as per the CONFIG flags you intend to enable:
  42. * - emif_get_reg_dump()
  43. * - emif_get_dmm_regs()
  44. * - emif_get_device_details()
  45. * - emif_get_device_timings()
  46. */
  47. #ifdef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS
  48. const struct emif_regs emif_regs_532_mhz_2cs = {
  49. .sdram_config_init = 0x80800EBA,
  50. .sdram_config = 0x808022BA,
  51. .ref_ctrl = 0x0000081A,
  52. .sdram_tim1 = 0x772F6873,
  53. .sdram_tim2 = 0x304a129a,
  54. .sdram_tim3 = 0x02f7e45f,
  55. .read_idle_ctrl = 0x00050000,
  56. .zq_config = 0x000b3215,
  57. .temp_alert_config = 0x08000a05,
  58. .emif_ddr_phy_ctlr_1_init = 0x0E28420d,
  59. .emif_ddr_phy_ctlr_1 = 0x0E28420d,
  60. .emif_ddr_ext_phy_ctrl_1 = 0x04020080,
  61. .emif_ddr_ext_phy_ctrl_2 = 0x28C518A3,
  62. .emif_ddr_ext_phy_ctrl_3 = 0x518A3146,
  63. .emif_ddr_ext_phy_ctrl_4 = 0x0014628C,
  64. .emif_ddr_ext_phy_ctrl_5 = 0x04010040
  65. };
  66. const struct emif_regs emif_regs_532_mhz_2cs_es2 = {
  67. .sdram_config_init = 0x80800EBA,
  68. .sdram_config = 0x808022BA,
  69. .ref_ctrl = 0x0000081A,
  70. .sdram_tim1 = 0x772F6873,
  71. .sdram_tim2 = 0x304a129a,
  72. .sdram_tim3 = 0x02f7e45f,
  73. .read_idle_ctrl = 0x00050000,
  74. .zq_config = 0x100b3215,
  75. .temp_alert_config = 0x08000a05,
  76. .emif_ddr_phy_ctlr_1_init = 0x0E30400d,
  77. .emif_ddr_phy_ctlr_1 = 0x0E30400d,
  78. .emif_ddr_ext_phy_ctrl_1 = 0x04020080,
  79. .emif_ddr_ext_phy_ctrl_2 = 0x28C518A3,
  80. .emif_ddr_ext_phy_ctrl_3 = 0x518A3146,
  81. .emif_ddr_ext_phy_ctrl_4 = 0x0014628C,
  82. .emif_ddr_ext_phy_ctrl_5 = 0xC330CC33,
  83. };
  84. const struct emif_regs emif_regs_266_mhz_2cs = {
  85. .sdram_config_init = 0x80800EBA,
  86. .sdram_config = 0x808022BA,
  87. .ref_ctrl = 0x0000040D,
  88. .sdram_tim1 = 0x2A86B419,
  89. .sdram_tim2 = 0x1025094A,
  90. .sdram_tim3 = 0x026BA22F,
  91. .read_idle_ctrl = 0x00050000,
  92. .zq_config = 0x000b3215,
  93. .temp_alert_config = 0x08000a05,
  94. .emif_ddr_phy_ctlr_1_init = 0x0E28420d,
  95. .emif_ddr_phy_ctlr_1 = 0x0E28420d,
  96. .emif_ddr_ext_phy_ctrl_1 = 0x04020080,
  97. .emif_ddr_ext_phy_ctrl_2 = 0x0A414829,
  98. .emif_ddr_ext_phy_ctrl_3 = 0x14829052,
  99. .emif_ddr_ext_phy_ctrl_4 = 0x000520A4,
  100. .emif_ddr_ext_phy_ctrl_5 = 0x04010040
  101. };
  102. const struct emif_regs emif_regs_ddr3_532_mhz_1cs = {
  103. .sdram_config_init = 0x61851B32,
  104. .sdram_config = 0x61851B32,
  105. .sdram_config2 = 0x0,
  106. .ref_ctrl = 0x00001035,
  107. .sdram_tim1 = 0xCCCF36B3,
  108. .sdram_tim2 = 0x308F7FDA,
  109. .sdram_tim3 = 0x027F88A8,
  110. .read_idle_ctrl = 0x00050000,
  111. .zq_config = 0x0007190B,
  112. .temp_alert_config = 0x00000000,
  113. .emif_ddr_phy_ctlr_1_init = 0x0020420A,
  114. .emif_ddr_phy_ctlr_1 = 0x0024420A,
  115. .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
  116. .emif_ddr_ext_phy_ctrl_2 = 0x00000000,
  117. .emif_ddr_ext_phy_ctrl_3 = 0x00000000,
  118. .emif_ddr_ext_phy_ctrl_4 = 0x00000000,
  119. .emif_ddr_ext_phy_ctrl_5 = 0x04010040,
  120. .emif_rd_wr_lvl_rmp_win = 0x00000000,
  121. .emif_rd_wr_lvl_rmp_ctl = 0x80000000,
  122. .emif_rd_wr_lvl_ctl = 0x00000000,
  123. .emif_rd_wr_exec_thresh = 0x00000305
  124. };
  125. const struct emif_regs emif_regs_ddr3_532_mhz_1cs_es2 = {
  126. .sdram_config_init = 0x61851B32,
  127. .sdram_config = 0x61851B32,
  128. .sdram_config2 = 0x0,
  129. .ref_ctrl = 0x00001035,
  130. .sdram_tim1 = 0xCCCF36B3,
  131. .sdram_tim2 = 0x308F7FDA,
  132. .sdram_tim3 = 0x027F88A8,
  133. .read_idle_ctrl = 0x00050000,
  134. .zq_config = 0x1007190B,
  135. .temp_alert_config = 0x00000000,
  136. .emif_ddr_phy_ctlr_1_init = 0x0030400A,
  137. .emif_ddr_phy_ctlr_1 = 0x0034400A,
  138. .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
  139. .emif_ddr_ext_phy_ctrl_2 = 0x00000000,
  140. .emif_ddr_ext_phy_ctrl_3 = 0x00000000,
  141. .emif_ddr_ext_phy_ctrl_4 = 0x00000000,
  142. .emif_ddr_ext_phy_ctrl_5 = 0x4350D435,
  143. .emif_rd_wr_lvl_rmp_win = 0x00000000,
  144. .emif_rd_wr_lvl_rmp_ctl = 0x80000000,
  145. .emif_rd_wr_lvl_ctl = 0x00000000,
  146. .emif_rd_wr_exec_thresh = 0x40000305
  147. };
  148. const struct emif_regs emif_1_regs_ddr3_532_mhz_1cs_dra_es1 = {
  149. .sdram_config_init = 0x61851ab2,
  150. .sdram_config = 0x61851ab2,
  151. .sdram_config2 = 0x08000000,
  152. .ref_ctrl = 0x00001035,
  153. .sdram_tim1 = 0xCCCF36B3,
  154. .sdram_tim2 = 0x308F7FDA,
  155. .sdram_tim3 = 0x027F88A8,
  156. .read_idle_ctrl = 0x00050000,
  157. .zq_config = 0x0007190B,
  158. .temp_alert_config = 0x00000000,
  159. .emif_ddr_phy_ctlr_1_init = 0x0E20400A,
  160. .emif_ddr_phy_ctlr_1 = 0x0E24400A,
  161. .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
  162. .emif_ddr_ext_phy_ctrl_2 = 0x009E009E,
  163. .emif_ddr_ext_phy_ctrl_3 = 0x009E009E,
  164. .emif_ddr_ext_phy_ctrl_4 = 0x009E009E,
  165. .emif_ddr_ext_phy_ctrl_5 = 0x009E009E,
  166. .emif_rd_wr_lvl_rmp_win = 0x00000000,
  167. .emif_rd_wr_lvl_rmp_ctl = 0x80000000,
  168. .emif_rd_wr_lvl_ctl = 0x00000000,
  169. .emif_rd_wr_exec_thresh = 0x00000305
  170. };
  171. const struct emif_regs emif_2_regs_ddr3_532_mhz_1cs_dra_es1 = {
  172. .sdram_config_init = 0x61851B32,
  173. .sdram_config = 0x61851B32,
  174. .sdram_config2 = 0x08000000,
  175. .ref_ctrl = 0x00001035,
  176. .sdram_tim1 = 0xCCCF36B3,
  177. .sdram_tim2 = 0x308F7FDA,
  178. .sdram_tim3 = 0x027F88A8,
  179. .read_idle_ctrl = 0x00050000,
  180. .zq_config = 0x0007190B,
  181. .temp_alert_config = 0x00000000,
  182. .emif_ddr_phy_ctlr_1_init = 0x0020400A,
  183. .emif_ddr_phy_ctlr_1 = 0x0E24400A,
  184. .emif_ddr_ext_phy_ctrl_1 = 0x04040100,
  185. .emif_ddr_ext_phy_ctrl_2 = 0x009D009D,
  186. .emif_ddr_ext_phy_ctrl_3 = 0x009D009D,
  187. .emif_ddr_ext_phy_ctrl_4 = 0x009D009D,
  188. .emif_ddr_ext_phy_ctrl_5 = 0x009D009D,
  189. .emif_rd_wr_lvl_rmp_win = 0x00000000,
  190. .emif_rd_wr_lvl_rmp_ctl = 0x80000000,
  191. .emif_rd_wr_lvl_ctl = 0x00000000,
  192. .emif_rd_wr_exec_thresh = 0x00000305
  193. };
  194. const struct dmm_lisa_map_regs lisa_map_4G_x_2_x_2 = {
  195. .dmm_lisa_map_0 = 0x0,
  196. .dmm_lisa_map_1 = 0x0,
  197. .dmm_lisa_map_2 = 0x80740300,
  198. .dmm_lisa_map_3 = 0xFF020100,
  199. .is_ma_present = 0x1
  200. };
  201. /*
  202. * DRA752 EVM board has 1.5 GB of memory
  203. * EMIF1 --> 2Gb * 2 = 512MB
  204. * EMIF2 --> 2Gb * 4 = 1GB
  205. * so mapping 1GB interleaved and 512MB non-interleaved
  206. */
  207. const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2_2G_x_1_x_2 = {
  208. .dmm_lisa_map_0 = 0x0,
  209. .dmm_lisa_map_1 = 0x80640300,
  210. .dmm_lisa_map_2 = 0xC0500220,
  211. .dmm_lisa_map_3 = 0xFF020100,
  212. .is_ma_present = 0x1
  213. };
  214. /*
  215. * DRA752 EVM EMIF1 ONLY CONFIGURATION
  216. */
  217. const struct dmm_lisa_map_regs lisa_map_2G_x_1_x_2 = {
  218. .dmm_lisa_map_0 = 0x0,
  219. .dmm_lisa_map_1 = 0x0,
  220. .dmm_lisa_map_2 = 0x80500100,
  221. .dmm_lisa_map_3 = 0xFF020100,
  222. .is_ma_present = 0x1
  223. };
  224. /*
  225. * DRA752 EVM EMIF2 ONLY CONFIGURATION
  226. */
  227. const struct dmm_lisa_map_regs lisa_map_2G_x_2_x_2 = {
  228. .dmm_lisa_map_0 = 0x0,
  229. .dmm_lisa_map_1 = 0x0,
  230. .dmm_lisa_map_2 = 0x80600200,
  231. .dmm_lisa_map_3 = 0xFF020100,
  232. .is_ma_present = 0x1
  233. };
  234. static void emif_get_reg_dump_sdp(u32 emif_nr, const struct emif_regs **regs)
  235. {
  236. switch (omap_revision()) {
  237. case OMAP5430_ES1_0:
  238. *regs = &emif_regs_532_mhz_2cs;
  239. break;
  240. case OMAP5432_ES1_0:
  241. *regs = &emif_regs_ddr3_532_mhz_1cs;
  242. break;
  243. case OMAP5430_ES2_0:
  244. *regs = &emif_regs_532_mhz_2cs_es2;
  245. break;
  246. case OMAP5432_ES2_0:
  247. *regs = &emif_regs_ddr3_532_mhz_1cs_es2;
  248. break;
  249. case DRA752_ES1_0:
  250. switch (emif_nr) {
  251. case 1:
  252. *regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
  253. break;
  254. case 2:
  255. *regs = &emif_2_regs_ddr3_532_mhz_1cs_dra_es1;
  256. break;
  257. }
  258. break;
  259. default:
  260. *regs = &emif_1_regs_ddr3_532_mhz_1cs_dra_es1;
  261. }
  262. }
  263. void emif_get_reg_dump(u32 emif_nr, const struct emif_regs **regs)
  264. __attribute__((weak, alias("emif_get_reg_dump_sdp")));
  265. static void emif_get_dmm_regs_sdp(const struct dmm_lisa_map_regs
  266. **dmm_lisa_regs)
  267. {
  268. switch (omap_revision()) {
  269. case OMAP5430_ES1_0:
  270. case OMAP5430_ES2_0:
  271. case OMAP5432_ES1_0:
  272. case OMAP5432_ES2_0:
  273. *dmm_lisa_regs = &lisa_map_4G_x_2_x_2;
  274. break;
  275. case DRA752_ES1_0:
  276. default:
  277. *dmm_lisa_regs = &lisa_map_2G_x_2_x_2_2G_x_1_x_2;
  278. }
  279. }
  280. void emif_get_dmm_regs(const struct dmm_lisa_map_regs **dmm_lisa_regs)
  281. __attribute__((weak, alias("emif_get_dmm_regs_sdp")));
  282. #else
  283. static const struct lpddr2_device_details dev_4G_S4_details = {
  284. .type = LPDDR2_TYPE_S4,
  285. .density = LPDDR2_DENSITY_4Gb,
  286. .io_width = LPDDR2_IO_WIDTH_32,
  287. .manufacturer = LPDDR2_MANUFACTURER_SAMSUNG
  288. };
  289. static void emif_get_device_details_sdp(u32 emif_nr,
  290. struct lpddr2_device_details *cs0_device_details,
  291. struct lpddr2_device_details *cs1_device_details)
  292. {
  293. /* EMIF1 & EMIF2 have identical configuration */
  294. *cs0_device_details = dev_4G_S4_details;
  295. *cs1_device_details = dev_4G_S4_details;
  296. }
  297. void emif_get_device_details(u32 emif_nr,
  298. struct lpddr2_device_details *cs0_device_details,
  299. struct lpddr2_device_details *cs1_device_details)
  300. __attribute__((weak, alias("emif_get_device_details_sdp")));
  301. #endif /* CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS */
  302. const u32 ext_phy_ctrl_const_base[EMIF_EXT_PHY_CTRL_CONST_REG] = {
  303. 0x01004010,
  304. 0x00001004,
  305. 0x04010040,
  306. 0x01004010,
  307. 0x00001004,
  308. 0x00000000,
  309. 0x00000000,
  310. 0x00000000,
  311. 0x80080080,
  312. 0x00800800,
  313. 0x08102040,
  314. 0x00000001,
  315. 0x540A8150,
  316. 0xA81502a0,
  317. 0x002A0540,
  318. 0x00000000,
  319. 0x00000000,
  320. 0x00000000,
  321. 0x00000077,
  322. 0x0
  323. };
  324. const u32 ddr3_ext_phy_ctrl_const_base_es1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
  325. 0x01004010,
  326. 0x00001004,
  327. 0x04010040,
  328. 0x01004010,
  329. 0x00001004,
  330. 0x00000000,
  331. 0x00000000,
  332. 0x00000000,
  333. 0x80080080,
  334. 0x00800800,
  335. 0x08102040,
  336. 0x00000002,
  337. 0x0,
  338. 0x0,
  339. 0x0,
  340. 0x00000000,
  341. 0x00000000,
  342. 0x00000000,
  343. 0x00000057,
  344. 0x0
  345. };
  346. const u32 ddr3_ext_phy_ctrl_const_base_es2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
  347. 0x50D4350D,
  348. 0x00000D43,
  349. 0x04010040,
  350. 0x01004010,
  351. 0x00001004,
  352. 0x00000000,
  353. 0x00000000,
  354. 0x00000000,
  355. 0x80080080,
  356. 0x00800800,
  357. 0x08102040,
  358. 0x00000002,
  359. 0x00000000,
  360. 0x00000000,
  361. 0x00000000,
  362. 0x00000000,
  363. 0x00000000,
  364. 0x00000000,
  365. 0x00000057,
  366. 0x0
  367. };
  368. const u32
  369. dra_ddr3_ext_phy_ctrl_const_base_es1_emif1[EMIF_EXT_PHY_CTRL_CONST_REG] = {
  370. 0x009E009E,
  371. 0x002E002E,
  372. 0x002E002E,
  373. 0x002E002E,
  374. 0x002E002E,
  375. 0x002E002E,
  376. 0x004D004D,
  377. 0x004D004D,
  378. 0x004D004D,
  379. 0x004D004D,
  380. 0x004D004D,
  381. 0x004D004D,
  382. 0x004D004D,
  383. 0x004D004D,
  384. 0x004D004D,
  385. 0x004D004D,
  386. 0x0,
  387. 0x600020,
  388. 0x40010080,
  389. 0x8102040
  390. };
  391. const u32
  392. dra_ddr3_ext_phy_ctrl_const_base_es1_emif2[EMIF_EXT_PHY_CTRL_CONST_REG] = {
  393. 0x009D009D,
  394. 0x002D002D,
  395. 0x002D002D,
  396. 0x002D002D,
  397. 0x002D002D,
  398. 0x002D002D,
  399. 0x00570057,
  400. 0x00570057,
  401. 0x00570057,
  402. 0x00570057,
  403. 0x00570057,
  404. 0x00570057,
  405. 0x00570057,
  406. 0x00570057,
  407. 0x00570057,
  408. 0x00570057,
  409. 0x0,
  410. 0x600020,
  411. 0x40010080,
  412. 0x8102040
  413. };
  414. const struct lpddr2_mr_regs mr_regs = {
  415. .mr1 = MR1_BL_8_BT_SEQ_WRAP_EN_NWR_8,
  416. .mr2 = 0x6,
  417. .mr3 = 0x1,
  418. .mr10 = MR10_ZQ_ZQINIT,
  419. .mr16 = MR16_REF_FULL_ARRAY
  420. };
  421. static void emif_get_ext_phy_ctrl_const_regs(u32 emif_nr, const u32 **regs)
  422. {
  423. switch (omap_revision()) {
  424. case OMAP5430_ES1_0:
  425. case OMAP5430_ES2_0:
  426. *regs = ext_phy_ctrl_const_base;
  427. break;
  428. case OMAP5432_ES1_0:
  429. *regs = ddr3_ext_phy_ctrl_const_base_es1;
  430. break;
  431. case OMAP5432_ES2_0:
  432. *regs = ddr3_ext_phy_ctrl_const_base_es2;
  433. break;
  434. case DRA752_ES1_0:
  435. if (emif_nr == 1)
  436. *regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif1;
  437. else
  438. *regs = dra_ddr3_ext_phy_ctrl_const_base_es1_emif2;
  439. break;
  440. default:
  441. *regs = ddr3_ext_phy_ctrl_const_base_es2;
  442. }
  443. }
  444. void get_lpddr2_mr_regs(const struct lpddr2_mr_regs **regs)
  445. {
  446. *regs = &mr_regs;
  447. }
  448. void do_ext_phy_settings(u32 base, const struct emif_regs *regs)
  449. {
  450. u32 *ext_phy_ctrl_base = 0;
  451. u32 *emif_ext_phy_ctrl_base = 0;
  452. u32 emif_nr;
  453. const u32 *ext_phy_ctrl_const_regs;
  454. u32 i = 0;
  455. emif_nr = (base == EMIF1_BASE) ? 1 : 2;
  456. struct emif_reg_struct *emif = (struct emif_reg_struct *)base;
  457. ext_phy_ctrl_base = (u32 *) &(regs->emif_ddr_ext_phy_ctrl_1);
  458. emif_ext_phy_ctrl_base = (u32 *) &(emif->emif_ddr_ext_phy_ctrl_1);
  459. /* Configure external phy control timing registers */
  460. for (i = 0; i < EMIF_EXT_PHY_CTRL_TIMING_REG; i++) {
  461. writel(*ext_phy_ctrl_base, emif_ext_phy_ctrl_base++);
  462. /* Update shadow registers */
  463. writel(*ext_phy_ctrl_base++, emif_ext_phy_ctrl_base++);
  464. }
  465. /*
  466. * external phy 6-24 registers do not change with
  467. * ddr frequency
  468. */
  469. emif_get_ext_phy_ctrl_const_regs(emif_nr, &ext_phy_ctrl_const_regs);
  470. for (i = 0; i < EMIF_EXT_PHY_CTRL_CONST_REG; i++) {
  471. writel(ext_phy_ctrl_const_regs[i],
  472. emif_ext_phy_ctrl_base++);
  473. /* Update shadow registers */
  474. writel(ext_phy_ctrl_const_regs[i],
  475. emif_ext_phy_ctrl_base++);
  476. }
  477. }
  478. #ifndef CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
  479. static const struct lpddr2_ac_timings timings_jedec_532_mhz = {
  480. .max_freq = 532000000,
  481. .RL = 8,
  482. .tRPab = 21,
  483. .tRCD = 18,
  484. .tWR = 15,
  485. .tRASmin = 42,
  486. .tRRD = 10,
  487. .tWTRx2 = 15,
  488. .tXSR = 140,
  489. .tXPx2 = 15,
  490. .tRFCab = 130,
  491. .tRTPx2 = 15,
  492. .tCKE = 3,
  493. .tCKESR = 15,
  494. .tZQCS = 90,
  495. .tZQCL = 360,
  496. .tZQINIT = 1000,
  497. .tDQSCKMAXx2 = 11,
  498. .tRASmax = 70,
  499. .tFAW = 50
  500. };
  501. static const struct lpddr2_min_tck min_tck = {
  502. .tRL = 3,
  503. .tRP_AB = 3,
  504. .tRCD = 3,
  505. .tWR = 3,
  506. .tRAS_MIN = 3,
  507. .tRRD = 2,
  508. .tWTR = 2,
  509. .tXP = 2,
  510. .tRTP = 2,
  511. .tCKE = 3,
  512. .tCKESR = 3,
  513. .tFAW = 8
  514. };
  515. static const struct lpddr2_ac_timings *ac_timings[MAX_NUM_SPEEDBINS] = {
  516. &timings_jedec_532_mhz
  517. };
  518. static const struct lpddr2_device_timings dev_4G_S4_timings = {
  519. .ac_timings = ac_timings,
  520. .min_tck = &min_tck,
  521. };
  522. void emif_get_device_timings_sdp(u32 emif_nr,
  523. const struct lpddr2_device_timings **cs0_device_timings,
  524. const struct lpddr2_device_timings **cs1_device_timings)
  525. {
  526. /* Identical devices on EMIF1 & EMIF2 */
  527. *cs0_device_timings = &dev_4G_S4_timings;
  528. *cs1_device_timings = &dev_4G_S4_timings;
  529. }
  530. void emif_get_device_timings(u32 emif_nr,
  531. const struct lpddr2_device_timings **cs0_device_timings,
  532. const struct lpddr2_device_timings **cs1_device_timings)
  533. __attribute__((weak, alias("emif_get_device_timings_sdp")));
  534. #endif /* CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS */