configs: mt8183: support 'adb reboot bootloader'
Add bcb logic to support 'adb reboot bootloader'
Test:
adb reboot bootloader
fastboot devices
# device is enumerated in fastboot
fastboot reboot
# device reboots into Android
Bug: RITA-105
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
diff --git a/include/configs/mt8183.h b/include/configs/mt8183.h
index 7b2bc2a..2d7f87e 100644
--- a/include/configs/mt8183.h
+++ b/include/configs/mt8183.h
@@ -101,6 +101,22 @@
#endif // ifdef CONFIG_CMD_AB_SELECT
+#define ANDROID_BOOT_FASTBOOT \
+ "fastboot usb 0;"
+
+/*
+ * checks if we should boot into 'fastboot' mode
+ *
+ * set androidboot_fastboot to 1 if we should boot into 'fastboot'
+ */
+#define ANDROID_TEST_FASTBOOT \
+ "if bcb load ${mmcdev} misc; then " \
+ "if bcb test command = bootonce-bootloader ; then " \
+ "bcb clear command; bcb store;" \
+ "setenv androidboot_fastboot 1;" \
+ "fi;" \
+ "fi;" \
+
/*
* checks if we should boot into android recovery mode
*
@@ -137,11 +153,17 @@
"dtb_index=0\0" \
"dtbo_index=1\0" \
"loadaddr=0x50000000\0" \
+ "androidboot_fastboot=0\0" \
"androidboot_recovery=0\0" \
"android_ab_slot=\0" \
"mmcboot=" \
ANDROID_AB_GET_SLOT \
+ ANDROID_TEST_FASTBOOT \
ANDROID_TEST_RECOVERY \
+ "if test \"${androidboot_fastboot}\" -eq 1; then " \
+ "echo Android: booting into fastboot;" \
+ ANDROID_BOOT_FASTBOOT \
+ "fi;" \
"if test \"${androidboot_recovery}\" -eq 1; then " \
"echo Android: booting into recovery;" \
ANDROID_BOOT_RECOVERY \