diff options
author | Max Krummenacher <max.krummenacher@toradex.com> | 2021-05-03 21:28:55 +0200 |
---|---|---|
committer | Max Krummenacher <max.krummenacher@toradex.com> | 2021-05-03 21:30:40 +0200 |
commit | 835a8f67b2ca7aa3f2d05d6e6a1a51f7e1147266 (patch) | |
tree | 229385550c80485b4f31cdad8a78eda7d5fac26e /plat/imx/imx8m/ddr/ddr4_dvfs.c | |
parent | 7f1187ba31cc1624f7dadd98998e010cb229926a (diff) | |
parent | 2a26786460edd4f0ec3111e7027c93c57fc572c1 (diff) |
Merge remote-tracking branch 'nxp/imx_5.4.70_2.3.0' into toradex_imx_5.4.70_2.3.0
Updates to 5.4.70_2.3.2
Related-to: ELB-3957
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com>
Diffstat (limited to 'plat/imx/imx8m/ddr/ddr4_dvfs.c')
-rw-r--r-- | plat/imx/imx8m/ddr/ddr4_dvfs.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/plat/imx/imx8m/ddr/ddr4_dvfs.c b/plat/imx/imx8m/ddr/ddr4_dvfs.c index 52dd2066..d1c0d750 100644 --- a/plat/imx/imx8m/ddr/ddr4_dvfs.c +++ b/plat/imx/imx8m/ddr/ddr4_dvfs.c @@ -18,8 +18,22 @@ void ddr4_mr_write(uint32_t mr, uint32_t data, uint32_t mr_type, * 1. Poll MRSTAT.mr_wr_busy until it is 0 to make sure * that there is no outstanding MR transAction. */ - while (mmio_read_32(DDRC_MRSTAT(0)) & 0x1) - ; + + /* + * ERR050712: + * When performing a software driven MR access, the following sequence + * must be done automatically before performing other APB register accesses. + * 1. Set MRCTRL0.mr_wr=1 + * 2. Check for MRSTAT.mr_wr_busy=0. If not, go to step (2) + * 3. Check for MRSTAT.mr_wr_busy=0 again (for the second time). If not, go to step (2) + */ + mmio_setbits_32(DDRC_MRCTRL0(0), BIT(31)); + + do { + while (mmio_read_32(DDRC_MRSTAT(0)) & 0x1) + ; + + } while (mmio_read_32(DDRC_MRSTAT(0)) & 0x1); /* * 2. Write the MRCTRL0.mr_type, MRCTRL0.mr_addr, MRCTRL0.mr_rank |