drivers: fastboot: Add support for SPI flash memory

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@collabora.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
This commit is contained in:
Ariel D'Alessandro
2025-07-17 10:58:54 -03:00
committed by Tom Rini
parent babae80169
commit afca60620a
7 changed files with 326 additions and 4 deletions

View File

@@ -32,7 +32,7 @@ The following OEM commands are supported (if enabled):
- ``oem console`` - this dumps U-Boot console record buffer
- ``oem board`` - this executes a custom board function which is defined by the vendor
Support for both eMMC and NAND devices is included.
Support for eMMC, NAND and SPI flash memory devices is included.
Client installation
-------------------
@@ -97,8 +97,9 @@ Raw partition descriptors
^^^^^^^^^^^^^^^^^^^^^^^^^
In cases where no partition table is present, a raw partition descriptor can be
defined, specifying the offset, size, and optionally the MMC hardware partition
number for a given partition name.
defined, specifying the memory offset and size.
Currently, this support is available only for eMMC and SPI flash memory devices.
This is useful when using fastboot to flash files (e.g. SPL or U-Boot) to a
specific offset in the eMMC boot partition, without having to update the entire
@@ -106,6 +107,15 @@ boot partition.
To define a raw partition descriptor, add an environment variable similar to::
fastboot_raw_partition_<raw partition name>=<offset> <size>
for example::
fastboot_raw_partition_boot=0x100 0x1f00
Optionally, in the eMMC case, the hardware partition number can also be
specified for a given partition name::
fastboot_raw_partition_<raw partition name>=<offset> <size> [mmcpart <num>]
for example::