summaryrefslogtreecommitdiffstats
path: root/drivers/mci/sdhci.c
diff options
context:
space:
mode:
authorSteffen Trumtrar <str@pengutronix.de>2021-08-31 08:47:15 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-10-05 13:51:12 +0200
commit229d1635c675162c7b81a30e9f04c6b1bd83112f (patch)
treeea9a1fd2d27f2fb6073fe6b1389a01cf39ac1ab3 /drivers/mci/sdhci.c
parent99ef347449fab1d4d35e4e78bdd21370b2400b04 (diff)
downloadbarebox-229d1635c675162c7b81a30e9f04c6b1bd83112f.tar.gz
barebox-229d1635c675162c7b81a30e9f04c6b1bd83112f.tar.xz
mci: sdhci: fix big-endian write for blockcount/size
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> Link: https://lore.barebox.org/20210831064715.8392-1-s.trumtrar@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/sdhci.c')
-rw-r--r--drivers/mci/sdhci.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index aca4a5a6f9..8b5520d682 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,