{
struct mmdc_p_regs *mmdc0 = (struct mmdc_p_regs *)MMDC_P0_BASE_ADDR;
struct mmdc_p_regs *mmdc1 = (struct mmdc_p_regs *)MMDC_P1_BASE_ADDR;
- u32 esdmisc_val, zq_val;
+ u32 esdmisc_val, zq_val, mdmisc_val;
u32 errors = 0;
u32 ldectrl[4] = {0};
u32 ddr_mr1 = 0x4;
/* disable Adopt power down timer */
setbits_le32(&mmdc0->mapsr, 0x1);
+ /* Save old RALAT and WALAT values */
+ mdmisc_val = readl(&mmdc0->mdmisc);
+
debug("Starting write leveling calibration.\n");
/*
writel(esdmisc_val, &mmdc0->mdref);
writel(zq_val, &mmdc0->mpzqhwctrl);
+ /* restore WALAT/RALAT */
+ writel(mdmisc_val, &mmdc0->mdmisc);
+
debug("\tMMDC_MPWLDECTRL0 after write level cal: 0x%08x\n",
readl(&mmdc0->mpwldectrl0));
debug("\tMMDC_MPWLDECTRL1 after write level cal: 0x%08x\n",