diff options
| author | Tom Rini <[email protected]> | 2023-05-06 10:34:34 -0400 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-05-06 10:34:34 -0400 |
| commit | ae0772f333a7e76c4fb3771a77117b2f740d7c93 (patch) | |
| tree | 89fd938073db85162aab26a9096447d7a311b957 /drivers/fastboot | |
| parent | ab75996ba49c140c529f14b5c40d0d16430feefb (diff) | |
| parent | 1a3af267c097c330fb2bf12493186a345523df38 (diff) | |
Merge branch '2023-05-05-networking-updates'
- Cleanup NFS support, add NFSv1 support, assorted IPv6 improvements,
PHY cleanups and improvements, ksz9477, ldpaa and rtl8169
improvements, overall network performance improvements.
Diffstat (limited to 'drivers/fastboot')
| -rw-r--r-- | drivers/fastboot/Kconfig | 14 | ||||
| -rw-r--r-- | drivers/fastboot/fb_common.c | 33 |
2 files changed, 46 insertions, 1 deletions
diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index eefa34779c4..a3df9aa3d0f 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -4,6 +4,13 @@ config FASTBOOT bool imply ANDROID_BOOT_IMAGE imply CMD_FASTBOOT + help + Fastboot is a protocol used in Android devices for + communicating between the device and a computer during + the bootloader stage. It allows the user to flash the + device firmware and unlock the bootloader. + More information about the protocol and usecases: + https://android.googlesource.com/platform/system/core/+/refs/heads/master/fastboot/ config USB_FUNCTION_FASTBOOT bool "Enable USB fastboot gadget" @@ -28,6 +35,13 @@ config UDP_FUNCTION_FASTBOOT_PORT help The fastboot protocol requires a UDP port number. +config TCP_FUNCTION_FASTBOOT + depends on NET + select FASTBOOT + bool "Enable fastboot protocol over TCP" + help + This enables the fastboot protocol over TCP. + if FASTBOOT config FASTBOOT_BUF_ADDR diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c index 57b6182c46a..621146bc6b0 100644 --- a/drivers/fastboot/fb_common.c +++ b/drivers/fastboot/fb_common.c @@ -15,7 +15,7 @@ #include <command.h> #include <env.h> #include <fastboot.h> -#include <net/fastboot.h> +#include <net.h> /** * fastboot_buf_addr - base address of the fastboot download buffer @@ -157,6 +157,37 @@ void fastboot_boot(void) } /** + * fastboot_handle_boot() - Shared implementation of system reaction to + * fastboot commands + * + * Making desceisions about device boot state (stay in fastboot, reboot + * to bootloader, reboot to OS, etc). + */ +void fastboot_handle_boot(int command, bool success) +{ + if (!success) + return; + + switch (command) { + case FASTBOOT_COMMAND_BOOT: + fastboot_boot(); + net_set_state(NETLOOP_SUCCESS); + break; + + case FASTBOOT_COMMAND_CONTINUE: + net_set_state(NETLOOP_SUCCESS); + break; + + case FASTBOOT_COMMAND_REBOOT: + case FASTBOOT_COMMAND_REBOOT_BOOTLOADER: + case FASTBOOT_COMMAND_REBOOT_FASTBOOTD: + case FASTBOOT_COMMAND_REBOOT_RECOVERY: + do_reset(NULL, 0, 0, NULL); + break; + } +} + +/** * fastboot_set_progress_callback() - set progress callback * * @progress: Pointer to progress callback |
