linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haibo Chen <haibo.chen@nxp.com>
To: Han Xu <han.xu@nxp.com>, Yogesh Gaur <yogeshgaur.83@gmail.com>,
	 Mark Brown <broonie@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	 Frank Li <Frank.Li@nxp.com>
Cc: linux-spi@vger.kernel.org, imx@lists.linux.dev,
	 linux-kernel@vger.kernel.org, Haibo Chen <haibo.chen@nxp.com>
Subject: [PATCH 2/3] spi: spi-nxp-fspi: add extra delay after dll locked
Date: Mon, 22 Sep 2025 16:47:14 +0800	[thread overview]
Message-ID: <20250922-fspi-fix-v1-2-ff4315359d31@nxp.com> (raw)
In-Reply-To: <20250922-fspi-fix-v1-0-ff4315359d31@nxp.com>

From: Han Xu <han.xu@nxp.com>

Due to the erratum ERR050272, the DLL lock status register STS2
[xREFLOCK, xSLVLOCK] bit may indicate DLL is locked before DLL is
actually locked. Add an extra 4us delay as a workaround.

refer to ERR050272, on Page 20.
https://www.nxp.com/docs/en/errata/IMX8_1N94W.pdf

Fixes: 99d822b3adc4 ("spi: spi-nxp-fspi: use DLL calibration when clock rate > 100MHz")
Signed-off-by: Han Xu <han.xu@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
---
 drivers/spi/spi-nxp-fspi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/spi/spi-nxp-fspi.c b/drivers/spi/spi-nxp-fspi.c
index 4e82f9e900acb91c6de46559efd265f07cf4437d..96b3654b45abcaf53266ce9acac8d6578a19458a 100644
--- a/drivers/spi/spi-nxp-fspi.c
+++ b/drivers/spi/spi-nxp-fspi.c
@@ -721,6 +721,12 @@ static void nxp_fspi_dll_calibration(struct nxp_fspi *f)
 				   0, POLL_TOUT, true);
 	if (ret)
 		dev_warn(f->dev, "DLL lock failed, please fix it!\n");
+
+	/*
+	 * For ERR050272, DLL lock status bit is not accurate,
+	 * wait for 4us more as a workaround.
+	 */
+	udelay(4);
 }
 
 /*

-- 
2.34.1


  parent reply	other threads:[~2025-09-22  8:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22  8:47 [PATCH 0/3] spi: spi-nxp-fspi: few fix for flexspi Haibo Chen
2025-09-22  8:47 ` [PATCH 1/3] spi: spi-nxp-fspi: re-config the clock rate when operation require new clock rate Haibo Chen
2025-09-22  8:47 ` Haibo Chen [this message]
2025-09-22  8:47 ` [PATCH 3/3] spi: spi-nxp-fspi: limit the clock rate for different sample clock source selection Haibo Chen
2025-10-15 19:30 ` [PATCH 0/3] spi: spi-nxp-fspi: few fix for flexspi Mark Brown

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=20250922-fspi-fix-v1-2-ff4315359d31@nxp.com \
    --to=haibo.chen@nxp.com \
    --cc=Frank.Li@nxp.com \
    --cc=broonie@kernel.org \
    --cc=han.xu@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=yogeshgaur.83@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).