All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peng Fan (OSS) <peng.fan@oss.nxp.com>
To: u-boot@lists.denx.de
Subject: [PATCH 04/13] imx: ddr: imx8m: Move selfref_en after DDR scrub
Date: Mon, 28 Dec 2020 20:17:01 +0800	[thread overview]
Message-ID: <20201228121710.17235-4-peng.fan@oss.nxp.com> (raw)
In-Reply-To: <20201228121710.17235-1-peng.fan@oss.nxp.com>

From: Ye Li <ye.li@nxp.com>

When doing DDR scrub, the DDR may enter into self refresh if the
selfref_en is enabled before DDR scrub. This will cause scrub
can't complete that SBRSTAT.scrub_done won't be set.

Since the selfref_en can be programmed during the course of
normal operation, move it after DDR scrub

Signed-off-by: Ye Li <ye.li@nxp.com>
Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
---
 drivers/ddr/imx/imx8m/ddr_init.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/ddr/imx/imx8m/ddr_init.c b/drivers/ddr/imx/imx8m/ddr_init.c
index 65739dbaa7..57331649ac 100644
--- a/drivers/ddr/imx/imx8m/ddr_init.c
+++ b/drivers/ddr/imx/imx8m/ddr_init.c
@@ -236,8 +236,6 @@ int ddr_init(struct dram_timing_info *dram_timing)
 
 	/* Step26: Set back register in Step4 to the original values if desired */
 	reg32_write(DDRC_RFSHCTL3(0), 0x0000000);
-	/* enable selfref_en by default */
-	setbits_le32(DDRC_PWRCTL(0), 0x1);
 
 	/* enable port 0 */
 	reg32_write(DDRC_PCTRL_0(0), 0x00000001);
@@ -245,6 +243,9 @@ int ddr_init(struct dram_timing_info *dram_timing)
 
 	board_dram_ecc_scrub();
 
+	/* enable selfref_en by default */
+	setbits_le32(DDRC_PWRCTL(0), 0x1);
+
 	/* save the dram timing config into memory */
 	dram_config_save(dram_timing, CONFIG_SAVED_DRAM_TIMING_BASE);
 
-- 
2.28.0

  parent reply	other threads:[~2020-12-28 12:17 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-28 12:16 [PATCH 01/13] imx: imx8mp_evk: enable eth support Peng Fan
2020-12-28 12:16 ` [PATCH 02/13] imx: imx8mn_ddr4_evk: Use CONFIG_TARGET_IMX8MN_DDR4_EVK for DDR4 EVK board Peng Fan
2020-12-28 12:17 ` [PATCH 03/13] imx: ddr: imx8m: add print for DRAM rate Peng Fan
2020-12-28 13:53   ` Adam Ford
2020-12-28 14:01     ` Fabio Estevam
2020-12-28 12:17 ` Peng Fan [this message]
2020-12-28 12:17 ` [PATCH 05/13] imx: imx8mn_evk: correct stack/malloc adress Peng Fan
2020-12-28 21:42   ` ZHIZHIKIN Andrey
2020-12-29  1:27     ` Peng Fan
2020-12-29 12:19   ` Adam Ford
2020-12-30  0:55     ` Peng Fan
2020-12-28 12:17 ` [PATCH 06/13] arm: dts: imx8mn: sync dts from Linux Kernel Peng Fan
2020-12-28 12:17 ` [PATCH 07/13] imx: imx8mn: add i.MX8MN LPDDR4 EVK support Peng Fan
2020-12-28 21:54   ` ZHIZHIKIN Andrey
2020-12-29  1:28     ` Peng Fan
2020-12-28 12:17 ` [PATCH 08/13] imx8m: clock: add type of set_clk_eqos Peng Fan
2020-12-28 12:17 ` [PATCH 09/13] arm: dts: imx8mp: sync dts from Linux Kernel Peng Fan
2020-12-28 12:17 ` [PATCH 10/13] arm: dts: imx8mm: " Peng Fan
2020-12-28 12:17 ` [PATCH 11/13] arm: dts: imx8mq: " Peng Fan
2020-12-28 12:17 ` [PATCH 12/13] imx8m: lowlevel_init: tune alignment Peng Fan
2020-12-28 12:17 ` [PATCH 13/13] imx: imx8m: move CONFIG_SPL_SYS_[I, D]CACHE_OFF to defconfig Peng Fan
2020-12-28 21:34 ` [PATCH 01/13] imx: imx8mp_evk: enable eth support ZHIZHIKIN Andrey
2020-12-28 22:00 ` Fabio Estevam
2020-12-29  1:26   ` Peng Fan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201228121710.17235-4-peng.fan@oss.nxp.com \
    --to=peng.fan@oss.nxp.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.