[PATCH] drivers: fastboot: Add support for SPI flash memory

Tom Rini trini at konsulko.com
Tue Jul 15 19:50:25 CEST 2025


On Tue, Jul 15, 2025 at 02:23:11PM -0300, Ariel D'Alessandro wrote:

> Fastboot currently supports MMC and NAND flash devices. Similarly,
> extend the support to SPI flash memories.
> 
> Note that in this initial implementation, partitions on the device are
> not supported yet, but raw partitions can be set in u-boot environment.
> 
> To define a raw partition descriptor, add an environment variable
> similar to the MMC case:
> 
> ```
> fastboot_raw_partition_<raw partition name>=<offset> <size>
> ```
> 
> for example:
> 
> ```
> fastboot_raw_partition_boot=0x0 0x1000000
> ```
> 
> Signed-off-by: Ariel D'Alessandro <ariel.dalessandro at collabora.com>
> ---
>  drivers/fastboot/Kconfig        |   7 +-
>  drivers/fastboot/Makefile       |   1 +
>  drivers/fastboot/fb_command.c   |   8 +
>  drivers/fastboot/fb_getvar.c    |   6 +
>  drivers/fastboot/fb_spi_flash.c | 266 ++++++++++++++++++++++++++++++++
>  include/fb_spi_flash.h          |  40 +++++
>  6 files changed, 327 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/fastboot/fb_spi_flash.c
>  create mode 100644 include/fb_spi_flash.h
> 
> diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig
> index 70207573de2..0cf955ef53d 100644
> --- a/drivers/fastboot/Kconfig
> +++ b/drivers/fastboot/Kconfig
> @@ -91,7 +91,8 @@ config FASTBOOT_USB_DEV
>  config FASTBOOT_FLASH
>  	bool "Enable FASTBOOT FLASH command"
>  	default y if ARCH_SUNXI || ARCH_ROCKCHIP
> -	depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS)
> +	depends on MMC || (MTD_RAW_NAND && CMD_MTDPARTS) || \
> +			(SPI_FLASH || DM_SPI_FLASH)

Why do we need to support the non-DM_SPI_FLASH case? It's legacy and we
shouldn't add new features for it.

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250715/1411e862/attachment.sig>


More information about the U-Boot mailing list