diff mbox series

[v2] usb: dfu: Migrate CONFIG_SYS_DFU_DATA_BUF_SIZE and CONFIG_SYS_DFU_MAX_FILE_SIZE to Kconfig

Message ID 20210226071849.29070-1-a-govindraju@ti.com
State New
Delegated to: Lukasz Majewski
Headers show
Series [v2] usb: dfu: Migrate CONFIG_SYS_DFU_DATA_BUF_SIZE and CONFIG_SYS_DFU_MAX_FILE_SIZE to Kconfig | expand

Commit Message

Aswath Govindraju Feb. 26, 2021, 7:18 a.m. UTC
Currently the config options CONFIG_SYS_DFU_DATA_BUF_SIZE and
CONFIG_SYS_DFU_MAX_FILE_SIZE are being set in include/configs/<board>.h
files and also in <board_name>_defconfig files without a Kconfig option. It
is easier for users to set these configs in defconfig files than in config
header files as they are a part of the source code.

Add Kconfig symbols, and update the defconfigs by using tools/moveconfig.py
script.

Suggested-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>
---

Changes since v1:
- Removed CONFIG_SYS_DFU_MAX_FILE_SIZE in defconfig files, where it was
  not defined previously. The list of files in which this change is made
  are listed below,
  configs/colibri-imx6ull_defconfig
  configs/colibri_vf_defconfig
  configs/corvus_defconfig
  configs/dh_imx6_defconfig
  configs/draco_defconfig
  configs/etamin_defconfig 
  configs/odroid-xu3_defconfig
  configs/odroid_defconfig
  configs/origen_defconfig
  configs/pico-dwarf-imx6ul_defconfig
  configs/pico-hobbit-imx6ul_defconfig
  configs/pico-imx6_defconfig
  configs/pico-imx6ul_defconfig
  configs/pico-pi-imx6ul_defconfig
  configs/pxm2_defconfig
  configs/rastaban_defconfig 
  configs/rut_defconfig
  configs/s5p_goni_defconfig
  configs/s5pc210_universal_defconfig
  configs/smartweb_defconfig  
  configs/socfpga_arria5_defconfig
  configs/socfpga_cyclone5_defconfig
  configs/socfpga_dbm_soc1_defconfig
  configs/socfpga_de0_nano_soc_defconfig
  configs/socfpga_de10_nano_defconfig 
  configs/socfpga_mcvevk_defconfig
  configs/socfpga_sockit_defconfig
  configs/socfpga_socrates_defconfig
  configs/socfpga_vining_fpga_defconfig
  configs/taurus_defconfig
  configs/thuban_defconfig
  configs/topic_miami_defconfig
  configs/topic_miamilite_defconfig
  configs/topic_miamiplus_defconfig 
  configs/trats2_defconfig 
  configs/trats_defconfig
  configs/warp7_bl33_defconfig
  configs/warp7_defconfig
  configs/warp_defconfig
  configs/xilinx_versal_virt_defconfig
  configs/xilinx_zynq_virt_defconfig
  configs/xilinx_zynqmp_virt_defconfig

Link to v1,
https://patchwork.ozlabs.org/project/uboot/patch/20210223061427.20742-1-a-govindraju@ti.com/ 

 configs/am65x_evm_a53_defconfig           |  2 ++
 configs/am65x_evm_r5_usbdfu_defconfig     |  2 ++
 configs/am65x_hs_evm_a53_defconfig        |  2 ++
 configs/beaver_defconfig                  |  2 ++
 configs/cei-tk1-som_defconfig             |  2 ++
 configs/colibri-imx6ull_defconfig         |  1 +
 configs/colibri_vf_defconfig              |  1 +
 configs/corvus_defconfig                  |  1 +
 configs/dalmore_defconfig                 |  2 ++
 configs/dh_imx6_defconfig                 |  1 +
 configs/draco_defconfig                   |  1 +
 configs/e2220-1170_defconfig              |  2 ++
 configs/etamin_defconfig                  |  1 +
 configs/jetson-tk1_defconfig              |  2 ++
 configs/nyan-big_defconfig                |  2 ++
 configs/odroid-xu3_defconfig              |  1 +
 configs/odroid_defconfig                  |  1 +
 configs/origen_defconfig                  |  1 +
 configs/p2371-0000_defconfig              |  2 ++
 configs/p2371-2180_defconfig              |  2 ++
 configs/p2571_defconfig                   |  2 ++
 configs/p3450-0000_defconfig              |  2 ++
 configs/pico-dwarf-imx6ul_defconfig       |  1 +
 configs/pico-hobbit-imx6ul_defconfig      |  1 +
 configs/pico-imx6_defconfig               |  1 +
 configs/pico-imx6ul_defconfig             |  1 +
 configs/pico-pi-imx6ul_defconfig          |  1 +
 configs/pxm2_defconfig                    |  1 +
 configs/rastaban_defconfig                |  1 +
 configs/rpi_4_32b_defconfig               |  2 ++
 configs/rpi_4_defconfig                   |  2 ++
 configs/rut_defconfig                     |  1 +
 configs/s5p_goni_defconfig                |  1 +
 configs/s5pc210_universal_defconfig       |  1 +
 configs/smartweb_defconfig                |  1 +
 configs/socfpga_arria5_defconfig          |  1 +
 configs/socfpga_cyclone5_defconfig        |  1 +
 configs/socfpga_dbm_soc1_defconfig        |  1 +
 configs/socfpga_de0_nano_soc_defconfig    |  1 +
 configs/socfpga_de10_nano_defconfig       |  1 +
 configs/socfpga_mcvevk_defconfig          |  1 +
 configs/socfpga_sockit_defconfig          |  1 +
 configs/socfpga_socrates_defconfig        |  1 +
 configs/socfpga_vining_fpga_defconfig     |  1 +
 configs/taurus_defconfig                  |  1 +
 configs/thuban_defconfig                  |  1 +
 configs/topic_miami_defconfig             |  1 +
 configs/topic_miamilite_defconfig         |  1 +
 configs/topic_miamiplus_defconfig         |  1 +
 configs/trats2_defconfig                  |  1 +
 configs/trats_defconfig                   |  1 +
 configs/venice2_defconfig                 |  2 ++
 configs/warp7_bl33_defconfig              |  1 +
 configs/warp7_defconfig                   |  1 +
 configs/warp_defconfig                    |  1 +
 configs/xilinx_versal_virt_defconfig      |  1 +
 configs/xilinx_zynq_virt_defconfig        |  1 +
 configs/xilinx_zynqmp_virt_defconfig      |  1 +
 drivers/dfu/Kconfig                       | 20 ++++++++++++++++++++
 include/configs/am65x_evm.h               |  8 --------
 include/configs/colibri-imx6ull.h         |  1 -
 include/configs/colibri_vf.h              |  1 -
 include/configs/corvus.h                  |  1 -
 include/configs/dh_imx6.h                 |  1 -
 include/configs/exynos4-common.h          |  1 -
 include/configs/odroid_xu3.h              |  1 -
 include/configs/pico-imx6.h               |  1 -
 include/configs/pico-imx6ul.h             |  1 -
 include/configs/rpi.h                     |  3 ---
 include/configs/s5p_goni.h                |  1 -
 include/configs/siemens-am33x-common.h    |  1 -
 include/configs/smartweb.h                |  1 -
 include/configs/socfpga_common.h          |  1 -
 include/configs/taurus.h                  |  1 -
 include/configs/tegra-common-usb-gadget.h |  2 --
 include/configs/warp.h                    |  1 -
 include/configs/warp7.h                   |  1 -
 include/configs/xilinx_versal.h           |  1 -
 include/configs/xilinx_zynqmp.h           |  1 -
 include/configs/zynq-common.h             |  1 -
 include/dfu.h                             |  6 ------
 scripts/config_whitelist.txt              |  2 --
 82 files changed, 94 insertions(+), 39 deletions(-)

Comments

Oleksandr Suvorov Feb. 26, 2021, 4:37 p.m. UTC | #1
Hi Aswath,

On Fri, Feb 26, 2021 at 3:44 PM Aswath Govindraju <a-govindraju@ti.com> wrote:
>
> Currently the config options CONFIG_SYS_DFU_DATA_BUF_SIZE and
> CONFIG_SYS_DFU_MAX_FILE_SIZE are being set in include/configs/<board>.h
> files and also in <board_name>_defconfig files without a Kconfig option. It
> is easier for users to set these configs in defconfig files than in config
> header files as they are a part of the source code.
>
> Add Kconfig symbols, and update the defconfigs by using tools/moveconfig.py
> script.
>
> Suggested-by: Pratyush Yadav <p.yadav@ti.com>
> Signed-off-by: Aswath Govindraju <a-govindraju@ti.com>

For colibri-imx6ull and colibri_vf
Reviewed-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>
And for the rest
Acked-by: Oleksandr Suvorov <oleksandr.suvorov@toradex.com>


> ---
>
> Changes since v1:
> - Removed CONFIG_SYS_DFU_MAX_FILE_SIZE in defconfig files, where it was
>   not defined previously. The list of files in which this change is made
>   are listed below,
>   configs/colibri-imx6ull_defconfig
>   configs/colibri_vf_defconfig
>   configs/corvus_defconfig
>   configs/dh_imx6_defconfig
>   configs/draco_defconfig
>   configs/etamin_defconfig
>   configs/odroid-xu3_defconfig
>   configs/odroid_defconfig
>   configs/origen_defconfig
>   configs/pico-dwarf-imx6ul_defconfig
>   configs/pico-hobbit-imx6ul_defconfig
>   configs/pico-imx6_defconfig
>   configs/pico-imx6ul_defconfig
>   configs/pico-pi-imx6ul_defconfig
>   configs/pxm2_defconfig
>   configs/rastaban_defconfig
>   configs/rut_defconfig
>   configs/s5p_goni_defconfig
>   configs/s5pc210_universal_defconfig
>   configs/smartweb_defconfig
>   configs/socfpga_arria5_defconfig
>   configs/socfpga_cyclone5_defconfig
>   configs/socfpga_dbm_soc1_defconfig
>   configs/socfpga_de0_nano_soc_defconfig
>   configs/socfpga_de10_nano_defconfig
>   configs/socfpga_mcvevk_defconfig
>   configs/socfpga_sockit_defconfig
>   configs/socfpga_socrates_defconfig
>   configs/socfpga_vining_fpga_defconfig
>   configs/taurus_defconfig
>   configs/thuban_defconfig
>   configs/topic_miami_defconfig
>   configs/topic_miamilite_defconfig
>   configs/topic_miamiplus_defconfig
>   configs/trats2_defconfig
>   configs/trats_defconfig
>   configs/warp7_bl33_defconfig
>   configs/warp7_defconfig
>   configs/warp_defconfig
>   configs/xilinx_versal_virt_defconfig
>   configs/xilinx_zynq_virt_defconfig
>   configs/xilinx_zynqmp_virt_defconfig
>
> Link to v1,
> https://patchwork.ozlabs.org/project/uboot/patch/20210223061427.20742-1-a-govindraju@ti.com/
>
>  configs/am65x_evm_a53_defconfig           |  2 ++
>  configs/am65x_evm_r5_usbdfu_defconfig     |  2 ++
>  configs/am65x_hs_evm_a53_defconfig        |  2 ++
>  configs/beaver_defconfig                  |  2 ++
>  configs/cei-tk1-som_defconfig             |  2 ++
>  configs/colibri-imx6ull_defconfig         |  1 +
>  configs/colibri_vf_defconfig              |  1 +
>  configs/corvus_defconfig                  |  1 +
>  configs/dalmore_defconfig                 |  2 ++
>  configs/dh_imx6_defconfig                 |  1 +
>  configs/draco_defconfig                   |  1 +
>  configs/e2220-1170_defconfig              |  2 ++
>  configs/etamin_defconfig                  |  1 +
>  configs/jetson-tk1_defconfig              |  2 ++
>  configs/nyan-big_defconfig                |  2 ++
>  configs/odroid-xu3_defconfig              |  1 +
>  configs/odroid_defconfig                  |  1 +
>  configs/origen_defconfig                  |  1 +
>  configs/p2371-0000_defconfig              |  2 ++
>  configs/p2371-2180_defconfig              |  2 ++
>  configs/p2571_defconfig                   |  2 ++
>  configs/p3450-0000_defconfig              |  2 ++
>  configs/pico-dwarf-imx6ul_defconfig       |  1 +
>  configs/pico-hobbit-imx6ul_defconfig      |  1 +
>  configs/pico-imx6_defconfig               |  1 +
>  configs/pico-imx6ul_defconfig             |  1 +
>  configs/pico-pi-imx6ul_defconfig          |  1 +
>  configs/pxm2_defconfig                    |  1 +
>  configs/rastaban_defconfig                |  1 +
>  configs/rpi_4_32b_defconfig               |  2 ++
>  configs/rpi_4_defconfig                   |  2 ++
>  configs/rut_defconfig                     |  1 +
>  configs/s5p_goni_defconfig                |  1 +
>  configs/s5pc210_universal_defconfig       |  1 +
>  configs/smartweb_defconfig                |  1 +
>  configs/socfpga_arria5_defconfig          |  1 +
>  configs/socfpga_cyclone5_defconfig        |  1 +
>  configs/socfpga_dbm_soc1_defconfig        |  1 +
>  configs/socfpga_de0_nano_soc_defconfig    |  1 +
>  configs/socfpga_de10_nano_defconfig       |  1 +
>  configs/socfpga_mcvevk_defconfig          |  1 +
>  configs/socfpga_sockit_defconfig          |  1 +
>  configs/socfpga_socrates_defconfig        |  1 +
>  configs/socfpga_vining_fpga_defconfig     |  1 +
>  configs/taurus_defconfig                  |  1 +
>  configs/thuban_defconfig                  |  1 +
>  configs/topic_miami_defconfig             |  1 +
>  configs/topic_miamilite_defconfig         |  1 +
>  configs/topic_miamiplus_defconfig         |  1 +
>  configs/trats2_defconfig                  |  1 +
>  configs/trats_defconfig                   |  1 +
>  configs/venice2_defconfig                 |  2 ++
>  configs/warp7_bl33_defconfig              |  1 +
>  configs/warp7_defconfig                   |  1 +
>  configs/warp_defconfig                    |  1 +
>  configs/xilinx_versal_virt_defconfig      |  1 +
>  configs/xilinx_zynq_virt_defconfig        |  1 +
>  configs/xilinx_zynqmp_virt_defconfig      |  1 +
>  drivers/dfu/Kconfig                       | 20 ++++++++++++++++++++
>  include/configs/am65x_evm.h               |  8 --------
>  include/configs/colibri-imx6ull.h         |  1 -
>  include/configs/colibri_vf.h              |  1 -
>  include/configs/corvus.h                  |  1 -
>  include/configs/dh_imx6.h                 |  1 -
>  include/configs/exynos4-common.h          |  1 -
>  include/configs/odroid_xu3.h              |  1 -
>  include/configs/pico-imx6.h               |  1 -
>  include/configs/pico-imx6ul.h             |  1 -
>  include/configs/rpi.h                     |  3 ---
>  include/configs/s5p_goni.h                |  1 -
>  include/configs/siemens-am33x-common.h    |  1 -
>  include/configs/smartweb.h                |  1 -
>  include/configs/socfpga_common.h          |  1 -
>  include/configs/taurus.h                  |  1 -
>  include/configs/tegra-common-usb-gadget.h |  2 --
>  include/configs/warp.h                    |  1 -
>  include/configs/warp7.h                   |  1 -
>  include/configs/xilinx_versal.h           |  1 -
>  include/configs/xilinx_zynqmp.h           |  1 -
>  include/configs/zynq-common.h             |  1 -
>  include/dfu.h                             |  6 ------
>  scripts/config_whitelist.txt              |  2 --
>  82 files changed, 94 insertions(+), 39 deletions(-)
>
> diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig
> index 0b5a27f7cfbb..0ffc1907c1fd 100644
> --- a/configs/am65x_evm_a53_defconfig
> +++ b/configs/am65x_evm_a53_defconfig
> @@ -90,6 +90,8 @@ CONFIG_CLK_TI_SCI=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x20000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
>  CONFIG_DMA_CHANNELS=y
>  CONFIG_TI_K3_NAVSS_UDMA=y
>  CONFIG_TI_SCI_PROTOCOL=y
> diff --git a/configs/am65x_evm_r5_usbdfu_defconfig b/configs/am65x_evm_r5_usbdfu_defconfig
> index 161634222517..b45a6d242955 100644
> --- a/configs/am65x_evm_r5_usbdfu_defconfig
> +++ b/configs/am65x_evm_r5_usbdfu_defconfig
> @@ -65,6 +65,8 @@ CONFIG_BLK=y
>  CONFIG_CLK=y
>  CONFIG_SPL_CLK=y
>  CONFIG_CLK_TI_SCI=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
>  CONFIG_TI_SCI_PROTOCOL=y
>  CONFIG_DA8XX_GPIO=y
>  CONFIG_DM_I2C=y
> diff --git a/configs/am65x_hs_evm_a53_defconfig b/configs/am65x_hs_evm_a53_defconfig
> index 7d467c167e9d..e43280f528bd 100644
> --- a/configs/am65x_hs_evm_a53_defconfig
> +++ b/configs/am65x_hs_evm_a53_defconfig
> @@ -85,6 +85,8 @@ CONFIG_CLK_TI_SCI=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x20000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
>  CONFIG_DMA_CHANNELS=y
>  CONFIG_TI_K3_NAVSS_UDMA=y
>  CONFIG_TI_SCI_PROTOCOL=y
> diff --git a/configs/beaver_defconfig b/configs/beaver_defconfig
> index 4c892443b970..cf18feef407b 100644
> --- a/configs/beaver_defconfig
> +++ b/configs/beaver_defconfig
> @@ -34,6 +34,8 @@ CONFIG_SPL_DM=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/cei-tk1-som_defconfig b/configs/cei-tk1-som_defconfig
> index 987e3ac8e95f..c1ff9d7f1428 100644
> --- a/configs/cei-tk1-som_defconfig
> +++ b/configs/cei-tk1-som_defconfig
> @@ -34,6 +34,8 @@ CONFIG_SPL_DM=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/colibri-imx6ull_defconfig b/configs/colibri-imx6ull_defconfig
> index 5e18f66d71bd..72552c413ca4 100644
> --- a/configs/colibri-imx6ull_defconfig
> +++ b/configs/colibri-imx6ull_defconfig
> @@ -62,6 +62,7 @@ CONFIG_BOUNCE_BUFFER=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_MXC=y
>  CONFIG_DM_MMC=y
> diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
> index abac672cf2e7..a522e3f3cb92 100644
> --- a/configs/colibri_vf_defconfig
> +++ b/configs/colibri_vf_defconfig
> @@ -62,6 +62,7 @@ CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_DM=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_VYBRID_GPIO=y
>  CONFIG_DM_MMC=y
>  # CONFIG_MMC_HW_PARTITIONING is not set
> diff --git a/configs/corvus_defconfig b/configs/corvus_defconfig
> index 491f5630822e..8206c4cdc98f 100644
> --- a/configs/corvus_defconfig
> +++ b/configs/corvus_defconfig
> @@ -51,6 +51,7 @@ CONFIG_BLK=y
>  CONFIG_CLK=y
>  CONFIG_CLK_AT91=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_AT91_GPIO=y
>  # CONFIG_MMC is not set
>  CONFIG_MTD=y
> diff --git a/configs/dalmore_defconfig b/configs/dalmore_defconfig
> index f2c1e849787e..fc152121225d 100644
> --- a/configs/dalmore_defconfig
> +++ b/configs/dalmore_defconfig
> @@ -33,6 +33,8 @@ CONFIG_SPL_DM=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
> index 7bb6ce168aea..2f174754670d 100644
> --- a/configs/dh_imx6_defconfig
> +++ b/configs/dh_imx6_defconfig
> @@ -65,6 +65,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DWC_AHSATA=y
>  CONFIG_BOOTCOUNT_LIMIT=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_MXC=y
>  CONFIG_MISC=y
> diff --git a/configs/draco_defconfig b/configs/draco_defconfig
> index fb41d55feb01..ab7f6ddb5979 100644
> --- a/configs/draco_defconfig
> +++ b/configs/draco_defconfig
> @@ -75,6 +75,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
>  CONFIG_MTD_RAW_NAND=y
> diff --git a/configs/e2220-1170_defconfig b/configs/e2220-1170_defconfig
> index efe3f8b5746f..a9ca7f102d77 100644
> --- a/configs/e2220-1170_defconfig
> +++ b/configs/e2220-1170_defconfig
> @@ -28,6 +28,8 @@ CONFIG_SYS_MMC_ENV_PART=2
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig
> index 2849c606260c..53d853321c08 100644
> --- a/configs/etamin_defconfig
> +++ b/configs/etamin_defconfig
> @@ -76,6 +76,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
>  CONFIG_MTD_RAW_NAND=y
> diff --git a/configs/jetson-tk1_defconfig b/configs/jetson-tk1_defconfig
> index 74d315d14359..0e7216621646 100644
> --- a/configs/jetson-tk1_defconfig
> +++ b/configs/jetson-tk1_defconfig
> @@ -34,6 +34,8 @@ CONFIG_SPL_DM=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
> index 3a47c5a0d01f..349f918727b7 100644
> --- a/configs/nyan-big_defconfig
> +++ b/configs/nyan-big_defconfig
> @@ -51,6 +51,8 @@ CONFIG_SPL_DM=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_CROS_EC_KEYB=y
>  CONFIG_CROS_EC=y
> diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig
> index 755a2ca9add9..bc71b45c0fb7 100644
> --- a/configs/odroid-xu3_defconfig
> +++ b/configs/odroid-xu3_defconfig
> @@ -41,6 +41,7 @@ CONFIG_ADC=y
>  CONFIG_ADC_EXYNOS=y
>  CONFIG_DFU_MMC=y
>  CONFIG_SET_DFU_ALT_INFO=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_MMC_DW=y
>  CONFIG_MTD=y
> diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig
> index 9f2b0b205d56..36719d91f66f 100644
> --- a/configs/odroid_defconfig
> +++ b/configs/odroid_defconfig
> @@ -42,6 +42,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DFU_MMC=y
>  CONFIG_SET_DFU_ALT_INFO=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/origen_defconfig b/configs/origen_defconfig
> index 4c4dc1a0db64..650276e379e3 100644
> --- a/configs/origen_defconfig
> +++ b/configs/origen_defconfig
> @@ -31,6 +31,7 @@ CONFIG_OF_CONTROL=y
>  CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_SDMA=y
> diff --git a/configs/p2371-0000_defconfig b/configs/p2371-0000_defconfig
> index 16f6b68e57f2..8fae527adfde 100644
> --- a/configs/p2371-0000_defconfig
> +++ b/configs/p2371-0000_defconfig
> @@ -29,6 +29,8 @@ CONFIG_SYS_MMC_ENV_PART=2
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig
> index c7f4404bbacb..af490891e2bc 100644
> --- a/configs/p2371-2180_defconfig
> +++ b/configs/p2371-2180_defconfig
> @@ -32,6 +32,8 @@ CONFIG_SYS_MMC_ENV_PART=2
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/p2571_defconfig b/configs/p2571_defconfig
> index 973034096743..68bfb8f28cdd 100644
> --- a/configs/p2571_defconfig
> +++ b/configs/p2571_defconfig
> @@ -29,6 +29,8 @@ CONFIG_SYS_MMC_ENV_PART=2
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/p3450-0000_defconfig b/configs/p3450-0000_defconfig
> index 6e6a8133b4d4..12c3f9bb28e7 100644
> --- a/configs/p3450-0000_defconfig
> +++ b/configs/p3450-0000_defconfig
> @@ -33,6 +33,8 @@ CONFIG_ENV_IS_IN_SPI_FLASH=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/pico-dwarf-imx6ul_defconfig b/configs/pico-dwarf-imx6ul_defconfig
> index de0984755090..a4207bd2cc19 100644
> --- a/configs/pico-dwarf-imx6ul_defconfig
> +++ b/configs/pico-dwarf-imx6ul_defconfig
> @@ -43,6 +43,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_BUF_SIZE=0x10000000
>  CONFIG_FASTBOOT_FLASH=y
> diff --git a/configs/pico-hobbit-imx6ul_defconfig b/configs/pico-hobbit-imx6ul_defconfig
> index e452f9c600f2..235301cbd8fd 100644
> --- a/configs/pico-hobbit-imx6ul_defconfig
> +++ b/configs/pico-hobbit-imx6ul_defconfig
> @@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_BUF_SIZE=0x10000000
>  CONFIG_FASTBOOT_FLASH=y
> diff --git a/configs/pico-imx6_defconfig b/configs/pico-imx6_defconfig
> index b08fa5f9b796..0c9fdd5fca19 100644
> --- a/configs/pico-imx6_defconfig
> +++ b/configs/pico-imx6_defconfig
> @@ -58,6 +58,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_BUF_ADDR=0x12000000
>  CONFIG_FASTBOOT_BUF_SIZE=0x10000000
> diff --git a/configs/pico-imx6ul_defconfig b/configs/pico-imx6ul_defconfig
> index 9cc50141ed8b..20c023ee4811 100644
> --- a/configs/pico-imx6ul_defconfig
> +++ b/configs/pico-imx6ul_defconfig
> @@ -47,6 +47,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_NET_RANDOM_ETHADDR=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_BUF_SIZE=0x10000000
>  CONFIG_FASTBOOT_FLASH=y
> diff --git a/configs/pico-pi-imx6ul_defconfig b/configs/pico-pi-imx6ul_defconfig
> index d93f342361fd..99619c5c3261 100644
> --- a/configs/pico-pi-imx6ul_defconfig
> +++ b/configs/pico-pi-imx6ul_defconfig
> @@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_BUF_SIZE=0x10000000
>  CONFIG_FASTBOOT_FLASH=y
> diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig
> index a547398ae34c..bdbef5d8066b 100644
> --- a/configs/pxm2_defconfig
> +++ b/configs/pxm2_defconfig
> @@ -75,6 +75,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
>  CONFIG_MTD_RAW_NAND=y
> diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig
> index a0d1ccd710a0..3bc75915d7c9 100644
> --- a/configs/rastaban_defconfig
> +++ b/configs/rastaban_defconfig
> @@ -75,6 +75,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
>  CONFIG_MTD_RAW_NAND=y
> diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
> index 0a5d3ff8cd73..6b36b642c637 100644
> --- a/configs/rpi_4_32b_defconfig
> +++ b/configs/rpi_4_32b_defconfig
> @@ -24,6 +24,8 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DM_DMA=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x200000
>  CONFIG_DM_KEYBOARD=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
> index cb6ee773e151..db5294f02a10 100644
> --- a/configs/rpi_4_defconfig
> +++ b/configs/rpi_4_defconfig
> @@ -24,6 +24,8 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DM_DMA=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x200000
>  CONFIG_DM_KEYBOARD=y
>  CONFIG_DM_MMC=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/rut_defconfig b/configs/rut_defconfig
> index 4037c6a9f45b..1466b91fbb3c 100644
> --- a/configs/rut_defconfig
> +++ b/configs/rut_defconfig
> @@ -76,6 +76,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
>  CONFIG_MTD_RAW_NAND=y
> diff --git a/configs/s5p_goni_defconfig b/configs/s5p_goni_defconfig
> index 28d8be6b01f6..72f9ce16a950 100644
> --- a/configs/s5p_goni_defconfig
> +++ b/configs/s5p_goni_defconfig
> @@ -36,6 +36,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  # CONFIG_NET is not set
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_DM_I2C_GPIO=y
>  CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_S5P=y
> diff --git a/configs/s5pc210_universal_defconfig b/configs/s5pc210_universal_defconfig
> index 759034a8a5c6..734a99f8efa5 100644
> --- a/configs/s5pc210_universal_defconfig
> +++ b/configs/s5pc210_universal_defconfig
> @@ -33,6 +33,7 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_MMC_DW=y
>  CONFIG_MMC_SDHCI=y
> diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
> index 1f600d02780a..dc7b27742f87 100644
> --- a/configs/smartweb_defconfig
> +++ b/configs/smartweb_defconfig
> @@ -53,6 +53,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_CLK=y
>  CONFIG_CLK_AT91=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_AT91_GPIO=y
>  # CONFIG_MMC is not set
>  CONFIG_MTD=y
> diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig
> index ff9c8340fe5f..be119d399f99 100644
> --- a/configs/socfpga_arria5_defconfig
> +++ b/configs/socfpga_arria5_defconfig
> @@ -39,6 +39,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig
> index 5b75026ee85d..1265b0a12881 100644
> --- a/configs/socfpga_cyclone5_defconfig
> +++ b/configs/socfpga_cyclone5_defconfig
> @@ -39,6 +39,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_dbm_soc1_defconfig b/configs/socfpga_dbm_soc1_defconfig
> index 73549fe67901..f1fbcbf4f92c 100644
> --- a/configs/socfpga_dbm_soc1_defconfig
> +++ b/configs/socfpga_dbm_soc1_defconfig
> @@ -44,6 +44,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig
> index 6c49f2895504..2741b4c2c223 100644
> --- a/configs/socfpga_de0_nano_soc_defconfig
> +++ b/configs/socfpga_de0_nano_soc_defconfig
> @@ -39,6 +39,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_de10_nano_defconfig b/configs/socfpga_de10_nano_defconfig
> index 9075af61e473..bf1ad84e057a 100644
> --- a/configs/socfpga_de10_nano_defconfig
> +++ b/configs/socfpga_de10_nano_defconfig
> @@ -36,6 +36,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig
> index 58700d9bc5b0..ddaaf3661ec8 100644
> --- a/configs/socfpga_mcvevk_defconfig
> +++ b/configs/socfpga_mcvevk_defconfig
> @@ -37,6 +37,7 @@ CONFIG_ENV_IS_IN_MMC=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig
> index 2c6135bde4e0..afa3ecf5fb78 100644
> --- a/configs/socfpga_sockit_defconfig
> +++ b/configs/socfpga_sockit_defconfig
> @@ -39,6 +39,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig
> index 13a911fc0b82..73cda1063be7 100644
> --- a/configs/socfpga_socrates_defconfig
> +++ b/configs/socfpga_socrates_defconfig
> @@ -40,6 +40,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_SYS_I2C_DW=y
> diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig
> index 78f894844c5b..fccdec4d594c 100644
> --- a/configs/socfpga_vining_fpga_defconfig
> +++ b/configs/socfpga_vining_fpga_defconfig
> @@ -53,6 +53,7 @@ CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DWAPB_GPIO=y
>  CONFIG_DM_I2C=y
>  CONFIG_LED_STATUS=y
> diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig
> index 6198159107a4..7f57a6d3b1e6 100644
> --- a/configs/taurus_defconfig
> +++ b/configs/taurus_defconfig
> @@ -71,6 +71,7 @@ CONFIG_BLK=y
>  CONFIG_CLK=y
>  CONFIG_CLK_AT91=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_AT91_GPIO=y
>  # CONFIG_MMC is not set
>  CONFIG_MTD=y
> diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig
> index c54b91ef8b60..3243408546c2 100644
> --- a/configs/thuban_defconfig
> +++ b/configs/thuban_defconfig
> @@ -75,6 +75,7 @@ CONFIG_SPL_DM=y
>  CONFIG_BOOTCOUNT_LIMIT=y
>  CONFIG_BOOTCOUNT_ENV=y
>  CONFIG_DFU_NAND=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
>  CONFIG_MMC_OMAP_HS=y
>  CONFIG_MTD=y
>  CONFIG_MTD_RAW_NAND=y
> diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
> index ec66bb09584a..3681919f8503 100644
> --- a/configs/topic_miami_defconfig
> +++ b/configs/topic_miami_defconfig
> @@ -38,6 +38,7 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_RAM=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_I2C=y
> diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig
> index e4145948859e..301a357ec70f 100644
> --- a/configs/topic_miamilite_defconfig
> +++ b/configs/topic_miamilite_defconfig
> @@ -38,6 +38,7 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_RAM=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_I2C=y
> diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig
> index 0041ee153669..27cd9132e86b 100644
> --- a/configs/topic_miamiplus_defconfig
> +++ b/configs/topic_miamiplus_defconfig
> @@ -37,6 +37,7 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_RAM=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_I2C=y
> diff --git a/configs/trats2_defconfig b/configs/trats2_defconfig
> index 8439ddc26775..a3955e1ffc5a 100644
> --- a/configs/trats2_defconfig
> +++ b/configs/trats2_defconfig
> @@ -34,6 +34,7 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_DM_I2C_GPIO=y
>  CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_MMC_DW=y
> diff --git a/configs/trats_defconfig b/configs/trats_defconfig
> index 931c69ba6f17..64cd5dcdb3b2 100644
> --- a/configs/trats_defconfig
> +++ b/configs/trats_defconfig
> @@ -33,6 +33,7 @@ CONFIG_ENV_OVERWRITE=y
>  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
>  CONFIG_DM_I2C_GPIO=y
>  CONFIG_SYS_I2C_S3C24X0=y
>  CONFIG_MMC_DW=y
> diff --git a/configs/venice2_defconfig b/configs/venice2_defconfig
> index ca18677dd4c7..9c14cef2b999 100644
> --- a/configs/venice2_defconfig
> +++ b/configs/venice2_defconfig
> @@ -32,6 +32,8 @@ CONFIG_SPL_DM=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
>  CONFIG_DFU_SF=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
> +CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
>  CONFIG_SYS_I2C_TEGRA=y
>  CONFIG_SF_DEFAULT_MODE=0
>  CONFIG_SF_DEFAULT_SPEED=24000000
> diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
> index 4b45fcd50ab6..6478e6e20295 100644
> --- a/configs/warp7_bl33_defconfig
> +++ b/configs/warp7_bl33_defconfig
> @@ -35,6 +35,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_NET_RANDOM_ETHADDR=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DM_I2C=y
>  CONFIG_DM_MMC=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
> diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
> index 3d11196080ff..df3227405bb1 100644
> --- a/configs/warp7_defconfig
> +++ b/configs/warp7_defconfig
> @@ -41,6 +41,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  CONFIG_NET_RANDOM_ETHADDR=y
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_DM_I2C=y
>  CONFIG_DM_MMC=y
>  CONFIG_SUPPORT_EMMC_BOOT=y
> diff --git a/configs/warp_defconfig b/configs/warp_defconfig
> index 34acc9e6c844..04f756aacf8c 100644
> --- a/configs/warp_defconfig
> +++ b/configs/warp_defconfig
> @@ -33,6 +33,7 @@ CONFIG_SYS_RELOC_GD_ENV_ADDR=y
>  # CONFIG_NET is not set
>  CONFIG_BOUNCE_BUFFER=y
>  CONFIG_DFU_MMC=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
>  CONFIG_SUPPORT_EMMC_BOOT=y
>  CONFIG_FSL_USDHC=y
>  CONFIG_MXC_UART=y
> diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
> index 69adb0b69dbf..4336e1dcdb9a 100644
> --- a/configs/xilinx_versal_virt_defconfig
> +++ b/configs/xilinx_versal_virt_defconfig
> @@ -45,6 +45,7 @@ CONFIG_IP_DEFRAG=y
>  CONFIG_TFTP_BLOCKSIZE=4096
>  CONFIG_CLK_VERSAL=y
>  CONFIG_DFU_RAM=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1800000
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_VERSALPL=y
>  CONFIG_DM_I2C=y
> diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig
> index 552f1b4dfb94..7b0843541009 100644
> --- a/configs/xilinx_zynq_virt_defconfig
> +++ b/configs/xilinx_zynq_virt_defconfig
> @@ -61,6 +61,7 @@ CONFIG_NETCONSOLE=y
>  CONFIG_SPL_DM_SEQ_ALIAS=y
>  CONFIG_DFU_MMC=y
>  CONFIG_DFU_RAM=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
>  CONFIG_FPGA_XILINX=y
>  CONFIG_FPGA_ZYNQPL=y
>  CONFIG_DM_I2C=y
> diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
> index 0bf4b7d692e9..fbe98c96078f 100644
> --- a/configs/xilinx_zynqmp_virt_defconfig
> +++ b/configs/xilinx_zynqmp_virt_defconfig
> @@ -80,6 +80,7 @@ CONFIG_SATA_CEVA=y
>  CONFIG_CLK_ZYNQMP=y
>  CONFIG_DFU_TFTP=y
>  CONFIG_DFU_RAM=y
> +CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1800000
>  CONFIG_USB_FUNCTION_FASTBOOT=y
>  CONFIG_FASTBOOT_FLASH=y
>  CONFIG_FASTBOOT_FLASH_MMC_DEV=0
> diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
> index 121dc54f5463..b50547476cbd 100644
> --- a/drivers/dfu/Kconfig
> +++ b/drivers/dfu/Kconfig
> @@ -92,5 +92,25 @@ config SET_DFU_ALT_INFO
>         help
>           This option allows to call the function set_dfu_alt_info to
>           dynamically build dfu_alt_info in board.
> +
> +config SYS_DFU_DATA_BUF_SIZE
> +       hex "Size of buffer to be allocated for transfer to raw storage device"
> +       default 0x800000
> +       help
> +         DFU transfer uses a buffer before writing data to the
> +         raw storage device. This value can be used for setting the
> +         size of this buffer. The size of the buffer is also configurable
> +         through the "dfu_bufsiz" environment variable. If both are
> +         given the size of the buffer is set to "dfu_bufsize".
> +
> +config SYS_DFU_MAX_FILE_SIZE
> +       hex "Size of the buffer to be allocated for transferring files"
> +       default SYS_DFU_DATA_BUF_SIZE
> +       help
> +         When updating files rather than the raw storage device,
> +         we use a static buffer to copy the file into and then write
> +         the buffer once we've been given the whole file.  Define
> +         this to the maximum filesize (in bytes) for the buffer.
> +         If undefined it defaults to the CONFIG_SYS_DFU_DATA_BUF_SIZE.
>  endif
>  endmenu
> diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h
> index b39a5b4ca498..4c89d32e4085 100644
> --- a/include/configs/am65x_evm.h
> +++ b/include/configs/am65x_evm.h
> @@ -22,7 +22,6 @@
>  #ifdef CONFIG_TARGET_AM654_A53_EVM
>  #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +        \
>                                          CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE)
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   0x20000
>  #else
>  /*
>   * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
> @@ -45,7 +44,6 @@
>  /* Configure R5 SPL post-relocation malloc pool in DDR */
>  #define CONFIG_SYS_SPL_MALLOC_START    0x84000000
>  #define CONFIG_SYS_SPL_MALLOC_SIZE     SZ_16M
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   0x5000
>  #endif
>
>  #ifdef CONFIG_SYS_K3_SPL_ATF
> @@ -56,12 +54,6 @@
>  #define CONFIG_SKIP_LOWLEVEL_INIT
>  #endif
>
> -/*
> - * If the maximum size is not declared then it is defined as
> - * CONFIG_SYS_DFU_DATA_BUF_SIZE.
> - */
> -#define CONFIG_SYS_DFU_MAX_FILE_SIZE   (1024 * 1024 * 8)   /* 8 MiB */
> -
>  #define CONFIG_SPL_MAX_SIZE            CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
>
>  #define CONFIG_SYS_BOOTM_LEN           SZ_64M
> diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
> index 2827c171c970..17482451fb33 100644
> --- a/include/configs/colibri-imx6ull.h
> +++ b/include/configs/colibri-imx6ull.h
> @@ -143,7 +143,6 @@
>  #define CONFIG_USBD_HS
>
>  /* USB Device Firmware Update support */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_16M
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>
>  #if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
> diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
> index cae7c14bfb90..5bd440f1db33 100644
> --- a/include/configs/colibri_vf.h
> +++ b/include/configs/colibri_vf.h
> @@ -143,6 +143,5 @@
>  #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
>
>  /* USB DFU */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE (SZ_1M)
>
>  #endif /* __CONFIG_H */
> diff --git a/include/configs/corvus.h b/include/configs/corvus.h
> index 55f77e4400a2..bd4d6e8e39f4 100644
> --- a/include/configs/corvus.h
> +++ b/include/configs/corvus.h
> @@ -81,7 +81,6 @@
>  #define CONFIG_AT91_WANTS_COMMON_PHY
>
>  /* DFU class support */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   (SZ_1M)
>  #define DFU_MANIFEST_POLL_TIMEOUT      25000
>
>  #define CONFIG_SYS_LOAD_ADDR   ATMEL_BASE_CS6
> diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
> index 4a469af5e60b..d9be1c38c44a 100644
> --- a/include/configs/dh_imx6.h
> +++ b/include/configs/dh_imx6.h
> @@ -66,7 +66,6 @@
>
>  /* USB Gadget (DFU, UMS) */
>  #if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   (16 * 1024 * 1024)
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>
>  /* USB IDs */
> diff --git a/include/configs/exynos4-common.h b/include/configs/exynos4-common.h
> index 005f65d4ed6a..5e2aca371e7e 100644
> --- a/include/configs/exynos4-common.h
> +++ b/include/configs/exynos4-common.h
> @@ -19,7 +19,6 @@
>  /* SD/MMC configuration */
>  #define CONFIG_MMC_DEFAULT_DEV 0
>
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
>  #define DFU_DEFAULT_POLL_TIMEOUT 300
>
>  /* USB Samsung's IDs */
> diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
> index 0c86196152fc..fc70dc6a7323 100644
> --- a/include/configs/odroid_xu3.h
> +++ b/include/configs/odroid_xu3.h
> @@ -27,7 +27,6 @@
>  #define CONFIG_USB_EHCI_EXYNOS
>
>  /* DFU */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_32M
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>  #define DFU_MANIFEST_POLL_TIMEOUT      25000
>
> diff --git a/include/configs/pico-imx6.h b/include/configs/pico-imx6.h
> index 19c8aeb71b6e..6199f0d72e76 100644
> --- a/include/configs/pico-imx6.h
> +++ b/include/configs/pico-imx6.h
> @@ -38,7 +38,6 @@
>  #define CONFIG_MXC_USB_PORTSC          (PORT_PTS_UTMI | PORT_PTS_PTW)
>  #define CONFIG_MXC_USB_FLAGS           0
>
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
>  #define DFU_DEFAULT_POLL_TIMEOUT 300
>
>  #define CONFIG_DFU_ENV_SETTINGS \
> diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
> index 747ef09f37d9..04a2531f7447 100644
> --- a/include/configs/pico-imx6ul.h
> +++ b/include/configs/pico-imx6ul.h
> @@ -49,7 +49,6 @@
>
>  #define CONFIG_USBD_HS
>
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
>  #define DFU_DEFAULT_POLL_TIMEOUT 300
>
>  #define CONFIG_DFU_ENV_SETTINGS \
> diff --git a/include/configs/rpi.h b/include/configs/rpi.h
> index 834f1cd23640..46ada884b487 100644
> --- a/include/configs/rpi.h
> +++ b/include/configs/rpi.h
> @@ -74,9 +74,6 @@
>
>  /* DFU over USB/UDC */
>  #ifdef CONFIG_CMD_DFU
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_1M
> -#define CONFIG_SYS_DFU_MAX_FILE_SIZE   SZ_2M
> -
>  #ifdef CONFIG_ARM64
>  #define KERNEL_FILENAME                "Image"
>  #else
> diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
> index 9688bdc4c035..6af6009e6126 100644
> --- a/include/configs/s5p_goni.h
> +++ b/include/configs/s5p_goni.h
> @@ -41,7 +41,6 @@
>  #define CONFIG_PWM                     1
>
>  /* USB Composite download gadget - g_dnl */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
>  #define DFU_DEFAULT_POLL_TIMEOUT 300
>
>  /* USB Samsung's IDs */
> diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
> index e18af7493c7f..f96dd774b178 100644
> --- a/include/configs/siemens-am33x-common.h
> +++ b/include/configs/siemens-am33x-common.h
> @@ -143,7 +143,6 @@
>  #define CONFIG_USBD_HS
>
>  /* USB Device Firmware Update support */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   (1 << 20)
>  #define DFU_MANIFEST_POLL_TIMEOUT      25000
>
>  #endif /* CONFIG_SPL_BUILD */
> diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
> index 6e715dc0c1be..5e8637e49484 100644
> --- a/include/configs/smartweb.h
> +++ b/include/configs/smartweb.h
> @@ -122,7 +122,6 @@
>  #define CONFIG_USB_GADGET_AT91
>
>  /* DFU class support */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_1M
>  #define DFU_MANIFEST_POLL_TIMEOUT      25000
>  #endif
>
> diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
> index 62b327cd6e52..c5e4292f1964 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -148,7 +148,6 @@ unsigned int cm_get_qspi_controller_clk_hz(void);
>   * USB Gadget (DFU, UMS)
>   */
>  #if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   (16 * 1024 * 1024)
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>
>  /* USB IDs */
> diff --git a/include/configs/taurus.h b/include/configs/taurus.h
> index 39eae8e2ba04..6e869462f1e6 100644
> --- a/include/configs/taurus.h
> +++ b/include/configs/taurus.h
> @@ -92,7 +92,6 @@
>  #define CONFIG_USB_GADGET_AT91
>
>  /* DFU class support */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   (SZ_1M)
>  #define DFU_MANIFEST_POLL_TIMEOUT      25000
>  #endif
>
> diff --git a/include/configs/tegra-common-usb-gadget.h b/include/configs/tegra-common-usb-gadget.h
> index e6b61c4e8fd3..201f4bc093c9 100644
> --- a/include/configs/tegra-common-usb-gadget.h
> +++ b/include/configs/tegra-common-usb-gadget.h
> @@ -13,8 +13,6 @@
>  #define CONFIG_CI_UDC_HAS_HOSTPC
>  #endif
>  /* DFU protocol */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_1M
> -#define CONFIG_SYS_DFU_MAX_FILE_SIZE SZ_32M
>  #endif
>
>  #endif /* _TEGRA_COMMON_USB_GADGET_H_ */
> diff --git a/include/configs/warp.h b/include/configs/warp.h
> index f17eea117f3a..ba8b0110d749 100644
> --- a/include/configs/warp.h
> +++ b/include/configs/warp.h
> @@ -50,7 +50,6 @@
>
>  #define CONFIG_USBD_HS
>
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
>  #define DFU_DEFAULT_POLL_TIMEOUT 300
>
>  /* I2C Configs */
> diff --git a/include/configs/warp7.h b/include/configs/warp7.h
> index 8eb106027440..a5d52e3977fd 100644
> --- a/include/configs/warp7.h
> +++ b/include/configs/warp7.h
> @@ -149,7 +149,6 @@
>  #define CONFIG_USBD_HS
>
>  /* USB Device Firmware Update support */
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   SZ_16M
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>
>  #define CONFIG_USBNET_DEV_ADDR         "de:ad:be:af:00:01"
> diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
> index f1d2594f3b32..7ffd655dc9df 100644
> --- a/include/configs/xilinx_versal.h
> +++ b/include/configs/xilinx_versal.h
> @@ -47,7 +47,6 @@
>  #define CONFIG_SYS_MAXARGS             64
>
>  #if defined(CONFIG_CMD_DFU)
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   0x1800000
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>  #define CONFIG_THOR_RESET_OFF
>  #define DFU_ALT_INFO_RAM \
> diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
> index 15ad4198a6be..57e1163c81f1 100644
> --- a/include/configs/xilinx_zynqmp.h
> +++ b/include/configs/xilinx_zynqmp.h
> @@ -52,7 +52,6 @@
>  #define CONFIG_SYS_LOAD_ADDR           0x8000000
>
>  #if defined(CONFIG_ZYNQMP_USB)
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE   0x1800000
>  #define DFU_DEFAULT_POLL_TIMEOUT       300
>  #define CONFIG_THOR_RESET_OFF
>  #define DFU_ALT_INFO_RAM \
> diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
> index 1607a8d06518..7afd2e9f86a8 100644
> --- a/include/configs/zynq-common.h
> +++ b/include/configs/zynq-common.h
> @@ -58,7 +58,6 @@
>  #ifdef CONFIG_USB_EHCI_ZYNQ
>  # define CONFIG_EHCI_IS_TDI
>
> -# define CONFIG_SYS_DFU_DATA_BUF_SIZE  0x600000
>  # define DFU_DEFAULT_POLL_TIMEOUT      300
>  # define CONFIG_THOR_RESET_OFF
>  # define DFU_ALT_INFO_RAM \
> diff --git a/include/dfu.h b/include/dfu.h
> index d18b70172829..afada3959b72 100644
> --- a/include/dfu.h
> +++ b/include/dfu.h
> @@ -100,12 +100,6 @@ struct virt_internal_data {
>  };
>
>  #define DFU_NAME_SIZE                  32
> -#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
> -#define CONFIG_SYS_DFU_DATA_BUF_SIZE           (1024*1024*8)   /* 8 MiB */
> -#endif
> -#ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE
> -#define CONFIG_SYS_DFU_MAX_FILE_SIZE CONFIG_SYS_DFU_DATA_BUF_SIZE
> -#endif
>  #ifndef DFU_DEFAULT_POLL_TIMEOUT
>  #define DFU_DEFAULT_POLL_TIMEOUT 0
>  #endif
> diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
> index c8c87900ce8f..e0d434ce2d55 100644
> --- a/scripts/config_whitelist.txt
> +++ b/scripts/config_whitelist.txt
> @@ -2083,8 +2083,6 @@ CONFIG_SYS_DEBUG_SERVER_FW_IN_NOR
>  CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
>  CONFIG_SYS_DEFAULT_VIDEO_MODE
>  CONFIG_SYS_DEF_EEPROM_ADDR
> -CONFIG_SYS_DFU_DATA_BUF_SIZE
> -CONFIG_SYS_DFU_MAX_FILE_SIZE
>  CONFIG_SYS_DIAG_ADDR
>  CONFIG_SYS_DIALOG_PMIC_I2C_ADDR
>  CONFIG_SYS_DIMM_SLOTS_PER_CTLR
> --
> 2.17.1
>


--
Best regards
Oleksandr Suvorov

Toradex AG
Ebenaustrasse 10 | 6048 Horw | Switzerland | T: +41 41 500 48 00
diff mbox series

Patch

diff --git a/configs/am65x_evm_a53_defconfig b/configs/am65x_evm_a53_defconfig
index 0b5a27f7cfbb..0ffc1907c1fd 100644
--- a/configs/am65x_evm_a53_defconfig
+++ b/configs/am65x_evm_a53_defconfig
@@ -90,6 +90,8 @@  CONFIG_CLK_TI_SCI=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x20000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
diff --git a/configs/am65x_evm_r5_usbdfu_defconfig b/configs/am65x_evm_r5_usbdfu_defconfig
index 161634222517..b45a6d242955 100644
--- a/configs/am65x_evm_r5_usbdfu_defconfig
+++ b/configs/am65x_evm_r5_usbdfu_defconfig
@@ -65,6 +65,8 @@  CONFIG_BLK=y
 CONFIG_CLK=y
 CONFIG_SPL_CLK=y
 CONFIG_CLK_TI_SCI=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x5000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_TI_SCI_PROTOCOL=y
 CONFIG_DA8XX_GPIO=y
 CONFIG_DM_I2C=y
diff --git a/configs/am65x_hs_evm_a53_defconfig b/configs/am65x_hs_evm_a53_defconfig
index 7d467c167e9d..e43280f528bd 100644
--- a/configs/am65x_hs_evm_a53_defconfig
+++ b/configs/am65x_hs_evm_a53_defconfig
@@ -85,6 +85,8 @@  CONFIG_CLK_TI_SCI=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x20000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x800000
 CONFIG_DMA_CHANNELS=y
 CONFIG_TI_K3_NAVSS_UDMA=y
 CONFIG_TI_SCI_PROTOCOL=y
diff --git a/configs/beaver_defconfig b/configs/beaver_defconfig
index 4c892443b970..cf18feef407b 100644
--- a/configs/beaver_defconfig
+++ b/configs/beaver_defconfig
@@ -34,6 +34,8 @@  CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/cei-tk1-som_defconfig b/configs/cei-tk1-som_defconfig
index 987e3ac8e95f..c1ff9d7f1428 100644
--- a/configs/cei-tk1-som_defconfig
+++ b/configs/cei-tk1-som_defconfig
@@ -34,6 +34,8 @@  CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/colibri-imx6ull_defconfig b/configs/colibri-imx6ull_defconfig
index 5e18f66d71bd..72552c413ca4 100644
--- a/configs/colibri-imx6ull_defconfig
+++ b/configs/colibri-imx6ull_defconfig
@@ -62,6 +62,7 @@  CONFIG_BOUNCE_BUFFER=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_DM_MMC=y
diff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig
index abac672cf2e7..a522e3f3cb92 100644
--- a/configs/colibri_vf_defconfig
+++ b/configs/colibri_vf_defconfig
@@ -62,6 +62,7 @@  CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_DM=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_VYBRID_GPIO=y
 CONFIG_DM_MMC=y
 # CONFIG_MMC_HW_PARTITIONING is not set
diff --git a/configs/corvus_defconfig b/configs/corvus_defconfig
index 491f5630822e..8206c4cdc98f 100644
--- a/configs/corvus_defconfig
+++ b/configs/corvus_defconfig
@@ -51,6 +51,7 @@  CONFIG_BLK=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/dalmore_defconfig b/configs/dalmore_defconfig
index f2c1e849787e..fc152121225d 100644
--- a/configs/dalmore_defconfig
+++ b/configs/dalmore_defconfig
@@ -33,6 +33,8 @@  CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/dh_imx6_defconfig b/configs/dh_imx6_defconfig
index 7bb6ce168aea..2f174754670d 100644
--- a/configs/dh_imx6_defconfig
+++ b/configs/dh_imx6_defconfig
@@ -65,6 +65,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DWC_AHSATA=y
 CONFIG_BOOTCOUNT_LIMIT=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_MXC=y
 CONFIG_MISC=y
diff --git a/configs/draco_defconfig b/configs/draco_defconfig
index fb41d55feb01..ab7f6ddb5979 100644
--- a/configs/draco_defconfig
+++ b/configs/draco_defconfig
@@ -75,6 +75,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/e2220-1170_defconfig b/configs/e2220-1170_defconfig
index efe3f8b5746f..a9ca7f102d77 100644
--- a/configs/e2220-1170_defconfig
+++ b/configs/e2220-1170_defconfig
@@ -28,6 +28,8 @@  CONFIG_SYS_MMC_ENV_PART=2
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/etamin_defconfig b/configs/etamin_defconfig
index 2849c606260c..53d853321c08 100644
--- a/configs/etamin_defconfig
+++ b/configs/etamin_defconfig
@@ -76,6 +76,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/jetson-tk1_defconfig b/configs/jetson-tk1_defconfig
index 74d315d14359..0e7216621646 100644
--- a/configs/jetson-tk1_defconfig
+++ b/configs/jetson-tk1_defconfig
@@ -34,6 +34,8 @@  CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/nyan-big_defconfig b/configs/nyan-big_defconfig
index 3a47c5a0d01f..349f918727b7 100644
--- a/configs/nyan-big_defconfig
+++ b/configs/nyan-big_defconfig
@@ -51,6 +51,8 @@  CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_CROS_EC_KEYB=y
 CONFIG_CROS_EC=y
diff --git a/configs/odroid-xu3_defconfig b/configs/odroid-xu3_defconfig
index 755a2ca9add9..bc71b45c0fb7 100644
--- a/configs/odroid-xu3_defconfig
+++ b/configs/odroid-xu3_defconfig
@@ -41,6 +41,7 @@  CONFIG_ADC=y
 CONFIG_ADC_EXYNOS=y
 CONFIG_DFU_MMC=y
 CONFIG_SET_DFU_ALT_INFO=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_MMC_DW=y
 CONFIG_MTD=y
diff --git a/configs/odroid_defconfig b/configs/odroid_defconfig
index 9f2b0b205d56..36719d91f66f 100644
--- a/configs/odroid_defconfig
+++ b/configs/odroid_defconfig
@@ -42,6 +42,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
 CONFIG_SET_DFU_ALT_INFO=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_SYS_I2C_S3C24X0=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
diff --git a/configs/origen_defconfig b/configs/origen_defconfig
index 4c4dc1a0db64..650276e379e3 100644
--- a/configs/origen_defconfig
+++ b/configs/origen_defconfig
@@ -31,6 +31,7 @@  CONFIG_OF_CONTROL=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_SDMA=y
diff --git a/configs/p2371-0000_defconfig b/configs/p2371-0000_defconfig
index 16f6b68e57f2..8fae527adfde 100644
--- a/configs/p2371-0000_defconfig
+++ b/configs/p2371-0000_defconfig
@@ -29,6 +29,8 @@  CONFIG_SYS_MMC_ENV_PART=2
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/p2371-2180_defconfig b/configs/p2371-2180_defconfig
index c7f4404bbacb..af490891e2bc 100644
--- a/configs/p2371-2180_defconfig
+++ b/configs/p2371-2180_defconfig
@@ -32,6 +32,8 @@  CONFIG_SYS_MMC_ENV_PART=2
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/p2571_defconfig b/configs/p2571_defconfig
index 973034096743..68bfb8f28cdd 100644
--- a/configs/p2571_defconfig
+++ b/configs/p2571_defconfig
@@ -29,6 +29,8 @@  CONFIG_SYS_MMC_ENV_PART=2
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/p3450-0000_defconfig b/configs/p3450-0000_defconfig
index 6e6a8133b4d4..12c3f9bb28e7 100644
--- a/configs/p3450-0000_defconfig
+++ b/configs/p3450-0000_defconfig
@@ -33,6 +33,8 @@  CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/pico-dwarf-imx6ul_defconfig b/configs/pico-dwarf-imx6ul_defconfig
index de0984755090..a4207bd2cc19 100644
--- a/configs/pico-dwarf-imx6ul_defconfig
+++ b/configs/pico-dwarf-imx6ul_defconfig
@@ -43,6 +43,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
diff --git a/configs/pico-hobbit-imx6ul_defconfig b/configs/pico-hobbit-imx6ul_defconfig
index e452f9c600f2..235301cbd8fd 100644
--- a/configs/pico-hobbit-imx6ul_defconfig
+++ b/configs/pico-hobbit-imx6ul_defconfig
@@ -44,6 +44,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
diff --git a/configs/pico-imx6_defconfig b/configs/pico-imx6_defconfig
index b08fa5f9b796..0c9fdd5fca19 100644
--- a/configs/pico-imx6_defconfig
+++ b/configs/pico-imx6_defconfig
@@ -58,6 +58,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_ADDR=0x12000000
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
diff --git a/configs/pico-imx6ul_defconfig b/configs/pico-imx6ul_defconfig
index 9cc50141ed8b..20c023ee4811 100644
--- a/configs/pico-imx6ul_defconfig
+++ b/configs/pico-imx6ul_defconfig
@@ -47,6 +47,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
diff --git a/configs/pico-pi-imx6ul_defconfig b/configs/pico-pi-imx6ul_defconfig
index d93f342361fd..99619c5c3261 100644
--- a/configs/pico-pi-imx6ul_defconfig
+++ b/configs/pico-pi-imx6ul_defconfig
@@ -44,6 +44,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_BUF_SIZE=0x10000000
 CONFIG_FASTBOOT_FLASH=y
diff --git a/configs/pxm2_defconfig b/configs/pxm2_defconfig
index a547398ae34c..bdbef5d8066b 100644
--- a/configs/pxm2_defconfig
+++ b/configs/pxm2_defconfig
@@ -75,6 +75,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/rastaban_defconfig b/configs/rastaban_defconfig
index a0d1ccd710a0..3bc75915d7c9 100644
--- a/configs/rastaban_defconfig
+++ b/configs/rastaban_defconfig
@@ -75,6 +75,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig
index 0a5d3ff8cd73..6b36b642c637 100644
--- a/configs/rpi_4_32b_defconfig
+++ b/configs/rpi_4_32b_defconfig
@@ -24,6 +24,8 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM_DMA=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x200000
 CONFIG_DM_KEYBOARD=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
diff --git a/configs/rpi_4_defconfig b/configs/rpi_4_defconfig
index cb6ee773e151..db5294f02a10 100644
--- a/configs/rpi_4_defconfig
+++ b/configs/rpi_4_defconfig
@@ -24,6 +24,8 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DM_DMA=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x200000
 CONFIG_DM_KEYBOARD=y
 CONFIG_DM_MMC=y
 CONFIG_MMC_SDHCI=y
diff --git a/configs/rut_defconfig b/configs/rut_defconfig
index 4037c6a9f45b..1466b91fbb3c 100644
--- a/configs/rut_defconfig
+++ b/configs/rut_defconfig
@@ -76,6 +76,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/s5p_goni_defconfig b/configs/s5p_goni_defconfig
index 28d8be6b01f6..72f9ce16a950 100644
--- a/configs/s5p_goni_defconfig
+++ b/configs/s5p_goni_defconfig
@@ -36,6 +36,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 # CONFIG_NET is not set
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_DM_I2C_GPIO=y
 CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_S5P=y
diff --git a/configs/s5pc210_universal_defconfig b/configs/s5pc210_universal_defconfig
index 759034a8a5c6..734a99f8efa5 100644
--- a/configs/s5pc210_universal_defconfig
+++ b/configs/s5pc210_universal_defconfig
@@ -33,6 +33,7 @@  CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_SYS_I2C_S3C24X0=y
 CONFIG_MMC_DW=y
 CONFIG_MMC_SDHCI=y
diff --git a/configs/smartweb_defconfig b/configs/smartweb_defconfig
index 1f600d02780a..dc7b27742f87 100644
--- a/configs/smartweb_defconfig
+++ b/configs/smartweb_defconfig
@@ -53,6 +53,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/socfpga_arria5_defconfig b/configs/socfpga_arria5_defconfig
index ff9c8340fe5f..be119d399f99 100644
--- a/configs/socfpga_arria5_defconfig
+++ b/configs/socfpga_arria5_defconfig
@@ -39,6 +39,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_cyclone5_defconfig b/configs/socfpga_cyclone5_defconfig
index 5b75026ee85d..1265b0a12881 100644
--- a/configs/socfpga_cyclone5_defconfig
+++ b/configs/socfpga_cyclone5_defconfig
@@ -39,6 +39,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_dbm_soc1_defconfig b/configs/socfpga_dbm_soc1_defconfig
index 73549fe67901..f1fbcbf4f92c 100644
--- a/configs/socfpga_dbm_soc1_defconfig
+++ b/configs/socfpga_dbm_soc1_defconfig
@@ -44,6 +44,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig
index 6c49f2895504..2741b4c2c223 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -39,6 +39,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_de10_nano_defconfig b/configs/socfpga_de10_nano_defconfig
index 9075af61e473..bf1ad84e057a 100644
--- a/configs/socfpga_de10_nano_defconfig
+++ b/configs/socfpga_de10_nano_defconfig
@@ -36,6 +36,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_mcvevk_defconfig b/configs/socfpga_mcvevk_defconfig
index 58700d9bc5b0..ddaaf3661ec8 100644
--- a/configs/socfpga_mcvevk_defconfig
+++ b/configs/socfpga_mcvevk_defconfig
@@ -37,6 +37,7 @@  CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_sockit_defconfig b/configs/socfpga_sockit_defconfig
index 2c6135bde4e0..afa3ecf5fb78 100644
--- a/configs/socfpga_sockit_defconfig
+++ b/configs/socfpga_sockit_defconfig
@@ -39,6 +39,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_socrates_defconfig b/configs/socfpga_socrates_defconfig
index 13a911fc0b82..73cda1063be7 100644
--- a/configs/socfpga_socrates_defconfig
+++ b/configs/socfpga_socrates_defconfig
@@ -40,6 +40,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_VERSION_VARIABLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_SYS_I2C_DW=y
diff --git a/configs/socfpga_vining_fpga_defconfig b/configs/socfpga_vining_fpga_defconfig
index 78f894844c5b..fccdec4d594c 100644
--- a/configs/socfpga_vining_fpga_defconfig
+++ b/configs/socfpga_vining_fpga_defconfig
@@ -53,6 +53,7 @@  CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DWAPB_GPIO=y
 CONFIG_DM_I2C=y
 CONFIG_LED_STATUS=y
diff --git a/configs/taurus_defconfig b/configs/taurus_defconfig
index 6198159107a4..7f57a6d3b1e6 100644
--- a/configs/taurus_defconfig
+++ b/configs/taurus_defconfig
@@ -71,6 +71,7 @@  CONFIG_BLK=y
 CONFIG_CLK=y
 CONFIG_CLK_AT91=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_AT91_GPIO=y
 # CONFIG_MMC is not set
 CONFIG_MTD=y
diff --git a/configs/thuban_defconfig b/configs/thuban_defconfig
index c54b91ef8b60..3243408546c2 100644
--- a/configs/thuban_defconfig
+++ b/configs/thuban_defconfig
@@ -75,6 +75,7 @@  CONFIG_SPL_DM=y
 CONFIG_BOOTCOUNT_LIMIT=y
 CONFIG_BOOTCOUNT_ENV=y
 CONFIG_DFU_NAND=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
 CONFIG_MMC_OMAP_HS=y
 CONFIG_MTD=y
 CONFIG_MTD_RAW_NAND=y
diff --git a/configs/topic_miami_defconfig b/configs/topic_miami_defconfig
index ec66bb09584a..3681919f8503 100644
--- a/configs/topic_miami_defconfig
+++ b/configs/topic_miami_defconfig
@@ -38,6 +38,7 @@  CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_RAM=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_I2C=y
diff --git a/configs/topic_miamilite_defconfig b/configs/topic_miamilite_defconfig
index e4145948859e..301a357ec70f 100644
--- a/configs/topic_miamilite_defconfig
+++ b/configs/topic_miamilite_defconfig
@@ -38,6 +38,7 @@  CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_RAM=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_I2C=y
diff --git a/configs/topic_miamiplus_defconfig b/configs/topic_miamiplus_defconfig
index 0041ee153669..27cd9132e86b 100644
--- a/configs/topic_miamiplus_defconfig
+++ b/configs/topic_miamiplus_defconfig
@@ -37,6 +37,7 @@  CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_RAM=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_I2C=y
diff --git a/configs/trats2_defconfig b/configs/trats2_defconfig
index 8439ddc26775..a3955e1ffc5a 100644
--- a/configs/trats2_defconfig
+++ b/configs/trats2_defconfig
@@ -34,6 +34,7 @@  CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_DM_I2C_GPIO=y
 CONFIG_SYS_I2C_S3C24X0=y
 CONFIG_MMC_DW=y
diff --git a/configs/trats_defconfig b/configs/trats_defconfig
index 931c69ba6f17..64cd5dcdb3b2 100644
--- a/configs/trats_defconfig
+++ b/configs/trats_defconfig
@@ -33,6 +33,7 @@  CONFIG_ENV_OVERWRITE=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x2000000
 CONFIG_DM_I2C_GPIO=y
 CONFIG_SYS_I2C_S3C24X0=y
 CONFIG_MMC_DW=y
diff --git a/configs/venice2_defconfig b/configs/venice2_defconfig
index ca18677dd4c7..9c14cef2b999 100644
--- a/configs/venice2_defconfig
+++ b/configs/venice2_defconfig
@@ -32,6 +32,8 @@  CONFIG_SPL_DM=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
 CONFIG_DFU_SF=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x100000
+CONFIG_SYS_DFU_MAX_FILE_SIZE=0x2000000
 CONFIG_SYS_I2C_TEGRA=y
 CONFIG_SF_DEFAULT_MODE=0
 CONFIG_SF_DEFAULT_SPEED=24000000
diff --git a/configs/warp7_bl33_defconfig b/configs/warp7_bl33_defconfig
index 4b45fcd50ab6..6478e6e20295 100644
--- a/configs/warp7_bl33_defconfig
+++ b/configs/warp7_bl33_defconfig
@@ -35,6 +35,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
diff --git a/configs/warp7_defconfig b/configs/warp7_defconfig
index 3d11196080ff..df3227405bb1 100644
--- a/configs/warp7_defconfig
+++ b/configs/warp7_defconfig
@@ -41,6 +41,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 CONFIG_NET_RANDOM_ETHADDR=y
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_DM_I2C=y
 CONFIG_DM_MMC=y
 CONFIG_SUPPORT_EMMC_BOOT=y
diff --git a/configs/warp_defconfig b/configs/warp_defconfig
index 34acc9e6c844..04f756aacf8c 100644
--- a/configs/warp_defconfig
+++ b/configs/warp_defconfig
@@ -33,6 +33,7 @@  CONFIG_SYS_RELOC_GD_ENV_ADDR=y
 # CONFIG_NET is not set
 CONFIG_BOUNCE_BUFFER=y
 CONFIG_DFU_MMC=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1000000
 CONFIG_SUPPORT_EMMC_BOOT=y
 CONFIG_FSL_USDHC=y
 CONFIG_MXC_UART=y
diff --git a/configs/xilinx_versal_virt_defconfig b/configs/xilinx_versal_virt_defconfig
index 69adb0b69dbf..4336e1dcdb9a 100644
--- a/configs/xilinx_versal_virt_defconfig
+++ b/configs/xilinx_versal_virt_defconfig
@@ -45,6 +45,7 @@  CONFIG_IP_DEFRAG=y
 CONFIG_TFTP_BLOCKSIZE=4096
 CONFIG_CLK_VERSAL=y
 CONFIG_DFU_RAM=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1800000
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_VERSALPL=y
 CONFIG_DM_I2C=y
diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig
index 552f1b4dfb94..7b0843541009 100644
--- a/configs/xilinx_zynq_virt_defconfig
+++ b/configs/xilinx_zynq_virt_defconfig
@@ -61,6 +61,7 @@  CONFIG_NETCONSOLE=y
 CONFIG_SPL_DM_SEQ_ALIAS=y
 CONFIG_DFU_MMC=y
 CONFIG_DFU_RAM=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x600000
 CONFIG_FPGA_XILINX=y
 CONFIG_FPGA_ZYNQPL=y
 CONFIG_DM_I2C=y
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index 0bf4b7d692e9..fbe98c96078f 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -80,6 +80,7 @@  CONFIG_SATA_CEVA=y
 CONFIG_CLK_ZYNQMP=y
 CONFIG_DFU_TFTP=y
 CONFIG_DFU_RAM=y
+CONFIG_SYS_DFU_DATA_BUF_SIZE=0x1800000
 CONFIG_USB_FUNCTION_FASTBOOT=y
 CONFIG_FASTBOOT_FLASH=y
 CONFIG_FASTBOOT_FLASH_MMC_DEV=0
diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig
index 121dc54f5463..b50547476cbd 100644
--- a/drivers/dfu/Kconfig
+++ b/drivers/dfu/Kconfig
@@ -92,5 +92,25 @@  config SET_DFU_ALT_INFO
 	help
 	  This option allows to call the function set_dfu_alt_info to
 	  dynamically build dfu_alt_info in board.
+
+config SYS_DFU_DATA_BUF_SIZE
+	hex "Size of buffer to be allocated for transfer to raw storage device"
+	default 0x800000
+	help
+	  DFU transfer uses a buffer before writing data to the
+	  raw storage device. This value can be used for setting the
+	  size of this buffer. The size of the buffer is also configurable
+	  through the "dfu_bufsiz" environment variable. If both are
+	  given the size of the buffer is set to "dfu_bufsize".
+
+config SYS_DFU_MAX_FILE_SIZE
+	hex "Size of the buffer to be allocated for transferring files"
+	default SYS_DFU_DATA_BUF_SIZE
+	help
+	  When updating files rather than the raw storage device,
+	  we use a static buffer to copy the file into and then write
+	  the buffer once we've been given the whole file.  Define
+	  this to the maximum filesize (in bytes) for the buffer.
+	  If undefined it defaults to the CONFIG_SYS_DFU_DATA_BUF_SIZE.
 endif
 endmenu
diff --git a/include/configs/am65x_evm.h b/include/configs/am65x_evm.h
index b39a5b4ca498..4c89d32e4085 100644
--- a/include/configs/am65x_evm.h
+++ b/include/configs/am65x_evm.h
@@ -22,7 +22,6 @@ 
 #ifdef CONFIG_TARGET_AM654_A53_EVM
 #define CONFIG_SYS_INIT_SP_ADDR         (CONFIG_SPL_TEXT_BASE +	\
 					 CONFIG_SYS_K3_NON_SECURE_MSRAM_SIZE)
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x20000
 #else
 /*
  * Maximum size in memory allocated to the SPL BSS. Keep it as tight as
@@ -45,7 +44,6 @@ 
 /* Configure R5 SPL post-relocation malloc pool in DDR */
 #define CONFIG_SYS_SPL_MALLOC_START	0x84000000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	SZ_16M
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x5000
 #endif
 
 #ifdef CONFIG_SYS_K3_SPL_ATF
@@ -56,12 +54,6 @@ 
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #endif
 
-/*
- * If the maximum size is not declared then it is defined as
- * CONFIG_SYS_DFU_DATA_BUF_SIZE.
- */
-#define CONFIG_SYS_DFU_MAX_FILE_SIZE	(1024 * 1024 * 8)   /* 8 MiB */
-
 #define CONFIG_SPL_MAX_SIZE		CONFIG_SYS_K3_MAX_DOWNLODABLE_IMAGE_SIZE
 
 #define CONFIG_SYS_BOOTM_LEN		SZ_64M
diff --git a/include/configs/colibri-imx6ull.h b/include/configs/colibri-imx6ull.h
index 2827c171c970..17482451fb33 100644
--- a/include/configs/colibri-imx6ull.h
+++ b/include/configs/colibri-imx6ull.h
@@ -143,7 +143,6 @@ 
 #define CONFIG_USBD_HS
 
 /* USB Device Firmware Update support */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_16M
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 
 #if defined(CONFIG_VIDEO) || defined(CONFIG_DM_VIDEO)
diff --git a/include/configs/colibri_vf.h b/include/configs/colibri_vf.h
index cae7c14bfb90..5bd440f1db33 100644
--- a/include/configs/colibri_vf.h
+++ b/include/configs/colibri_vf.h
@@ -143,6 +143,5 @@ 
 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET
 
 /* USB DFU */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE (SZ_1M)
 
 #endif /* __CONFIG_H */
diff --git a/include/configs/corvus.h b/include/configs/corvus.h
index 55f77e4400a2..bd4d6e8e39f4 100644
--- a/include/configs/corvus.h
+++ b/include/configs/corvus.h
@@ -81,7 +81,6 @@ 
 #define CONFIG_AT91_WANTS_COMMON_PHY
 
 /* DFU class support */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(SZ_1M)
 #define DFU_MANIFEST_POLL_TIMEOUT	25000
 
 #define CONFIG_SYS_LOAD_ADDR	ATMEL_BASE_CS6
diff --git a/include/configs/dh_imx6.h b/include/configs/dh_imx6.h
index 4a469af5e60b..d9be1c38c44a 100644
--- a/include/configs/dh_imx6.h
+++ b/include/configs/dh_imx6.h
@@ -66,7 +66,6 @@ 
 
 /* USB Gadget (DFU, UMS) */
 #if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(16 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 
 /* USB IDs */
diff --git a/include/configs/exynos4-common.h b/include/configs/exynos4-common.h
index 005f65d4ed6a..5e2aca371e7e 100644
--- a/include/configs/exynos4-common.h
+++ b/include/configs/exynos4-common.h
@@ -19,7 +19,6 @@ 
 /* SD/MMC configuration */
 #define CONFIG_MMC_DEFAULT_DEV	0
 
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* USB Samsung's IDs */
diff --git a/include/configs/odroid_xu3.h b/include/configs/odroid_xu3.h
index 0c86196152fc..fc70dc6a7323 100644
--- a/include/configs/odroid_xu3.h
+++ b/include/configs/odroid_xu3.h
@@ -27,7 +27,6 @@ 
 #define CONFIG_USB_EHCI_EXYNOS
 
 /* DFU */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 #define DFU_MANIFEST_POLL_TIMEOUT	25000
 
diff --git a/include/configs/pico-imx6.h b/include/configs/pico-imx6.h
index 19c8aeb71b6e..6199f0d72e76 100644
--- a/include/configs/pico-imx6.h
+++ b/include/configs/pico-imx6.h
@@ -38,7 +38,6 @@ 
 #define CONFIG_MXC_USB_PORTSC		(PORT_PTS_UTMI | PORT_PTS_PTW)
 #define CONFIG_MXC_USB_FLAGS		0
 
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 #define CONFIG_DFU_ENV_SETTINGS \
diff --git a/include/configs/pico-imx6ul.h b/include/configs/pico-imx6ul.h
index 747ef09f37d9..04a2531f7447 100644
--- a/include/configs/pico-imx6ul.h
+++ b/include/configs/pico-imx6ul.h
@@ -49,7 +49,6 @@ 
 
 #define CONFIG_USBD_HS
 
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 #define CONFIG_DFU_ENV_SETTINGS \
diff --git a/include/configs/rpi.h b/include/configs/rpi.h
index 834f1cd23640..46ada884b487 100644
--- a/include/configs/rpi.h
+++ b/include/configs/rpi.h
@@ -74,9 +74,6 @@ 
 
 /* DFU over USB/UDC */
 #ifdef CONFIG_CMD_DFU
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_1M
-#define CONFIG_SYS_DFU_MAX_FILE_SIZE	SZ_2M
-
 #ifdef CONFIG_ARM64
 #define KERNEL_FILENAME		"Image"
 #else
diff --git a/include/configs/s5p_goni.h b/include/configs/s5p_goni.h
index 9688bdc4c035..6af6009e6126 100644
--- a/include/configs/s5p_goni.h
+++ b/include/configs/s5p_goni.h
@@ -41,7 +41,6 @@ 
 #define CONFIG_PWM			1
 
 /* USB Composite download gadget - g_dnl */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_32M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* USB Samsung's IDs */
diff --git a/include/configs/siemens-am33x-common.h b/include/configs/siemens-am33x-common.h
index e18af7493c7f..f96dd774b178 100644
--- a/include/configs/siemens-am33x-common.h
+++ b/include/configs/siemens-am33x-common.h
@@ -143,7 +143,6 @@ 
 #define CONFIG_USBD_HS
 
 /* USB Device Firmware Update support */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(1 << 20)
 #define DFU_MANIFEST_POLL_TIMEOUT	25000
 
 #endif /* CONFIG_SPL_BUILD */
diff --git a/include/configs/smartweb.h b/include/configs/smartweb.h
index 6e715dc0c1be..5e8637e49484 100644
--- a/include/configs/smartweb.h
+++ b/include/configs/smartweb.h
@@ -122,7 +122,6 @@ 
 #define CONFIG_USB_GADGET_AT91
 
 /* DFU class support */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_1M
 #define DFU_MANIFEST_POLL_TIMEOUT	25000
 #endif
 
diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
index 62b327cd6e52..c5e4292f1964 100644
--- a/include/configs/socfpga_common.h
+++ b/include/configs/socfpga_common.h
@@ -148,7 +148,6 @@  unsigned int cm_get_qspi_controller_clk_hz(void);
  * USB Gadget (DFU, UMS)
  */
 #if defined(CONFIG_CMD_DFU) || defined(CONFIG_CMD_USB_MASS_STORAGE)
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(16 * 1024 * 1024)
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 
 /* USB IDs */
diff --git a/include/configs/taurus.h b/include/configs/taurus.h
index 39eae8e2ba04..6e869462f1e6 100644
--- a/include/configs/taurus.h
+++ b/include/configs/taurus.h
@@ -92,7 +92,6 @@ 
 #define CONFIG_USB_GADGET_AT91
 
 /* DFU class support */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	(SZ_1M)
 #define DFU_MANIFEST_POLL_TIMEOUT	25000
 #endif
 
diff --git a/include/configs/tegra-common-usb-gadget.h b/include/configs/tegra-common-usb-gadget.h
index e6b61c4e8fd3..201f4bc093c9 100644
--- a/include/configs/tegra-common-usb-gadget.h
+++ b/include/configs/tegra-common-usb-gadget.h
@@ -13,8 +13,6 @@ 
 #define CONFIG_CI_UDC_HAS_HOSTPC
 #endif
 /* DFU protocol */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_1M
-#define CONFIG_SYS_DFU_MAX_FILE_SIZE SZ_32M
 #endif
 
 #endif /* _TEGRA_COMMON_USB_GADGET_H_ */
diff --git a/include/configs/warp.h b/include/configs/warp.h
index f17eea117f3a..ba8b0110d749 100644
--- a/include/configs/warp.h
+++ b/include/configs/warp.h
@@ -50,7 +50,6 @@ 
 
 #define CONFIG_USBD_HS
 
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_16M
 #define DFU_DEFAULT_POLL_TIMEOUT 300
 
 /* I2C Configs */
diff --git a/include/configs/warp7.h b/include/configs/warp7.h
index 8eb106027440..a5d52e3977fd 100644
--- a/include/configs/warp7.h
+++ b/include/configs/warp7.h
@@ -149,7 +149,6 @@ 
 #define CONFIG_USBD_HS
 
 /* USB Device Firmware Update support */
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	SZ_16M
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 
 #define CONFIG_USBNET_DEV_ADDR		"de:ad:be:af:00:01"
diff --git a/include/configs/xilinx_versal.h b/include/configs/xilinx_versal.h
index f1d2594f3b32..7ffd655dc9df 100644
--- a/include/configs/xilinx_versal.h
+++ b/include/configs/xilinx_versal.h
@@ -47,7 +47,6 @@ 
 #define CONFIG_SYS_MAXARGS		64
 
 #if defined(CONFIG_CMD_DFU)
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x1800000
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 #define CONFIG_THOR_RESET_OFF
 #define DFU_ALT_INFO_RAM \
diff --git a/include/configs/xilinx_zynqmp.h b/include/configs/xilinx_zynqmp.h
index 15ad4198a6be..57e1163c81f1 100644
--- a/include/configs/xilinx_zynqmp.h
+++ b/include/configs/xilinx_zynqmp.h
@@ -52,7 +52,6 @@ 
 #define CONFIG_SYS_LOAD_ADDR		0x8000000
 
 #if defined(CONFIG_ZYNQMP_USB)
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x1800000
 #define DFU_DEFAULT_POLL_TIMEOUT	300
 #define CONFIG_THOR_RESET_OFF
 #define DFU_ALT_INFO_RAM \
diff --git a/include/configs/zynq-common.h b/include/configs/zynq-common.h
index 1607a8d06518..7afd2e9f86a8 100644
--- a/include/configs/zynq-common.h
+++ b/include/configs/zynq-common.h
@@ -58,7 +58,6 @@ 
 #ifdef CONFIG_USB_EHCI_ZYNQ
 # define CONFIG_EHCI_IS_TDI
 
-# define CONFIG_SYS_DFU_DATA_BUF_SIZE	0x600000
 # define DFU_DEFAULT_POLL_TIMEOUT	300
 # define CONFIG_THOR_RESET_OFF
 # define DFU_ALT_INFO_RAM \
diff --git a/include/dfu.h b/include/dfu.h
index d18b70172829..afada3959b72 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -100,12 +100,6 @@  struct virt_internal_data {
 };
 
 #define DFU_NAME_SIZE			32
-#ifndef CONFIG_SYS_DFU_DATA_BUF_SIZE
-#define CONFIG_SYS_DFU_DATA_BUF_SIZE		(1024*1024*8)	/* 8 MiB */
-#endif
-#ifndef CONFIG_SYS_DFU_MAX_FILE_SIZE
-#define CONFIG_SYS_DFU_MAX_FILE_SIZE CONFIG_SYS_DFU_DATA_BUF_SIZE
-#endif
 #ifndef DFU_DEFAULT_POLL_TIMEOUT
 #define DFU_DEFAULT_POLL_TIMEOUT 0
 #endif
diff --git a/scripts/config_whitelist.txt b/scripts/config_whitelist.txt
index c8c87900ce8f..e0d434ce2d55 100644
--- a/scripts/config_whitelist.txt
+++ b/scripts/config_whitelist.txt
@@ -2083,8 +2083,6 @@  CONFIG_SYS_DEBUG_SERVER_FW_IN_NOR
 CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS
 CONFIG_SYS_DEFAULT_VIDEO_MODE
 CONFIG_SYS_DEF_EEPROM_ADDR
-CONFIG_SYS_DFU_DATA_BUF_SIZE
-CONFIG_SYS_DFU_MAX_FILE_SIZE
 CONFIG_SYS_DIAG_ADDR
 CONFIG_SYS_DIALOG_PMIC_I2C_ADDR
 CONFIG_SYS_DIMM_SLOTS_PER_CTLR