From: Adrian Hunter <adrian.hunter@intel.com>
To: Doug Brown <doug@schmorgal.com>, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
linux-mmc@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 3/8] mmc: sdhci-pxav2: add register workaround for PXA168 silicon bug
Date: Tue, 29 Nov 2022 08:31:39 +0200 [thread overview]
Message-ID: <117f119b-96d3-342d-f03e-1176653be133@intel.com> (raw)
In-Reply-To: <20221128024407.224393-4-doug@schmorgal.com>
On 28/11/22 04:44, Doug Brown wrote:
> The PXA168 has a documented silicon bug that results in a data abort
> exception when accessing the SDHCI_HOST_VERSION register on SDH2 and
> SDH4 through a 16-bit read. Implement the workaround described in the
> errata, which performs a 32-bit read from a lower address instead. This
> is safe to use on all four SDH peripherals.
>
> Signed-off-by: Doug Brown <doug@schmorgal.com>
> ---
> drivers/mmc/host/sdhci-pxav2.c | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
> index 2f9fa0ecbddd..d76131b8986b 100644
> --- a/drivers/mmc/host/sdhci-pxav2.c
> +++ b/drivers/mmc/host/sdhci-pxav2.c
> @@ -80,6 +80,18 @@ static void pxav2_reset(struct sdhci_host *host, u8 mask)
> }
> }
>
> +static inline u16 pxav1_readw(struct sdhci_host *host, int reg)
> +{
> + u32 temp;
> + /* Workaround for data abort exception on SDH2 and SDH4 on PXA168 */
> + if (reg == SDHCI_HOST_VERSION) {
> + temp = readl(host->ioaddr + SDHCI_HOST_VERSION - 2) >> 16;
> + return temp & 0xffff;
Isn't this the same as just:
return readl(host->ioaddr + SDHCI_HOST_VERSION - 2) >> 16;
> + }
> +
> + return readw(host->ioaddr + reg);
> +}
> +
> static void pxav2_mmc_set_bus_width(struct sdhci_host *host, int width)
> {
> u8 ctrl;
> @@ -102,6 +114,7 @@ static void pxav2_mmc_set_bus_width(struct sdhci_host *host, int width)
> }
>
> static const struct sdhci_ops pxav1_sdhci_ops = {
> + .read_w = pxav1_readw,
> .set_clock = sdhci_set_clock,
> .get_max_clock = sdhci_pltfm_clk_get_max_clock,
> .set_bus_width = pxav2_mmc_set_bus_width,
next prev parent reply other threads:[~2022-11-29 6:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-28 2:43 [PATCH 0/8] mmc: sdhci-pxav2: Add support for PXA168 Doug Brown
2022-11-28 2:44 ` [PATCH 1/8] mmc: sdhci-pxav2: add initial support for PXA168 V1 controller Doug Brown
2022-11-28 2:44 ` [PATCH 2/8] mmc: sdhci-pxav2: enable CONFIG_MMC_SDHCI_IO_ACCESSORS Doug Brown
2022-11-28 2:44 ` [PATCH 3/8] mmc: sdhci-pxav2: add register workaround for PXA168 silicon bug Doug Brown
2022-11-29 6:31 ` Adrian Hunter [this message]
2022-11-28 2:44 ` [PATCH 4/8] mmc: sdhci-pxav2: change clock name to match DT bindings Doug Brown
2022-11-28 2:44 ` [PATCH 5/8] mmc: sdhci-pxav2: add optional core clock Doug Brown
2022-11-28 2:44 ` [PATCH 6/8] mmc: sdhci-pxav2: add SDIO card IRQ workaround for PXA168 V1 controller Doug Brown
2022-11-29 7:29 ` Adrian Hunter
2022-12-01 5:27 ` Doug Brown
2022-11-28 2:44 ` [PATCH 7/8] mmc: sdhci-pxav2: add optional pinctrl for SDIO IRQ workaround Doug Brown
2022-11-28 2:44 ` [PATCH 8/8] dt-bindings: mmc: sdhci-pxa: add pxav1 Doug Brown
2022-11-28 8:58 ` Krzysztof Kozlowski
2022-11-29 3:44 ` Doug Brown
2022-11-28 12:20 ` Rob Herring
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=117f119b-96d3-342d-f03e-1176653be133@intel.com \
--to=adrian.hunter@intel.com \
--cc=devicetree@vger.kernel.org \
--cc=doug@schmorgal.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-mmc@vger.kernel.org \
--cc=robh+dt@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