This serie permits using any block device as target for fastboot by moving the generic block logic into a common set of helpers and also use them as generic backend.
The erase logic has been extended to support software erase since only 2 block drivers exposes the erase operation. Tests are welcome to make sure this series doesn't introduce any regressions on the emmc backend. Signed-off-by: Neil Armstrong <neil.armstr...@linaro.org> --- Changes in v3: - Move Kconfig/Makefile changes over the 2 patches - Relicence to GPL2 with Dmitrii approval - Move soft erase in a separate function - Update help text of Kconfig BLOCK entries - Add warning at init if MMC was selected with BLOCK backend - Link to v2: https://lore.kernel.org/r/20250409-topic-fastboot-blk-v2-0-c676f21d4...@linaro.org Changes in v2: - Dropped applied virtio erase patch - Reorganize patches, introducing helpers first, using them in mmc afterwards - Added soft-erase logic - Added move helpers to handle the partitions erase & flash from emmc - Fixed const var on last patch - Link to v1: https://lore.kernel.org/all/20240306185921.1854109-1-dimori...@google.com/ --- Dmitrii Merkurev (3): fastboot: blk: introduce fastboot block flashing support fastboot: blk: switch emmc to use the block helpers fastboot: integrate block flashing back-end drivers/fastboot/Kconfig | 28 +++- drivers/fastboot/Makefile | 4 +- drivers/fastboot/fb_block.c | 323 ++++++++++++++++++++++++++++++++++++++++++ drivers/fastboot/fb_command.c | 8 ++ drivers/fastboot/fb_common.c | 22 ++- drivers/fastboot/fb_getvar.c | 8 +- drivers/fastboot/fb_mmc.c | 210 ++------------------------- include/fb_block.h | 105 ++++++++++++++ 8 files changed, 502 insertions(+), 206 deletions(-) --- base-commit: 4d3b5c679bc9d5c6cbbeedcc1e4a186f1cc35541 change-id: 20250408-topic-fastboot-blk-c5e14cd59224 Best regards, -- Neil Armstrong <neil.armstr...@linaro.org>