All of lore.kernel.org
 help / color / mirror / Atom feed
From: Francesco Dolcini <francesco.dolcini@toradex.com>
To: Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	uboot-imx@nxp.com, Marek Vasut <marex@denx.de>,
	Tim Harvey <tharvey@gateworks.com>
Cc: Francesco Dolcini <francesco.dolcini@toradex.com>, u-boot@lists.denx.de
Subject: [RFC PATCH 2/3] mx6: ddr: Wait before issuing the first MRS cmd
Date: Mon,  4 Apr 2022 10:51:18 +0200	[thread overview]
Message-ID: <20220404085119.97792-3-francesco.dolcini@toradex.com> (raw)
In-Reply-To: <20220404085119.97792-1-francesco.dolcini@toradex.com>

Wait 1ms before issuing the first MRS command to write DDR3 Mode
registers.

There is a requirement to wait minimum of Reset CKE Exit time, tXPR,
with tXPR = max(tXS, 5tCK) and to wait 500 useconds after reset is
de-asserted. It seems that for some reason this is not enforced by the
MMDC controller, despite MMDCx_MDOR RST_to_CKE and tXPR being correctly
configured.

Without this change we experienced random memory initialization failures
with about 2% boot failure rate on specific problematic boards, after
this change we were able to do more than 10.000 power-cycle without a
single failure.

Fixes: fe0f7f7842e1 ("mx6: add mmdc configuration for MX6Q/MX6DL")
Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
---
 arch/arm/mach-imx/mx6/ddr.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-imx/mx6/ddr.c b/arch/arm/mach-imx/mx6/ddr.c
index 08e2f0f130a6..7b3d620094c4 100644
--- a/arch/arm/mach-imx/mx6/ddr.c
+++ b/arch/arm/mach-imx/mx6/ddr.c
@@ -1526,6 +1526,8 @@ void mx6_ddr3_cfg(const struct mx6_ddr_sysinfo *sysinfo,
 			((sysinfo->ncs == 2) ? 1 : 0) << 30; /* SDE_1 for CS1 */
 
 	/* Step 8: Write Mode Registers to Init DDR3 devices */
+	mdelay(1); /* Wait before issuing the first MRS command
+		      (tXPR / 500us CKE delay after reset deassertion) */
 	for (cs = 0; cs < sysinfo->ncs; cs++) {
 		/* MR2 */
 		val = (sysinfo->rtt_wr & 3) << 9 | (ddr3_cfg->SRT & 1) << 7 |
-- 
2.25.1


  parent reply	other threads:[~2022-04-04  8:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-04  8:51 [RFC PATCH 0/3] Fix iMX6 DDR configuration issues and update toradex apalis-imx6 Francesco Dolcini
2022-04-04  8:51 ` [RFC PATCH 1/3] mx6: ddr: Restore ralat/walat in write level calibration Francesco Dolcini
2022-04-04 13:40   ` Marek Vasut
2022-04-04  8:51 ` Francesco Dolcini [this message]
2022-04-04 13:39   ` [RFC PATCH 2/3] mx6: ddr: Wait before issuing the first MRS cmd Marek Vasut
2022-04-04 14:53     ` Francesco Dolcini
2022-04-04 19:56       ` Marek Vasut
2022-04-05  9:09         ` Francesco Dolcini
2022-04-05  9:28           ` Marek Vasut
2022-04-04  8:51 ` [RFC PATCH 3/3] board: apalis_imx6: DDR init using mx6_dram_cfg() Francesco Dolcini

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=20220404085119.97792-3-francesco.dolcini@toradex.com \
    --to=francesco.dolcini@toradex.com \
    --cc=festevam@gmail.com \
    --cc=marex@denx.de \
    --cc=sbabic@denx.de \
    --cc=tharvey@gateworks.com \
    --cc=u-boot@lists.denx.de \
    --cc=uboot-imx@nxp.com \
    /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.