From 8e3ea2da729df07f296611abeabba6cc67333daa Mon Sep 17 00:00:00 2001 From: Aswath Govindraju Date: Tue, 1 Jun 2021 16:51:47 +0530 Subject: usb: dfu: Migrate CONFIG_SYS_DFU_DATA_BUF_SIZE and CONFIG_SYS_DFU_MAX_FILE_SIZE to Kconfig Currently the config options CONFIG_SYS_DFU_DATA_BUF_SIZE and CONFIG_SYS_DFU_MAX_FILE_SIZE are being set in include/configs/.h files and also in _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 Signed-off-by: Aswath Govindraju Acked-by: Oleksandr Suvorov Acked-by: Matthias Brugger Acked-by: Lukasz Majewski --- drivers/dfu/Kconfig | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'drivers/dfu') diff --git a/drivers/dfu/Kconfig b/drivers/dfu/Kconfig index 121dc54f54..b50547476c 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 -- cgit v1.2.3