summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmci.c
diff options
context:
space:
mode:
authorPierre Ossman <drzeus@drzeus.cx>2006-11-21 16:55:45 (GMT)
committerPierre Ossman <drzeus@drzeus.cx>2007-02-04 19:54:10 (GMT)
commit55db890a838c7b37256241b1fc53d6344aa79cc0 (patch)
tree02d5868f69a15eea69aaf517b67bc9cbdffe2ff8 /drivers/mmc/mmci.c
parentfe4a3c7a20f14d86022a8132adbf6ddb98e7197c (diff)
downloadlinux-fsl-qoriq-55db890a838c7b37256241b1fc53d6344aa79cc0.tar.xz
mmc: Allow host drivers to specify max block count
Many controllers have an upper limit on the number of blocks that can be transferred in one request. Allow the host drivers to specify this and make sure we avoid hitting this limit. Also change the max_sectors field to avoid confusion. This makes it map less directly to the block layer limits, but as they didn't apply directly on MMC cards anyway, this isn't a great loss. Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'drivers/mmc/mmci.c')
-rw-r--r--drivers/mmc/mmci.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c
index 5d48e00..5941dd9 100644
--- a/drivers/mmc/mmci.c
+++ b/drivers/mmc/mmci.c
@@ -524,21 +524,25 @@ static int mmci_probe(struct amba_device *dev, void *id)
/*
* Since we only have a 16-bit data length register, we must
* ensure that we don't exceed 2^16-1 bytes in a single request.
- * Choose 64 (512-byte) sectors as the limit.
*/
- mmc->max_sectors = 64;
+ mmc->max_req_size = 65535;
/*
* Set the maximum segment size. Since we aren't doing DMA
* (yet) we are only limited by the data length register.
*/
- mmc->max_seg_size = mmc->max_sectors << 9;
+ mmc->max_seg_size = mmc->max_req_size;
/*
* Block size can be up to 2048 bytes, but must be a power of two.
*/
mmc->max_blk_size = 2048;
+ /*
+ * No limit on the number of blocks transferred.
+ */
+ mmc->max_blk_count = mmc->max_req_size;
+
spin_lock_init(&host->lock);
writel(0, host->base + MMCIMASK0);