Commit 99d969612f6e46192b4a963a7e5f8466a884f920

Authored by Stephen Warren
Committed by Tom Rini
1 parent 411c5e57e8

ARM: tegra: fix malloc region sizing

Commit 52a7c98a1772 "tegra-common: increase malloc pool len by dfu mmc
file buffer size" updated the definition of CONFIG_SYS_MALLOC_LEN for
Tegra to take account of the DFU buffer size. However, this change had
no effect, since typical Tegra board config headers don't set the DFU-
related defines until after tegra-common.h is included. Fix this by
moving the affected conditional code to tegra-common-post.h, which is
included last. Also move the definition of SYS_NONCACHED_MEMORY since
it's a related and adjacent definition.

Fix the condition to test for the DFU feature, rather than specifically
MMC DFU support, so it applies in all cases.

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

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

include/configs/tegra-common-post.h
... ... @@ -8,6 +8,20 @@
8 8 #ifndef __TEGRA_COMMON_POST_H
9 9 #define __TEGRA_COMMON_POST_H
10 10  
  11 +/*
  12 + * Size of malloc() pool
  13 + */
  14 +#ifdef CONFIG_USB_FUNCTION_DFU
  15 +#define CONFIG_SYS_MALLOC_LEN ((4 << 20) + \
  16 + CONFIG_SYS_DFU_DATA_BUF_SIZE)
  17 +#else
  18 +#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
  19 +#endif
  20 +
  21 +#ifndef CONFIG_ARM64
  22 +#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
  23 +#endif
  24 +
11 25 #ifndef CONFIG_SPL_BUILD
12 26 #define BOOT_TARGET_DEVICES(func) \
13 27 func(MMC, mmc, 1) \
include/configs/tegra-common.h
... ... @@ -37,20 +37,6 @@
37 37 #define CONFIG_ENV_SIZE 0x2000 /* Total Size Environment */
38 38  
39 39 /*
40   - * Size of malloc() pool
41   - */
42   -#ifdef CONFIG_DFU_MMC
43   -#define CONFIG_SYS_MALLOC_LEN ((4 << 20) + \
44   - CONFIG_SYS_DFU_DATA_BUF_SIZE)
45   -#else
46   -#define CONFIG_SYS_MALLOC_LEN (4 << 20) /* 4MB */
47   -#endif
48   -
49   -#ifndef CONFIG_ARM64
50   -#define CONFIG_SYS_NONCACHED_MEMORY (1 << 20) /* 1 MiB */
51   -#endif
52   -
53   -/*
54 40 * NS16550 Configuration
55 41 */
56 42 #define CONFIG_TEGRA_SERIAL