aboutsummaryrefslogtreecommitdiff
path: root/include/mmc.h
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 /include/mmc.h
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 'include/mmc.h')
-rw-r--r--include/mmc.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/mmc.h b/include/mmc.h
index 85fc349..e92e920 100644
--- a/include/mmc.h
+++ b/include/mmc.h
@@ -907,6 +907,15 @@ struct blk_desc *mmc_get_blk_desc(struct mmc *mmc);
*/
int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd);
+/**
+ * mmc_boot_wp() - power on write protect boot partitions
+ *
+ * The boot partitions are write protected until the next power cycle.
+ *
+ * Return: 0 for success
+ */
+int mmc_boot_wp(struct mmc *mmc);
+
static inline enum dma_data_direction mmc_get_dma_dir(struct mmc_data *data)
{
return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE;