All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] Add fastboot to SPL
@ 2026-09-06 20:01 Carlo Caione
  2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Carlo Caione @ 2026-09-06 20:01 UTC (permalink / raw)
  To: u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Carlo Caione, David Lechner, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

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-57e5ef71c74d@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-dbea3ff4529e@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-2ba3f71c42bc@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-c9bab5b0ba72@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 <ccaione@baylibre.com>


^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH v5 1/5] fastboot: factor out the USB session runner
  2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
@ 2026-09-06 20:01 ` Carlo Caione
  2026-09-09 20:31   ` David Lechner
  2026-09-11 12:34   ` Mattijs Korpershoek
  2026-09-06 20:02 ` [PATCH v5 2/5] fastboot: use the common handler for USB reboot Carlo Caione
                   ` (3 subsequent siblings)
  4 siblings, 2 replies; 16+ messages in thread
From: Carlo Caione @ 2026-09-06 20:01 UTC (permalink / raw)
  To: u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Carlo Caione, David Lechner, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

The fastboot command currently owns USB gadget setup, protocol
initialization, the service loop and teardown. This prevents callers
which do not use the command line from starting USB fastboot without
duplicating the same session lifecycle.

Move that lifecycle into fastboot_usb_run() and leave cmd/fastboot.c
responsible only for argument parsing and transport selection.
Initialize network sessions in their transport path so their existing
behavior is preserved.

Keep the command-line diagnostics for a missing USB cable. The helper
returns -ENODEV in that case, which the command maps to its existing
failure result. Unregister the gadget before releasing the UDC so no
registered function remains attached to a released controller.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 cmd/fastboot.c            | 53 ++++---------------------------------
 drivers/fastboot/Makefile |  1 +
 drivers/fastboot/fb_usb.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++
 include/fastboot.h        | 10 +++++++
 4 files changed, 82 insertions(+), 48 deletions(-)

diff --git a/cmd/fastboot.c b/cmd/fastboot.c
index f3929f88dfa..ace877b6e28 100644
--- a/cmd/fastboot.c
+++ b/cmd/fastboot.c
@@ -7,12 +7,9 @@
  * Rob Herring <robh@kernel.org>
  */
 #include <command.h>
-#include <console.h>
-#include <g_dnl.h>
 #include <fastboot.h>
 #include <net.h>
-#include <usb.h>
-#include <watchdog.h>
+#include <vsprintf.h>
 #include <linux/printk.h>
 #include <linux/stringify.h>
 
@@ -27,6 +24,7 @@ static int do_fastboot_udp(int argc, char *const argv[],
 		return CMD_RET_FAILURE;
 	}
 
+	fastboot_init((void *)buf_addr, buf_size);
 	err = net_loop(FASTBOOT_UDP);
 
 	if (err < 0) {
@@ -47,6 +45,7 @@ static int do_fastboot_tcp(int argc, char *const argv[],
 		return CMD_RET_FAILURE;
 	}
 
+	fastboot_init((void *)buf_addr, buf_size);
 	err = net_loop(FASTBOOT_TCP);
 
 	if (err < 0) {
@@ -63,7 +62,6 @@ static int do_fastboot_usb(int argc, char *const argv[],
 {
 	int controller_index;
 	char *usb_controller;
-	struct udevice *udc;
 	char *endp;
 	int ret;
 
@@ -82,48 +80,9 @@ static int do_fastboot_usb(int argc, char *const argv[],
 		return CMD_RET_FAILURE;
 	}
 
-	ret = udc_device_get_by_index(controller_index, &udc);
-	if (ret) {
-		pr_err("USB init failed: %d\n", ret);
-		return CMD_RET_FAILURE;
-	}
-
-	g_dnl_clear_detach();
-	ret = g_dnl_register("usb_dnl_fastboot");
-	if (ret)
-		return ret;
-
-	if (!g_dnl_board_usb_cable_connected()) {
-		puts("\rUSB cable not detected.\n" \
-		     "Command exit.\n");
-		ret = CMD_RET_FAILURE;
-		goto exit;
-	}
+	ret = fastboot_usb_run(controller_index, (void *)buf_addr, buf_size);
 
-	while (1) {
-		if (g_dnl_detach())
-			break;
-		if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
-			if (tstc()) {
-				getchar();
-				puts("\rOperation aborted.\n");
-				break;
-			}
-		} else if (ctrlc()) {
-			break;
-		}
-		schedule();
-		dm_usb_gadget_handle_interrupts(udc);
-	}
-
-	ret = CMD_RET_SUCCESS;
-
-exit:
-	udc_device_put(udc);
-	g_dnl_unregister();
-	g_dnl_clear_detach();
-
-	return ret;
+	return ret ? CMD_RET_FAILURE : CMD_RET_SUCCESS;
 }
 
 static int do_fastboot(struct cmd_tbl *cmdtp, int flag, int argc,
@@ -167,8 +126,6 @@ NXTARG:
 		return CMD_RET_USAGE;
 	}
 
-	fastboot_init((void *)buf_addr, buf_size);
-
 #if CONFIG_IS_ENABLED(NET_LEGACY)
 	if (!strcmp(argv[1], "udp"))
 		return do_fastboot_udp(argc, argv, buf_addr, buf_size);
diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile
index a341af076d1..32e8e072c88 100644
--- a/drivers/fastboot/Makefile
+++ b/drivers/fastboot/Makefile
@@ -3,6 +3,7 @@
 obj-y += fb_common.o
 obj-y += fb_getvar.o
 obj-y += fb_command.o
+obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += fb_usb.o
 obj-$(CONFIG_FASTBOOT_FLASH_BLOCK) += fb_block.o
 # MMC reuses block implementation
 obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fb_block.o fb_mmc.o
diff --git a/drivers/fastboot/fb_usb.c b/drivers/fastboot/fb_usb.c
new file mode 100644
index 00000000000..5c62bf42e72
--- /dev/null
+++ b/drivers/fastboot/fb_usb.c
@@ -0,0 +1,66 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright 2026 BayLibre SAS
+ *
+ * Copyright 2008 - 2009 Windriver, <www.windriver.com>
+ * Author: Tom Rix <Tom.Rix@windriver.com>
+ *
+ * (C) Copyright 2014 Linaro, Ltd.
+ * Rob Herring <robh@kernel.org>
+ */
+
+#include <console.h>
+#include <fastboot.h>
+#include <g_dnl.h>
+#include <usb.h>
+#include <u-boot/schedule.h>
+#include <linux/errno.h>
+#include <linux/printk.h>
+
+int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size)
+{
+	struct udevice *udc;
+	int ret;
+
+	ret = udc_device_get_by_index(controller_index, &udc);
+	if (ret) {
+		pr_err("USB init failed: %d\n", ret);
+		return ret;
+	}
+
+	fastboot_init(buf_addr, buf_size);
+	g_dnl_clear_detach();
+
+	ret = g_dnl_register("usb_dnl_fastboot");
+	if (ret)
+		goto err_put;
+
+	if (!g_dnl_board_usb_cable_connected()) {
+		puts("\rUSB cable not detected.\n"
+		     "Command exit.\n");
+		ret = -ENODEV;
+		goto err_unregister;
+	}
+
+	while (!g_dnl_detach()) {
+		if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
+			if (tstc()) {
+				getchar();
+				puts("\rOperation aborted.\n");
+				break;
+			}
+		} else if (ctrlc()) {
+			break;
+		}
+		schedule();
+		dm_usb_gadget_handle_interrupts(udc);
+	}
+
+err_unregister:
+	g_dnl_unregister();
+	g_dnl_clear_detach();
+err_put:
+	udc_device_put(udc);
+
+	return ret;
+}
diff --git a/include/fastboot.h b/include/fastboot.h
index b106d617749..f02d2559f2b 100644
--- a/include/fastboot.h
+++ b/include/fastboot.h
@@ -125,6 +125,16 @@ void fastboot_set_progress_callback(void (*progress)(const char *msg));
  */
 void fastboot_init(void *buf_addr, u32 buf_size);
 
+/**
+ * fastboot_usb_run() - run a USB fastboot session
+ *
+ * @controller_index: USB gadget controller index
+ * @buf_addr: Pointer to download buffer, or NULL for default
+ * @buf_size: Size of download buffer, or zero for default
+ * Return: 0 on success, or a negative error code
+ */
+int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size);
+
 /**
  * fastboot_boot() - Execute fastboot boot command
  *

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 2/5] fastboot: use the common handler for USB reboot
  2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
  2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
@ 2026-09-06 20:02 ` Carlo Caione
  2026-09-06 20:02 ` [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware Carlo Caione
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 16+ messages in thread
From: Carlo Caione @ 2026-09-06 20:02 UTC (permalink / raw)
  To: u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Carlo Caione, David Lechner, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

USB fastboot resets the device directly from its request-completion
callback, while the network transports route completed commands through
fastboot_handle_boot(). Keeping reset policy in the transport makes it
harder to support callers with a different reset interface.

Send the USB reboot completion through the common handler as well. U-Boot
proper retains the same do_reset() behavior, while execution-phase-specific
policy can be contained in the shared code. Drop the command header which
is no longer used by the USB gadget.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 drivers/usb/gadget/f_fastboot.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 8df0e3f331d..1971755721f 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -9,7 +9,6 @@
  * Copyright 2014 Linaro, Ltd.
  * Rob Herring <robh@kernel.org>
  */
-#include <command.h>
 #include <config.h>
 #include <env.h>
 #include <errno.h>
@@ -422,7 +421,7 @@ static int fastboot_tx_write_str(const char *buffer)
 static void compl_do_reset(struct usb_ep *ep, struct usb_request *req)
 {
 	g_dnl_unregister();
-	do_reset(NULL, 0, 0, NULL);
+	fastboot_handle_boot(FASTBOOT_COMMAND_REBOOT, true);
 }
 
 static unsigned int rx_bytes_expected(struct usb_ep *ep)

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware
  2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
  2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
  2026-09-06 20:02 ` [PATCH v5 2/5] fastboot: use the common handler for USB reboot Carlo Caione
@ 2026-09-06 20:02 ` Carlo Caione
  2026-09-11 12:38   ` Mattijs Korpershoek
  2026-09-06 20:02 ` [PATCH v5 4/5] image: sparse: add phase-aware SPL support Carlo Caione
  2026-09-06 20:02 ` [PATCH v5 5/5] fastboot: add " Carlo Caione
  4 siblings, 1 reply; 16+ messages in thread
From: Carlo Caione @ 2026-09-06 20:02 UTC (permalink / raw)
  To: u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Carlo Caione, David Lechner, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

Fastboot currently builds only for U-Boot proper, so its source and
Makefile rules test CONFIG_FASTBOOT_* directly. The same checks would
select U-Boot-proper options when these files are compiled for another
phase, potentially compiling unavailable backends or using the wrong
configuration values.

Use CONFIG_IS_ENABLED(), CONFIG_VAL() and CONFIG_$(PHASE_) consistently
for code and object selection. The empty phase prefix preserves the
existing U-Boot-proper configuration and behavior while making the
shared implementation safe to reuse from SPL.

This also makes the Android boot-image condition phase-aware. Since SPL
has no SPL_ANDROID_BOOT_IMAGE option, the existing flash:zimage path
remains available only in U-Boot proper.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 drivers/Makefile              |  2 +-
 drivers/fastboot/Makefile     | 10 +++++-----
 drivers/fastboot/fb_block.c   | 11 ++++++-----
 drivers/fastboot/fb_command.c | 31 +++++++++++++++++--------------
 drivers/fastboot/fb_common.c  | 21 ++++++++++++---------
 drivers/fastboot/fb_getvar.c  | 14 +++++++-------
 drivers/fastboot/fb_mmc.c     | 36 ++++++++++++++++++------------------
 drivers/fastboot/fb_nand.c    |  2 +-
 drivers/fastboot/fb_usb.c     |  2 +-
 9 files changed, 68 insertions(+), 61 deletions(-)

diff --git a/drivers/Makefile b/drivers/Makefile
index 4c7ba741acb..19f5c3802a4 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -12,6 +12,7 @@ obj-$(CONFIG_$(PHASE_)DMA) += dma/
 obj-$(CONFIG_$(PHASE_)DMA_LEGACY) += dma/
 obj-$(CONFIG_$(PHASE_)DFU) += dfu/
 obj-$(CONFIG_$(PHASE_)EXTCON) += extcon/
+obj-$(CONFIG_$(PHASE_)FASTBOOT) += fastboot/
 obj-$(CONFIG_$(PHASE_)GPIO) += gpio/
 obj-$(CONFIG_$(PHASE_)DRIVERS_MISC) += misc/
 obj-$(CONFIG_$(PHASE_)SYSRESET) += sysreset/
@@ -94,7 +95,6 @@ obj-y += block/
 obj-y += cache/
 obj-$(CONFIG_CPU) += cpu/
 obj-y += crypto/
-obj-$(CONFIG_FASTBOOT) += fastboot/
 obj-$(CONFIG_FWU_MDATA) += fwu-mdata/
 obj-y += misc/
 obj-$(CONFIG_MMC) += mmc/
diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile
index 32e8e072c88..7eb666bdd60 100644
--- a/drivers/fastboot/Makefile
+++ b/drivers/fastboot/Makefile
@@ -3,9 +3,9 @@
 obj-y += fb_common.o
 obj-y += fb_getvar.o
 obj-y += fb_command.o
-obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += fb_usb.o
-obj-$(CONFIG_FASTBOOT_FLASH_BLOCK) += fb_block.o
+obj-$(CONFIG_$(PHASE_)USB_FUNCTION_FASTBOOT) += fb_usb.o
+obj-$(CONFIG_$(PHASE_)FASTBOOT_FLASH_BLOCK) += fb_block.o
 # MMC reuses block implementation
-obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fb_block.o fb_mmc.o
-obj-$(CONFIG_FASTBOOT_FLASH_NAND) += fb_nand.o
-obj-$(CONFIG_FASTBOOT_FLASH_SPI) += fb_spi_flash.o
+obj-$(CONFIG_$(PHASE_)FASTBOOT_FLASH_MMC) += fb_block.o fb_mmc.o
+obj-$(CONFIG_$(PHASE_)FASTBOOT_FLASH_NAND) += fb_nand.o
+obj-$(CONFIG_$(PHASE_)FASTBOOT_FLASH_SPI) += fb_spi_flash.o
diff --git a/drivers/fastboot/fb_block.c b/drivers/fastboot/fb_block.c
index 51d1abb18c7..68593244ab9 100644
--- a/drivers/fastboot/fb_block.c
+++ b/drivers/fastboot/fb_block.c
@@ -130,11 +130,12 @@ int fastboot_block_get_part_info(const char *part_name,
 				 char *response)
 {
 	int ret;
-	const char *interface = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK,
-						   CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME,
-						   NULL);
-	const int device = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK,
-					      CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID, -1);
+	const char *interface = CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK,
+						  (CONFIG_VAL(FASTBOOT_FLASH_BLOCK_INTERFACE_NAME)),
+						  (NULL));
+	const int device = CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK,
+						     (CONFIG_VAL(FASTBOOT_FLASH_BLOCK_DEVICE_ID)),
+						     (-1));
 
 	if (!part_name || !strcmp(part_name, "")) {
 		fastboot_fail("partition not given", response);
diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
index 18d86988f4c..111516fd1b3 100644
--- a/drivers/fastboot/fb_command.c
+++ b/drivers/fastboot/fb_command.c
@@ -339,19 +339,19 @@ void fastboot_data_complete(char *response)
  */
 static void __maybe_unused flash(char *cmd_parameter, char *response)
 {
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK))
 		fastboot_block_flash_write(cmd_parameter, fastboot_buf_addr,
 					   image_size, response);
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC))
 		fastboot_mmc_flash_write(cmd_parameter, fastboot_buf_addr,
 					 image_size, response);
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_NAND))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_NAND))
 		fastboot_nand_flash_write(cmd_parameter, fastboot_buf_addr,
 					  image_size, response);
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_SPI))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_SPI))
 		fastboot_spi_flash_write(cmd_parameter, fastboot_buf_addr,
 					 image_size, response);
 }
@@ -367,16 +367,16 @@ static void __maybe_unused flash(char *cmd_parameter, char *response)
  */
 static void __maybe_unused erase(char *cmd_parameter, char *response)
 {
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK))
 		fastboot_block_erase(cmd_parameter, response);
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC))
 		fastboot_mmc_erase(cmd_parameter, response);
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_NAND))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_NAND))
 		fastboot_nand_erase(cmd_parameter, response);
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_SPI))
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_SPI))
 		fastboot_spi_flash_erase(cmd_parameter, response);
 }
 
@@ -482,8 +482,9 @@ static void reboot_recovery(char *cmd_parameter, char *response)
 static void __maybe_unused oem_format(char *cmd_parameter, char *response)
 {
 	char cmdbuf[32];
-	const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
-					       CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+	const int mmc_dev = CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC,
+					      (CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV)),
+					      (-1));
 
 	if (!env_get("partitions")) {
 		fastboot_fail("partitions not set", response);
@@ -505,8 +506,9 @@ static void __maybe_unused oem_format(char *cmd_parameter, char *response)
 static void __maybe_unused oem_partconf(char *cmd_parameter, char *response)
 {
 	char cmdbuf[32];
-	const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
-					       CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+	const int mmc_dev = CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC,
+					      (CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV)),
+					      (-1));
 
 	if (!cmd_parameter) {
 		fastboot_fail("Expected command parameter", response);
@@ -531,8 +533,9 @@ static void __maybe_unused oem_partconf(char *cmd_parameter, char *response)
 static void __maybe_unused oem_bootbus(char *cmd_parameter, char *response)
 {
 	char cmdbuf[32];
-	const int mmc_dev = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
-					       CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+	const int mmc_dev = CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC,
+					      (CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV)),
+					      (-1));
 
 	if (!cmd_parameter) {
 		fastboot_fail("Expected command parameter", response);
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index 9c52e004588..db6088653e5 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -98,15 +98,18 @@ int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
 		[FASTBOOT_REBOOT_REASON_RECOVERY] = "boot-recovery"
 	};
 
-	int device = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK,
-					CONFIG_FASTBOOT_FLASH_BLOCK_DEVICE_ID, -1);
+	int device = CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK,
+				       (CONFIG_VAL(FASTBOOT_FLASH_BLOCK_DEVICE_ID)),
+				       (-1));
+	const char *bcb_iface = CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK,
+						  (CONFIG_VAL(FASTBOOT_FLASH_BLOCK_INTERFACE_NAME)),
+						  ("mmc"));
+
 	if (device == -1) {
-		device = config_opt_enabled(CONFIG_FASTBOOT_FLASH_MMC,
-					    CONFIG_FASTBOOT_FLASH_MMC_DEV, -1);
+		device = CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC,
+					   (CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV)),
+					   (-1));
 	}
-	const char *bcb_iface = config_opt_enabled(CONFIG_FASTBOOT_FLASH_BLOCK,
-						   CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME,
-						   "mmc");
 
 	if (device == -1)
 		return -EINVAL;
@@ -234,8 +237,8 @@ void fastboot_set_progress_callback(void (*progress)(const char *msg))
  */
 void fastboot_init(void *buf_addr, u32 buf_size)
 {
-#if IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK)
-	if (!strcmp(CONFIG_FASTBOOT_FLASH_BLOCK_INTERFACE_NAME, "mmc"))
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK)
+	if (!strcmp(CONFIG_VAL(FASTBOOT_FLASH_BLOCK_INTERFACE_NAME), "mmc"))
 		printf("Warning: the fastboot block backend features are limited, consider using the MMC backend\n");
 #endif
 
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index e8aa0e09aa6..9e8e8889d08 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -70,19 +70,19 @@ static const struct {
 		.variable = "current-slot",
 		.dispatch = getvar_current_slot,
 		.list = true
-#if IS_ENABLED(CONFIG_FASTBOOT_FLASH)
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
 	}, {
 		.variable = "has-slot",
 		.dispatch = getvar_has_slot,
 		.list = false
 #endif
-#if IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC)
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)
 	}, {
 		.variable = "partition-type",
 		.dispatch = getvar_partition_type,
 		.list = false
 #endif
-#if IS_ENABLED(CONFIG_FASTBOOT_FLASH)
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH)
 	}, {
 		.variable = "partition-size",
 		.dispatch = getvar_partition_size,
@@ -116,21 +116,21 @@ static int getvar_get_part_info(const char *part_name, char *response,
 	struct disk_partition disk_part;
 	struct part_info *part_info;
 
-	if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK)) {
+	if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_BLOCK)) {
 		r = fastboot_block_get_part_info(part_name, &dev_desc, &disk_part,
 						 response);
 		if (r >= 0 && size)
 			*size = disk_part.size * disk_part.blksz;
-	} else if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC)) {
+	} else if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_MMC)) {
 		r = fastboot_mmc_get_part_info(part_name, &dev_desc, &disk_part,
 					       response);
 		if (r >= 0 && size)
 			*size = disk_part.size * disk_part.blksz;
-	} else if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_NAND)) {
+	} else if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_NAND)) {
 		r = fastboot_nand_get_part_info(part_name, &part_info, response);
 		if (r >= 0 && size)
 			*size = part_info->size;
-	} else if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_SPI)) {
+	} else if (CONFIG_IS_ENABLED(FASTBOOT_FLASH_SPI)) {
 		r = fastboot_spi_flash_get_part_info(part_name, &disk_part,
 						     response);
 		if (r >= 0 && size)
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index 9bc782ccd02..ae33e35365b 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -75,7 +75,7 @@ static int do_get_part_info(struct blk_desc **dev_desc, const char *name,
 	int ret;
 
 	/* First try partition names on the default device */
-	*dev_desc = blk_get_dev("mmc", CONFIG_FASTBOOT_FLASH_MMC_DEV);
+	*dev_desc = blk_get_dev("mmc", CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV));
 	if (*dev_desc) {
 		ret = part_get_info_by_name(*dev_desc, name, info);
 		if (ret >= 0)
@@ -111,7 +111,7 @@ static int part_get_info_by_name_or_alias(struct blk_desc **dev_desc,
 	return do_get_part_info(dev_desc, name, info);
 }
 
-#ifdef CONFIG_FASTBOOT_MMC_BOOT_SUPPORT
+#if CONFIG_IS_ENABLED(FASTBOOT_MMC_BOOT_SUPPORT)
 static void fb_mmc_boot_ops(struct blk_desc *dev_desc, void *buffer,
 			    int hwpart, u32 buff_sz, char *response)
 {
@@ -130,7 +130,7 @@ static void fb_mmc_boot_ops(struct blk_desc *dev_desc, void *buffer,
 }
 #endif
 
-#ifdef CONFIG_ANDROID_BOOT_IMAGE
+#if CONFIG_IS_ENABLED(ANDROID_BOOT_IMAGE)
 /**
  * Read Android boot image header from boot partition.
  *
@@ -346,7 +346,7 @@ int fastboot_mmc_get_part_info(const char *part_name,
 static struct blk_desc *fastboot_mmc_get_dev(char *response)
 {
 	struct blk_desc *ret = blk_get_dev("mmc",
-					   CONFIG_FASTBOOT_FLASH_MMC_DEV);
+					   CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV));
 
 	if (!ret || ret->type == DEV_TYPE_UNKNOWN) {
 		pr_err("invalid mmc device\n");
@@ -370,15 +370,15 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 	struct blk_desc *dev_desc;
 	struct disk_partition info = {0};
 
-#ifdef CONFIG_FASTBOOT_MMC_BOOT_SUPPORT
-	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT1_NAME) == 0) {
+#if CONFIG_IS_ENABLED(FASTBOOT_MMC_BOOT_SUPPORT)
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MMC_BOOT1_NAME))) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
 			fb_mmc_boot_ops(dev_desc, download_buffer, 1,
 					download_bytes, response);
 		return;
 	}
-	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MMC_BOOT2_NAME))) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
 			fb_mmc_boot_ops(dev_desc, download_buffer, 2,
@@ -388,7 +388,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 #endif
 
 #if CONFIG_IS_ENABLED(EFI_PARTITION)
-	if (strcmp(cmd, CONFIG_FASTBOOT_GPT_NAME) == 0) {
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_GPT_NAME))) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (!dev_desc)
 			return;
@@ -415,7 +415,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 #endif
 
 #if CONFIG_IS_ENABLED(DOS_PARTITION)
-	if (strcmp(cmd, CONFIG_FASTBOOT_MBR_NAME) == 0) {
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MBR_NAME))) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (!dev_desc)
 			return;
@@ -440,7 +440,7 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 	}
 #endif
 
-#ifdef CONFIG_ANDROID_BOOT_IMAGE
+#if CONFIG_IS_ENABLED(ANDROID_BOOT_IMAGE)
 	if (strncasecmp(cmd, "zimage", 6) == 0) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
@@ -450,8 +450,8 @@ void fastboot_mmc_flash_write(const char *cmd, void *download_buffer,
 	}
 #endif
 
-#if IS_ENABLED(CONFIG_FASTBOOT_MMC_USER_SUPPORT)
-	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
+#if CONFIG_IS_ENABLED(FASTBOOT_MMC_USER_SUPPORT)
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MMC_USER_NAME))) {
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (!dev_desc)
 			return;
@@ -485,17 +485,17 @@ void fastboot_mmc_erase(const char *cmd, char *response)
 {
 	struct blk_desc *dev_desc;
 	struct disk_partition info;
-	struct mmc *mmc = find_mmc_device(CONFIG_FASTBOOT_FLASH_MMC_DEV);
+	struct mmc *mmc = find_mmc_device(CONFIG_VAL(FASTBOOT_FLASH_MMC_DEV));
 
-#ifdef CONFIG_FASTBOOT_MMC_BOOT_SUPPORT
-	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT1_NAME) == 0) {
+#if CONFIG_IS_ENABLED(FASTBOOT_MMC_BOOT_SUPPORT)
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MMC_BOOT1_NAME))) {
 		/* erase EMMC boot1 */
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
 			fb_mmc_boot_ops(dev_desc, NULL, 1, 0, response);
 		return;
 	}
-	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_BOOT2_NAME) == 0) {
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MMC_BOOT2_NAME))) {
 		/* erase EMMC boot2 */
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (dev_desc)
@@ -504,8 +504,8 @@ void fastboot_mmc_erase(const char *cmd, char *response)
 	}
 #endif
 
-#ifdef CONFIG_FASTBOOT_MMC_USER_SUPPORT
-	if (strcmp(cmd, CONFIG_FASTBOOT_MMC_USER_NAME) == 0) {
+#if CONFIG_IS_ENABLED(FASTBOOT_MMC_USER_SUPPORT)
+	if (!strcmp(cmd, CONFIG_VAL(FASTBOOT_MMC_USER_NAME))) {
 		/* erase EMMC userdata */
 		dev_desc = fastboot_mmc_get_dev(response);
 		if (!dev_desc)
diff --git a/drivers/fastboot/fb_nand.c b/drivers/fastboot/fb_nand.c
index 6df3917e129..1d8db1c8b11 100644
--- a/drivers/fastboot/fb_nand.c
+++ b/drivers/fastboot/fb_nand.c
@@ -94,7 +94,7 @@ static int _fb_nand_write(struct mtd_info *mtd, struct part_info *part,
 {
 	int flags = WITH_WR_VERIFY;
 
-#ifdef CONFIG_FASTBOOT_FLASH_NAND_TRIMFFS
+#if CONFIG_IS_ENABLED(FASTBOOT_FLASH_NAND_TRIMFFS)
 	flags |= WITH_DROP_FFS;
 #endif
 
diff --git a/drivers/fastboot/fb_usb.c b/drivers/fastboot/fb_usb.c
index 5c62bf42e72..fa8ac134328 100644
--- a/drivers/fastboot/fb_usb.c
+++ b/drivers/fastboot/fb_usb.c
@@ -43,7 +43,7 @@ int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size)
 	}
 
 	while (!g_dnl_detach()) {
-		if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
+		if (CONFIG_IS_ENABLED(CMD_FASTBOOT_ABORT_KEYED)) {
 			if (tstc()) {
 				getchar();
 				puts("\rOperation aborted.\n");

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 4/5] image: sparse: add phase-aware SPL support
  2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
                   ` (2 preceding siblings ...)
  2026-09-06 20:02 ` [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware Carlo Caione
@ 2026-09-06 20:02 ` Carlo Caione
  2026-09-06 20:02 ` [PATCH v5 5/5] fastboot: add " Carlo Caione
  4 siblings, 0 replies; 16+ messages in thread
From: Carlo Caione @ 2026-09-06 20:02 UTC (permalink / raw)
  To: u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Carlo Caione, David Lechner, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

The Android sparse-image writer is selected and configured only through
U-Boot-proper symbols. An SPL storage service therefore cannot reuse
it without either pulling it into every SPL build or interpreting the
U-Boot-proper fill-buffer setting.

Add opt-in SPL symbols, build the writer through the phase-aware object
rule and read the matching phase value with CONFIG_VAL(). Existing
U-Boot-proper builds continue to use IMAGE_SPARSE and retain the same
fill-buffer default.

Require the reclaiming SPL allocator because the sparse writer frees its
temporary buffer after each image. Use a 64 KiB SPL fill buffer by default
instead of carrying the 512 KiB U-Boot-proper default into SPL.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 lib/Kconfig        | 13 +++++++++++++
 lib/Makefile       |  3 ++-
 lib/image-sparse.c |  2 +-
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/lib/Kconfig b/lib/Kconfig
index 24e55ade4d3..fc8ba70c7cd 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -205,6 +205,10 @@ config VPL_STRTO
 config IMAGE_SPARSE
 	bool
 
+config SPL_IMAGE_SPARSE
+	bool
+	depends on SPL_SYS_MALLOC && !SPL_SYS_MALLOC_SIMPLE
+
 config IMAGE_SPARSE_FILLBUF_SIZE
 	hex "Android sparse image CHUNK_TYPE_FILL buffer size"
 	default 0x80000
@@ -213,6 +217,15 @@ config IMAGE_SPARSE_FILLBUF_SIZE
 	  Set the size of the fill buffer used when processing CHUNK_TYPE_FILL
 	  chunks.
 
+config SPL_IMAGE_SPARSE_FILLBUF_SIZE
+	hex "Android sparse image fill buffer size in SPL"
+	default 0x10000
+	depends on SPL_IMAGE_SPARSE
+	help
+	  Set the size of the fill buffer used when processing CHUNK_TYPE_FILL
+	  chunks in SPL. A smaller default limits transient heap use in the
+	  size-constrained SPL phase.
+
 config USE_PRIVATE_LIBGCC
 	bool "Use private libgcc"
 	depends on HAVE_PRIVATE_LIBGCC
diff --git a/lib/Makefile b/lib/Makefile
index 222378a8531..014fda82860 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -44,7 +44,6 @@ obj-$(CONFIG_GENERATE_SMBIOS_TABLE) += smbios.o
 endif
 
 obj-$(CONFIG_SMBIOS_PARSER) += smbios-parser.o
-obj-$(CONFIG_IMAGE_SPARSE) += image-sparse.o
 obj-y += ldiv.o
 obj-$(CONFIG_XXHASH) += xxhash.o
 obj-y += net_utils.o
@@ -56,6 +55,8 @@ obj-y += list_sort.o
 obj-$(CONFIG_PMBUS) += pmbus.o
 endif
 
+obj-$(CONFIG_$(PHASE_)IMAGE_SPARSE) += image-sparse.o
+
 obj-$(CONFIG_$(PHASE_)TPM) += tpm-common.o
 ifeq ($(CONFIG_$(PHASE_)TPM),y)
 obj-$(CONFIG_TPM) += tpm_api.o
diff --git a/lib/image-sparse.c b/lib/image-sparse.c
index 09225692e9b..48e5d8ee869 100644
--- a/lib/image-sparse.c
+++ b/lib/image-sparse.c
@@ -125,7 +125,7 @@ int write_sparse_image(struct sparse_storage *info,
 	int i;
 	int j;
 
-	fill_buf_num_blks = CONFIG_IMAGE_SPARSE_FILLBUF_SIZE / info->blksz;
+	fill_buf_num_blks = CONFIG_VAL(IMAGE_SPARSE_FILLBUF_SIZE) / info->blksz;
 
 	/* Read and skip over sparse image header */
 	sparse_header = (sparse_header_t *)data;

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH v5 5/5] fastboot: add SPL support
  2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
                   ` (3 preceding siblings ...)
  2026-09-06 20:02 ` [PATCH v5 4/5] image: sparse: add phase-aware SPL support Carlo Caione
@ 2026-09-06 20:02 ` Carlo Caione
  2026-09-09 21:16   ` David Lechner
  2026-09-11 13:30   ` Mattijs Korpershoek
  4 siblings, 2 replies; 16+ messages in thread
From: Carlo Caione @ 2026-09-06 20:02 UTC (permalink / raw)
  To: u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Carlo Caione, David Lechner, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

Some recovery and initial-provisioning flows run before usable firmware
is available in persistent storage. In these flows the SoC ROM loads a
small first stage, but that stage must still provide a standard protocol
with which the host can provision the device.

U-Boot already provides fastboot for this purpose, but its implementation
is currently restricted to U-Boot proper and coupled to command-line
support. This forces platforms that need provisioning from SPL to maintain
a separate downloader or an out-of-tree fastboot implementation.

Allow boards to run USB fastboot as a service directly from SPL. Include
MMC partition flashing and Android sparse-image handling so that the SPL
service can provision the same storage images accepted by fastboot in
U-Boot proper.

Keep the SPL interface deliberately narrower. The fastboot boot command
is not supported because SPL is being used for provisioning rather than
OS boot orchestration. Filesystem probing is also omitted, so partition
types are reported as raw. Reboot support remains optional since reset
and persistent reboot-reason handling are platform-specific.

Environment-backed USB serial numbers, getvars, MMC aliases and raw
partition descriptors are available when SPL_ENV_SUPPORT is enabled, but
the core service no longer requires the environment. Document the full
printf, allocator, reset, command and shared-buffer requirements.

SPL size remains an important constraint. Make the support entirely
opt-in and phase-specific: when CONFIG_SPL_FASTBOOT is disabled, no
fastboot code or supporting library is added to SPL. Enable the core
service in sandbox_spl so this build path receives CI compile coverage.

Signed-off-by: Julien Masson <jmasson@baylibre.com>
Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
Signed-off-by: Carlo Caione <ccaione@baylibre.com>
---
 configs/sandbox_spl_defconfig   |   4 ++
 doc/android/fastboot.rst        |  48 +++++++++++++++++++
 drivers/fastboot/Kconfig        | 104 ++++++++++++++++++++++++++++++++++++++--
 drivers/fastboot/fb_command.c   |  68 +++++++++++++++++++++++---
 drivers/fastboot/fb_common.c    |  15 ++++++
 drivers/fastboot/fb_getvar.c    |  16 +++++--
 drivers/fastboot/fb_mmc.c       |  13 +++--
 drivers/fastboot/fb_usb.c       |   3 ++
 drivers/usb/gadget/Makefile     |   2 +-
 drivers/usb/gadget/f_fastboot.c |   6 ++-
 10 files changed, 260 insertions(+), 19 deletions(-)

diff --git a/configs/sandbox_spl_defconfig b/configs/sandbox_spl_defconfig
index 3b6d18d7d76..03301e49021 100644
--- a/configs/sandbox_spl_defconfig
+++ b/configs/sandbox_spl_defconfig
@@ -214,6 +214,10 @@ CONFIG_TIMER_EARLY=y
 CONFIG_SANDBOX_TIMER=y
 CONFIG_USB=y
 CONFIG_DM_USB_GADGET=y
+CONFIG_SPL_DM_USB_GADGET=y
+CONFIG_USB_GADGET=y
+CONFIG_SPL_USB_GADGET=y
+CONFIG_SPL_FASTBOOT=y
 CONFIG_USB_EMUL=y
 CONFIG_USB_KEYBOARD=y
 CONFIG_VIDEO=y
diff --git a/doc/android/fastboot.rst b/doc/android/fastboot.rst
index 96c544ae11b..8e15f287f9b 100644
--- a/doc/android/fastboot.rst
+++ b/doc/android/fastboot.rst
@@ -72,6 +72,54 @@ platform. The location of the buffer and size are set with
 may be overridden on the fastboot command line using ``-l`` and
 ``-s``.
 
+Fastboot in SPL
+^^^^^^^^^^^^^^^
+
+Fastboot can be used from SPL without enabling the command line. Enable
+``CONFIG_SPL_FASTBOOT`` together with the platform's SPL USB gadget support,
+then start the session from board code::
+
+   ret = fastboot_usb_run(controller_index, NULL, 0);
+
+The call normally belongs in ``board_init_r()`` or in a board recovery hook.
+It services USB until the host sends ``continue`` or detaches the gadget, then
+returns control to its caller.
+
+A ``NULL`` buffer and zero size select ``CONFIG_FASTBOOT_BUF_ADDR`` and
+``CONFIG_FASTBOOT_BUF_SIZE``. These Kconfig settings are shared with U-Boot
+proper. A board which needs a different SPL memory layout must pass explicit
+values. Unlike the command-line invocation, an SPL session cannot be aborted
+from the local console.
+
+SPL supports ``getvar``, ``download``, ``continue`` and the ``set_active``
+stub. The ``continue`` command ends the session and returns control to the
+caller. The ``flash`` and ``erase`` commands are available when their SPL
+backend is enabled. A recognized command whose optional backend is disabled is
+reported as unsupported. Commands omitted from the SPL table, including
+``boot``, ``ucmd``, ``acmd`` and the OEM commands, are reported as unrecognized.
+
+MMC flash and erase support is enabled with
+``CONFIG_SPL_FASTBOOT_FLASH_MMC``. The SPL partition-table parser matching the
+storage layout must also be enabled, for example ``CONFIG_SPL_EFI_PARTITION``
+for GPT. This backend requires the reclaiming SPL allocator; it cannot be used
+with ``CONFIG_SPL_SYS_MALLOC_SIMPLE`` because sparse and block writes allocate
+and free transient buffers.
+
+SPL reports ``raw`` for ``partition-type`` because it does not add filesystem
+probing for this getvar. The special ``flash:zimage`` path is not available
+because Android boot-image support is not enabled for SPL.
+
+Environment support is optional. With ``CONFIG_SPL_ENV_SUPPORT``, the USB
+serial number, environment-backed getvars, MMC partition aliases and raw
+partition descriptors work as in U-Boot proper. Without it, the core protocol
+and partition-table lookups remain available, while those environment-backed
+features are omitted.
+
+Reboot commands require ``CONFIG_SPL_FASTBOOT_REBOOT`` and a platform
+``reset_cpu()`` implementation. The ``reboot-bootloader``, ``reboot-fastboot``
+and ``reboot-recovery`` commands also require a platform
+``fastboot_set_reboot_flag()`` implementation.
+
 Fastboot environment variables
 ------------------------------
 
diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
index 90212fcf9ef..938fa127db8 100644
--- a/drivers/fastboot/Kconfig
+++ b/drivers/fastboot/Kconfig
@@ -1,5 +1,6 @@
 menu "Fastboot support"
-	depends on CMDLINE
+
+if CMDLINE
 
 config FASTBOOT
 	bool
@@ -47,7 +48,33 @@ config TCP_FUNCTION_FASTBOOT
 	help
 	  This enables the fastboot protocol over TCP.
 
-if FASTBOOT
+endif # CMDLINE
+
+config SPL_FASTBOOT
+	bool "Support fastboot in SPL"
+	depends on USB_GADGET && SPL_USB_GADGET
+	depends on !SPL_USE_TINY_PRINTF
+	select SPL_LIBCOMMON_SUPPORT
+	select SPL_LIBGENERIC_SUPPORT
+	select SPL_PRINTF
+	select SPL_USB_FUNCTION_FASTBOOT
+	help
+	  Enable the USB fastboot protocol in SPL. The board is responsible
+	  for starting the fastboot session. Full printf support is required
+	  because fastboot builds bounded responses with vsnprintf() and uses
+	  formats which are not supported by the tiny implementation.
+
+config SPL_USB_FUNCTION_FASTBOOT
+	bool
+
+config SPL_FASTBOOT_REBOOT
+	bool "Enable fastboot reboot commands in SPL"
+	depends on SPL_FASTBOOT
+	help
+	  Enable the fastboot reboot commands in SPL. The platform must provide
+	  reset_cpu(), either directly or through the SPL sysreset framework.
+
+if FASTBOOT || SPL_FASTBOOT
 
 config FASTBOOT_BUF_ADDR
 	hex "Define FASTBOOT buffer address"
@@ -65,7 +92,8 @@ config FASTBOOT_BUF_ADDR
 	help
 	  The fastboot protocol requires a large memory buffer for
 	  downloads. Define this to the starting RAM address to use for
-	  downloaded images.
+	  downloaded images. U-Boot proper and SPL share this setting; an SPL
+	  caller needing a different address can pass it to fastboot_usb_run().
 
 config FASTBOOT_BUF_SIZE
 	hex "Define FASTBOOT buffer size"
@@ -77,7 +105,13 @@ config FASTBOOT_BUF_SIZE
 	help
 	  The fastboot protocol requires a large memory buffer for
 	  downloads. This buffer should be as large as possible for a
-	  platform. Define this to the size available RAM for fastboot.
+	  platform. Define this to the size available RAM for fastboot. U-Boot
+	  proper and SPL share this setting; an SPL caller needing a different
+	  size can pass it to fastboot_usb_run().
+
+endif # FASTBOOT || SPL_FASTBOOT
+
+if FASTBOOT
 
 config FASTBOOT_USB_DEV
 	int "USB controller number"
@@ -294,4 +328,66 @@ config FASTBOOT_OEM_BOARD
 
 endif # FASTBOOT
 
+config SPL_FASTBOOT_FLASH
+	bool
+	default y if SPL_FASTBOOT_FLASH_MMC
+	select SPL_IMAGE_SPARSE
+
+config SPL_FASTBOOT_FLASH_MMC
+	bool "Enable fastboot MMC flashing in SPL"
+	depends on SPL_FASTBOOT && SPL_MMC && SPL_DM_MMC && SPL_PARTITIONS
+	depends on SPL_SYS_MALLOC && !SPL_SYS_MALLOC_SIMPLE
+	select SPL_MMC_WRITE
+	help
+	  Build the fastboot MMC flashing backend into SPL. This allows the
+	  fastboot flash and erase commands to operate on MMC partitions. A
+	  suitable SPL partition-table parser and a reclaiming malloc
+	  implementation must also be enabled.
+
+config SPL_FASTBOOT_FLASH_MMC_DEV
+	int "Define fastboot MMC flash device in SPL"
+	depends on SPL_FASTBOOT_FLASH_MMC
+	default 0
+	help
+	  Define the MMC device that the SPL fastboot flash backend uses.
+
+config SPL_FASTBOOT_MMC_BOOT_SUPPORT
+	bool "Enable eMMC boot-partition flash/erase in SPL"
+	depends on SPL_FASTBOOT_FLASH_MMC && SUPPORT_EMMC_BOOT
+	help
+	  Enable the special fastboot targets used to flash or erase the eMMC
+	  boot hardware partitions from SPL.
+
+config SPL_FASTBOOT_MMC_BOOT1_NAME
+	string "Target name for updating eMMC boot partition 1 in SPL"
+	depends on SPL_FASTBOOT_MMC_BOOT_SUPPORT
+	default "mmc0boot0"
+
+config SPL_FASTBOOT_MMC_BOOT2_NAME
+	string "Target name for updating eMMC boot partition 2 in SPL"
+	depends on SPL_FASTBOOT_MMC_BOOT_SUPPORT
+	default "mmc0boot1"
+
+config SPL_FASTBOOT_MMC_USER_SUPPORT
+	bool "Enable eMMC user-area flash/erase in SPL"
+	depends on SPL_FASTBOOT_FLASH_MMC
+	help
+	  Enable a special fastboot target for flashing or erasing the complete
+	  eMMC user area from SPL.
+
+config SPL_FASTBOOT_MMC_USER_NAME
+	string "Target name for updating the eMMC user area in SPL"
+	depends on SPL_FASTBOOT_MMC_USER_SUPPORT
+	default "mmc0"
+
+config SPL_FASTBOOT_GPT_NAME
+	string "Target name for updating GPT from SPL"
+	depends on SPL_FASTBOOT_FLASH_MMC && SPL_EFI_PARTITION
+	default "gpt"
+
+config SPL_FASTBOOT_MBR_NAME
+	string "Target name for updating MBR from SPL"
+	depends on SPL_FASTBOOT_FLASH_MMC && SPL_DOS_PARTITION
+	default "mbr"
+
 endmenu
diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
index 111516fd1b3..a2a89fc04f8 100644
--- a/drivers/fastboot/fb_command.c
+++ b/drivers/fastboot/fb_command.c
@@ -48,10 +48,59 @@ static void oem_board(char *, char *);
 static void run_ucmd(char *, char *);
 static void run_acmd(char *, char *);
 
-static const struct {
+struct fastboot_command {
 	const char *command;
 	void (*dispatch)(char *cmd_parameter, char *response);
-} commands[FASTBOOT_COMMAND_COUNT] = {
+};
+
+#ifdef CONFIG_XPL_BUILD
+static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
+	[FASTBOOT_COMMAND_GETVAR] = {
+		.command = "getvar",
+		.dispatch = getvar
+	},
+	[FASTBOOT_COMMAND_DOWNLOAD] = {
+		.command = "download",
+		.dispatch = download
+	},
+	[FASTBOOT_COMMAND_FLASH] =  {
+		.command = "flash",
+		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (flash), (NULL))
+	},
+	[FASTBOOT_COMMAND_ERASE] =  {
+		.command = "erase",
+		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (erase), (NULL))
+	},
+	[FASTBOOT_COMMAND_CONTINUE] =  {
+		.command = "continue",
+		.dispatch = okay
+	},
+	[FASTBOOT_COMMAND_REBOOT] =  {
+		.command = "reboot",
+		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT, (okay), (NULL))
+	},
+	[FASTBOOT_COMMAND_REBOOT_BOOTLOADER] =  {
+		.command = "reboot-bootloader",
+		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
+					     (reboot_bootloader), (NULL))
+	},
+	[FASTBOOT_COMMAND_REBOOT_FASTBOOTD] =  {
+		.command = "reboot-fastboot",
+		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
+					     (reboot_fastbootd), (NULL))
+	},
+	[FASTBOOT_COMMAND_REBOOT_RECOVERY] =  {
+		.command = "reboot-recovery",
+		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
+					     (reboot_recovery), (NULL))
+	},
+	[FASTBOOT_COMMAND_SET_ACTIVE] =  {
+		.command = "set_active",
+		.dispatch = okay
+	},
+};
+#else
+static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
 	[FASTBOOT_COMMAND_GETVAR] = {
 		.command = "getvar",
 		.dispatch = getvar
@@ -129,6 +178,7 @@ static const struct {
 		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_UUU_SUPPORT, (run_acmd), (NULL))
 	},
 };
+#endif
 
 /**
  * fastboot_handle_command - Handle fastboot command
@@ -147,7 +197,8 @@ int fastboot_handle_command(char *cmd_string, char *response)
 	strsep(&cmd_parameter, ":");
 
 	for (i = 0; i < FASTBOOT_COMMAND_COUNT; i++) {
-		if (!strcmp(commands[i].command, cmd_string)) {
+		if (commands[i].command &&
+		    !strcmp(commands[i].command, cmd_string)) {
 			if (commands[i].dispatch) {
 				commands[i].dispatch(cmd_parameter,
 							response);
@@ -323,7 +374,9 @@ void fastboot_data_complete(char *response)
 	fastboot_okay(NULL, response);
 	printf("\ndownloading of %d bytes finished\n", fastboot_bytes_received);
 	image_size = fastboot_bytes_received;
+#if CONFIG_IS_ENABLED(ENV_SUPPORT)
 	env_set_hex("filesize", image_size);
+#endif
 	fastboot_bytes_expected = 0;
 	fastboot_bytes_received = 0;
 }
@@ -437,7 +490,8 @@ static void __maybe_unused run_acmd(char *cmd_parameter, char *response)
  * @cmd_parameter: Pointer to command parameter
  * @response: Pointer to fastboot response buffer
  */
-static void reboot_bootloader(char *cmd_parameter, char *response)
+static void __maybe_unused reboot_bootloader(char *cmd_parameter,
+					     char *response)
 {
 	if (fastboot_set_reboot_flag(FASTBOOT_REBOOT_REASON_BOOTLOADER))
 		fastboot_fail("Cannot set reboot flag", response);
@@ -451,7 +505,8 @@ static void reboot_bootloader(char *cmd_parameter, char *response)
  * @cmd_parameter: Pointer to command parameter
  * @response: Pointer to fastboot response buffer
  */
-static void reboot_fastbootd(char *cmd_parameter, char *response)
+static void __maybe_unused reboot_fastbootd(char *cmd_parameter,
+					    char *response)
 {
 	if (fastboot_set_reboot_flag(FASTBOOT_REBOOT_REASON_FASTBOOTD))
 		fastboot_fail("Cannot set fastboot flag", response);
@@ -465,7 +520,8 @@ static void reboot_fastbootd(char *cmd_parameter, char *response)
  * @cmd_parameter: Pointer to command parameter
  * @response: Pointer to fastboot response buffer
  */
-static void reboot_recovery(char *cmd_parameter, char *response)
+static void __maybe_unused reboot_recovery(char *cmd_parameter,
+					   char *response)
 {
 	if (fastboot_set_reboot_flag(FASTBOOT_REBOOT_REASON_RECOVERY))
 		fastboot_fail("Cannot set recovery flag", response);
diff --git a/drivers/fastboot/fb_common.c b/drivers/fastboot/fb_common.c
index db6088653e5..9184bc6346d 100644
--- a/drivers/fastboot/fb_common.c
+++ b/drivers/fastboot/fb_common.c
@@ -12,6 +12,7 @@
 
 #include <bcb.h>
 #include <command.h>
+#include <cpu_func.h>
 #include <env.h>
 #include <fastboot.h>
 #include <net.h>
@@ -91,6 +92,10 @@ void fastboot_okay(const char *reason, char *response)
  */
 int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
 {
+#ifdef CONFIG_XPL_BUILD
+	/* SPL does not provide the BCB command plumbing used by U-Boot proper. */
+	return -EOPNOTSUPP;
+#else
 	int ret;
 	static const char * const boot_cmds[] = {
 		[FASTBOOT_REBOOT_REASON_BOOTLOADER] = "bootonce-bootloader",
@@ -129,6 +134,7 @@ int __weak fastboot_set_reboot_flag(enum fastboot_reboot_reason reason)
 out:
 	bcb_reset();
 	return ret;
+#endif
 }
 
 /**
@@ -141,6 +147,7 @@ void (*fastboot_get_progress_callback(void))(const char *)
 	return fastboot_progress_callback;
 }
 
+#ifndef CONFIG_XPL_BUILD
 /**
  * fastboot_boot() - Execute fastboot boot command
  *
@@ -178,6 +185,7 @@ void fastboot_boot(void)
 		do_reset(NULL, 0, 0, NULL);
 	}
 }
+#endif
 
 /**
  * fastboot_handle_boot() - Shared implementation of system reaction to
@@ -192,12 +200,14 @@ void fastboot_handle_boot(int command, bool success)
 		return;
 
 	switch (command) {
+#ifndef CONFIG_XPL_BUILD
 	case FASTBOOT_COMMAND_BOOT:
 		fastboot_boot();
 #if CONFIG_IS_ENABLED(NET_LEGACY)
 		net_set_state(NETLOOP_SUCCESS);
 #endif
 		break;
+#endif
 
 	case FASTBOOT_COMMAND_CONTINUE:
 #if CONFIG_IS_ENABLED(NET_LEGACY)
@@ -209,7 +219,12 @@ void fastboot_handle_boot(int command, bool success)
 	case FASTBOOT_COMMAND_REBOOT_BOOTLOADER:
 	case FASTBOOT_COMMAND_REBOOT_FASTBOOTD:
 	case FASTBOOT_COMMAND_REBOOT_RECOVERY:
+#if defined(CONFIG_XPL_BUILD) && CONFIG_IS_ENABLED(FASTBOOT_REBOOT)
+		/* SPL may omit CMDLINE, so use the platform reset hook directly. */
+		reset_cpu();
+#elif !defined(CONFIG_XPL_BUILD)
 		do_reset(NULL, 0, 0, NULL);
+#endif
 		break;
 	}
 }
diff --git a/drivers/fastboot/fb_getvar.c b/drivers/fastboot/fb_getvar.c
index 9e8e8889d08..2eacc84c465 100644
--- a/drivers/fastboot/fb_getvar.c
+++ b/drivers/fastboot/fb_getvar.c
@@ -160,7 +160,8 @@ static void getvar_downloadsize(char *var_parameter, char *response)
 
 static void getvar_serialno(char *var_parameter, char *response)
 {
-	const char *tmp = env_get("serial#");
+	const char *tmp = CONFIG_IS_ENABLED(ENV_SUPPORT,
+					    (env_get("serial#")), (NULL));
 
 	if (tmp)
 		fastboot_okay(tmp, response);
@@ -175,7 +176,8 @@ static void getvar_version_baseband(char *var_parameter, char *response)
 
 static void getvar_product(char *var_parameter, char *response)
 {
-	const char *board = env_get("board");
+	const char *board = CONFIG_IS_ENABLED(ENV_SUPPORT,
+					      (env_get("board")), (NULL));
 
 	if (board)
 		fastboot_okay(board, response);
@@ -185,7 +187,8 @@ static void getvar_product(char *var_parameter, char *response)
 
 static void getvar_platform(char *var_parameter, char *response)
 {
-	const char *p = env_get("platform");
+	const char *p = CONFIG_IS_ENABLED(ENV_SUPPORT,
+					  (env_get("platform")), (NULL));
 
 	if (p)
 		fastboot_okay(p, response);
@@ -240,12 +243,17 @@ static void __maybe_unused getvar_partition_type(char *part_name, char *response
 	r = fastboot_mmc_get_part_info(part_name, &dev_desc, &part_info,
 				       response);
 	if (r >= 0) {
+#ifdef CONFIG_XPL_BUILD
+		/* SPL does not pull in filesystem probing just for this getvar. */
+		fastboot_okay("raw", response);
+#else
 		r = fs_set_blk_dev_with_part(dev_desc, r);
 		if (r < 0)
 			/* If we don't know then just default to raw */
 			fastboot_okay("raw", response);
 		else
 			fastboot_okay(fs_get_type_name(), response);
+#endif
 	}
 }
 
@@ -327,7 +335,7 @@ void fastboot_getvar(char *cmd_parameter, char *response)
 
 		snprintf(envstr, sizeof(envstr) - 1,
 			 FASTBOOT_ENV_PREFIX "%s", cmd_parameter);
-		s = env_get(envstr);
+		s = CONFIG_IS_ENABLED(ENV_SUPPORT, (env_get(envstr)), (NULL));
 		if (s) {
 			fastboot_response("OKAY", response, "%s", s);
 			return;
diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
index ae33e35365b..faf345fbcbb 100644
--- a/drivers/fastboot/fb_mmc.c
+++ b/drivers/fastboot/fb_mmc.c
@@ -27,6 +27,7 @@ static int raw_part_get_info_by_name(struct blk_desc *dev_desc,
 {
 	/* strlen("fastboot_raw_partition_") + PART_NAME_LEN + 1 */
 	char env_desc_name[23 + PART_NAME_LEN + 1];
+	const char *raw_part_env;
 	char *raw_part_desc;
 	const char *argv[2];
 	const char **parg = argv;
@@ -34,7 +35,12 @@ static int raw_part_get_info_by_name(struct blk_desc *dev_desc,
 	/* check for raw partition descriptor */
 	strcpy(env_desc_name, "fastboot_raw_partition_");
 	strlcat(env_desc_name, name, sizeof(env_desc_name));
-	raw_part_desc = strdup(env_get(env_desc_name));
+	raw_part_env = CONFIG_IS_ENABLED(ENV_SUPPORT,
+					 (env_get(env_desc_name)), (NULL));
+	if (!raw_part_env)
+		return -ENODEV;
+
+	raw_part_desc = strdup(raw_part_env);
 	if (raw_part_desc == NULL)
 		return -ENODEV;
 
@@ -99,12 +105,13 @@ static int part_get_info_by_name_or_alias(struct blk_desc **dev_desc,
 {
 	/* strlen("fastboot_partition_alias_") + PART_NAME_LEN + 1 */
 	char env_alias_name[25 + PART_NAME_LEN + 1];
-	char *aliased_part_name;
+	const char *aliased_part_name;
 
 	/* check for alias */
 	strlcpy(env_alias_name, "fastboot_partition_alias_", sizeof(env_alias_name));
 	strlcat(env_alias_name, name, sizeof(env_alias_name));
-	aliased_part_name = env_get(env_alias_name);
+	aliased_part_name = CONFIG_IS_ENABLED(ENV_SUPPORT,
+					      (env_get(env_alias_name)), (NULL));
 	if (aliased_part_name)
 		name = aliased_part_name;
 
diff --git a/drivers/fastboot/fb_usb.c b/drivers/fastboot/fb_usb.c
index fa8ac134328..c5f6f1b522e 100644
--- a/drivers/fastboot/fb_usb.c
+++ b/drivers/fastboot/fb_usb.c
@@ -43,6 +43,8 @@ int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size)
 	}
 
 	while (!g_dnl_detach()) {
+#ifndef CONFIG_XPL_BUILD
+		/* SPL callers own the session lifetime and may have no console. */
 		if (CONFIG_IS_ENABLED(CMD_FASTBOOT_ABORT_KEYED)) {
 			if (tstc()) {
 				getchar();
@@ -52,6 +54,7 @@ int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size)
 		} else if (ctrlc()) {
 			break;
 		}
+#endif
 		schedule();
 		dm_usb_gadget_handle_interrupts(udc);
 	}
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index f2aebf4e480..9dd3abe2a5c 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -6,6 +6,7 @@
 obj-$(CONFIG_$(PHASE_)USB_GADGET) += epautoconf.o config.o usbstring.o
 obj-$(CONFIG_$(PHASE_)USB_ETHER) += epautoconf.o config.o usbstring.o ether.o
 obj-$(CONFIG_$(PHASE_)USB_ETH_RNDIS) += rndis.o
+obj-$(CONFIG_$(PHASE_)USB_FUNCTION_FASTBOOT) += f_fastboot.o
 
 ifdef CONFIG_XPL_BUILD
 obj-$(CONFIG_SPL_USB_GADGET) += g_dnl.o
@@ -25,7 +26,6 @@ obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
 obj-$(CONFIG_USB_FUNCTION_THOR) += f_thor.o
 obj-$(CONFIG_DFU_OVER_USB) += f_dfu.o
 obj-$(CONFIG_USB_FUNCTION_MASS_STORAGE) += f_mass_storage.o
-obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += f_fastboot.o
 obj-$(CONFIG_USB_FUNCTION_SDP) += f_sdp.o
 obj-$(CONFIG_USB_FUNCTION_ROCKUSB) += f_rockusb.o
 obj-$(CONFIG_USB_FUNCTION_ACM)	+= f_acm.o
diff --git a/drivers/usb/gadget/f_fastboot.c b/drivers/usb/gadget/f_fastboot.c
index 1971755721f..9a2e9850112 100644
--- a/drivers/usb/gadget/f_fastboot.c
+++ b/drivers/usb/gadget/f_fastboot.c
@@ -260,7 +260,7 @@ static int fastboot_bind(struct usb_configuration *c, struct usb_function *f)
 		f->ss_descriptors = fb_ss_function;
 	}
 
-	s = env_get("serial#");
+	s = CONFIG_IS_ENABLED(ENV_SUPPORT, (env_get("serial#")), (NULL));
 	if (s)
 		g_dnl_set_serialnumber((char *)s);
 
@@ -489,11 +489,13 @@ static void do_exit_on_complete(struct usb_ep *ep, struct usb_request *req)
 	g_dnl_trigger_detach();
 }
 
+#ifndef CONFIG_XPL_BUILD
 static void do_bootm_on_complete(struct usb_ep *ep, struct usb_request *req)
 {
 	fastboot_boot();
 	do_exit_on_complete(ep, req);
 }
+#endif
 
 static int multiresponse_cmd = -1;
 static void multiresponse_on_complete(struct usb_ep *ep, struct usb_request *req)
@@ -559,7 +561,9 @@ static void rx_handler_command(struct usb_ep *ep, struct usb_request *req)
 	if (!strncmp("OKAY", response, 4)) {
 		switch (cmd) {
 		case FASTBOOT_COMMAND_BOOT:
+#ifndef CONFIG_XPL_BUILD
 			fastboot_func->in_req->complete = do_bootm_on_complete;
+#endif
 			break;
 
 		case FASTBOOT_COMMAND_CONTINUE:

-- 
2.55.0


^ permalink raw reply related	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 1/5] fastboot: factor out the USB session runner
  2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
@ 2026-09-09 20:31   ` David Lechner
  2026-09-11 12:34   ` Mattijs Korpershoek
  1 sibling, 0 replies; 16+ messages in thread
From: David Lechner @ 2026-09-09 20:31 UTC (permalink / raw)
  To: Carlo Caione, u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut,
	Peng Fan, Jaehoon Chung, Neil Armstrong, Julien Masson,
	Alexey Charkov, Adrian Freihofer, Francois Berder,
	Ilias Apalodimas, Marek Vasut, Vincent Jardin, Peter Robinson

On 9/6/26 3:01 PM, Carlo Caione wrote:
> The fastboot command currently owns USB gadget setup, protocol
> initialization, the service loop and teardown. This prevents callers
> which do not use the command line from starting USB fastboot without
> duplicating the same session lifecycle.
> 

...

> diff --git a/drivers/fastboot/fb_usb.c b/drivers/fastboot/fb_usb.c
> new file mode 100644
> index 00000000000..5c62bf42e72
> --- /dev/null
> +++ b/drivers/fastboot/fb_usb.c
> @@ -0,0 +1,66 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later
> +/*
> + * Copyright 2026 BayLibre SAS
> + *
> + * Copyright 2008 - 2009 Windriver, <www.windriver.com>
> + * Author: Tom Rix <Tom.Rix@windriver.com>
> + *
> + * (C) Copyright 2014 Linaro, Ltd.
> + * Rob Herring <robh@kernel.org>
> + */
> +
> +#include <console.h>
> +#include <fastboot.h>
> +#include <g_dnl.h>
> +#include <usb.h>
> +#include <u-boot/schedule.h>
> +#include <linux/errno.h>
> +#include <linux/printk.h>

Could also use stdio.h and linux/usb/gadget.h

> +
> +int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size)
> +{
> +	struct udevice *udc;
> +	int ret;
> +
> +	ret = udc_device_get_by_index(controller_index, &udc);
> +	if (ret) {
> +		pr_err("USB init failed: %d\n", ret);
> +		return ret;
> +	}
> +
> +	fastboot_init(buf_addr, buf_size);
> +	g_dnl_clear_detach();
> +
> +	ret = g_dnl_register("usb_dnl_fastboot");
> +	if (ret)
> +		goto err_put;
> +
> +	if (!g_dnl_board_usb_cable_connected()) {
> +		puts("\rUSB cable not detected.\n"
> +		     "Command exit.\n");

Technically this can be called by something other than a command now, so
perhaps leave out the 2nd line.

> +		ret = -ENODEV;
> +		goto err_unregister;
> +	}
> +
> +	while (!g_dnl_detach()) {
> +		if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
> +			if (tstc()) {
> +				getchar();
> +				puts("\rOperation aborted.\n");
> +				break;
> +			}
> +		} else if (ctrlc()) {
> +			break;
> +		}
> +		schedule();
> +		dm_usb_gadget_handle_interrupts(udc);
> +	}
> +

The code below runs on success to, so perhaps labels shoudl be out_ rather
than err_.

> +err_unregister:
> +	g_dnl_unregister();
> +	g_dnl_clear_detach();
> +err_put:
> +	udc_device_put(udc);
> +
> +	return ret;
> +}
> diff --git a/include/fastboot.h b/include/fastboot.h
> index b106d617749..f02d2559f2b 100644
> --- a/include/fastboot.h
> +++ b/include/fastboot.h
> @@ -125,6 +125,16 @@ void fastboot_set_progress_callback(void (*progress)(const char *msg));
>   */
>  void fastboot_init(void *buf_addr, u32 buf_size);
>  
> +/**
> + * fastboot_usb_run() - run a USB fastboot session
> + *
> + * @controller_index: USB gadget controller index
> + * @buf_addr: Pointer to download buffer, or NULL for default
> + * @buf_size: Size of download buffer, or zero for default
> + * Return: 0 on success, or a negative error code
> + */
> +int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size);
> +
>  /**
>   * fastboot_boot() - Execute fastboot boot command
>   *
> 


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 5/5] fastboot: add SPL support
  2026-09-06 20:02 ` [PATCH v5 5/5] fastboot: add " Carlo Caione
@ 2026-09-09 21:16   ` David Lechner
  2026-09-09 21:23     ` Carlo Caione
  2026-09-11 13:30   ` Mattijs Korpershoek
  1 sibling, 1 reply; 16+ messages in thread
From: David Lechner @ 2026-09-09 21:16 UTC (permalink / raw)
  To: Carlo Caione, u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut,
	Peng Fan, Jaehoon Chung, Neil Armstrong, Julien Masson,
	Alexey Charkov, Adrian Freihofer, Francois Berder,
	Ilias Apalodimas, Marek Vasut, Vincent Jardin, Peter Robinson

On 9/6/26 3:02 PM, Carlo Caione wrote:
> Some recovery and initial-provisioning flows run before usable firmware
> is available in persistent storage. In these flows the SoC ROM loads a
> small first stage, but that stage must still provide a standard protocol
> with which the host can provision the device.
> 

...

> diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
> index 111516fd1b3..a2a89fc04f8 100644
> --- a/drivers/fastboot/fb_command.c
> +++ b/drivers/fastboot/fb_command.c
> @@ -48,10 +48,59 @@ static void oem_board(char *, char *);
>  static void run_ucmd(char *, char *);
>  static void run_acmd(char *, char *);
>  
> -static const struct {
> +struct fastboot_command {
>  	const char *command;
>  	void (*dispatch)(char *cmd_parameter, char *response);
> -} commands[FASTBOOT_COMMAND_COUNT] = {
> +};
> +
> +#ifdef CONFIG_XPL_BUILD
> +static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
> +	[FASTBOOT_COMMAND_GETVAR] = {
> +		.command = "getvar",
> +		.dispatch = getvar
> +	},
> +	[FASTBOOT_COMMAND_DOWNLOAD] = {
> +		.command = "download",
> +		.dispatch = download
> +	},
> +	[FASTBOOT_COMMAND_FLASH] =  {
> +		.command = "flash",
> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (flash), (NULL))
> +	},
> +	[FASTBOOT_COMMAND_ERASE] =  {
> +		.command = "erase",
> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (erase), (NULL))
> +	},
> +	[FASTBOOT_COMMAND_CONTINUE] =  {
> +		.command = "continue",
> +		.dispatch = okay
> +	},
> +	[FASTBOOT_COMMAND_REBOOT] =  {
> +		.command = "reboot",
> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT, (okay), (NULL))
> +	},
> +	[FASTBOOT_COMMAND_REBOOT_BOOTLOADER] =  {
> +		.command = "reboot-bootloader",
> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> +					     (reboot_bootloader), (NULL))
> +	},
> +	[FASTBOOT_COMMAND_REBOOT_FASTBOOTD] =  {
> +		.command = "reboot-fastboot",
> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> +					     (reboot_fastbootd), (NULL))
> +	},
> +	[FASTBOOT_COMMAND_REBOOT_RECOVERY] =  {
> +		.command = "reboot-recovery",
> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> +					     (reboot_recovery), (NULL))
> +	},
> +	[FASTBOOT_COMMAND_SET_ACTIVE] =  {
> +		.command = "set_active",
> +		.dispatch = okay
> +	},
> +};

Do we really need to make a complete second table or can we just #ifndef
the indivdual commands in the existing table?

> +#else
> +static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
>  	[FASTBOOT_COMMAND_GETVAR] = {
>  		.command = "getvar",
>  		.dispatch = getvar

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 5/5] fastboot: add SPL support
  2026-09-09 21:16   ` David Lechner
@ 2026-09-09 21:23     ` Carlo Caione
  2026-09-09 21:57       ` David Lechner
  0 siblings, 1 reply; 16+ messages in thread
From: Carlo Caione @ 2026-09-09 21:23 UTC (permalink / raw)
  To: David Lechner
  Cc: u-boot, GSS_MTK_Uboot_upstream, Suhrid Subramaniam,
	Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut,
	Peng Fan, Jaehoon Chung, Neil Armstrong, Julien Masson,
	Alexey Charkov, Adrian Freihofer, Francois Berder,
	Ilias Apalodimas, Marek Vasut, Vincent Jardin, Peter Robinson

On Wed, Sep 09, 2026 at 16:16:16 +0100, David Lechner wrote:
> On 9/6/26 3:02 PM, Carlo Caione wrote:
> > Some recovery and initial-provisioning flows run before usable firmware
> > is available in persistent storage. In these flows the SoC ROM loads a
> > small first stage, but that stage must still provide a standard protocol
> > with which the host can provision the device.
> > 
> 
> ...
> 
> > diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
> > index 111516fd1b3..a2a89fc04f8 100644
> > --- a/drivers/fastboot/fb_command.c
> > +++ b/drivers/fastboot/fb_command.c
> > @@ -48,10 +48,59 @@ static void oem_board(char *, char *);
> >  static void run_ucmd(char *, char *);
> >  static void run_acmd(char *, char *);
> >  
> > -static const struct {
> > +struct fastboot_command {
> >  	const char *command;
> >  	void (*dispatch)(char *cmd_parameter, char *response);
> > -} commands[FASTBOOT_COMMAND_COUNT] = {
> > +};
> > +
> > +#ifdef CONFIG_XPL_BUILD
> > +static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
> > +	[FASTBOOT_COMMAND_GETVAR] = {
> > +		.command = "getvar",
> > +		.dispatch = getvar
> > +	},
> > +	[FASTBOOT_COMMAND_DOWNLOAD] = {
> > +		.command = "download",
> > +		.dispatch = download
> > +	},
> > +	[FASTBOOT_COMMAND_FLASH] =  {
> > +		.command = "flash",
> > +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (flash), (NULL))
> > +	},
> > +	[FASTBOOT_COMMAND_ERASE] =  {
> > +		.command = "erase",
> > +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (erase), (NULL))
> > +	},
> > +	[FASTBOOT_COMMAND_CONTINUE] =  {
> > +		.command = "continue",
> > +		.dispatch = okay
> > +	},
> > +	[FASTBOOT_COMMAND_REBOOT] =  {
> > +		.command = "reboot",
> > +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT, (okay), (NULL))
> > +	},
> > +	[FASTBOOT_COMMAND_REBOOT_BOOTLOADER] =  {
> > +		.command = "reboot-bootloader",
> > +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> > +					     (reboot_bootloader), (NULL))
> > +	},
> > +	[FASTBOOT_COMMAND_REBOOT_FASTBOOTD] =  {
> > +		.command = "reboot-fastboot",
> > +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> > +					     (reboot_fastbootd), (NULL))
> > +	},
> > +	[FASTBOOT_COMMAND_REBOOT_RECOVERY] =  {
> > +		.command = "reboot-recovery",
> > +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
> > +					     (reboot_recovery), (NULL))
> > +	},
> > +	[FASTBOOT_COMMAND_SET_ACTIVE] =  {
> > +		.command = "set_active",
> > +		.dispatch = okay
> > +	},
> > +};
> 
> Do we really need to make a complete second table or can we just #ifndef
> the indivdual commands in the existing table?

That was actually suggested by Mattijs here
https://lore.kernel.org/all/877blphqmg.fsf@kernel.org/




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 5/5] fastboot: add SPL support
  2026-09-09 21:23     ` Carlo Caione
@ 2026-09-09 21:57       ` David Lechner
  2026-09-11 12:26         ` Mattijs Korpershoek
  0 siblings, 1 reply; 16+ messages in thread
From: David Lechner @ 2026-09-09 21:57 UTC (permalink / raw)
  To: Carlo Caione
  Cc: u-boot, GSS_MTK_Uboot_upstream, Suhrid Subramaniam,
	Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris,
	Mattijs Korpershoek, Tom Rini, Simon Glass, Sam Day,
	Quentin Schulz, Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut,
	Peng Fan, Jaehoon Chung, Neil Armstrong, Julien Masson,
	Alexey Charkov, Adrian Freihofer, Francois Berder,
	Ilias Apalodimas, Marek Vasut, Vincent Jardin, Peter Robinson

On 9/9/26 4:23 PM, Carlo Caione wrote:
> On Wed, Sep 09, 2026 at 16:16:16 +0100, David Lechner wrote:
>> On 9/6/26 3:02 PM, Carlo Caione wrote:
>>> Some recovery and initial-provisioning flows run before usable firmware
>>> is available in persistent storage. In these flows the SoC ROM loads a
>>> small first stage, but that stage must still provide a standard protocol
>>> with which the host can provision the device.
>>>
>>
>> ...
>>
>>> diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
>>> index 111516fd1b3..a2a89fc04f8 100644
>>> --- a/drivers/fastboot/fb_command.c
>>> +++ b/drivers/fastboot/fb_command.c
>>> @@ -48,10 +48,59 @@ static void oem_board(char *, char *);
>>>  static void run_ucmd(char *, char *);
>>>  static void run_acmd(char *, char *);
>>>  
>>> -static const struct {
>>> +struct fastboot_command {
>>>  	const char *command;
>>>  	void (*dispatch)(char *cmd_parameter, char *response);
>>> -} commands[FASTBOOT_COMMAND_COUNT] = {
>>> +};
>>> +
>>> +#ifdef CONFIG_XPL_BUILD
>>> +static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
>>> +	[FASTBOOT_COMMAND_GETVAR] = {
>>> +		.command = "getvar",
>>> +		.dispatch = getvar
>>> +	},
>>> +	[FASTBOOT_COMMAND_DOWNLOAD] = {
>>> +		.command = "download",
>>> +		.dispatch = download
>>> +	},
>>> +	[FASTBOOT_COMMAND_FLASH] =  {
>>> +		.command = "flash",
>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (flash), (NULL))
>>> +	},
>>> +	[FASTBOOT_COMMAND_ERASE] =  {
>>> +		.command = "erase",
>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (erase), (NULL))
>>> +	},
>>> +	[FASTBOOT_COMMAND_CONTINUE] =  {
>>> +		.command = "continue",
>>> +		.dispatch = okay
>>> +	},
>>> +	[FASTBOOT_COMMAND_REBOOT] =  {
>>> +		.command = "reboot",
>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT, (okay), (NULL))
>>> +	},
>>> +	[FASTBOOT_COMMAND_REBOOT_BOOTLOADER] =  {
>>> +		.command = "reboot-bootloader",
>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
>>> +					     (reboot_bootloader), (NULL))
>>> +	},
>>> +	[FASTBOOT_COMMAND_REBOOT_FASTBOOTD] =  {
>>> +		.command = "reboot-fastboot",
>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
>>> +					     (reboot_fastbootd), (NULL))
>>> +	},
>>> +	[FASTBOOT_COMMAND_REBOOT_RECOVERY] =  {
>>> +		.command = "reboot-recovery",
>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
>>> +					     (reboot_recovery), (NULL))
>>> +	},
>>> +	[FASTBOOT_COMMAND_SET_ACTIVE] =  {
>>> +		.command = "set_active",
>>> +		.dispatch = okay
>>> +	},
>>> +};
>>
>> Do we really need to make a complete second table or can we just #ifndef
>> the indivdual commands in the existing table?
> 
> That was actually suggested by Mattijs here
> https://lore.kernel.org/all/877blphqmg.fsf@kernel.org/

ok

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 5/5] fastboot: add SPL support
  2026-09-09 21:57       ` David Lechner
@ 2026-09-11 12:26         ` Mattijs Korpershoek
  0 siblings, 0 replies; 16+ messages in thread
From: Mattijs Korpershoek @ 2026-09-11 12:26 UTC (permalink / raw)
  To: David Lechner, Carlo Caione
  Cc: u-boot, GSS_MTK_Uboot_upstream, Suhrid Subramaniam,
	Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris, Tom Rini,
	Simon Glass, Sam Day, Quentin Schulz, Vitor Sato Eschholz,
	Lukasz Majewski, Marek Vasut, Peng Fan, Jaehoon Chung,
	Neil Armstrong, Julien Masson, Alexey Charkov, Adrian Freihofer,
	Francois Berder, Ilias Apalodimas, Marek Vasut, Vincent Jardin,
	Peter Robinson

On Wed, Sep 09, 2026 at 16:57, David Lechner <dlechner@baylibre.com> wrote:

> On 9/9/26 4:23 PM, Carlo Caione wrote:
>> On Wed, Sep 09, 2026 at 16:16:16 +0100, David Lechner wrote:
>>> On 9/6/26 3:02 PM, Carlo Caione wrote:
>>>> Some recovery and initial-provisioning flows run before usable firmware
>>>> is available in persistent storage. In these flows the SoC ROM loads a
>>>> small first stage, but that stage must still provide a standard protocol
>>>> with which the host can provision the device.
>>>>
>>>
>>> ...
>>>
>>>> diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c
>>>> index 111516fd1b3..a2a89fc04f8 100644
>>>> --- a/drivers/fastboot/fb_command.c
>>>> +++ b/drivers/fastboot/fb_command.c
>>>> @@ -48,10 +48,59 @@ static void oem_board(char *, char *);
>>>>  static void run_ucmd(char *, char *);
>>>>  static void run_acmd(char *, char *);
>>>>  
>>>> -static const struct {
>>>> +struct fastboot_command {
>>>>  	const char *command;
>>>>  	void (*dispatch)(char *cmd_parameter, char *response);
>>>> -} commands[FASTBOOT_COMMAND_COUNT] = {
>>>> +};
>>>> +
>>>> +#ifdef CONFIG_XPL_BUILD
>>>> +static const struct fastboot_command commands[FASTBOOT_COMMAND_COUNT] = {
>>>> +	[FASTBOOT_COMMAND_GETVAR] = {
>>>> +		.command = "getvar",
>>>> +		.dispatch = getvar
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_DOWNLOAD] = {
>>>> +		.command = "download",
>>>> +		.dispatch = download
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_FLASH] =  {
>>>> +		.command = "flash",
>>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (flash), (NULL))
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_ERASE] =  {
>>>> +		.command = "erase",
>>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_FLASH, (erase), (NULL))
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_CONTINUE] =  {
>>>> +		.command = "continue",
>>>> +		.dispatch = okay
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_REBOOT] =  {
>>>> +		.command = "reboot",
>>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT, (okay), (NULL))
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_REBOOT_BOOTLOADER] =  {
>>>> +		.command = "reboot-bootloader",
>>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
>>>> +					     (reboot_bootloader), (NULL))
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_REBOOT_FASTBOOTD] =  {
>>>> +		.command = "reboot-fastboot",
>>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
>>>> +					     (reboot_fastbootd), (NULL))
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_REBOOT_RECOVERY] =  {
>>>> +		.command = "reboot-recovery",
>>>> +		.dispatch = CONFIG_IS_ENABLED(FASTBOOT_REBOOT,
>>>> +					     (reboot_recovery), (NULL))
>>>> +	},
>>>> +	[FASTBOOT_COMMAND_SET_ACTIVE] =  {
>>>> +		.command = "set_active",
>>>> +		.dispatch = okay
>>>> +	},
>>>> +};
>>>
>>> Do we really need to make a complete second table or can we just #ifndef
>>> the indivdual commands in the existing table?
>> 
>> That was actually suggested by Mattijs here
>> https://lore.kernel.org/all/877blphqmg.fsf@kernel.org/
>
> ok

Yeah, this thing is more of a personal preference. In my opinion it's a
bit more readable this way, so thank you for splitting it.

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 1/5] fastboot: factor out the USB session runner
  2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
  2026-09-09 20:31   ` David Lechner
@ 2026-09-11 12:34   ` Mattijs Korpershoek
  2026-09-11 13:33     ` Carlo Caione
  1 sibling, 1 reply; 16+ messages in thread
From: Mattijs Korpershoek @ 2026-09-11 12:34 UTC (permalink / raw)
  To: Carlo Caione, u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris, Tom Rini,
	Simon Glass, Sam Day, Quentin Schulz, Carlo Caione, David Lechner,
	Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut, Peng Fan,
	Jaehoon Chung, Neil Armstrong, Julien Masson, Alexey Charkov,
	Adrian Freihofer, Francois Berder, Ilias Apalodimas, Marek Vasut,
	Vincent Jardin, Peter Robinson

Hi Carlo,

Thank you for the patch.

compared with v3, v5 introduced some new changes which I don't
understand.

Please see below.

On Sun, Sep 06, 2026 at 22:01, Carlo Caione <ccaione@baylibre.com> wrote:

> The fastboot command currently owns USB gadget setup, protocol
> initialization, the service loop and teardown. This prevents callers
> which do not use the command line from starting USB fastboot without
> duplicating the same session lifecycle.
>
> Move that lifecycle into fastboot_usb_run() and leave cmd/fastboot.c
> responsible only for argument parsing and transport selection.
> Initialize network sessions in their transport path so their existing
> behavior is preserved.
>
> Keep the command-line diagnostics for a missing USB cable. The helper
> returns -ENODEV in that case, which the command maps to its existing
> failure result. Unregister the gadget before releasing the UDC so no
> registered function remains attached to a released controller.
>
> Signed-off-by: Julien Masson <jmasson@baylibre.com>
> Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
> Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>
> ---
>  cmd/fastboot.c            | 53 ++++---------------------------------
>  drivers/fastboot/Makefile |  1 +
>  drivers/fastboot/fb_usb.c | 66 +++++++++++++++++++++++++++++++++++++++++++++++
>  include/fastboot.h        | 10 +++++++
>  4 files changed, 82 insertions(+), 48 deletions(-)
>

[...]

>  		return do_fastboot_udp(argc, argv, buf_addr, buf_size);
> diff --git a/drivers/fastboot/Makefile b/drivers/fastboot/Makefile
> index a341af076d1..32e8e072c88 100644
> --- a/drivers/fastboot/Makefile
> +++ b/drivers/fastboot/Makefile
> @@ -3,6 +3,7 @@
>  obj-y += fb_common.o
>  obj-y += fb_getvar.o
>  obj-y += fb_command.o
> +obj-$(CONFIG_USB_FUNCTION_FASTBOOT) += fb_usb.o
>  obj-$(CONFIG_FASTBOOT_FLASH_BLOCK) += fb_block.o
>  # MMC reuses block implementation
>  obj-$(CONFIG_FASTBOOT_FLASH_MMC) += fb_block.o fb_mmc.o
> diff --git a/drivers/fastboot/fb_usb.c b/drivers/fastboot/fb_usb.c
> new file mode 100644
> index 00000000000..5c62bf42e72
> --- /dev/null
> +++ b/drivers/fastboot/fb_usb.c
> @@ -0,0 +1,66 @@
> +// SPDX-License-Identifier: GPL-2.0-or-later

Why is this GPL-2.0-or-later? In v3 it was GPL-2.0+ which is what's
present in cmd/fastboot.c

> +/*
> + * Copyright 2026 BayLibre SAS

This was also not present in v3 and does not seem an appropriate
addition to me since we are just copying code around. Why should it have
a new copyright?

> + *
> + * Copyright 2008 - 2009 Windriver, <www.windriver.com>
> + * Author: Tom Rix <Tom.Rix@windriver.com>
> + *
> + * (C) Copyright 2014 Linaro, Ltd.
> + * Rob Herring <robh@kernel.org>
> + */
> +
> +#include <console.h>
> +#include <fastboot.h>
> +#include <g_dnl.h>
> +#include <usb.h>
> +#include <u-boot/schedule.h>
> +#include <linux/errno.h>
> +#include <linux/printk.h>
> +
> +int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size)
> +{
> +	struct udevice *udc;
> +	int ret;
> +
> +	ret = udc_device_get_by_index(controller_index, &udc);
> +	if (ret) {
> +		pr_err("USB init failed: %d\n", ret);
> +		return ret;
> +	}
> +
> +	fastboot_init(buf_addr, buf_size);
> +	g_dnl_clear_detach();
> +
> +	ret = g_dnl_register("usb_dnl_fastboot");
> +	if (ret)
> +		goto err_put;
> +
> +	if (!g_dnl_board_usb_cable_connected()) {
> +		puts("\rUSB cable not detected.\n"
> +		     "Command exit.\n");

This is a function that's not necessarily only called from a command.
Please drop the Command exit. part (that was also not present in v3).

> +		ret = -ENODEV;
> +		goto err_unregister;
> +	}
> +
> +	while (!g_dnl_detach()) {
> +		if (IS_ENABLED(CONFIG_CMD_FASTBOOT_ABORT_KEYED)) {
> +			if (tstc()) {
> +				getchar();
> +				puts("\rOperation aborted.\n");
> +				break;
> +			}
> +		} else if (ctrlc()) {
> +			break;
> +		}
> +		schedule();
> +		dm_usb_gadget_handle_interrupts(udc);
> +	}
> +
> +err_unregister:
> +	g_dnl_unregister();
> +	g_dnl_clear_detach();
> +err_put:
> +	udc_device_put(udc);
> +
> +	return ret;
> +}
> diff --git a/include/fastboot.h b/include/fastboot.h
> index b106d617749..f02d2559f2b 100644
> --- a/include/fastboot.h
> +++ b/include/fastboot.h
> @@ -125,6 +125,16 @@ void fastboot_set_progress_callback(void (*progress)(const char *msg));
>   */
>  void fastboot_init(void *buf_addr, u32 buf_size);
>  
> +/**
> + * fastboot_usb_run() - run a USB fastboot session
> + *
> + * @controller_index: USB gadget controller index
> + * @buf_addr: Pointer to download buffer, or NULL for default
> + * @buf_size: Size of download buffer, or zero for default
> + * Return: 0 on success, or a negative error code
> + */
> +int fastboot_usb_run(int controller_index, void *buf_addr, u32 buf_size);
> +
>  /**
>   * fastboot_boot() - Execute fastboot boot command
>   *
>
> -- 
> 2.55.0

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware
  2026-09-06 20:02 ` [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware Carlo Caione
@ 2026-09-11 12:38   ` Mattijs Korpershoek
  0 siblings, 0 replies; 16+ messages in thread
From: Mattijs Korpershoek @ 2026-09-11 12:38 UTC (permalink / raw)
  To: Carlo Caione, u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris, Tom Rini,
	Simon Glass, Sam Day, Quentin Schulz, Carlo Caione, David Lechner,
	Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut, Peng Fan,
	Jaehoon Chung, Neil Armstrong, Julien Masson, Alexey Charkov,
	Adrian Freihofer, Francois Berder, Ilias Apalodimas, Marek Vasut,
	Vincent Jardin, Peter Robinson

Hi Carlo,

Thank you for the patch.

On Sun, Sep 06, 2026 at 22:02, Carlo Caione <ccaione@baylibre.com> wrote:

> Fastboot currently builds only for U-Boot proper, so its source and
> Makefile rules test CONFIG_FASTBOOT_* directly. The same checks would
> select U-Boot-proper options when these files are compiled for another
> phase, potentially compiling unavailable backends or using the wrong
> configuration values.
>
> Use CONFIG_IS_ENABLED(), CONFIG_VAL() and CONFIG_$(PHASE_) consistently
> for code and object selection. The empty phase prefix preserves the
> existing U-Boot-proper configuration and behavior while making the
> shared implementation safe to reuse from SPL.
>
> This also makes the Android boot-image condition phase-aware. Since SPL
> has no SPL_ANDROID_BOOT_IMAGE option, the existing flash:zimage path
> remains available only in U-Boot proper.
>
> Signed-off-by: Julien Masson <jmasson@baylibre.com>
> Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 5/5] fastboot: add SPL support
  2026-09-06 20:02 ` [PATCH v5 5/5] fastboot: add " Carlo Caione
  2026-09-09 21:16   ` David Lechner
@ 2026-09-11 13:30   ` Mattijs Korpershoek
  1 sibling, 0 replies; 16+ messages in thread
From: Mattijs Korpershoek @ 2026-09-11 13:30 UTC (permalink / raw)
  To: Carlo Caione, u-boot, GSS_MTK_Uboot_upstream
  Cc: Suhrid Subramaniam, Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris, Tom Rini,
	Simon Glass, Sam Day, Quentin Schulz, Carlo Caione, David Lechner,
	Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut, Peng Fan,
	Jaehoon Chung, Neil Armstrong, Julien Masson, Alexey Charkov,
	Adrian Freihofer, Francois Berder, Ilias Apalodimas, Marek Vasut,
	Vincent Jardin, Peter Robinson

Hi Carlo,

Thank you for the patch.

On Sun, Sep 06, 2026 at 22:02, Carlo Caione <ccaione@baylibre.com> wrote:

> Some recovery and initial-provisioning flows run before usable firmware
> is available in persistent storage. In these flows the SoC ROM loads a
> small first stage, but that stage must still provide a standard protocol
> with which the host can provision the device.
>
> U-Boot already provides fastboot for this purpose, but its implementation
> is currently restricted to U-Boot proper and coupled to command-line
> support. This forces platforms that need provisioning from SPL to maintain
> a separate downloader or an out-of-tree fastboot implementation.
>
> Allow boards to run USB fastboot as a service directly from SPL. Include
> MMC partition flashing and Android sparse-image handling so that the SPL
> service can provision the same storage images accepted by fastboot in
> U-Boot proper.
>
> Keep the SPL interface deliberately narrower. The fastboot boot command
> is not supported because SPL is being used for provisioning rather than
> OS boot orchestration. Filesystem probing is also omitted, so partition
> types are reported as raw. Reboot support remains optional since reset
> and persistent reboot-reason handling are platform-specific.
>
> Environment-backed USB serial numbers, getvars, MMC aliases and raw
> partition descriptors are available when SPL_ENV_SUPPORT is enabled, but
> the core service no longer requires the environment. Document the full
> printf, allocator, reset, command and shared-buffer requirements.
>
> SPL size remains an important constraint. Make the support entirely
> opt-in and phase-specific: when CONFIG_SPL_FASTBOOT is disabled, no
> fastboot code or supporting library is added to SPL. Enable the core
> service in sandbox_spl so this build path receives CI compile coverage.
>
> Signed-off-by: Julien Masson <jmasson@baylibre.com>
> Signed-off-by: Vitor Sato Eschholz <vsatoes@baylibre.com>
> Signed-off-by: Carlo Caione <ccaione@baylibre.com>

Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>

> ---

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 1/5] fastboot: factor out the USB session runner
  2026-09-11 12:34   ` Mattijs Korpershoek
@ 2026-09-11 13:33     ` Carlo Caione
  2026-09-11 14:49       ` Mattijs Korpershoek
  0 siblings, 1 reply; 16+ messages in thread
From: Carlo Caione @ 2026-09-11 13:33 UTC (permalink / raw)
  To: Mattijs Korpershoek
  Cc: u-boot, GSS_MTK_Uboot_upstream, Suhrid Subramaniam,
	Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris, Tom Rini,
	Simon Glass, Sam Day, Quentin Schulz, David Lechner,
	Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut, Peng Fan,
	Jaehoon Chung, Neil Armstrong, Julien Masson, Alexey Charkov,
	Adrian Freihofer, Francois Berder, Ilias Apalodimas, Marek Vasut,
	Vincent Jardin, Peter Robinson

On Fri, Sep 11, 2026 at 14:34:47 +0100, Mattijs Korpershoek wrote:
> Hi Carlo,
> 
> Thank you for the patch.
> 
> compared with v3, v5 introduced some new changes which I don't
> understand.
> 
> Please see below.

Yeah, sorry about that. I received an off-list review so the changes are
probably result of fixing those comments.

[...]
> > --- /dev/null
> > +++ b/drivers/fastboot/fb_usb.c
> > @@ -0,0 +1,66 @@
> > +// SPDX-License-Identifier: GPL-2.0-or-later
> 
> Why is this GPL-2.0-or-later? In v3 it was GPL-2.0+ which is what's
> present in cmd/fastboot.c

There was a suggestion to move to GPL-2.0-or-later because GPL-2.0+ is
currently deprecated see https://spdx.org/licenses/GPL-2.0+.html

> > +/*
> > + * Copyright 2026 BayLibre SAS
> 
> This was also not present in v3 and does not seem an appropriate
> addition to me since we are just copying code around. Why should it have
> a new copyright?

Totally fair point, I'll remove this.

Thanks!

--
Carlo Caione

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH v5 1/5] fastboot: factor out the USB session runner
  2026-09-11 13:33     ` Carlo Caione
@ 2026-09-11 14:49       ` Mattijs Korpershoek
  0 siblings, 0 replies; 16+ messages in thread
From: Mattijs Korpershoek @ 2026-09-11 14:49 UTC (permalink / raw)
  To: Carlo Caione
  Cc: u-boot, GSS_MTK_Uboot_upstream, Suhrid Subramaniam,
	Macpaul Lin (林智斌),
	Pablo Sun (孫毓翔), Arnaud Ferraris, Tom Rini,
	Simon Glass, Sam Day, Quentin Schulz, David Lechner,
	Vitor Sato Eschholz, Lukasz Majewski, Marek Vasut, Peng Fan,
	Jaehoon Chung, Neil Armstrong, Julien Masson, Alexey Charkov,
	Adrian Freihofer, Francois Berder, Ilias Apalodimas, Marek Vasut,
	Vincent Jardin, Peter Robinson

On Fri, Sep 11, 2026 at 15:33, Carlo Caione <ccaione@baylibre.com> wrote:

> On Fri, Sep 11, 2026 at 14:34:47 +0100, Mattijs Korpershoek wrote:
>> Hi Carlo,
>> 
>> Thank you for the patch.
>> 
>> compared with v3, v5 introduced some new changes which I don't
>> understand.
>> 
>> Please see below.
>
> Yeah, sorry about that. I received an off-list review so the changes are
> probably result of fixing those comments.

When possible, can we please try to avoid off-list reviews (or do them before
sending things out publicly) ?
It makes following along various versions for series harder (at least to
me)

>
> [...]
>> > --- /dev/null
>> > +++ b/drivers/fastboot/fb_usb.c
>> > @@ -0,0 +1,66 @@
>> > +// SPDX-License-Identifier: GPL-2.0-or-later
>> 
>> Why is this GPL-2.0-or-later? In v3 it was GPL-2.0+ which is what's
>> present in cmd/fastboot.c
>
> There was a suggestion to move to GPL-2.0-or-later because GPL-2.0+ is
> currently deprecated see https://spdx.org/licenses/GPL-2.0+.html

Ah, I was not aware that GPL-2.0+ was deprecated. Thanks for letting me know.

I see it's still widely used in the U-Boot sources:

$ git grep --count GPL-2.0+ | wc -l
14298

$ git grep --count GPL-2.0-or-later | wc -l
2315

I agree that we should migrate to GPL-2.0-or-later but that's not in
scope for this series, in my opinion.
Therefore, can we please keep the (deprecated) GPL-2.0+ instead since we
are literally copying it over from cmd/fastboot.c ?

Thanks
Mattijs

>
>> > +/*
>> > + * Copyright 2026 BayLibre SAS
>> 
>> This was also not present in v3 and does not seem an appropriate
>> addition to me since we are just copying code around. Why should it have
>> a new copyright?
>
> Totally fair point, I'll remove this.
>
> Thanks!
>
> --
> Carlo Caione

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2026-09-11 14:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-06 20:01 [PATCH v5 0/5] Add fastboot to SPL Carlo Caione
2026-09-06 20:01 ` [PATCH v5 1/5] fastboot: factor out the USB session runner Carlo Caione
2026-09-09 20:31   ` David Lechner
2026-09-11 12:34   ` Mattijs Korpershoek
2026-09-11 13:33     ` Carlo Caione
2026-09-11 14:49       ` Mattijs Korpershoek
2026-09-06 20:02 ` [PATCH v5 2/5] fastboot: use the common handler for USB reboot Carlo Caione
2026-09-06 20:02 ` [PATCH v5 3/5] fastboot: make shared configuration checks phase-aware Carlo Caione
2026-09-11 12:38   ` Mattijs Korpershoek
2026-09-06 20:02 ` [PATCH v5 4/5] image: sparse: add phase-aware SPL support Carlo Caione
2026-09-06 20:02 ` [PATCH v5 5/5] fastboot: add " Carlo Caione
2026-09-09 21:16   ` David Lechner
2026-09-09 21:23     ` Carlo Caione
2026-09-09 21:57       ` David Lechner
2026-09-11 12:26         ` Mattijs Korpershoek
2026-09-11 13:30   ` Mattijs Korpershoek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.