mmc: block: support no access to boot partitions
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 23 Sep 2011 09:48:21 +0000 (12:48 +0300)
committerChris Ball <cjb@laptop.org>
Wed, 26 Oct 2011 20:32:15 +0000 (16:32 -0400)
Intel Medfield platform blocks access to eMMC boot partitions which
results in switch errors.  Since there is no access, mmcboot0/1
devices should not be created.  Add a host capability to reflect that.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/block.c
drivers/mmc/host/sdhci-pci.c
include/linux/mmc/host.h

index d7eb2c082336056359719e0e0814934493d1b12b..aa66d3f3abb148892dd190d193bd4c804184de22 100644 (file)
@@ -1480,7 +1480,7 @@ static int mmc_blk_alloc_parts(struct mmc_card *card, struct mmc_blk_data *md)
        if (!mmc_card_mmc(card))
                return 0;
 
-       if (card->ext_csd.boot_size) {
+       if (card->ext_csd.boot_size && mmc_boot_partition_access(card->host)) {
                ret = mmc_blk_alloc_part(card, md, EXT_CSD_PART_CONFIG_ACC_BOOT0,
                                         card->ext_csd.boot_size >> 9,
                                         true,
index 3b30c515cbc24ac15c8f7df3b528d0896c373a4c..f8a17f98f3a98182394b6b4c0fe6660962a13878 100644 (file)
@@ -215,6 +215,8 @@ static int mfd_emmc_probe_slot(struct sdhci_pci_slot *slot)
 
        slot->host->mmc->caps |= MMC_CAP_8_BIT_DATA;
 
+       slot->host->mmc->caps2 = MMC_CAP2_BOOTPART_NOACC;
+
        return 0;
 }
 
index b2aefea970485db73fe6881012f914a526611f1e..aed5bc7245f7a73241b95d411b9715a7629a43fd 100644 (file)
@@ -236,6 +236,10 @@ struct mmc_host {
 #define MMC_CAP_CMD23          (1 << 30)       /* CMD23 supported. */
 #define MMC_CAP_HW_RESET       (1 << 31)       /* Hardware reset */
 
+       unsigned int            caps2;          /* More host capabilities */
+
+#define MMC_CAP2_BOOTPART_NOACC        (1 << 0)        /* Boot partition no access */
+
        mmc_pm_flag_t           pm_caps;        /* supported pm features */
 
 #ifdef CONFIG_MMC_CLKGATE
@@ -404,4 +408,10 @@ static inline int mmc_host_cmd23(struct mmc_host *host)
 {
        return host->caps & MMC_CAP_CMD23;
 }
+
+static inline int mmc_boot_partition_access(struct mmc_host *host)
+{
+       return !(host->caps2 & MMC_CAP2_BOOTPART_NOACC);
+}
+
 #endif /* LINUX_MMC_HOST_H */