From: Sascha Hauer <sha@pengutronix.de>
To: Steffen Trumtrar <s.trumtrar@pengutronix.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH v2] mci: sdhci: fix big-endian write for blockcount/size
Date: Mon, 4 Oct 2021 13:05:16 +0200 [thread overview]
Message-ID: <20211004110516.GV28453@pengutronix.de> (raw)
In-Reply-To: <20210831064715.8392-1-s.trumtrar@pengutronix.de>
On Tue, Aug 31, 2021 at 08:47:15AM +0200, Steffen Trumtrar wrote:
> From: Steffen Trumtrar <str@pengutronix.de>
>
> The patch
>
> 0a47bce1b03fd236384e904dca005c0870ce8684
> mci: imx-esdhc: Use common DMA helpers
>
> converted the imx-esdhc driver to use the DMA helpers introduced with
>
> 60b608b2714472aa22862a20d04f267cbbac0863
> mci: sdhci: Add DMA transfer helpers
>
> The common DMA helpers however break support for BE-variants (e.g.
> Layerscape) as the BLKATTR register seems to be a 32-bit register which
> internally switches bytes when used with two 16-bit write accesses.
> As the alignment should also work for LE-SDHCI-variants convert the two
> 16-bit accesses to one 32-bit access.
>
> Signed-off-by: Steffen Trumtrar <str@pengutronix.de>
> ---
> drivers/mci/sdhci.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
Applied, thanks
Sascha
>
> diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
> index aca4a5a6f911..8b5520d6827a 100644
> --- a/drivers/mci/sdhci.c
> +++ b/drivers/mci/sdhci.c
> @@ -129,9 +129,8 @@ void sdhci_setup_data_pio(struct sdhci *sdhci, struct mci_data *data)
> if (!data)
> return;
>
> - sdhci_write16(sdhci, SDHCI_BLOCK_SIZE, sdhci->sdma_boundary |
> - SDHCI_TRANSFER_BLOCK_SIZE(data->blocksize));
> - sdhci_write16(sdhci, SDHCI_BLOCK_COUNT, data->blocks);
> + sdhci_write32(sdhci, SDHCI_BLOCK_SIZE, sdhci->sdma_boundary |
> + SDHCI_TRANSFER_BLOCK_SIZE(data->blocksize) | data->blocks << 16);
> }
>
> void sdhci_setup_data_dma(struct sdhci *sdhci, struct mci_data *data,
> --
> 2.30.2
>
>
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
>
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
prev parent reply other threads:[~2021-10-04 11:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-31 6:47 Steffen Trumtrar
2021-10-04 11:05 ` Sascha Hauer [this message]
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=20211004110516.GV28453@pengutronix.de \
--to=sha@pengutronix.de \
--cc=barebox@lists.infradead.org \
--cc=s.trumtrar@pengutronix.de \
/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