diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2006-09-24 05:44:09 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2006-09-24 05:44:09 -0400 |
commit | 42431acbac43eb47c774c29d370f5c59136805bf (patch) | |
tree | 6e2a3353b4aa3f7ab179d10c287053f04c637542 | |
parent | db53f28b3a6d9338cca1b7e917dc063ac99e1871 (diff) |
[MMC] MMC_CAP_BYTEBLOCK flag for non-log2 block sizes capable hosts
Some MMC hosts can only handle log2 block sizes. Unfortunately,
the MMC password support needs to be able to send non-log2 block
sizes. Provide a capability so that the MMC password support can
decide whether it should use this support or not.
The unfortunate side effect of this host limitation is that any
MMC card protected by a password which is not a log2 block size
can not be accessed on a host which only allows a log2 block size.
This change just adds the flag. The MMC password support code
needs updating to use it (if and when it is finally submitted.)
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | drivers/mmc/at91_mci.c | 1 | ||||
-rw-r--r-- | drivers/mmc/imxmmc.c | 2 | ||||
-rw-r--r-- | drivers/mmc/omap.c | 7 | ||||
-rw-r--r-- | drivers/mmc/sdhci.c | 2 | ||||
-rw-r--r-- | drivers/mmc/wbsd.c | 2 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 1 |
6 files changed, 9 insertions, 6 deletions
diff --git a/drivers/mmc/at91_mci.c b/drivers/mmc/at91_mci.c index 6b7638b84290..d34b7d9d92ed 100644 --- a/drivers/mmc/at91_mci.c +++ b/drivers/mmc/at91_mci.c | |||
@@ -822,6 +822,7 @@ static int at91_mci_probe(struct platform_device *pdev) | |||
822 | mmc->f_min = 375000; | 822 | mmc->f_min = 375000; |
823 | mmc->f_max = 25000000; | 823 | mmc->f_max = 25000000; |
824 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; | 824 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; |
825 | mmc->caps = MMC_CAP_BYTEBLOCK; | ||
825 | 826 | ||
826 | host = mmc_priv(mmc); | 827 | host = mmc_priv(mmc); |
827 | host->mmc = mmc; | 828 | host->mmc = mmc; |
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index fb6565b98f32..1b79dd271aae 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c | |||
@@ -956,7 +956,7 @@ static int imxmci_probe(struct platform_device *pdev) | |||
956 | mmc->f_min = 150000; | 956 | mmc->f_min = 150000; |
957 | mmc->f_max = CLK_RATE/2; | 957 | mmc->f_max = CLK_RATE/2; |
958 | mmc->ocr_avail = MMC_VDD_32_33; | 958 | mmc->ocr_avail = MMC_VDD_32_33; |
959 | mmc->caps |= MMC_CAP_4_BIT_DATA; | 959 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_BYTEBLOCK; |
960 | 960 | ||
961 | /* MMC core transfer sizes tunable parameters */ | 961 | /* MMC core transfer sizes tunable parameters */ |
962 | mmc->max_hw_segs = 64; | 962 | mmc->max_hw_segs = 64; |
diff --git a/drivers/mmc/omap.c b/drivers/mmc/omap.c index ddf06b32c159..52c9e52e6b78 100644 --- a/drivers/mmc/omap.c +++ b/drivers/mmc/omap.c | |||
@@ -1034,13 +1034,14 @@ static int __init mmc_omap_probe(struct platform_device *pdev) | |||
1034 | host->irq = pdev->resource[1].start; | 1034 | host->irq = pdev->resource[1].start; |
1035 | host->base = (void __iomem*)IO_ADDRESS(r->start); | 1035 | host->base = (void __iomem*)IO_ADDRESS(r->start); |
1036 | 1036 | ||
1037 | if (minfo->wire4) | ||
1038 | mmc->caps |= MMC_CAP_4_BIT_DATA; | ||
1039 | |||
1040 | mmc->ops = &mmc_omap_ops; | 1037 | mmc->ops = &mmc_omap_ops; |
1041 | mmc->f_min = 400000; | 1038 | mmc->f_min = 400000; |
1042 | mmc->f_max = 24000000; | 1039 | mmc->f_max = 24000000; |
1043 | mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34; | 1040 | mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34; |
1041 | mmc->caps = MMC_CAP_BYTEBLOCK; | ||
1042 | |||
1043 | if (minfo->wire4) | ||
1044 | mmc->caps |= MMC_CAP_4_BIT_DATA; | ||
1044 | 1045 | ||
1045 | /* Use scatterlist DMA to reduce per-transfer costs. | 1046 | /* Use scatterlist DMA to reduce per-transfer costs. |
1046 | * NOTE max_seg_size assumption that small blocks aren't | 1047 | * NOTE max_seg_size assumption that small blocks aren't |
diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index dea4edd1c434..fdfc3838dd79 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c | |||
@@ -1262,7 +1262,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot) | |||
1262 | mmc->ops = &sdhci_ops; | 1262 | mmc->ops = &sdhci_ops; |
1263 | mmc->f_min = host->max_clk / 256; | 1263 | mmc->f_min = host->max_clk / 256; |
1264 | mmc->f_max = host->max_clk; | 1264 | mmc->f_max = host->max_clk; |
1265 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE; | 1265 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK; |
1266 | 1266 | ||
1267 | mmc->ocr_avail = 0; | 1267 | mmc->ocr_avail = 0; |
1268 | if (caps & SDHCI_CAN_VDD_330) | 1268 | if (caps & SDHCI_CAN_VDD_330) |
diff --git a/drivers/mmc/wbsd.c b/drivers/mmc/wbsd.c index 4a6617d9a49f..6435a6822ad3 100644 --- a/drivers/mmc/wbsd.c +++ b/drivers/mmc/wbsd.c | |||
@@ -1323,7 +1323,7 @@ static int __devinit wbsd_alloc_mmc(struct device *dev) | |||
1323 | mmc->f_min = 375000; | 1323 | mmc->f_min = 375000; |
1324 | mmc->f_max = 24000000; | 1324 | mmc->f_max = 24000000; |
1325 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; | 1325 | mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34; |
1326 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE; | 1326 | mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK; |
1327 | 1327 | ||
1328 | spin_lock_init(&host->lock); | 1328 | spin_lock_init(&host->lock); |
1329 | 1329 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index b282ec9bba08..587264a58d56 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -86,6 +86,7 @@ struct mmc_host { | |||
86 | 86 | ||
87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
88 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ | 88 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ |
89 | #define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ | ||
89 | 90 | ||
90 | /* host specific block data */ | 91 | /* host specific block data */ |
91 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 92 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |