[MMC] sdhci: Avoid sdhci DMA boundaries

The sdhci controllers will issue an interrupt when a configurable number of
bytes have been transfered using DMA. The purpose is to handle multiple,
scattered memory pages.

Unfortunately, it requires that all transfers are completely aligned to
memory pages, which we cannot guarantee. So we just disable the function.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Pierre Ossman 2006-07-02 16:51:35 +01:00 committed by Russell King
parent a406f5a3b6
commit bab7696184
2 changed files with 10 additions and 4 deletions

View File

@ -326,6 +326,9 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
DBG("tsac %d ms nsac %d clk\n", DBG("tsac %d ms nsac %d clk\n",
data->timeout_ns / 1000000, data->timeout_clks); data->timeout_ns / 1000000, data->timeout_clks);
/* Sanity checks */
BUG_ON(data->blksz * data->blocks > 524288);
/* timeout in us */ /* timeout in us */
target_timeout = data->timeout_ns / 1000 + target_timeout = data->timeout_ns / 1000 +
data->timeout_clks / host->clock; data->timeout_clks / host->clock;
@ -375,7 +378,9 @@ static void sdhci_prepare_data(struct sdhci_host *host, struct mmc_data *data)
host->remain = host->cur_sg->length; host->remain = host->cur_sg->length;
} }
writew(data->blksz, host->ioaddr + SDHCI_BLOCK_SIZE); /* We do not handle DMA boundaries, so set it to max (512 KiB) */
writew(SDHCI_MAKE_BLKSZ(7, data->blksz),
host->ioaddr + SDHCI_BLOCK_SIZE);
writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT); writew(data->blocks, host->ioaddr + SDHCI_BLOCK_COUNT);
} }
@ -1188,10 +1193,10 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
mmc->max_phys_segs = 16; mmc->max_phys_segs = 16;
/* /*
* Maximum number of sectors in one transfer. Limited by sector * Maximum number of sectors in one transfer. Limited by DMA boundary
* count register. * size (512KiB), which means (512 KiB/512=) 1024 entries.
*/ */
mmc->max_sectors = 0x3FFF; mmc->max_sectors = 1024;
/* /*
* Maximum segment size. Could be one segment with the maximum number * Maximum segment size. Could be one segment with the maximum number

View File

@ -23,6 +23,7 @@
#define SDHCI_DMA_ADDRESS 0x00 #define SDHCI_DMA_ADDRESS 0x00
#define SDHCI_BLOCK_SIZE 0x04 #define SDHCI_BLOCK_SIZE 0x04
#define SDHCI_MAKE_BLKSZ(dma, blksz) (((dma & 0x7) << 12) | (blksz & 0xFFF))
#define SDHCI_BLOCK_COUNT 0x06 #define SDHCI_BLOCK_COUNT 0x06