mem.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. /*
  3. * (C) Copyright 2006-2008
  4. * Texas Instruments, <www.ti.com>
  5. * Richard Woodruff <r-woodruff2@ti.com>
  6. */
  7. #ifndef _MEM_H_
  8. #define _MEM_H_
  9. #define CS0 0x0
  10. #define CS1 0x1 /* mirror CS1 regs appear offset 0x30 from CS0 */
  11. #ifndef __ASSEMBLY__
  12. enum {
  13. STACKED = 0,
  14. IP_DDR = 1,
  15. COMBO_DDR = 2,
  16. IP_SDR = 3,
  17. };
  18. #endif /* __ASSEMBLY__ */
  19. #define EARLY_INIT 1
  20. /*
  21. * For a full explanation of these registers and values please see
  22. * the Technical Reference Manual (TRM) for any of the processors in
  23. * this family.
  24. */
  25. /* Slower full frequency range default timings for x32 operation*/
  26. #define SDRC_SHARING 0x00000100
  27. #define SDRC_MR_0_SDR 0x00000031
  28. /*
  29. * SDRC autorefresh control values. This register consists of autorefresh
  30. * enable at bits 0:1 and an autorefresh counter value in bits 8:23. The
  31. * counter is a result of ( tREFI / tCK ) - 50.
  32. */
  33. #define SDP_3430_SDRC_RFR_CTRL_100MHz 0x0002da01
  34. #define SDP_3430_SDRC_RFR_CTRL_133MHz 0x0003de01 /* 7.8us/7.5ns - 50=0x3de */
  35. #define SDP_3430_SDRC_RFR_CTRL_165MHz 0x0004e201 /* 7.8us/6ns - 50=0x4e2 */
  36. #define SDP_3430_SDRC_RFR_CTRL_200MHz 0x0005e601 /* 7.8us/5ns - 50=0x5e6 */
  37. #define DLL_OFFSET 0
  38. #define DLL_WRITEDDRCLKX2DIS 1
  39. #define DLL_ENADLL 1
  40. #define DLL_LOCKDLL 0
  41. #define DLL_DLLPHASE_72 0
  42. #define DLL_DLLPHASE_90 1
  43. /* rkw - need to find of 90/72 degree recommendation for speed like before */
  44. #define SDP_SDRC_DLLAB_CTRL ((DLL_ENADLL << 3) | \
  45. (DLL_LOCKDLL << 2) | (DLL_DLLPHASE_90 << 1))
  46. /* Helper macros to arrive at value of the SDRC_ACTIM_CTRLA register. */
  47. #define ACTIM_CTRLA_TRFC(v) (((v) & 0x1F) << 27) /* 31:27 */
  48. #define ACTIM_CTRLA_TRC(v) (((v) & 0x1F) << 22) /* 26:22 */
  49. #define ACTIM_CTRLA_TRAS(v) (((v) & 0x0F) << 18) /* 21:18 */
  50. #define ACTIM_CTRLA_TRP(v) (((v) & 0x07) << 15) /* 17:15 */
  51. #define ACTIM_CTRLA_TRCD(v) (((v) & 0x07) << 12) /* 14:12 */
  52. #define ACTIM_CTRLA_TRRD(v) (((v) & 0x07) << 9) /* 11:9 */
  53. #define ACTIM_CTRLA_TDPL(v) (((v) & 0x07) << 6) /* 8:6 */
  54. #define ACTIM_CTRLA_TDAL(v) (v & 0x1F) /* 4:0 */
  55. #define ACTIM_CTRLA(trfc, trc, tras, trp, trcd, trrd, tdpl, tdal) \
  56. ACTIM_CTRLA_TRFC(trfc) | \
  57. ACTIM_CTRLA_TRC(trc) | \
  58. ACTIM_CTRLA_TRAS(tras) | \
  59. ACTIM_CTRLA_TRP(trp) | \
  60. ACTIM_CTRLA_TRCD(trcd) | \
  61. ACTIM_CTRLA_TRRD(trrd) | \
  62. ACTIM_CTRLA_TDPL(tdpl) | \
  63. ACTIM_CTRLA_TDAL(tdal)
  64. /* Helper macros to arrive at value of the SDRC_ACTIM_CTRLB register. */
  65. #define ACTIM_CTRLB_TWTR(v) (((v) & 0x03) << 16) /* 17:16 */
  66. #define ACTIM_CTRLB_TCKE(v) (((v) & 0x07) << 12) /* 14:12 */
  67. #define ACTIM_CTRLB_TXP(v) (((v) & 0x07) << 8) /* 10:8 */
  68. #define ACTIM_CTRLB_TXSR(v) (v & 0xFF) /* 7:0 */
  69. #define ACTIM_CTRLB(twtr, tcke, txp, txsr) \
  70. ACTIM_CTRLB_TWTR(twtr) | \
  71. ACTIM_CTRLB_TCKE(tcke) | \
  72. ACTIM_CTRLB_TXP(txp) | \
  73. ACTIM_CTRLB_TXSR(txsr)
  74. /*
  75. * Values used in the MCFG register. Only values we use today
  76. * are defined and the rest can be found in the TRM. Unless otherwise
  77. * noted all fields are one bit.
  78. */
  79. #define V_MCFG_RAMTYPE_DDR (0x1)
  80. #define V_MCFG_DEEPPD_EN (0x1 << 3)
  81. #define V_MCFG_B32NOT16_32 (0x1 << 4)
  82. #define V_MCFG_BANKALLOCATION_RBC (0x2 << 6) /* 6:7 */
  83. #define V_MCFG_RAMSIZE(ramsize) ((((ramsize) >> 20)/2) << 8) /* 8:17 */
  84. #define V_MCFG_ADDRMUXLEGACY_FLEX (0x1 << 19)
  85. #define V_MCFG_CASWIDTH(caswidth) (((caswidth)-5) << 20) /* 20:22 */
  86. #define V_MCFG_CASWIDTH_10B V_MCFG_CASWIDTH(10)
  87. #define V_MCFG_RASWIDTH(raswidth) (((raswidth)-11) << 24) /* 24:26 */
  88. /* Macro to construct MCFG */
  89. #define MCFG(ramsize, raswidth) \
  90. V_MCFG_RASWIDTH(raswidth) | V_MCFG_CASWIDTH_10B | \
  91. V_MCFG_ADDRMUXLEGACY_FLEX | V_MCFG_RAMSIZE(ramsize) | \
  92. V_MCFG_BANKALLOCATION_RBC | V_MCFG_B32NOT16_32 | \
  93. V_MCFG_DEEPPD_EN | V_MCFG_RAMTYPE_DDR
  94. /* Hynix part of Overo (165MHz optimized) 6.06ns */
  95. #define HYNIX_TDAL_165 6
  96. #define HYNIX_TDPL_165 3
  97. #define HYNIX_TRRD_165 2
  98. #define HYNIX_TRCD_165 3
  99. #define HYNIX_TRP_165 3
  100. #define HYNIX_TRAS_165 7
  101. #define HYNIX_TRC_165 10
  102. #define HYNIX_TRFC_165 21
  103. #define HYNIX_V_ACTIMA_165 \
  104. ACTIM_CTRLA(HYNIX_TRFC_165, HYNIX_TRC_165, \
  105. HYNIX_TRAS_165, HYNIX_TRP_165, \
  106. HYNIX_TRCD_165, HYNIX_TRRD_165, \
  107. HYNIX_TDPL_165, HYNIX_TDAL_165)
  108. #define HYNIX_TWTR_165 1
  109. #define HYNIX_TCKE_165 1
  110. #define HYNIX_TXP_165 2
  111. #define HYNIX_XSR_165 24
  112. #define HYNIX_V_ACTIMB_165 \
  113. ACTIM_CTRLB(HYNIX_TWTR_165, HYNIX_TCKE_165, \
  114. HYNIX_TXP_165, HYNIX_XSR_165)
  115. #define HYNIX_RASWIDTH_165 13
  116. #define HYNIX_V_MCFG_165(size) MCFG((size), HYNIX_RASWIDTH_165)
  117. /* Hynix part of AM/DM37xEVM (200MHz optimized) */
  118. #define HYNIX_TDAL_200 6
  119. #define HYNIX_TDPL_200 3
  120. #define HYNIX_TRRD_200 2
  121. #define HYNIX_TRCD_200 4
  122. #define HYNIX_TRP_200 3
  123. #define HYNIX_TRAS_200 8
  124. #define HYNIX_TRC_200 11
  125. #define HYNIX_TRFC_200 18
  126. #define HYNIX_V_ACTIMA_200 \
  127. ACTIM_CTRLA(HYNIX_TRFC_200, HYNIX_TRC_200, \
  128. HYNIX_TRAS_200, HYNIX_TRP_200, \
  129. HYNIX_TRCD_200, HYNIX_TRRD_200, \
  130. HYNIX_TDPL_200, HYNIX_TDAL_200)
  131. #define HYNIX_TWTR_200 2
  132. #define HYNIX_TCKE_200 1
  133. #define HYNIX_TXP_200 1
  134. #define HYNIX_XSR_200 28
  135. #define HYNIX_V_ACTIMB_200 \
  136. ACTIM_CTRLB(HYNIX_TWTR_200, HYNIX_TCKE_200, \
  137. HYNIX_TXP_200, HYNIX_XSR_200)
  138. #define HYNIX_RASWIDTH_200 14
  139. #define HYNIX_V_MCFG_200(size) MCFG((size), HYNIX_RASWIDTH_200)
  140. /* Infineon part of 3430SDP (165MHz optimized) 6.06ns */
  141. #define INFINEON_TDAL_165 6 /* Twr/Tck + Trp/tck */
  142. /* 15/6 + 18/6 = 5.5 -> 6 */
  143. #define INFINEON_TDPL_165 3 /* 15/6 = 2.5 -> 3 (Twr) */
  144. #define INFINEON_TRRD_165 2 /* 12/6 = 2 */
  145. #define INFINEON_TRCD_165 3 /* 18/6 = 3 */
  146. #define INFINEON_TRP_165 3 /* 18/6 = 3 */
  147. #define INFINEON_TRAS_165 7 /* 42/6 = 7 */
  148. #define INFINEON_TRC_165 10 /* 60/6 = 10 */
  149. #define INFINEON_TRFC_165 12 /* 72/6 = 12 */
  150. #define INFINEON_V_ACTIMA_165 \
  151. ACTIM_CTRLA(INFINEON_TRFC_165, INFINEON_TRC_165, \
  152. INFINEON_TRAS_165, INFINEON_TRP_165, \
  153. INFINEON_TRCD_165, INFINEON_TRRD_165, \
  154. INFINEON_TDPL_165, INFINEON_TDAL_165)
  155. #define INFINEON_TWTR_165 1
  156. #define INFINEON_TCKE_165 2
  157. #define INFINEON_TXP_165 2
  158. #define INFINEON_XSR_165 20 /* 120/6 = 20 */
  159. #define INFINEON_V_ACTIMB_165 \
  160. ACTIM_CTRLB(INFINEON_TWTR_165, INFINEON_TCKE_165, \
  161. INFINEON_TXP_165, INFINEON_XSR_165)
  162. /* Micron part of 3430 EVM (165MHz optimized) 6.06ns */
  163. #define MICRON_TDAL_165 6 /* Twr/Tck + Trp/tck */
  164. /* 15/6 + 18/6 = 5.5 -> 6 */
  165. #define MICRON_TDPL_165 3 /* 15/6 = 2.5 -> 3 (Twr) */
  166. #define MICRON_TRRD_165 2 /* 12/6 = 2 */
  167. #define MICRON_TRCD_165 3 /* 18/6 = 3 */
  168. #define MICRON_TRP_165 3 /* 18/6 = 3 */
  169. #define MICRON_TRAS_165 7 /* 42/6 = 7 */
  170. #define MICRON_TRC_165 10 /* 60/6 = 10 */
  171. #define MICRON_TRFC_165 21 /* 125/6 = 21 */
  172. #define MICRON_V_ACTIMA_165 \
  173. ACTIM_CTRLA(MICRON_TRFC_165, MICRON_TRC_165, \
  174. MICRON_TRAS_165, MICRON_TRP_165, \
  175. MICRON_TRCD_165, MICRON_TRRD_165, \
  176. MICRON_TDPL_165, MICRON_TDAL_165)
  177. #define MICRON_TWTR_165 1
  178. #define MICRON_TCKE_165 1
  179. #define MICRON_XSR_165 23 /* 138/6 = 23 */
  180. #define MICRON_TXP_165 5 /* 25/6 = 4.1 => ~5 */
  181. #define MICRON_V_ACTIMB_165 \
  182. ACTIM_CTRLB(MICRON_TWTR_165, MICRON_TCKE_165, \
  183. MICRON_TXP_165, MICRON_XSR_165)
  184. #define MICRON_RASWIDTH_165 13
  185. #define MICRON_V_MCFG_165(size) MCFG((size), MICRON_RASWIDTH_165)
  186. #define MICRON_BL_165 0x2
  187. #define MICRON_SIL_165 0x0
  188. #define MICRON_CASL_165 0x3
  189. #define MICRON_WBST_165 0x0
  190. #define MICRON_V_MR_165 ((MICRON_WBST_165 << 9) | \
  191. (MICRON_CASL_165 << 4) | (MICRON_SIL_165 << 3) | \
  192. (MICRON_BL_165))
  193. /* Micron part (200MHz optimized) 5 ns */
  194. #define MICRON_TDAL_200 6
  195. #define MICRON_TDPL_200 3
  196. #define MICRON_TRRD_200 2
  197. #define MICRON_TRCD_200 3
  198. #define MICRON_TRP_200 3
  199. #define MICRON_TRAS_200 8
  200. #define MICRON_TRC_200 11
  201. #define MICRON_TRFC_200 15
  202. #define MICRON_V_ACTIMA_200 \
  203. ACTIM_CTRLA(MICRON_TRFC_200, MICRON_TRC_200, \
  204. MICRON_TRAS_200, MICRON_TRP_200, \
  205. MICRON_TRCD_200, MICRON_TRRD_200, \
  206. MICRON_TDPL_200, MICRON_TDAL_200)
  207. #define MICRON_TWTR_200 2
  208. #define MICRON_TCKE_200 4
  209. #define MICRON_TXP_200 2
  210. #define MICRON_XSR_200 23
  211. #define MICRON_V_ACTIMB_200 \
  212. ACTIM_CTRLB(MICRON_TWTR_200, MICRON_TCKE_200, \
  213. MICRON_TXP_200, MICRON_XSR_200)
  214. #define MICRON_RASWIDTH_200 14
  215. #define MICRON_V_MCFG_200(size) MCFG((size), MICRON_RASWIDTH_200)
  216. /* Samsung K4X51163PG - FGC6 (165MHz optimized) 6.06ns - from 2010.90 src */
  217. #define SAMSUNG_TDAL_165 5
  218. #define SAMSUNG_TDPL_165 2
  219. #define SAMSUNG_TRRD_165 2
  220. #define SAMSUNG_TRCD_165 3
  221. #define SAMSUNG_TRP_165 3
  222. #define SAMSUNG_TRAS_165 7
  223. #define SAMSUNG_TRC_165 10
  224. #define SAMSUNG_TRFC_165 12
  225. #define SAMSUNG_V_ACTIMA_165 \
  226. ACTIM_CTRLA(SAMSUNG_TRFC_165, SAMSUNG_TRC_165, \
  227. SAMSUNG_TRAS_165, SAMSUNG_TRP_165, \
  228. SAMSUNG_TRCD_165, SAMSUNG_TRRD_165, \
  229. SAMSUNG_TDPL_165, SAMSUNG_TDAL_165)
  230. #define SAMSUNG_TWTR_165 1
  231. #define SAMSUNG_TCKE_165 2
  232. #define SAMSUNG_XSR_165 20
  233. #define SAMSUNG_TXP_165 5
  234. #define SAMSUNG_V_ACTIMB_165 \
  235. ACTIM_CTRLB(SAMSUNG_TWTR_165, SAMSUNG_TCKE_165, \
  236. SAMSUNG_TXP_165, SAMSUNG_XSR_165)
  237. #define SAMSUNG_RASWIDTH_165 14
  238. #define SAMSUNG_V_MCFG_165(size) \
  239. V_MCFG_RASWIDTH(SAMSUNG_RASWIDTH_165) | V_MCFG_CASWIDTH_10B | \
  240. V_MCFG_ADDRMUXLEGACY_FLEX | V_MCFG_RAMSIZE(size) | \
  241. V_MCFG_BANKALLOCATION_RBC | V_MCFG_RAMTYPE_DDR
  242. /* TODO: find which register these were taken from */
  243. #define SAMSUNG_BL_165 0x2
  244. #define SAMSUNG_SIL_165 0x0
  245. #define SAMSUNG_CASL_165 0x3
  246. #define SAMSUNG_WBST_165 0x0
  247. #define SAMSUNG_V_MR_165 ((SAMSUNG_WBST_165 << 9) | \
  248. (SAMSUNG_CASL_165 << 4) | (SAMSUNG_SIL_165 << 3) | \
  249. (SAMSUNG_BL_165))
  250. #define SAMSUNG_SHARING 0x00003700
  251. /* NUMONYX part of IGEP v2 (165MHz optimized) 6.06ns */
  252. #define NUMONYX_TDAL_165 6 /* Twr/Tck + Trp/tck */
  253. /* 15/6 + 18/6 = 5.5 -> 6 */
  254. #define NUMONYX_TDPL_165 3 /* 15/6 = 2.5 -> 3 (Twr) */
  255. #define NUMONYX_TRRD_165 2 /* 12/6 = 2 */
  256. #define NUMONYX_TRCD_165 4 /* 22.5/6 = 3.75 -> 4 */
  257. #define NUMONYX_TRP_165 3 /* 18/6 = 3 */
  258. #define NUMONYX_TRAS_165 7 /* 42/6 = 7 */
  259. #define NUMONYX_TRC_165 10 /* 60/6 = 10 */
  260. #define NUMONYX_TRFC_165 24 /* 140/6 = 23.3 -> 24 */
  261. #define NUMONYX_V_ACTIMA_165 \
  262. ACTIM_CTRLA(NUMONYX_TRFC_165, NUMONYX_TRC_165, \
  263. NUMONYX_TRAS_165, NUMONYX_TRP_165, \
  264. NUMONYX_TRCD_165, NUMONYX_TRRD_165, \
  265. NUMONYX_TDPL_165, NUMONYX_TDAL_165)
  266. #define NUMONYX_TWTR_165 2
  267. #define NUMONYX_TCKE_165 2
  268. #define NUMONYX_TXP_165 3 /* 200/6 = 33.3 -> 34 */
  269. #define NUMONYX_XSR_165 34 /* 1.0 + 1.1 = 2.1 -> 3 */
  270. #define NUMONYX_V_ACTIMB_165 \
  271. ACTIM_CTRLB(NUMONYX_TWTR_165, NUMONYX_TCKE_165, \
  272. NUMONYX_TXP_165, NUMONYX_XSR_165)
  273. #define NUMONYX_RASWIDTH_165 15
  274. #define NUMONYX_V_MCFG_165(size) MCFG((size), NUMONYX_RASWIDTH_165)
  275. /* NUMONYX part of IGEP v2 (200MHz optimized) 5 ns */
  276. #define NUMONYX_TDAL_200 6 /* Twr/Tck + Trp/tck */
  277. /* 15/5 + 15/5 = 3 + 3 -> 6 */
  278. #define NUMONYX_TDPL_200 3 /* 15/5 = 3 -> 3 (Twr) */
  279. #define NUMONYX_TRRD_200 2 /* 10/5 = 2 */
  280. #define NUMONYX_TRCD_200 4 /* 16.2/5 = 3.24 -> 4 */
  281. #define NUMONYX_TRP_200 3 /* 15/5 = 3 */
  282. #define NUMONYX_TRAS_200 8 /* 40/5 = 8 */
  283. #define NUMONYX_TRC_200 11 /* 55/5 = 11 */
  284. #define NUMONYX_TRFC_200 28 /* 140/5 = 28 */
  285. #define NUMONYX_V_ACTIMA_200 \
  286. ACTIM_CTRLA(NUMONYX_TRFC_200, NUMONYX_TRC_200, \
  287. NUMONYX_TRAS_200, NUMONYX_TRP_200, \
  288. NUMONYX_TRCD_200, NUMONYX_TRRD_200, \
  289. NUMONYX_TDPL_200, NUMONYX_TDAL_200)
  290. #define NUMONYX_TWTR_200 2
  291. #define NUMONYX_TCKE_200 2
  292. #define NUMONYX_TXP_200 3
  293. #define NUMONYX_XSR_200 40
  294. #define NUMONYX_V_ACTIMB_200 \
  295. ACTIM_CTRLB(NUMONYX_TWTR_200, NUMONYX_TCKE_200, \
  296. NUMONYX_TXP_200, NUMONYX_XSR_200)
  297. #define NUMONYX_RASWIDTH_200 15
  298. #define NUMONYX_V_MCFG_200(size) MCFG((size), NUMONYX_RASWIDTH_200)
  299. /*
  300. * GPMC settings -
  301. * Definitions is as per the following format
  302. * #define <PART>_GPMC_CONFIG<x> <value>
  303. * Where:
  304. * PART is the part name e.g. STNOR - Intel Strata Flash
  305. * x is GPMC config registers from 1 to 6 (there will be 6 macros)
  306. * Value is corresponding value
  307. *
  308. * For every valid PRCM configuration there should be only one definition of
  309. * the same. if values are independent of the board, this definition will be
  310. * present in this file if values are dependent on the board, then this should
  311. * go into corresponding mem-boardName.h file
  312. *
  313. * Currently valid part Names are (PART):
  314. * STNOR - Intel Strata Flash
  315. * SMNAND - Samsung NAND
  316. * MPDB - H4 MPDB board
  317. * SBNOR - Sibley NOR
  318. * MNAND - Micron Large page x16 NAND
  319. * ONNAND - Samsung One NAND
  320. *
  321. * include/configs/file.h contains the defn - for all CS we are interested
  322. * #define OMAP34XX_GPMC_CSx PART
  323. * #define OMAP34XX_GPMC_CSx_SIZE Size
  324. * #define OMAP34XX_GPMC_CSx_MAP Map
  325. * Where:
  326. * x - CS number
  327. * PART - Part Name as defined above
  328. * SIZE - how big is the mapping to be
  329. * GPMC_SIZE_128M - 0x8
  330. * GPMC_SIZE_64M - 0xC
  331. * GPMC_SIZE_32M - 0xE
  332. * GPMC_SIZE_16M - 0xF
  333. * MAP - Map this CS to which address(GPMC address space)- Absolute address
  334. * >>24 before being used.
  335. */
  336. #define GPMC_SIZE_256M 0x0
  337. #define GPMC_SIZE_128M 0x8
  338. #define GPMC_SIZE_64M 0xC
  339. #define GPMC_SIZE_32M 0xE
  340. #define GPMC_SIZE_16M 0xF
  341. #define GPMC_BASEADDR_MASK 0x3F
  342. #define GPMC_CS_ENABLE 0x1
  343. #define M_NAND_GPMC_CONFIG1 0x00001800
  344. #define M_NAND_GPMC_CONFIG2 0x00141400
  345. #define M_NAND_GPMC_CONFIG3 0x00141400
  346. #define M_NAND_GPMC_CONFIG4 0x0F010F01
  347. #define M_NAND_GPMC_CONFIG5 0x010C1414
  348. #define M_NAND_GPMC_CONFIG6 0x1f0f0A80
  349. #define M_NAND_GPMC_CONFIG7 0x00000C44
  350. #define STNOR_GPMC_CONFIG1 0x3
  351. #define STNOR_GPMC_CONFIG2 0x00151501
  352. #define STNOR_GPMC_CONFIG3 0x00060602
  353. #define STNOR_GPMC_CONFIG4 0x11091109
  354. #define STNOR_GPMC_CONFIG5 0x01141F1F
  355. #define STNOR_GPMC_CONFIG6 0x000004c4
  356. #define SIBNOR_GPMC_CONFIG1 0x1200
  357. #define SIBNOR_GPMC_CONFIG2 0x001f1f00
  358. #define SIBNOR_GPMC_CONFIG3 0x00080802
  359. #define SIBNOR_GPMC_CONFIG4 0x1C091C09
  360. #define SIBNOR_GPMC_CONFIG5 0x01131F1F
  361. #define SIBNOR_GPMC_CONFIG6 0x1F0F03C2
  362. #define SDPV2_MPDB_GPMC_CONFIG1 0x00611200
  363. #define SDPV2_MPDB_GPMC_CONFIG2 0x001F1F01
  364. #define SDPV2_MPDB_GPMC_CONFIG3 0x00080803
  365. #define SDPV2_MPDB_GPMC_CONFIG4 0x1D091D09
  366. #define SDPV2_MPDB_GPMC_CONFIG5 0x041D1F1F
  367. #define SDPV2_MPDB_GPMC_CONFIG6 0x1D0904C4
  368. #define MPDB_GPMC_CONFIG1 0x00011000
  369. #define MPDB_GPMC_CONFIG2 0x001f1f01
  370. #define MPDB_GPMC_CONFIG3 0x00080803
  371. #define MPDB_GPMC_CONFIG4 0x1c0b1c0a
  372. #define MPDB_GPMC_CONFIG5 0x041f1F1F
  373. #define MPDB_GPMC_CONFIG6 0x1F0F04C4
  374. #define P2_GPMC_CONFIG1 0x0
  375. #define P2_GPMC_CONFIG2 0x0
  376. #define P2_GPMC_CONFIG3 0x0
  377. #define P2_GPMC_CONFIG4 0x0
  378. #define P2_GPMC_CONFIG5 0x0
  379. #define P2_GPMC_CONFIG6 0x0
  380. #define ONENAND_GPMC_CONFIG1 0x00001200
  381. #define ONENAND_GPMC_CONFIG2 0x000F0F01
  382. #define ONENAND_GPMC_CONFIG3 0x00030301
  383. #define ONENAND_GPMC_CONFIG4 0x0F040F04
  384. #define ONENAND_GPMC_CONFIG5 0x010F1010
  385. #define ONENAND_GPMC_CONFIG6 0x1F060000
  386. #define NET_GPMC_CONFIG1 0x00001000
  387. #define NET_GPMC_CONFIG2 0x001e1e01
  388. #define NET_GPMC_CONFIG3 0x00080300
  389. #define NET_GPMC_CONFIG4 0x1c091c09
  390. #define NET_GPMC_CONFIG5 0x04181f1f
  391. #define NET_GPMC_CONFIG6 0x00000FCF
  392. #define NET_GPMC_CONFIG7 0x00000f6c
  393. /* GPMC CS configuration for an SMSC LAN9221 ethernet controller */
  394. #define NET_LAN9221_GPMC_CONFIG1 0x00001000
  395. #define NET_LAN9221_GPMC_CONFIG2 0x00060700
  396. #define NET_LAN9221_GPMC_CONFIG3 0x00020201
  397. #define NET_LAN9221_GPMC_CONFIG4 0x06000700
  398. #define NET_LAN9221_GPMC_CONFIG5 0x0006090A
  399. #define NET_LAN9221_GPMC_CONFIG6 0x87030000
  400. #define NET_LAN9221_GPMC_CONFIG7 0x00000f6c
  401. /* max number of GPMC Chip Selects */
  402. #define GPMC_MAX_CS 8
  403. /* max number of GPMC regs */
  404. #define GPMC_MAX_REG 7
  405. #define DBG_MPDB 6
  406. #define DBG_MPDB_BASE DEBUG_BASE
  407. #ifndef __ASSEMBLY__
  408. /* Function prototypes */
  409. void mem_init(void);
  410. u32 is_mem_sdr(void);
  411. u32 mem_ok(u32 cs);
  412. u32 get_sdr_cs_size(u32);
  413. u32 get_sdr_cs_offset(u32);
  414. #endif /* __ASSEMBLY__ */
  415. #endif /* endif _MEM_H_ */