smc.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533
  1. /*
  2. * Copyright (C) 2013, Intel Corporation
  3. * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com>
  4. *
  5. * Ported from Intel released Quark UEFI BIOS
  6. * QuarkSocPkg/QuarkNorthCluster/MemoryInit/Pei
  7. *
  8. * SPDX-License-Identifier: Intel
  9. */
  10. #ifndef _SMC_H_
  11. #define _SMC_H_
  12. /* System Memory Controller Register Defines */
  13. /* Memory Controller Message Bus Registers Offsets */
  14. #define DRP 0x00
  15. #define DTR0 0x01
  16. #define DTR1 0x02
  17. #define DTR2 0x03
  18. #define DTR3 0x04
  19. #define DTR4 0x05
  20. #define DPMC0 0x06
  21. #define DPMC1 0x07
  22. #define DRFC 0x08
  23. #define DSCH 0x09
  24. #define DCAL 0x0a
  25. #define DRMC 0x0b
  26. #define PMSTS 0x0c
  27. #define DCO 0x0f
  28. #define DSTAT 0x20
  29. #define SSKPD0 0x4a
  30. #define SSKPD1 0x4b
  31. #define DECCCTRL 0x60
  32. #define DECCSTAT 0x61
  33. #define DECCSBECNT 0x62
  34. #define DECCSBECA 0x68
  35. #define DECCSBECS 0x69
  36. #define DECCDBECA 0x6a
  37. #define DECCDBECS 0x6b
  38. #define DFUSESTAT 0x70
  39. #define SCRMSEED 0x80
  40. #define SCRMLO 0x81
  41. #define SCRMHI 0x82
  42. /* DRP register defines */
  43. #define DRP_RKEN0 (1 << 0)
  44. #define DRP_RKEN1 (1 << 1)
  45. #define DRP_PRI64BSPLITEN (1 << 13)
  46. #define DRP_ADDRMAP_MAP0 (1 << 14)
  47. #define DRP_ADDRMAP_MAP1 (1 << 15)
  48. #define DRP_ADDRMAP_MASK 0x0000c000
  49. /* DTR0 register defines */
  50. #define DTR0_DFREQ_MASK 0x00000003
  51. #define DTR0_TRP_MASK 0x000000f0
  52. #define DTR0_TRCD_MASK 0x00000f00
  53. #define DTR0_TCL_MASK 0x00007000
  54. /* DTR1 register defines */
  55. #define DTR1_TWCL_MASK 0x00000007
  56. #define DTR1_TCMD_MASK 0x00000030
  57. #define DTR1_TWTP_MASK 0x00000f00
  58. #define DTR1_TCCD_12CLK (1 << 12)
  59. #define DTR1_TCCD_18CLK (1 << 13)
  60. #define DTR1_TCCD_MASK 0x00003000
  61. #define DTR1_TFAW_MASK 0x000f0000
  62. #define DTR1_TRAS_MASK 0x00f00000
  63. #define DTR1_TRRD_MASK 0x03000000
  64. #define DTR1_TRTP_MASK 0x70000000
  65. /* DTR2 register defines */
  66. #define DTR2_TRRDR_MASK 0x00000007
  67. #define DTR2_TWWDR_MASK 0x00000700
  68. #define DTR2_TRWDR_MASK 0x000f0000
  69. /* DTR3 register defines */
  70. #define DTR3_TWRDR_MASK 0x00000007
  71. #define DTR3_TXXXX_MASK 0x00000070
  72. #define DTR3_TRWSR_MASK 0x00000f00
  73. #define DTR3_TWRSR_MASK 0x0001e000
  74. #define DTR3_TXP_MASK 0x00c00000
  75. /* DTR4 register defines */
  76. #define DTR4_WRODTSTRT_MASK 0x00000003
  77. #define DTR4_WRODTSTOP_MASK 0x00000070
  78. #define DTR4_XXXX1_MASK 0x00000700
  79. #define DTR4_XXXX2_MASK 0x00007000
  80. #define DTR4_ODTDIS (1 << 15)
  81. #define DTR4_TRGSTRDIS (1 << 16)
  82. /* DPMC0 register defines */
  83. #define DPMC0_PCLSTO_MASK 0x00070000
  84. #define DPMC0_PREAPWDEN (1 << 21)
  85. #define DPMC0_DYNSREN (1 << 23)
  86. #define DPMC0_CLKGTDIS (1 << 24)
  87. #define DPMC0_DISPWRDN (1 << 25)
  88. #define DPMC0_ENPHYCLKGATE (1 << 29)
  89. /* DRFC register defines */
  90. #define DRFC_TREFI_MASK 0x00007000
  91. #define DRFC_REFDBTCLR (1 << 21)
  92. /* DSCH register defines */
  93. #define DSCH_OOODIS (1 << 8)
  94. #define DSCH_OOOST3DIS (1 << 9)
  95. #define DSCH_NEWBYPDIS (1 << 12)
  96. /* DCAL register defines */
  97. #define DCAL_ZQCINT_MASK 0x00000700
  98. #define DCAL_SRXZQCL_MASK 0x00003000
  99. /* DRMC register defines */
  100. #define DRMC_CKEMODE (1 << 4)
  101. #define DRMC_ODTMODE (1 << 12)
  102. #define DRMC_COLDWAKE (1 << 16)
  103. /* PMSTS register defines */
  104. #define PMSTS_DISR (1 << 0)
  105. /* DCO register defines */
  106. #define DCO_DRPLOCK (1 << 0)
  107. #define DCO_CPGCLOCK (1 << 8)
  108. #define DCO_PMICTL (1 << 28)
  109. #define DCO_PMIDIS (1 << 29)
  110. #define DCO_IC (1 << 31)
  111. /* DECCCTRL register defines */
  112. #define DECCCTRL_SBEEN (1 << 0)
  113. #define DECCCTRL_DBEEN (1 << 1)
  114. #define DECCCTRL_ENCBGEN (1 << 17)
  115. /* DRAM init command */
  116. #define DCMD_MRS1(rnk, dat) (0 | ((rnk) << 22) | (1 << 3) | ((dat) << 6))
  117. #define DCMD_REF(rnk) (1 | ((rnk) << 22))
  118. #define DCMD_PRE(rnk) (2 | ((rnk) << 22))
  119. #define DCMD_PREA(rnk) (2 | ((rnk) << 22) | (0x400 << 6))
  120. #define DCMD_ACT(rnk, row) (3 | ((rnk) << 22) | ((row) << 6))
  121. #define DCMD_WR(rnk, col) (4 | ((rnk) << 22) | ((col) << 6))
  122. #define DCMD_RD(rnk, col) (5 | ((rnk) << 22) | ((col) << 6))
  123. #define DCMD_ZQCS(rnk) (6 | ((rnk) << 22))
  124. #define DCMD_ZQCL(rnk) (6 | ((rnk) << 22) | (0x400 << 6))
  125. #define DCMD_NOP(rnk) (7 | ((rnk) << 22))
  126. #define DDR3_EMRS1_DIC_40 0
  127. #define DDR3_EMRS1_DIC_34 1
  128. #define DDR3_EMRS1_RTTNOM_0 0
  129. #define DDR3_EMRS1_RTTNOM_60 0x04
  130. #define DDR3_EMRS1_RTTNOM_120 0x40
  131. #define DDR3_EMRS1_RTTNOM_40 0x44
  132. #define DDR3_EMRS1_RTTNOM_20 0x200
  133. #define DDR3_EMRS1_RTTNOM_30 0x204
  134. #define DDR3_EMRS2_RTTWR_60 (1 << 9)
  135. #define DDR3_EMRS2_RTTWR_120 (1 << 10)
  136. /* BEGIN DDRIO Registers */
  137. /* DDR IOs & COMPs */
  138. #define DDRIODQ_BL_OFFSET 0x0800
  139. #define DDRIODQ_CH_OFFSET ((NUM_BYTE_LANES / 2) * DDRIODQ_BL_OFFSET)
  140. #define DDRIOCCC_CH_OFFSET 0x0800
  141. #define DDRCOMP_CH_OFFSET 0x0100
  142. /* CH0-BL01-DQ */
  143. #define DQOBSCKEBBCTL 0x0000
  144. #define DQDLLTXCTL 0x0004
  145. #define DQDLLRXCTL 0x0008
  146. #define DQMDLLCTL 0x000c
  147. #define B0RXIOBUFCTL 0x0010
  148. #define B0VREFCTL 0x0014
  149. #define B0RXOFFSET1 0x0018
  150. #define B0RXOFFSET0 0x001c
  151. #define B1RXIOBUFCTL 0x0020
  152. #define B1VREFCTL 0x0024
  153. #define B1RXOFFSET1 0x0028
  154. #define B1RXOFFSET0 0x002c
  155. #define DQDFTCTL 0x0030
  156. #define DQTRAINSTS 0x0034
  157. #define B1DLLPICODER0 0x0038
  158. #define B0DLLPICODER0 0x003c
  159. #define B1DLLPICODER1 0x0040
  160. #define B0DLLPICODER1 0x0044
  161. #define B1DLLPICODER2 0x0048
  162. #define B0DLLPICODER2 0x004c
  163. #define B1DLLPICODER3 0x0050
  164. #define B0DLLPICODER3 0x0054
  165. #define B1RXDQSPICODE 0x0058
  166. #define B0RXDQSPICODE 0x005c
  167. #define B1RXDQPICODER32 0x0060
  168. #define B1RXDQPICODER10 0x0064
  169. #define B0RXDQPICODER32 0x0068
  170. #define B0RXDQPICODER10 0x006c
  171. #define B01PTRCTL0 0x0070
  172. #define B01PTRCTL1 0x0074
  173. #define B01DBCTL0 0x0078
  174. #define B01DBCTL1 0x007c
  175. #define B0LATCTL0 0x0080
  176. #define B1LATCTL0 0x0084
  177. #define B01LATCTL1 0x0088
  178. #define B0ONDURCTL 0x008c
  179. #define B1ONDURCTL 0x0090
  180. #define B0OVRCTL 0x0094
  181. #define B1OVRCTL 0x0098
  182. #define DQCTL 0x009c
  183. #define B0RK2RKCHGPTRCTRL 0x00a0
  184. #define B1RK2RKCHGPTRCTRL 0x00a4
  185. #define DQRK2RKCTL 0x00a8
  186. #define DQRK2RKPTRCTL 0x00ac
  187. #define B0RK2RKLAT 0x00b0
  188. #define B1RK2RKLAT 0x00b4
  189. #define DQCLKALIGNREG0 0x00b8
  190. #define DQCLKALIGNREG1 0x00bc
  191. #define DQCLKALIGNREG2 0x00c0
  192. #define DQCLKALIGNSTS0 0x00c4
  193. #define DQCLKALIGNSTS1 0x00c8
  194. #define DQCLKGATE 0x00cc
  195. #define B0COMPSLV1 0x00d0
  196. #define B1COMPSLV1 0x00d4
  197. #define B0COMPSLV2 0x00d8
  198. #define B1COMPSLV2 0x00dc
  199. #define B0COMPSLV3 0x00e0
  200. #define B1COMPSLV3 0x00e4
  201. #define DQVISALANECR0TOP 0x00e8
  202. #define DQVISALANECR1TOP 0x00ec
  203. #define DQVISACONTROLCRTOP 0x00f0
  204. #define DQVISALANECR0BL 0x00f4
  205. #define DQVISALANECR1BL 0x00f8
  206. #define DQVISACONTROLCRBL 0x00fc
  207. #define DQTIMINGCTRL 0x010c
  208. /* CH0-ECC */
  209. #define ECCDLLTXCTL 0x2004
  210. #define ECCDLLRXCTL 0x2008
  211. #define ECCMDLLCTL 0x200c
  212. #define ECCB1DLLPICODER0 0x2038
  213. #define ECCB1DLLPICODER1 0x2040
  214. #define ECCB1DLLPICODER2 0x2048
  215. #define ECCB1DLLPICODER3 0x2050
  216. #define ECCB01DBCTL0 0x2078
  217. #define ECCB01DBCTL1 0x207c
  218. #define ECCCLKALIGNREG0 0x20b8
  219. #define ECCCLKALIGNREG1 0x20bc
  220. #define ECCCLKALIGNREG2 0x20c0
  221. /* CH0-CMD */
  222. #define CMDOBSCKEBBCTL 0x4800
  223. #define CMDDLLTXCTL 0x4808
  224. #define CMDDLLRXCTL 0x480c
  225. #define CMDMDLLCTL 0x4810
  226. #define CMDRCOMPODT 0x4814
  227. #define CMDDLLPICODER0 0x4820
  228. #define CMDDLLPICODER1 0x4824
  229. #define CMDCFGREG0 0x4840
  230. #define CMDPTRREG 0x4844
  231. #define CMDCLKALIGNREG0 0x4850
  232. #define CMDCLKALIGNREG1 0x4854
  233. #define CMDCLKALIGNREG2 0x4858
  234. #define CMDPMCONFIG0 0x485c
  235. #define CMDPMDLYREG0 0x4860
  236. #define CMDPMDLYREG1 0x4864
  237. #define CMDPMDLYREG2 0x4868
  238. #define CMDPMDLYREG3 0x486c
  239. #define CMDPMDLYREG4 0x4870
  240. #define CMDCLKALIGNSTS0 0x4874
  241. #define CMDCLKALIGNSTS1 0x4878
  242. #define CMDPMSTS0 0x487c
  243. #define CMDPMSTS1 0x4880
  244. #define CMDCOMPSLV 0x4884
  245. #define CMDBONUS0 0x488c
  246. #define CMDBONUS1 0x4890
  247. #define CMDVISALANECR0 0x4894
  248. #define CMDVISALANECR1 0x4898
  249. #define CMDVISACONTROLCR 0x489c
  250. #define CMDCLKGATE 0x48a0
  251. #define CMDTIMINGCTRL 0x48a4
  252. /* CH0-CLK-CTL */
  253. #define CCOBSCKEBBCTL 0x5800
  254. #define CCRCOMPIO 0x5804
  255. #define CCDLLTXCTL 0x5808
  256. #define CCDLLRXCTL 0x580c
  257. #define CCMDLLCTL 0x5810
  258. #define CCRCOMPODT 0x5814
  259. #define CCDLLPICODER0 0x5820
  260. #define CCDLLPICODER1 0x5824
  261. #define CCDDR3RESETCTL 0x5830
  262. #define CCCFGREG0 0x5838
  263. #define CCCFGREG1 0x5840
  264. #define CCPTRREG 0x5844
  265. #define CCCLKALIGNREG0 0x5850
  266. #define CCCLKALIGNREG1 0x5854
  267. #define CCCLKALIGNREG2 0x5858
  268. #define CCPMCONFIG0 0x585c
  269. #define CCPMDLYREG0 0x5860
  270. #define CCPMDLYREG1 0x5864
  271. #define CCPMDLYREG2 0x5868
  272. #define CCPMDLYREG3 0x586c
  273. #define CCPMDLYREG4 0x5870
  274. #define CCCLKALIGNSTS0 0x5874
  275. #define CCCLKALIGNSTS1 0x5878
  276. #define CCPMSTS0 0x587c
  277. #define CCPMSTS1 0x5880
  278. #define CCCOMPSLV1 0x5884
  279. #define CCCOMPSLV2 0x5888
  280. #define CCCOMPSLV3 0x588c
  281. #define CCBONUS0 0x5894
  282. #define CCBONUS1 0x5898
  283. #define CCVISALANECR0 0x589c
  284. #define CCVISALANECR1 0x58a0
  285. #define CCVISACONTROLCR 0x58a4
  286. #define CCCLKGATE 0x58a8
  287. #define CCTIMINGCTL 0x58ac
  288. /* COMP */
  289. #define CMPCTRL 0x6800
  290. #define SOFTRSTCNTL 0x6804
  291. #define MSCNTR 0x6808
  292. #define NMSCNTRL 0x680c
  293. #define LATCH1CTL 0x6814
  294. #define COMPVISALANECR0 0x681c
  295. #define COMPVISALANECR1 0x6820
  296. #define COMPVISACONTROLCR 0x6824
  297. #define COMPBONUS0 0x6830
  298. #define TCOCNTCTRL 0x683c
  299. #define DQANAODTPUCTL 0x6840
  300. #define DQANAODTPDCTL 0x6844
  301. #define DQANADRVPUCTL 0x6848
  302. #define DQANADRVPDCTL 0x684c
  303. #define DQANADLYPUCTL 0x6850
  304. #define DQANADLYPDCTL 0x6854
  305. #define DQANATCOPUCTL 0x6858
  306. #define DQANATCOPDCTL 0x685c
  307. #define CMDANADRVPUCTL 0x6868
  308. #define CMDANADRVPDCTL 0x686c
  309. #define CMDANADLYPUCTL 0x6870
  310. #define CMDANADLYPDCTL 0x6874
  311. #define CLKANAODTPUCTL 0x6880
  312. #define CLKANAODTPDCTL 0x6884
  313. #define CLKANADRVPUCTL 0x6888
  314. #define CLKANADRVPDCTL 0x688c
  315. #define CLKANADLYPUCTL 0x6890
  316. #define CLKANADLYPDCTL 0x6894
  317. #define CLKANATCOPUCTL 0x6898
  318. #define CLKANATCOPDCTL 0x689c
  319. #define DQSANAODTPUCTL 0x68a0
  320. #define DQSANAODTPDCTL 0x68a4
  321. #define DQSANADRVPUCTL 0x68a8
  322. #define DQSANADRVPDCTL 0x68ac
  323. #define DQSANADLYPUCTL 0x68b0
  324. #define DQSANADLYPDCTL 0x68b4
  325. #define DQSANATCOPUCTL 0x68b8
  326. #define DQSANATCOPDCTL 0x68bc
  327. #define CTLANADRVPUCTL 0x68c8
  328. #define CTLANADRVPDCTL 0x68cc
  329. #define CTLANADLYPUCTL 0x68d0
  330. #define CTLANADLYPDCTL 0x68d4
  331. #define CHNLBUFSTATIC 0x68f0
  332. #define COMPOBSCNTRL 0x68f4
  333. #define COMPBUFFDBG0 0x68f8
  334. #define COMPBUFFDBG1 0x68fc
  335. #define CFGMISCCH0 0x6900
  336. #define COMPEN0CH0 0x6904
  337. #define COMPEN1CH0 0x6908
  338. #define COMPEN2CH0 0x690c
  339. #define STATLEGEN0CH0 0x6910
  340. #define STATLEGEN1CH0 0x6914
  341. #define DQVREFCH0 0x6918
  342. #define CMDVREFCH0 0x691c
  343. #define CLKVREFCH0 0x6920
  344. #define DQSVREFCH0 0x6924
  345. #define CTLVREFCH0 0x6928
  346. #define TCOVREFCH0 0x692c
  347. #define DLYSELCH0 0x6930
  348. #define TCODRAMBUFODTCH0 0x6934
  349. #define CCBUFODTCH0 0x6938
  350. #define RXOFFSETCH0 0x693c
  351. #define DQODTPUCTLCH0 0x6940
  352. #define DQODTPDCTLCH0 0x6944
  353. #define DQDRVPUCTLCH0 0x6948
  354. #define DQDRVPDCTLCH0 0x694c
  355. #define DQDLYPUCTLCH0 0x6950
  356. #define DQDLYPDCTLCH0 0x6954
  357. #define DQTCOPUCTLCH0 0x6958
  358. #define DQTCOPDCTLCH0 0x695c
  359. #define CMDDRVPUCTLCH0 0x6968
  360. #define CMDDRVPDCTLCH0 0x696c
  361. #define CMDDLYPUCTLCH0 0x6970
  362. #define CMDDLYPDCTLCH0 0x6974
  363. #define CLKODTPUCTLCH0 0x6980
  364. #define CLKODTPDCTLCH0 0x6984
  365. #define CLKDRVPUCTLCH0 0x6988
  366. #define CLKDRVPDCTLCH0 0x698c
  367. #define CLKDLYPUCTLCH0 0x6990
  368. #define CLKDLYPDCTLCH0 0x6994
  369. #define CLKTCOPUCTLCH0 0x6998
  370. #define CLKTCOPDCTLCH0 0x699c
  371. #define DQSODTPUCTLCH0 0x69a0
  372. #define DQSODTPDCTLCH0 0x69a4
  373. #define DQSDRVPUCTLCH0 0x69a8
  374. #define DQSDRVPDCTLCH0 0x69ac
  375. #define DQSDLYPUCTLCH0 0x69b0
  376. #define DQSDLYPDCTLCH0 0x69b4
  377. #define DQSTCOPUCTLCH0 0x69b8
  378. #define DQSTCOPDCTLCH0 0x69bc
  379. #define CTLDRVPUCTLCH0 0x69c8
  380. #define CTLDRVPDCTLCH0 0x69cc
  381. #define CTLDLYPUCTLCH0 0x69d0
  382. #define CTLDLYPDCTLCH0 0x69d4
  383. #define FNLUPDTCTLCH0 0x69f0
  384. /* PLL */
  385. #define MPLLCTRL0 0x7800
  386. #define MPLLCTRL1 0x7808
  387. #define MPLLCSR0 0x7810
  388. #define MPLLCSR1 0x7814
  389. #define MPLLCSR2 0x7820
  390. #define MPLLDFT 0x7828
  391. #define MPLLMON0CTL 0x7830
  392. #define MPLLMON1CTL 0x7838
  393. #define MPLLMON2CTL 0x783c
  394. #define SFRTRIM 0x7850
  395. #define MPLLDFTOUT0 0x7858
  396. #define MPLLDFTOUT1 0x785c
  397. #define MASTERRSTN 0x7880
  398. #define PLLLOCKDEL 0x7884
  399. #define SFRDEL 0x7888
  400. #define CRUVISALANECR0 0x78f0
  401. #define CRUVISALANECR1 0x78f4
  402. #define CRUVISACONTROLCR 0x78f8
  403. #define IOSFVISALANECR0 0x78fc
  404. #define IOSFVISALANECR1 0x7900
  405. #define IOSFVISACONTROLCR 0x7904
  406. /* END DDRIO Registers */
  407. /* DRAM Specific Message Bus OpCodes */
  408. #define MSG_OP_DRAM_INIT 0x68
  409. #define MSG_OP_DRAM_WAKE 0xca
  410. #define SAMPLE_SIZE 6
  411. /* must be less than this number to enable early deadband */
  412. #define EARLY_DB 0x12
  413. /* must be greater than this number to enable late deadband */
  414. #define LATE_DB 0x34
  415. #define CHX_REGS (11 * 4)
  416. #define FULL_CLK 128
  417. #define HALF_CLK 64
  418. #define QRTR_CLK 32
  419. #define MCEIL(num, den) ((uint8_t)((num + den - 1) / den))
  420. #define MMAX(a, b) ((a) > (b) ? (a) : (b))
  421. #define DEAD_LOOP() for (;;);
  422. #define MIN_RDQS_EYE 10 /* in PI Codes */
  423. #define MIN_VREF_EYE 10 /* in VREF Codes */
  424. /* how many RDQS codes to jump while margining */
  425. #define RDQS_STEP 1
  426. /* how many VREF codes to jump while margining */
  427. #define VREF_STEP 1
  428. /* offset into "vref_codes[]" for minimum allowed VREF setting */
  429. #define VREF_MIN 0x00
  430. /* offset into "vref_codes[]" for maximum allowed VREF setting */
  431. #define VREF_MAX 0x3f
  432. #define RDQS_MIN 0x00 /* minimum RDQS delay value */
  433. #define RDQS_MAX 0x3f /* maximum RDQS delay value */
  434. /* how many WDQ codes to jump while margining */
  435. #define WDQ_STEP 1
  436. enum {
  437. B, /* BOTTOM VREF */
  438. T /* TOP VREF */
  439. };
  440. enum {
  441. L, /* LEFT RDQS */
  442. R /* RIGHT RDQS */
  443. };
  444. /* Memory Options */
  445. /* enable STATIC timing settings for RCVN (BACKUP_MODE) */
  446. #undef BACKUP_RCVN
  447. /* enable STATIC timing settings for WDQS (BACKUP_MODE) */
  448. #undef BACKUP_WDQS
  449. /* enable STATIC timing settings for RDQS (BACKUP_MODE) */
  450. #undef BACKUP_RDQS
  451. /* enable STATIC timing settings for WDQ (BACKUP_MODE) */
  452. #undef BACKUP_WDQ
  453. /* enable *COMP overrides (BACKUP_MODE) */
  454. #undef BACKUP_COMPS
  455. /* enable the RD_TRAIN eye check */
  456. #undef RX_EYE_CHECK
  457. /* enable Host to Memory Clock Alignment */
  458. #define HMC_TEST
  459. /* enable multi-rank support via rank2rank sharing */
  460. #define R2R_SHARING
  461. /* disable signals not used in 16bit mode of DDRIO */
  462. #define FORCE_16BIT_DDRIO
  463. #define PLATFORM_ID 1
  464. void clear_self_refresh(struct mrc_params *mrc_params);
  465. void prog_ddr_timing_control(struct mrc_params *mrc_params);
  466. void prog_decode_before_jedec(struct mrc_params *mrc_params);
  467. void perform_ddr_reset(struct mrc_params *mrc_params);
  468. void ddrphy_init(struct mrc_params *mrc_params);
  469. void perform_jedec_init(struct mrc_params *mrc_params);
  470. void set_ddr_init_complete(struct mrc_params *mrc_params);
  471. void restore_timings(struct mrc_params *mrc_params);
  472. void default_timings(struct mrc_params *mrc_params);
  473. void rcvn_cal(struct mrc_params *mrc_params);
  474. void wr_level(struct mrc_params *mrc_params);
  475. void prog_page_ctrl(struct mrc_params *mrc_params);
  476. void rd_train(struct mrc_params *mrc_params);
  477. void wr_train(struct mrc_params *mrc_params);
  478. void store_timings(struct mrc_params *mrc_params);
  479. void enable_scrambling(struct mrc_params *mrc_params);
  480. void prog_ddr_control(struct mrc_params *mrc_params);
  481. void prog_dra_drb(struct mrc_params *mrc_params);
  482. void perform_wake(struct mrc_params *mrc_params);
  483. void change_refresh_period(struct mrc_params *mrc_params);
  484. void set_auto_refresh(struct mrc_params *mrc_params);
  485. void ecc_enable(struct mrc_params *mrc_params);
  486. void memory_test(struct mrc_params *mrc_params);
  487. void lock_registers(struct mrc_params *mrc_params);
  488. #endif /* _SMC_H_ */