From: Chester Lin <clin@suse.com>
To: Ulf Hansson <ulf.hansson@linaro.org>,
s32@nxp.com, NXP Linux Team <linux-imx@nxp.com>,
BOUGH CHEN <haibo.chen@nxp.com>,
Dong Aisheng <aisheng.dong@nxp.com>,
linux-mmc@vger.kernel.org
Cc: "Rob Herring" <robh+dt@kernel.org>,
"Shawn Guo" <shawnguo@kernel.org>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org,
"Radu Nicolae Pirea" <radu-nicolae.pirea@oss.nxp.com>,
"Andreas Färber" <afaerber@suse.de>,
"Matthias Brugger" <mbrugger@suse.com>,
"Ivan T . Ivanov" <iivanov@suse.de>,
"Lee, Chun-Yi" <jlee@suse.com>
Subject: Re: [RFC PATCH 2/3] mmc: sdhci-esdhc-imx: add NXP S32G2 support
Date: Thu, 21 Oct 2021 15:30:56 +0800 [thread overview]
Message-ID: <YXEXMGGiVOiLZ0H9@linux-8mug> (raw)
In-Reply-To: <20211021071333.32485-3-clin@suse.com>
Hi NXP S32 and i.MX Linux teams,
On Thu, Oct 21, 2021 at 03:13:32PM +0800, Chester Lin wrote:
> Support the SDHCI controller found on NXP S32G2 platform. The new flag
> ESDHC_FLAG_SKIP_ERR004536 is used because the hardware erratum bit is not
> applicable for S32G2.
>
> Signed-off-by: Chester Lin <clin@suse.com>
> ---
> drivers/mmc/host/sdhci-esdhc-imx.c | 17 +++++++++++++++--
> 1 file changed, 15 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
> index f18d169bc8ff..d0f7d46a0354 100644
> --- a/drivers/mmc/host/sdhci-esdhc-imx.c
> +++ b/drivers/mmc/host/sdhci-esdhc-imx.c
> @@ -196,6 +196,9 @@
> */
> #define ESDHC_FLAG_BROKEN_AUTO_CMD23 BIT(16)
>
> +/* ERR004536 is not applicable for the IP */
> +#define ESDHC_FLAG_SKIP_ERR004536 BIT(17)
> +
> enum wp_types {
> ESDHC_WP_NONE, /* no WP, neither controller nor gpio */
> ESDHC_WP_CONTROLLER, /* mmc controller internal WP */
> @@ -289,6 +292,13 @@ static const struct esdhc_soc_data usdhc_imx7d_data = {
> | ESDHC_FLAG_BROKEN_AUTO_CMD23,
> };
>
> +static struct esdhc_soc_data usdhc_s32g2_data = {
> + .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_MAN_TUNING
> + | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
> + | ESDHC_FLAG_HS400 | ESDHC_FLAG_HS400_ES
> + | ESDHC_FLAG_SKIP_ERR004536,
> +};
> +
> static struct esdhc_soc_data usdhc_imx7ulp_data = {
> .flags = ESDHC_FLAG_USDHC | ESDHC_FLAG_STD_TUNING
> | ESDHC_FLAG_HAVE_CAP1 | ESDHC_FLAG_HS200
> @@ -347,6 +357,7 @@ static const struct of_device_id imx_esdhc_dt_ids[] = {
> { .compatible = "fsl,imx7ulp-usdhc", .data = &usdhc_imx7ulp_data, },
> { .compatible = "fsl,imx8qxp-usdhc", .data = &usdhc_imx8qxp_data, },
> { .compatible = "fsl,imx8mm-usdhc", .data = &usdhc_imx8mm_data, },
> + { .compatible = "nxp,s32g2-usdhc", .data = &usdhc_s32g2_data, },
> { /* sentinel */ }
> };
> MODULE_DEVICE_TABLE(of, imx_esdhc_dt_ids);
> @@ -1359,8 +1370,10 @@ static void sdhci_esdhc_imx_hwinit(struct sdhci_host *host)
> * erratum ESDHC_FLAG_ERR004536 fix for MX6Q TO1.2 and MX6DL
> * TO1.1, it's harmless for MX6SL
> */
> - writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
> - host->ioaddr + 0x6c);
> + if (!(imx_data->socdata->flags & ESDHC_FLAG_SKIP_ERR004536)) {
> + writel(readl(host->ioaddr + 0x6c) & ~BIT(7),
> + host->ioaddr + 0x6c);
> + }
Hope you don't might that I raise this question here. Is it really necessary
to unconditionally apply the erratum bit even if some SoCs might not need this
workaround? From the S32 implementation in CodeAurora[1], I noticed that this
bit is not required by S32V/S32G so I wonder if there's any better way to
refine this part?
Thanks,
Chester
[1] https://source.codeaurora.org/external/autobsps32/linux/tree/drivers/mmc/host/sdhci-esdhc-imx.c?h=release/bsp30.0-5.4-rt#n1268
>
> /* disable DLL_CTRL delay line settings */
> writel(0x0, host->ioaddr + ESDHC_DLL_CTRL);
> --
> 2.30.0
>
next prev parent reply other threads:[~2021-10-21 7:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 7:13 [PATCH 0/3] Add SDHCI driver support for NXP S32G2 Chester Lin
2021-10-21 7:13 ` [PATCH 1/3] dt-bindings: mmc: fsl-imx-esdhc: add NXP S32G2 support Chester Lin
2021-10-21 7:13 ` [RFC PATCH 2/3] mmc: sdhci-esdhc-imx: " Chester Lin
2021-10-21 7:21 ` Bough Chen
2021-10-21 7:30 ` Chester Lin [this message]
2021-10-21 8:00 ` Bough Chen
2021-10-21 13:59 ` Chester Lin
2021-10-21 7:13 ` [PATCH 3/3] arm64: dts: s32g2: add USDHC support Chester Lin
2021-10-21 13:32 ` Radu Nicolae Pirea (NXP OSS)
2021-10-21 14:38 ` Chester Lin
2021-10-26 15:39 ` [PATCH 0/3] Add SDHCI driver support for NXP S32G2 Ulf Hansson
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=YXEXMGGiVOiLZ0H9@linux-8mug \
--to=clin@suse.com \
--cc=afaerber@suse.de \
--cc=aisheng.dong@nxp.com \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=haibo.chen@nxp.com \
--cc=iivanov@suse.de \
--cc=jlee@suse.com \
--cc=kernel@pengutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mbrugger@suse.com \
--cc=radu-nicolae.pirea@oss.nxp.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=s32@nxp.com \
--cc=shawnguo@kernel.org \
--cc=ulf.hansson@linaro.org \
/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).