Commit f69d72ee2a147b93f6d7664daf62af997e28f5b0

Authored by Stephen Warren
Committed by Tom Rini
1 parent 99d969612f

ARM: tegra: tweak DFU buffer sizes

CONFIG_SYS_DFU_DATA_BUF_SIZE defines the size of chunks transferred
across USB. This doesn't need to be particularly large, since it doesn't
limit the overall transfer size.

CONFIG_SYS_DFU_MAX_FILE_SIZE is used to buffer an entire file before
writing it to a filesystem. This define limits the maximum file size that
may be transferred. Bump this up to 32MiB in order to support large
uncompressed kernel images.

Both of these buffers are dynamically allocated, and so the size of both
needs to be taken into account when calculating the required malloc
region size.

Signed-off-by: Stephen Warren <swarren@nvidia.com>

Showing 2 changed files with 5 additions and 3 deletions Side-by-side Diff

include/configs/tegra-common-post.h
... ... @@ -12,8 +12,9 @@
12 12 * Size of malloc() pool
13 13 */
14 14 #ifdef CONFIG_USB_FUNCTION_DFU
15   -#define CONFIG_SYS_MALLOC_LEN ((4 << 20) + \
16   - CONFIG_SYS_DFU_DATA_BUF_SIZE)
  15 +#define CONFIG_SYS_MALLOC_LEN (SZ_4M + \
  16 + CONFIG_SYS_DFU_DATA_BUF_SIZE + \
  17 + CONFIG_SYS_DFU_MAX_FILE_SIZE)
17 18 #else
18 19 #define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
19 20 #endif
include/configs/tegra-common-usb-gadget.h
... ... @@ -30,7 +30,8 @@
30 30 #define CONFIG_CMD_USB_MASS_STORAGE
31 31 /* DFU protocol */
32 32 #define CONFIG_USB_FUNCTION_DFU
33   -#define CONFIG_SYS_DFU_DATA_BUF_SIZE (1 * 1024 * 1024)
  33 +#define CONFIG_SYS_DFU_DATA_BUF_SIZE SZ_1M
  34 +#define CONFIG_SYS_DFU_MAX_FILE_SIZE SZ_32M
34 35 #define CONFIG_CMD_DFU
35 36 #ifdef CONFIG_MMC
36 37 #define CONFIG_DFU_MMC