aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/sdhci.c')
-rw-r--r--drivers/mmc/host/sdhci.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index 5f95e10229b5..e3a8133560a2 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -278,6 +278,15 @@ static void sdhci_transfer_pio(struct sdhci_host *host)
278 else 278 else
279 mask = SDHCI_SPACE_AVAILABLE; 279 mask = SDHCI_SPACE_AVAILABLE;
280 280
281 /*
282 * Some controllers (JMicron JMB38x) mess up the buffer bits
283 * for transfers < 4 bytes. As long as it is just one block,
284 * we can ignore the bits.
285 */
286 if ((host->quirks & SDHCI_QUIRK_BROKEN_SMALL_PIO) &&
287 (host->data->blocks == 1))
288 mask = ~0;
289
281 while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) { 290 while (readl(host->ioaddr + SDHCI_PRESENT_STATE) & mask) {
282 if (host->data->flags & MMC_DATA_READ) 291 if (host->data->flags & MMC_DATA_READ)
283 sdhci_read_block_pio(host); 292 sdhci_read_block_pio(host);
@@ -439,7 +448,7 @@ static int sdhci_adma_table_pre(struct sdhci_host *host,
439 448
440 host->adma_addr = dma_map_single(mmc_dev(host->mmc), 449 host->adma_addr = dma_map_single(mmc_dev(host->mmc),
441 host->adma_desc, (128 * 2 + 1) * 4, DMA_TO_DEVICE); 450 host->adma_desc, (128 * 2 + 1) * 4, DMA_TO_DEVICE);
442 if (dma_mapping_error(mmc_dev(host->mmc), host->align_addr)) 451 if (dma_mapping_error(mmc_dev(host->mmc), host->adma_addr))
443 goto unmap_entries; 452 goto unmap_entries;
444 BUG_ON(host->adma_addr & 0x3); 453 BUG_ON(host->adma_addr & 0x3);
445 454
@@ -645,7 +654,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
645 * us an invalid request. 654 * us an invalid request.
646 */ 655 */
647 WARN_ON(1); 656 WARN_ON(1);
648 host->flags &= ~SDHCI_USE_DMA; 657 host->flags &= ~SDHCI_REQ_USE_DMA;
649 } else { 658 } else {
650 writel(host->adma_addr, 659 writel(host->adma_addr,
651 host->ioaddr + SDHCI_ADMA_ADDRESS); 660 host->ioaddr + SDHCI_ADMA_ADDRESS);
@@ -664,7 +673,7 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
664 * us an invalid request. 673 * us an invalid request.
665 */ 674 */
666 WARN_ON(1); 675 WARN_ON(1);
667 host->flags &= ~SDHCI_USE_DMA; 676 host->flags &= ~SDHCI_REQ_USE_DMA;
668 } else { 677 } else {
669 WARN_ON(sg_cnt != 1); 678 WARN_ON(sg_cnt != 1);
670 writel(sg_dma_address(data->sg), 679 writel(sg_dma_address(data->sg),