Add new "bootpart enable" command to enable boot partitions
This adds a new option to enable the boot from eMMC
by writing to the 179 ext_csd register.
The example below shows as to enable the mmcblk0boot0
partition and also set/reset the ACK bit).
$ ./mmc bootpart enable 1 1 /dev/mmcblk0boot0
$ ./mmc extcsd read /dev/mmcblk0boot0 | grep PARTITION_CON
Boot configuration bytes [PARTITION_CONFIG: 0x49]
Reported-by: Youssef TRIKI <youssef.triki@st.com>
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
diff --git a/mmc.c b/mmc.c
index c27fc24..6927b70 100644
--- a/mmc.c
+++ b/mmc.c
@@ -65,6 +65,11 @@
"Set the eMMC writeprotect status of <device>.",
NULL
},
+ { do_write_boot_en, -3,
+ "bootpart enable", "<boot_partition> " "<send_ack> " "<device>\n"
+ "Enable the boot partition for the <device>.\nTo receive acknowledgment of boot from the card set <send_ack>\nto 1, else set it to 0.",
+ NULL
+ },
{ 0, 0, 0, 0 }
};