Some recovery and initial-provisioning flows need a standard host protocol before usable firmware is available in persistent storage. U-Boot already provides fastboot, but the implementation can currently be started only from the U-Boot-proper command line.
This series makes USB fastboot available as an opt-in SPL service, including MMC partition flashing and Android sparse images. The interface is kept deliberately narrower in SPL: it does not support the boot command or filesystem probing, and reboot support remains platform-dependent. The first four patches separate the generic preparation from SPL enablement. They factor out the USB session runner, route USB reboot through the common handler, make shared fastboot configuration phase-aware, and add phase-aware sparse-image support. The final patch then contains the SPL-specific Kconfig, gadget behavior, and documentation. No fastboot code or supporting library is added to SPL when SPL_FASTBOOT is disabled, so the feature has no size cost for existing SPL builds. --- Changes in v3: - Rename the USB session helper to fastboot_usb_run(). - Initialize UDP and TCP sessions in their transport helpers. - Remove a redundant USB session return assignment. - Collect the Reviewed-by tag. - Link to v2: https://patch.msgid.link/20260722-ccaione-upstream-spl-fastboot-v2-0-2ba3f71c4...@baylibre.com Changes in v2: - Split the common USB session runner into a prerequisite patch. - Route USB reboot through the common fastboot handler separately. - Split phase-aware fastboot configuration and build rules. - Split phase-aware Android sparse-image support. - Keep SPL-specific behavior in the final patch. - No functional change from v1. - Link to v1: https://patch.msgid.link/20260719-ccaione-upstream-spl-fastboot-v1-1-c9bab5b0b...@baylibre.com --- Carlo Caione (5): fastboot: factor out the USB session runner fastboot: use the common handler for USB reboot fastboot: make shared configuration checks phase-aware image: sparse: add phase-aware SPL support fastboot: add SPL support cmd/fastboot.c | 53 +++--------------------- doc/android/fastboot.rst | 27 ++++++++++++- drivers/Makefile | 2 +- drivers/fastboot/Kconfig | 89 ++++++++++++++++++++++++++++++++++++++++- drivers/fastboot/Makefile | 13 ++++-- drivers/fastboot/fb_block.c | 9 ++--- drivers/fastboot/fb_command.c | 58 +++++++++++++++++++-------- drivers/fastboot/fb_common.c | 25 +++++++++++- drivers/fastboot/fb_getvar.c | 19 +++++---- drivers/fastboot/fb_mmc.c | 36 ++++++++--------- drivers/fastboot/fb_usb.c | 66 ++++++++++++++++++++++++++++++ drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/f_fastboot.c | 6 ++- include/fastboot.h | 10 +++++ lib/Kconfig | 11 +++++ lib/Makefile | 3 +- lib/image-sparse.c | 2 +- 17 files changed, 322 insertions(+), 108 deletions(-) --- base-commit: 100e12ea78c73071b9710f08b32fd4590019266f change-id: 20260718-ccaione-upstream-spl-fastboot-14fa2b6b2b64 Best regards, -- Carlo Caione <[email protected]>
