RE: [PATCH v2 2/3] mmc: sdhci-esdhc-imx: advertise HS400 mode through MMC caps
From: Bough Chen <haibo.chen@nxp.com>
Date: 2021-05-11 03:00:45
Also in:
linux-arm-kernel, linux-mmc
-----Original Message----- From: Lucas Stach [mailto:l.stach@pengutronix.de] Sent: 2021年5月11日 3:04 To: Ulf Hansson <redacted>; Adrian Hunter [off-list ref]; Bough Chen [off-list ref] Cc: Rob Herring <robh+dt@kernel.org>; dl-linux-imx <redacted>; kernel@pengutronix.de; linux-mmc@vger.kernel.org; devicetree@vger.kernel.org; linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] mmc: sdhci-esdhc-imx: advertise HS400 mode through MMC caps Instead of having an indirection through the SDHCI layer and emulating a capability bit, that isn't there in hardware, do the same same thing as
with
HS400_ES and advertise the support for HS400 directly through the MMC
caps.
quoted hunk ↗ jump to hunk
Signed-off-by: Lucas Stach <l.stach@pengutronix.de> --- drivers/mmc/host/sdhci-esdhc-imx.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)diff --git a/drivers/mmc/host/sdhci-esdhc-imx.cb/drivers/mmc/host/sdhci-esdhc-imx.c index a20459744d21..65a52586db36 100644--- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c@@ -427,9 +427,6 @@ static u32 esdhc_readl_le(struct sdhci_host *host, intreg) |
FIELD_PREP(SDHCI_RETUNING_MODE_MASK,
quoted hunk ↗ jump to hunk
SDHCI_TUNING_MODE_3); - if (imx_data->socdata->flags & ESDHC_FLAG_HS400) - val |= SDHCI_SUPPORT_HS400; - /* * Do not advertise faster UHS modes if there are no * pinctrl states for 100MHz/200MHz.@@ -1603,7 +1600,7 @@ static int sdhci_esdhc_imx_probe(structplatform_device *pdev) host->quirks |= SDHCI_QUIRK_BROKEN_ADMA; if (imx_data->socdata->flags & ESDHC_FLAG_HS400) - host->quirks2 |= SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400; + host->mmc->caps2 |= MMC_CAP2_HS400;
Hi Lucas,
I think patch1 and patch 2 are enough to cover your requirement.
For this patch, I think it's unnecessary, sdhci-esdhc-imx.c need to reuse
sdhci.c as much as possible.
In sdhci.c, already contain the following logic.
if (host->quirks2 & SDHCI_QUIRK2_CAPS_BIT63_FOR_HS400 &&
(host->caps1 & SDHCI_SUPPORT_HS400))
mmc->caps2 |= MMC_CAP2_HS400;
The reason why we directly use host->mmc->caps2 for HS400ES mode is that
sdhci.c do not contain the similar logic.
Adrian, what's your comment?
Best Regards
Haiboif (imx_data->socdata->flags & ESDHC_FLAG_BROKEN_AUTO_CMD23) host->quirks2 |= SDHCI_QUIRK2_ACMD23_BROKEN; -- 2.31.1
Attachments
- smime.p7s [application/pkcs7-signature] 9571 bytes