diff options
author | Tom Rini <trini@konsulko.com> | 2021-02-08 10:54:01 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-02-08 10:54:01 -0500 |
commit | 461b754a8b6e76382acb8985d7a64b82ba65b88d (patch) | |
tree | 6e30ab953d3044c395e5478f1cbba11782fdddcf /drivers/fastboot/fb_common.c | |
parent | 3936fd998668846f77468d8f6a662e906920969c (diff) | |
parent | adb5daf0905a190375e46d59f1244b13c3cdc640 (diff) |
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'drivers/fastboot/fb_common.c')
-rw-r--r-- | drivers/fastboot/fb_common.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c index 736ce1cd024..cbcc3683c47 100644 --- a/drivers/fastboot/fb_common.c +++ b/drivers/fastboot/fb_common.c @@ -10,6 +10,7 @@ * Rob Herring <robh@kernel.org> */ +#include <bcb.h> #include <common.h> #include <command.h> #include <env.h> @@ -90,7 +91,20 @@ void fastboot_okay(const char *reason, char *response) */ int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason) { - return -ENOSYS; +#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC_DEV) + static const char * const boot_cmds[] = { + [FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader", + [FASTBOOT_REBOOT_REASON_FASTBOOTD] = "boot-fastboot", + [FASTBOOT_REBOOT_REASON_RECOVERY] = "boot-recovery" + }; + + if (reason >= FASTBOOT_REBOOT_REASONS_COUNT) + return -EINVAL; + + return bcb_write_reboot_reason(CONFIG_FASTBOOT_FLASH_MMC_DEV, "misc", boot_cmds[reason]); +#else + return -EINVAL; +#endif } /** |