summaryrefslogtreecommitdiffstats
path: root/drivers/mci/sdhci.c
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2023-09-11 14:11:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2023-09-12 11:18:59 +0200
commitc1b317d5a1958fd9b4b882e9b397e65e3302791c (patch)
tree977a5f3b75effd971e0f1fac16cc9d68cd9a1c0a /drivers/mci/sdhci.c
parente8ccf976f13dc1ae659662cf42298e7d7b9a4e9a (diff)
downloadbarebox-c1b317d5a1958fd9b4b882e9b397e65e3302791c.tar.gz
barebox-c1b317d5a1958fd9b4b882e9b397e65e3302791c.tar.xz
mci: sdhci: hardcode SDMA boundary for DMA
Given that we are not using the feature, there's no reason to compute the boundary when polling for DMA completion. Therefore let's assume the initial default of 512K remains unchanged. The sdhci::sdma_boundary member is still left in place as the i.MX eSDHC driver sets it to zero to affect what sdhci_setup_data_pio() writes into SDHCI_BLOCK_SIZE as the i.MX repurposes doesn't implement the boundary feature and reserves the bits in the SDHCI_BLOCK_SIZE register. Fixes: 88f101358167 ("mci: sdhci: Force DMA update to the next block boundary") Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20230911121156.2632668-3-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/mci/sdhci.c')
-rw-r--r--drivers/mci/sdhci.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/drivers/mci/sdhci.c b/drivers/mci/sdhci.c
index 7b6466a3f4..3587539e44 100644
--- a/drivers/mci/sdhci.c
+++ b/drivers/mci/sdhci.c
@@ -289,17 +289,12 @@ int sdhci_transfer_data_dma(struct sdhci *sdhci, struct mci_data *data,
* some controllers are faulty, don't trust them.
*/
if (irqstat & SDHCI_INT_DMA) {
- int boundary_cfg = (sdhci->sdma_boundary >> 12) & 0x7;
- dma_addr_t boundary_size = 4096 << boundary_cfg;
- /* Force update to the next DMA block boundary. */
- dma_addr_t next = (dma & ~(boundary_size - 1)) + boundary_size;
-
/*
* DMA engine has stopped on buffer boundary. Acknowledge
* the interrupt and kick the DMA engine again.
*/
sdhci_write32(sdhci, SDHCI_INT_STATUS, SDHCI_INT_DMA);
- sdhci_set_sdma_addr(sdhci, next);
+ sdhci_set_sdma_addr(sdhci, ALIGN(dma, SDHCI_DEFAULT_BOUNDARY_SIZE));
}
if (irqstat & SDHCI_INT_XFER_COMPLETE)
@@ -661,7 +656,7 @@ int sdhci_setup_host(struct sdhci *host)
if (host->caps & SDHCI_CAN_DO_8BIT)
mci->host_caps |= MMC_CAP_8_BIT_DATA;
- host->sdma_boundary = SDHCI_DMA_BOUNDARY_512K;
+ host->sdma_boundary = SDHCI_DEFAULT_BOUNDARY_ARG;
if (sdhci_can_64bit_dma(host))
host->flags |= SDHCI_USE_64_BIT_DMA;