From 706fab8ccb290393c721c1f7e4e26bc0fa9e8d57 Mon Sep 17 00:00:00 2001 From: Xingyu Wu Date: Wed, 6 Sep 2023 17:01:51 +0800 Subject: drivers: fastboot: Fix the error of writing sparse file with fastboot Add config for max block size to write in MMC with sparse file. Signed-off-by: Xingyu Wu --- configs/starfive_evb_defconfig | 11 +++++++++++ drivers/fastboot/Kconfig | 3 +++ drivers/fastboot/fb_mmc.c | 4 ++++ 3 files changed, 18 insertions(+) diff --git a/configs/starfive_evb_defconfig b/configs/starfive_evb_defconfig index 1e879dabb3..fa4ce76af3 100644 --- a/configs/starfive_evb_defconfig +++ b/configs/starfive_evb_defconfig @@ -72,6 +72,17 @@ CONFIG_SPL_CLK_COMPOSITE_CCF=y CONFIG_CLK_CCF=y CONFIG_CLK_COMPOSITE_CCF=y CONFIG_SPL_CLK_JH7110=y +CONFIG_USB_FUNCTION_FASTBOOT=y +CONFIG_FASTBOOT_BUF_ADDR=0x60000000 +CONFIG_FASTBOOT_BUF_SIZE=0x80000000 +CONFIG_FASTBOOT_USB_DEV=1 +CONFIG_FASTBOOT_FLASH=y +CONFIG_FASTBOOT_UUU_SUPPORT=y +CONFIG_FASTBOOT_FLASH_MMC_DEV=0 +CONFIG_FASTBOOT_MMC_BOOT_SUPPORT=y +CONFIG_FASTBOOT_MMC_USER_SUPPORT=y +CONFIG_FASTBOOT_CMD_OEM_FORMAT=y +CONFIG_FASTBOOT_STARFIVE_MAX_BLK_WRITE=8192 CONFIG_SYS_I2C_DW=y CONFIG_MMC_HS200_SUPPORT=y CONFIG_SPL_MMC_HS200_SUPPORT=y diff --git a/drivers/fastboot/Kconfig b/drivers/fastboot/Kconfig index 2d1836a80e..eb4bad24f5 100644 --- a/drivers/fastboot/Kconfig +++ b/drivers/fastboot/Kconfig @@ -212,6 +212,9 @@ config FASTBOOT_CMD_OEM_BOOTBUS Add support for the "oem bootbus" command from a client. This set the mmc boot configuration for the selecting eMMC device. +config FASTBOOT_STARFIVE_MAX_BLK_WRITE + int "The max size of block writing with sparse file on StarFive JH7110 SoC" + endif # FASTBOOT endmenu diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c index d645ab4d86..ef51a5ed67 100644 --- a/drivers/fastboot/fb_mmc.c +++ b/drivers/fastboot/fb_mmc.c @@ -20,7 +20,11 @@ #include #include +#ifdef CONFIG_FASTBOOT_STARFIVE_MAX_BLK_WRITE +#define FASTBOOT_MAX_BLK_WRITE CONFIG_FASTBOOT_STARFIVE_MAX_BLK_WRITE /* = 8192 */ +#else #define FASTBOOT_MAX_BLK_WRITE 16384 +#endif #define BOOT_PARTITION_NAME "boot" -- cgit v1.2.3