aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-03-30 07:24:19 +0200
committerPeng Fan <peng.fan@nxp.com>2020-04-22 20:41:55 +0800
commit0469d846364ae54fc380a813cc4c3e9e19bdc99a (patch)
treed93f62a4625b8d53415ea44ced16b04e214674f2 /drivers/mmc
parentd5210e4589294b4c356e7c2ac598cda8d738aec8 (diff)
downloadu-boot-0469d846364ae54fc380a813cc4c3e9e19bdc99a.zip
u-boot-0469d846364ae54fc380a813cc4c3e9e19bdc99a.tar.gz
u-boot-0469d846364ae54fc380a813cc4c3e9e19bdc99a.tar.bz2
cmd: mmc: provide boot area protection command
Provide command 'mmc wp' to power on write protect boot areas on eMMC devices. The B_PWR_WP_EN bit in the extended CSD register BOOT_WP is set. The boot area are write protected until the next power cycle occurs. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/mmc.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index bfcdaa6..fc3123c 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -810,6 +810,11 @@ int mmc_switch(struct mmc *mmc, u8 set, u8 index, u8 value)
return __mmc_switch(mmc, set, index, value, true);
}
+int mmc_boot_wp(struct mmc *mmc)
+{
+ return mmc_switch(mmc, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BOOT_WP, 1);
+}
+
#if !CONFIG_IS_ENABLED(MMC_TINY)
static int mmc_set_card_speed(struct mmc *mmc, enum bus_mode mode,
bool hsdowngrade)