Merge branch '2020-10-08-misc-board-improvements'
[platform/kernel/u-boot.git] / include / fastboot.h
index 1933b1d..8e9ee80 100644 (file)
@@ -32,6 +32,8 @@ enum {
        FASTBOOT_COMMAND_CONTINUE,
        FASTBOOT_COMMAND_REBOOT,
        FASTBOOT_COMMAND_REBOOT_BOOTLOADER,
+       FASTBOOT_COMMAND_REBOOT_FASTBOOTD,
+       FASTBOOT_COMMAND_REBOOT_RECOVERY,
        FASTBOOT_COMMAND_SET_ACTIVE,
 #if CONFIG_IS_ENABLED(FASTBOOT_CMD_OEM_FORMAT)
        FASTBOOT_COMMAND_OEM_FORMAT,
@@ -41,6 +43,25 @@ enum {
 };
 
 /**
+ * Reboot reasons
+ */
+enum fastboot_reboot_reason {
+       FASTBOOT_REBOOT_REASON_BOOTLOADER,
+       FASTBOOT_REBOOT_REASON_FASTBOOTD,
+       FASTBOOT_REBOOT_REASON_RECOVERY,
+       FASTBOOT_REBOOT_REASONS_COUNT
+};
+
+/**
+ * BCB boot commands
+ */
+static const char * const fastboot_boot_cmds[] = {
+       [FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader",
+       [FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot",
+       [FASTBOOT_REBOOT_REASON_RECOVERY] = "boot-recovery"
+};
+
+/**
  * fastboot_response() - Writes a response of the form "$tag$reason".
  *
  * @tag: The first part of the response
@@ -77,7 +98,7 @@ void fastboot_okay(const char *reason, char *response);
  * which sets whatever flag your board specific Android bootloader flow
  * requires in order to re-enter the bootloader.
  */
-int fastboot_set_reboot_flag(void);
+int fastboot_set_reboot_flag(enum fastboot_reboot_reason reason);
 
 /**
  * fastboot_set_progress_callback() - set progress callback