diff options
author | Pierre Ossman <drzeus@drzeus.cx> | 2006-11-21 11:55:45 -0500 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2007-02-04 14:54:10 -0500 |
commit | 55db890a838c7b37256241b1fc53d6344aa79cc0 (patch) | |
tree | 02d5868f69a15eea69aaf517b67bc9cbdffe2ff8 /drivers/mmc/mmci.c | |
parent | fe4a3c7a20f14d86022a8132adbf6ddb98e7197c (diff) |
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.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/mmc/mmci.c b/drivers/mmc/mmci.c index 5d48e0081894..5941dd951e82 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) | |||
524 | /* | 524 | /* |
525 | * Since we only have a 16-bit data length register, we must | 525 | * Since we only have a 16-bit data length register, we must |
526 | * ensure that we don't exceed 2^16-1 bytes in a single request. | 526 | * ensure that we don't exceed 2^16-1 bytes in a single request. |
527 | * Choose 64 (512-byte) sectors as the limit. | ||
528 | */ | 527 | */ |
529 | mmc->max_sectors = 64; | 528 | mmc->max_req_size = 65535; |
530 | 529 | ||
531 | /* | 530 | /* |
532 | * Set the maximum segment size. Since we aren't doing DMA | 531 | * Set the maximum segment size. Since we aren't doing DMA |
533 | * (yet) we are only limited by the data length register. | 532 | * (yet) we are only limited by the data length register. |
534 | */ | 533 | */ |
535 | mmc->max_seg_size = mmc->max_sectors << 9; | 534 | mmc->max_seg_size = mmc->max_req_size; |
536 | 535 | ||
537 | /* | 536 | /* |
538 | * Block size can be up to 2048 bytes, but must be a power of two. | 537 | * Block size can be up to 2048 bytes, but must be a power of two. |
539 | */ | 538 | */ |
540 | mmc->max_blk_size = 2048; | 539 | mmc->max_blk_size = 2048; |
541 | 540 | ||
541 | /* | ||
542 | * No limit on the number of blocks transferred. | ||
543 | */ | ||
544 | mmc->max_blk_count = mmc->max_req_size; | ||
545 | |||
542 | spin_lock_init(&host->lock); | 546 | spin_lock_init(&host->lock); |
543 | 547 | ||
544 | writel(0, host->base + MMCIMASK0); | 548 | writel(0, host->base + MMCIMASK0); |