summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorHao Zhang <hzhang@ti.com>2014-07-09 19:48:41 +0300
committerTom Rini <trini@ti.com>2014-07-25 16:26:09 -0400
commit101eec50f021a354487a511dc1f72691404b2b48 (patch)
tree3ce38417d6fa5b3131307167e075c18b8f47aa41 /board
parent0b868589563ab96384b9a817bc5b82d93c573ea5 (diff)
downloadu-boot-imx-101eec50f021a354487a511dc1f72691404b2b48.zip
u-boot-imx-101eec50f021a354487a511dc1f72691404b2b48.tar.gz
u-boot-imx-101eec50f021a354487a511dc1f72691404b2b48.tar.bz2
keystone2: ddr: add DDR3 PHY configs updated for PG 2.0
Add DDR3 PHY configs updated for PG 2.0 Also add DDR3A PHY reset before init for PG2.0 SoCs. Acked-by: Murali Karicheri <m-maricheri2@ti.com> Signed-off-by: Hao Zhang <hzhang@ti.com> Signed-off-by: Ivan Khoronzhuk <ivan.khoronzhuk@ti.com>
Diffstat (limited to 'board')
-rw-r--r--board/ti/k2hk_evm/ddr3.c80
1 files changed, 78 insertions, 2 deletions
diff --git a/board/ti/k2hk_evm/ddr3.c b/board/ti/k2hk_evm/ddr3.c
index 0085f29..b604266 100644
--- a/board/ti/k2hk_evm/ddr3.c
+++ b/board/ti/k2hk_evm/ddr3.c
@@ -188,6 +188,61 @@ static struct ddr3_phy_config ddr3phy_1333_64 = {
.pir_v2 = 0x0000FF81ul,
};
/******************************************************/
+
+/* DDR PHY Configs Updated for PG 2.0
+ * zq0,1,2cr1 are updated for PG 2.0 specific configs *_pg2 */
+static struct ddr3_phy_config ddr3phy_1600_64A_pg2 = {
+ .pllcr = 0x0001C000ul,
+ .pgcr1_mask = (IODDRM_MASK | ZCKSEL_MASK),
+ .pgcr1_val = ((1 << 2) | (1 << 7) | (1 << 23)),
+ .ptr0 = 0x42C21590ul,
+ .ptr1 = 0xD05612C0ul,
+ .ptr2 = 0, /* not set in gel */
+ .ptr3 = 0x0D861A80ul,
+ .ptr4 = 0x0C827100ul,
+ .dcr_mask = (PDQ_MASK | MPRDQ_MASK | BYTEMASK_MASK),
+ .dcr_val = ((1 << 10)),
+ .dtpr0 = 0xA19DBB66ul,
+ .dtpr1 = 0x32868300ul,
+ .dtpr2 = 0x50035200ul,
+ .mr0 = 0x00001C70ul,
+ .mr1 = 0x00000006ul,
+ .mr2 = 0x00000018ul,
+ .dtcr = 0x730035C7ul,
+ .pgcr2 = 0x00F07A12ul,
+ .zq0cr1 = 0x0001005Dul,
+ .zq1cr1 = 0x0001005Bul,
+ .zq2cr1 = 0x0001005Bul,
+ .pir_v1 = 0x00000033ul,
+ .pir_v2 = 0x0000FF81ul,
+};
+
+static struct ddr3_phy_config ddr3phy_1333_64A_pg2 = {
+ .pllcr = 0x0005C000ul,
+ .pgcr1_mask = (IODDRM_MASK | ZCKSEL_MASK),
+ .pgcr1_val = ((1 << 2) | (1 << 7) | (1 << 23)),
+ .ptr0 = 0x42C21590ul,
+ .ptr1 = 0xD05612C0ul,
+ .ptr2 = 0, /* not set in gel */
+ .ptr3 = 0x0B4515C2ul,
+ .ptr4 = 0x0A6E08B4ul,
+ .dcr_mask = (PDQ_MASK | MPRDQ_MASK | BYTEMASK_MASK),
+ .dcr_val = ((1 << 10)),
+ .dtpr0 = 0x8558AA55ul,
+ .dtpr1 = 0x32857280ul,
+ .dtpr2 = 0x5002C200ul,
+ .mr0 = 0x00001A60ul,
+ .mr1 = 0x00000006ul,
+ .mr2 = 0x00000010ul,
+ .dtcr = 0x710035C7ul,
+ .pgcr2 = 0x00F065B8ul,
+ .zq0cr1 = 0x0001005Dul,
+ .zq1cr1 = 0x0001005Bul,
+ .zq2cr1 = 0x0001005Bul,
+ .pir_v1 = 0x00000033ul,
+ .pir_v2 = 0x0000FF81ul,
+};
+
int get_dimm_params(char *dimm_name)
{
u8 spd_params[256];
@@ -240,7 +295,18 @@ void ddr3_init(void)
if (!strcmp(dimm_name, "18KSF1G72HZ-1G6E2 ")) {
init_pll(&ddr3a_400);
if (cpu_revision() > 0) {
- ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC, &ddr3phy_1600_64A);
+ if (cpu_revision() > 1) {
+ /* PG 2.0 */
+ /* Reset DDR3A PHY after PLL enabled */
+ ddr3_reset_ddrphy();
+ ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+ &ddr3phy_1600_64A_pg2);
+ } else {
+ /* PG 1.1 */
+ ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+ &ddr3phy_1600_64A);
+ }
+
ddr3_init_ddremif(K2HK_DDR3A_EMIF_CTRL_BASE,
&ddr3_1600_64);
printf("DRAM: Capacity 8 GiB (includes reported below)\n");
@@ -253,7 +319,17 @@ void ddr3_init(void)
} else if (!strcmp(dimm_name, "SQR-SD3T-2G1333SED")) {
init_pll(&ddr3a_333);
if (cpu_revision() > 0) {
- ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC, &ddr3phy_1333_64A);
+ if (cpu_revision() > 1) {
+ /* PG 2.0 */
+ /* Reset DDR3A PHY after PLL enabled */
+ ddr3_reset_ddrphy();
+ ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+ &ddr3phy_1333_64A_pg2);
+ } else {
+ /* PG 1.1 */
+ ddr3_init_ddrphy(K2HK_DDR3A_DDRPHYC,
+ &ddr3phy_1333_64A);
+ }
ddr3_init_ddremif(K2HK_DDR3A_EMIF_CTRL_BASE,
&ddr3_1333_64);
} else {