diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mci/sdhci.c | 9 | ||||
-rw-r--r-- | drivers/mci/sdhci.h | 3 |
2 files changed, 5 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; diff --git a/drivers/mci/sdhci.h b/drivers/mci/sdhci.h index f3ffd62dff..b5e6a7619d 100644 --- a/drivers/mci/sdhci.h +++ b/drivers/mci/sdhci.h @@ -5,6 +5,7 @@ #include <pbl.h> #include <dma.h> #include <linux/iopoll.h> +#include <linux/sizes.h> #define SDHCI_DMA_ADDRESS 0x00 #define SDHCI_BLOCK_SIZE__BLOCK_COUNT 0x04 @@ -18,6 +19,8 @@ #define SDHCI_DMA_BOUNDARY_8K SDHCI_DMA_BOUNDARY(1) #define SDHCI_DMA_BOUNDARY_4K SDHCI_DMA_BOUNDARY(0) #define SDHCI_DMA_BOUNDARY(x) (((x) & 0x7) << 12) +#define SDHCI_DEFAULT_BOUNDARY_SIZE SZ_512K +#define SDHCI_DEFAULT_BOUNDARY_ARG SDHCI_DMA_BOUNDARY_512K #define SDHCI_TRANSFER_BLOCK_SIZE(x) ((x) & 0xfff) #define SDHCI_BLOCK_COUNT 0x06 #define SDHCI_ARGUMENT 0x08 |