diff options
author | Ariel D'Alessandro <ariel.dalessandro@collabora.com> | 2025-07-17 10:58:54 -0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-07-22 11:30:14 -0600 |
commit | afca60620ad7958fbee2d5518de0383483c82ced (patch) | |
tree | d850b74628c179b84c7f4b2e01aa12bd3a1f28dc /drivers/fastboot/fb_command.c | |
parent | babae80169dd4c9ea94f27e3c6f0f4e004f8e71a (diff) |
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>
Diffstat (limited to 'drivers/fastboot/fb_command.c')
-rw-r--r-- | drivers/fastboot/fb_command.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c index 2cdbac50ac4..7697139b622 100644 --- a/drivers/fastboot/fb_command.c +++ b/drivers/fastboot/fb_command.c @@ -10,6 +10,7 @@ #include <fastboot-internal.h> #include <fb_mmc.h> #include <fb_nand.h> +#include <fb_spi_flash.h> #include <part.h> #include <stdlib.h> #include <vsprintf.h> @@ -344,6 +345,10 @@ static void __maybe_unused flash(char *cmd_parameter, char *response) if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_NAND)) fastboot_nand_flash_write(cmd_parameter, fastboot_buf_addr, image_size, response); + + if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_SPI)) + fastboot_spi_flash_write(cmd_parameter, fastboot_buf_addr, + image_size, response); } /** @@ -362,6 +367,9 @@ static void __maybe_unused erase(char *cmd_parameter, char *response) if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_NAND)) fastboot_nand_erase(cmd_parameter, response); + + if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_SPI)) + fastboot_spi_flash_erase(cmd_parameter, response); } /** |