Skip to content

Add support for booting into userspace fastboot

Roman Kovalivskyi u-boot 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest3 patches 0 repliesNew
  2. v43 patches 0 repliesSuperseded
  3. v33 patches 0 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v22 patches0 repliesSuperseded
v11 patch0 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3fastboot: Extend fastboot_set_reboot_flag with reboot reasonarch/arm/mach-meson/board-common.c arch/arm/mach-rockchip/board.c board/amazon/kc1/kc1.c +6 more+41 -90 replies
2/3fastboot: Add support for 'reboot fastboot' commanddrivers/fastboot/fb_command.c drivers/usb/gadget/f_fastboot.c include/fastboot.h +1 more+46 -00 replies
3/3fastboot: Add default fastboot_set_reboot_flag implementationdrivers/fastboot/Kconfig drivers/fastboot/Makefile drivers/fastboot/fb_bcb_impl.c +1 more+65 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH v5 0/3] Add support for booting into userspace fastboot

Android 10 adds support for dynamic partitions and in order to support them userspace fastboot must be used[1]. New tool called fastbootd is included into recovery image.

Userspace fastboot works from recovery and is launched if:
1) - Dynamic partitioning is enabled
2) - Boot control block has 'boot-fastboot' value into command field

The bootloader is expected[2] to load and boot into the recovery image upon seeing boot-fastboot in the BCB command. Recovery then parses the BCB message and switches to fastbootd mode.

Please note that boot script is expected to handle 'boot-fastboot' command in BCB and load into recovery mode.

Bootloader must support[3] 'reboot fastboot' command which should reboot device into userspace fastboot to accomodate those changes.

Another command that bootloader must support[3] is 'reboot recovery'. This command should simply reboot device into recovery mode.

Changes since v4[7]:
* Moved BCB commands table next to reboot reasons enum to avoid issues in future with keeping them in sync
* Changed command buffer size to 64 to fix issue with longer string in case of bootonce-bootloader command

Changes since v3[6]:
* Fixed indentation in Kconfig
* Fixed default value for FASTBOOT_USE_BCB_SET_REBOOT_FLAG
* Extended help message for FASTBOOT_USE_BCB_SET_REBOOT_FLAG

Changes since v2[5]:
* Split patch 1 into two separate patches:
* Patch 1 extends fastboot_set_reboot_flag arguments with reboot reason
* Patch 2 adds new reboot reasons for fastbootd and recovery
* Added name for fastboot_rebot_reason enum
* Replaced switch inside fastboot_set_reboot_flag with table lookup
* Moved fastboot_set_reboot_flag BCB implementation to separate file

Changes since v1[4]:
* Added missing handling of reboot commands for network protocol
* Extended fastboot_set_reboot_flag command to accept reboot reason
* Made former fastboot_set_flag function as an optional implementation of fastboot_set_reboot_flag which could be turned on by Kconfig

[1] - https://source.android.com/devices/bootloader/fastbootd
[2] - https://source.android.com/devices/bootloader/fastbootd#unified_fastboot_and_recovery
[3] - https://source.android.com/devices/bootloader/fastbootd#modifications_to_the_bootloader
[4] - http://patchwork.ozlabs.org/project/uboot/cover/cover.1590539734.git.roman.kovalivskyi at globallogic.com/
[5] - http://patchwork.ozlabs.org/project/uboot/cover/cover.1591254465.git.roman.kovalivskyi at globallogic.com/
[6] - http://patchwork.ozlabs.org/project/uboot/cover/cover.1591806433.git.roman.kovalivskyi at globallogic.com/
[7] - http://patchwork.ozlabs.org/project/uboot/cover/cover.1592871839.git.roman.kovalivskyi at globallogic.com/

Roman Kovalivskyi (3):
fastboot: Extend fastboot_set_reboot_flag with reboot reason
fastboot: Add support for 'reboot fastboot' command
fastboot: Add default fastboot_set_reboot_flag implementation

 arch/arm/mach-meson/board-common.c |  6 ++++-
 arch/arm/mach-rockchip/board.c     |  6 ++++-
 board/amazon/kc1/kc1.c             |  6 ++++-
 board/lg/sniper/sniper.c           |  6 ++++-
 board/ti/am57xx/board.c            |  6 ++++-
 board/ti/dra7xx/evm.c              |  6 ++++-
 drivers/fastboot/Kconfig           | 12 +++++++++
 drivers/fastboot/Makefile          |  1 +
 drivers/fastboot/fb_bcb_impl.c     | 43 ++++++++++++++++++++++++++++++
 drivers/fastboot/fb_command.c      | 40 ++++++++++++++++++++++++++-
 drivers/fastboot/fb_common.c       |  2 +-
 drivers/usb/gadget/f_fastboot.c    |  2 ++
 include/fastboot.h                 | 23 +++++++++++++++-
 net/fastboot.c                     |  2 ++
 14 files changed, 152 insertions(+), 9 deletions(-)
 create mode 100644 drivers/fastboot/fb_bcb_impl.c
Signature · 1 line
2.17.1