]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
[MMC] MMC_CAP_BYTEBLOCK flag for non-log2 block sizes capable hosts
authorRussell King <rmk@dyn-67.arm.linux.org.uk>
Sun, 24 Sep 2006 09:44:09 +0000 (10:44 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sun, 24 Sep 2006 09:44:09 +0000 (10:44 +0100)
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>
drivers/mmc/at91_mci.c
drivers/mmc/imxmmc.c
drivers/mmc/omap.c
drivers/mmc/sdhci.c
drivers/mmc/wbsd.c
include/linux/mmc/host.h

index 6b7638b84290c0e91d4bc03e2be7328ee0388c64..d34b7d9d92ed1dc34b6dfffdfcbe7ac33d648306 100644 (file)
@@ -822,6 +822,7 @@ static int at91_mci_probe(struct platform_device *pdev)
        mmc->f_min = 375000;
        mmc->f_max = 25000000;
        mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
+       mmc->caps = MMC_CAP_BYTEBLOCK;
 
        host = mmc_priv(mmc);
        host->mmc = mmc;
index fb6565b98f32af75a0d4a5c25547b43b87a55f7f..1b79dd271aae37ce9e9d8c8d59b98683ca4fb543 100644 (file)
@@ -956,7 +956,7 @@ static int imxmci_probe(struct platform_device *pdev)
        mmc->f_min = 150000;
        mmc->f_max = CLK_RATE/2;
        mmc->ocr_avail = MMC_VDD_32_33;
-       mmc->caps |= MMC_CAP_4_BIT_DATA;
+       mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_BYTEBLOCK;
 
        /* MMC core transfer sizes tunable parameters */
        mmc->max_hw_segs = 64;
index ddf06b32c159912f6b4213364c4f0bc294fd49d4..52c9e52e6b781126ece1830f84e329293365ed1d 100644 (file)
@@ -1034,13 +1034,14 @@ static int __init mmc_omap_probe(struct platform_device *pdev)
        host->irq = pdev->resource[1].start;
        host->base = (void __iomem*)IO_ADDRESS(r->start);
 
-       if (minfo->wire4)
-                mmc->caps |= MMC_CAP_4_BIT_DATA;
-
        mmc->ops = &mmc_omap_ops;
        mmc->f_min = 400000;
        mmc->f_max = 24000000;
        mmc->ocr_avail = MMC_VDD_32_33|MMC_VDD_33_34;
+       mmc->caps = MMC_CAP_BYTEBLOCK;
+
+       if (minfo->wire4)
+                mmc->caps |= MMC_CAP_4_BIT_DATA;
 
        /* Use scatterlist DMA to reduce per-transfer costs.
         * NOTE max_seg_size assumption that small blocks aren't
index dea4edd1c434dd7d69e61f23bc0e34107a07bfd4..fdfc3838dd796ee1d37ed9d50039e4cc05ccf331 100644 (file)
@@ -1262,7 +1262,7 @@ static int __devinit sdhci_probe_slot(struct pci_dev *pdev, int slot)
        mmc->ops = &sdhci_ops;
        mmc->f_min = host->max_clk / 256;
        mmc->f_max = host->max_clk;
-       mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE;
+       mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;
 
        mmc->ocr_avail = 0;
        if (caps & SDHCI_CAN_VDD_330)
index 4a6617d9a49f4eee7347c610850d49e7bc82a5fc..6435a6822ad34106abc05a0d47996b4af1170e1d 100644 (file)
@@ -1323,7 +1323,7 @@ static int __devinit wbsd_alloc_mmc(struct device *dev)
        mmc->f_min = 375000;
        mmc->f_max = 24000000;
        mmc->ocr_avail = MMC_VDD_32_33 | MMC_VDD_33_34;
-       mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE;
+       mmc->caps = MMC_CAP_4_BIT_DATA | MMC_CAP_MULTIWRITE | MMC_CAP_BYTEBLOCK;
 
        spin_lock_init(&host->lock);
 
index b282ec9bba08202b3b2ac4145a5b2e2ba42781e5..587264a58d5605835319bcfc77912e9763391128 100644 (file)
@@ -86,6 +86,7 @@ struct mmc_host {
 
 #define MMC_CAP_4_BIT_DATA     (1 << 0)        /* Can the host do 4 bit transfers */
 #define MMC_CAP_MULTIWRITE     (1 << 1)        /* Can accurately report bytes sent to card on error */
+#define MMC_CAP_BYTEBLOCK      (1 << 2)        /* Can do non-log2 block sizes */
 
        /* host specific block data */
        unsigned int            max_seg_size;   /* see blk_queue_max_segment_size */