aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorJean-Jacques Hiblot2019-07-02 10:53:57 +0200
committerPeng Fan2019-07-15 10:16:49 +0800
commit9bc5666c8a32aa335b236fb3e140aa55766c7b03 (patch)
treeffd8e0abd79a9114be6bb756a4336bc04b76c4d8 /drivers/mmc/mmc.c
parentbb98b8c5c06a5a9befb74aef843f7cd698c52d5d (diff)
mmc: do not change mode when accessing a boot partition
Accessing the boot partition had been error prone with HS200 and HS400 and was disabled. The driver first switched to a lesser mode and then switched the partition access. It was mostly due to a bad handling of the switch and has been fixed, so let's remove this 'feature' Signed-off-by: Jean-Jacques Hiblot <jjhiblot@ti.com>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c36
1 files changed, 0 insertions, 36 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 1ad35fff7d1..709733747ab 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -955,46 +955,10 @@ static int mmc_set_capacity(struct mmc *mmc, int part_num)
return 0;
}
-#if CONFIG_IS_ENABLED(MMC_HS200_SUPPORT) || CONFIG_IS_ENABLED(MMC_HS400_SUPPORT)
-static int mmc_boot_part_access_chk(struct mmc *mmc, unsigned int part_num)
-{
- int forbidden = 0;
- bool change = false;
-
- if (part_num & PART_ACCESS_MASK)
- forbidden = MMC_CAP(MMC_HS_200) | MMC_CAP(MMC_HS_400);
-
- if (MMC_CAP(mmc->selected_mode) & forbidden) {
- pr_debug("selected mode (%s) is forbidden for part %d\n",
- mmc_mode_name(mmc->selected_mode), part_num);
- change = true;
- } else if (mmc->selected_mode != mmc->best_mode) {
- pr_debug("selected mode is not optimal\n");
- change = true;
- }
-
- if (change)
- return mmc_select_mode_and_width(mmc,
- mmc->card_caps & ~forbidden);
-
- return 0;
-}
-#else
-static inline int mmc_boot_part_access_chk(struct mmc *mmc,
- unsigned int part_num)
-{
- return 0;
-}
-#endif
-
int mmc_switch_part(struct mmc *mmc, unsigned int part_num)
{
int ret;
- ret = mmc_boot_part_access_chk(mmc, part_num);
- if (ret)
- return ret;
-
ret = mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_PART_CONF,
(mmc->part_config & ~PART_ACCESS_MASK)
| (part_num & PART_ACCESS_MASK));