summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorXingyu Wu <xingyu.wu@starfivetech.com>2023-09-06 12:01:51 +0300
committerXingyu Wu <xingyu.wu@starfivetech.com>2023-09-07 04:34:13 +0300
commit706fab8ccb290393c721c1f7e4e26bc0fa9e8d57 (patch)
tree4e50ff45e9fc99725296828de2d89af23b355b65 /drivers
parent92543ed1f3dc9ec0f70767115170719e93f2833f (diff)
downloadu-boot-706fab8ccb290393c721c1f7e4e26bc0fa9e8d57.tar.xz
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 <xingyu.wu@starfivetech.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/fastboot/Kconfig3
-rw-r--r--drivers/fastboot/fb_mmc.c4
2 files changed, 7 insertions, 0 deletions
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 <linux/compat.h>
#include <android_image.h>
+#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"