diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2011-09-23 12:48:21 +0300 |
---|---|---|
committer | Robert Marklund <robert.marklund@stericsson.com> | 2011-10-27 16:08:20 +0200 |
commit | a5e524bd7ba6353562c991475cf64b25fda2c0fd (patch) | |
tree | b16a9e0d4aee7c130f5e0e8ee92ead8c446ebf22 | |
parent | 105b0cbd2ff4baaddf4b6f7a7108399edb9a6667 (diff) |
mmc: block: support no access to boot partitions
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>
Change-Id: Idd40bbd8f8809afcabb385c2492680ff8182877e
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/33630
Reviewed-by: Ulf HANSSON <ulf.hansson@stericsson.com>
Tested-by: Ulf HANSSON <ulf.hansson@stericsson.com>
-rw-r--r-- | drivers/mmc/card/block.c | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-pci.c | 3 | ||||
-rw-r--r-- | include/linux/mmc/host.h | 10 |
3 files changed, 14 insertions, 1 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index e272d1708f6..44348f6b4ca 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c @@ -1484,7 +1484,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, diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 936bbca19c0..eeef3f7447f 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c @@ -98,6 +98,9 @@ static int ricoh_mmc_probe_slot(struct sdhci_pci_slot *slot) SDHCI_TIMEOUT_CLK_UNIT | SDHCI_CAN_VDD_330 | SDHCI_CAN_DO_SDMA; + + slot->host->mmc->caps2 = MMC_CAP2_BOOTPART_NOACC; + return 0; } diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 69266d0fc7e..1acd53b83a5 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -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 @@ -413,5 +417,11 @@ 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 |