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, documentation, and sandbox_spl build
coverage.

Boards which leave SPL_FASTBOOT disabled add no fastboot code or supporting
library to SPL. The sandbox_spl defconfig enables the core service so that
the SPL build remains covered by CI.

---
Changes in v5:
- Preserve the command-line USB diagnostics and document teardown behavior.
- Finish converting shared fastboot configuration checks for build phases.
- Require reclaiming malloc for SPL sparse writes and use a 64 KiB fill buffer.
- Make environment-backed fastboot features optional in SPL.
- Document SPL command, buffer, allocator, printf and reset requirements.
- Build the core SPL fastboot service with sandbox_spl for CI coverage.
- Link to v4: 
https://patch.msgid.link/20260820-ccaione-upstream-spl-fastboot-v4-0-57e5ef71c...@baylibre.com

Changes in v4:
- Drop RFC status.
- Make the USB fastboot helper and gadget build rules phase-aware.
- Use a separate command table for the SPL-supported command subset.
- Document the commands available in SPL.
- Apply the requested Makefile, annotation and preprocessor cleanups.
- Link to v3: 
https://patch.msgid.link/20260731-ccaione-upstream-spl-fastboot-v3-0-dbea3ff45...@baylibre.com

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 ++------------------
 configs/sandbox_spl_defconfig   |   4 ++
 doc/android/fastboot.rst        |  48 +++++++++++++++++++
 drivers/Makefile                |   2 +-
 drivers/fastboot/Kconfig        | 104 ++++++++++++++++++++++++++++++++++++++--
 drivers/fastboot/Makefile       |   9 ++--
 drivers/fastboot/fb_block.c     |  11 +++--
 drivers/fastboot/fb_command.c   |  99 ++++++++++++++++++++++++++++++--------
 drivers/fastboot/fb_common.c    |  36 ++++++++++----
 drivers/fastboot/fb_getvar.c    |  30 +++++++-----
 drivers/fastboot/fb_mmc.c       |  49 +++++++++++--------
 drivers/fastboot/fb_nand.c      |   2 +-
 drivers/fastboot/fb_usb.c       |  69 ++++++++++++++++++++++++++
 drivers/usb/gadget/Makefile     |   2 +-
 drivers/usb/gadget/f_fastboot.c |   9 ++--
 include/fastboot.h              |  10 ++++
 lib/Kconfig                     |  13 +++++
 lib/Makefile                    |   3 +-
 lib/image-sparse.c              |   2 +-
 19 files changed, 425 insertions(+), 130 deletions(-)
---
base-commit: 527115ef6783cec49e5610c523c124b399011361
change-id: 20260718-ccaione-upstream-spl-fastboot-14fa2b6b2b64

Best regards,
--  
Carlo Caione <[email protected]>

Reply via email to