From c7e207fbbcd8618d29b1192829c630777fea5220 Mon Sep 17 00:00:00 2001 From: Luo Ji Date: Wed, 3 Jul 2019 14:38:16 +0800 Subject: [PATCH] MA-14916-8 [iot] Set power-on write protection for boot1 partition The RPMB keyslot is stored in last block of boot1 partition which is easily erased or tampered, set power-on write protection for this partition to prevent corruption. Test: Power-on write protection works as expected on imx8m. Change-Id: Ib7e1094b979f7d94c0a2817391c5b3b5f3205d76 Signed-off-by: Luo Ji --- include/mmc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/mmc.h b/include/mmc.h index 6aa2badde9..9704264e2f 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -216,6 +216,7 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx) #define EXT_CSD_WR_REL_PARAM 166 /* R */ #define EXT_CSD_WR_REL_SET 167 /* R/W */ #define EXT_CSD_RPMB_MULT 168 /* RO */ +#define EXT_CSD_BOOT_WP 173 /* R/W & R/W/C_P */ #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ #define EXT_CSD_BOOT_BUS_WIDTH 177 #define EXT_CSD_PART_CONF 179 /* R/W */ @@ -326,6 +327,8 @@ static inline bool mmc_is_tuning_cmd(uint cmdidx) #define MMC_QUIRK_RETRY_SEND_CID BIT(0) #define MMC_QUIRK_RETRY_SET_BLOCKLEN BIT(1) +#define BOOT1_PWR_WP (0x83) + enum mmc_voltage { MMC_SIGNAL_VOLTAGE_000 = 0, MMC_SIGNAL_VOLTAGE_120 = 1, -- 2.17.1