From 769c6cbbb53074025c3af53d8df5571ae18d74c3 Mon Sep 17 00:00:00 2001 From: Dmitrii Merkurev Date: Fri, 21 Nov 2025 11:53:33 +0100 Subject: fastboot: integrate block flashing back-end 1. Get partition info/size 2. Erase partition 3. Flash partition 4. BCB Make FASTBOOT_FLASH also depend on BLK, but make sure it doesn't affect SUNXI and ROCKCHIP platforms since they default to y already. Make it only default on SUNXI when MMC or NAND is enabled, so it doesn't break the CHIP & Nintendo boards, and for ROCKCHIP when MMC is enabled. Signed-off-by: Dmitrii Merkurev Reviewed-by: Mattijs Korpershoek Tested-by: Mattijs Korpershoek Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20251121-topic-fastboot-blk-v7-3-9589d902fc91@linaro.org Signed-off-by: Mattijs Korpershoek --- drivers/fastboot/fb_command.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'drivers/fastboot/fb_command.c') diff --git a/drivers/fastboot/fb_command.c b/drivers/fastboot/fb_command.c index 791088bc094..18d86988f4c 100644 --- a/drivers/fastboot/fb_command.c +++ b/drivers/fastboot/fb_command.c @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -338,6 +339,10 @@ void fastboot_data_complete(char *response) */ static void __maybe_unused flash(char *cmd_parameter, char *response) { + if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_BLOCK)) + fastboot_block_flash_write(cmd_parameter, fastboot_buf_addr, + image_size, response); + if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC)) fastboot_mmc_flash_write(cmd_parameter, fastboot_buf_addr, image_size, response); @@ -362,6 +367,9 @@ 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)) + fastboot_block_erase(cmd_parameter, response); + if (IS_ENABLED(CONFIG_FASTBOOT_FLASH_MMC)) fastboot_mmc_erase(cmd_parameter, response); -- cgit v1.2.3