From bb779acfc385d135b32a6998c1d1fceef0491400 Mon Sep 17 00:00:00 2001 From: Markus Schuetterle Date: Sat, 19 Mar 2016 08:42:41 +0100 Subject: [PATCH] mmc-utils: Add disable partition boot to 'mmc bootpart enable' Modified 'bootpart enable' function to disable partition boot by setting the parameter to 0. Signed-off-by: Markus Schuetterle Signed-off-by: Chris Ball --- man/mmc.1 | 1 + mmc.c | 2 +- mmc.h | 1 + mmc_cmds.c | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/man/mmc.1 b/man/mmc.1 index 7584dde..971feae 100644 --- a/man/mmc.1 +++ b/man/mmc.1 @@ -52,6 +52,7 @@ Print the response to STATUS_SEND (CMD13). .TP .BR "bootpart enable " Enable the boot partition for the . +Disable the boot partition for the with set to 0. To receive acknowledgment of boot from the card set to 1, else set it to 0. .TP diff --git a/mmc.c b/mmc.c index 03631d2..d740535 100644 --- a/mmc.c +++ b/mmc.c @@ -95,7 +95,7 @@ static struct Command commands[] = { }, { do_write_boot_en, -3, "bootpart enable", " " " " "\n" - "Enable the boot partition for the .\nTo receive acknowledgment of boot from the card set \nto 1, else set it to 0.", + "Enable the boot partition for the .\nDisable the boot partition for the if is set to 0.\nTo receive acknowledgment of boot from the card set \nto 1, else set it to 0.", NULL }, { do_boot_bus_conditions_set, -4, diff --git a/mmc.h b/mmc.h index 38b215f..61da21f 100644 --- a/mmc.h +++ b/mmc.h @@ -150,6 +150,7 @@ #define EXT_CSD_HW_RESET_EN (0x01) #define EXT_CSD_HW_RESET_DIS (0x02) #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) +#define EXT_CSD_PART_CONFIG_ACC_NONE (0x0) #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2) #define EXT_CSD_PART_CONFIG_ACC_USER_AREA (0x7) diff --git a/mmc_cmds.c b/mmc_cmds.c index da3c5ce..0e84d44 100644 --- a/mmc_cmds.c +++ b/mmc_cmds.c @@ -275,6 +275,9 @@ int do_write_boot_en(int nargs, char **argv) value = ext_csd[EXT_CSD_PART_CONFIG]; switch (boot_area) { + case EXT_CSD_PART_CONFIG_ACC_NONE: + value &= ~(7 << 3); + break; case EXT_CSD_PART_CONFIG_ACC_BOOT0: value |= (1 << 3); value &= ~(3 << 4);