Skip to contentSkip to conversation

ti_armv7_common.h: Adjust malloc pool size in all cases.

PATCH In review Tom Rini 1 participant 2 messages Sep 19, 2016 – Sep 27, 2016

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

PATCH 1/1 ti_armv7_common.h: Adjust malloc pool size in all cases.

Previously we had been adjusting CONFIG_SYS_MALLOC_LEN based on if CONFIG_DFU_MMC has been set or not. However, for quite some time this has not been the case as we often include <configs/ti_armv7_common.h> prior to setting CONFIG_DFU_MMC so we would always use 16MiB and then not have enough room for to DFU files. Given the amount of memory we always have, setting a minimum size of 32MiB for malloc is reasonable. However, in the SPL case not only do we not need that much we start running into overlap problems and then will fail to boot. Since we don't need 16MiB in the SPL case, bring this down to 8MiB.

---
 include/configs/ti_armv7_common.h | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
include/configs/ti_armv7_common.h +2 -5
index d8a8c4a87558..3ec8a8f44997 100644
@@ -146,10 +146,7 @@
  * we are on so we do not need to rely on the command prompt.  We set a
  * console baudrate of 115200 and use the default baud rate table.
  */
-#ifdef CONFIG_DFU_MMC
-#define CONFIG_SYS_MALLOC_LEN	((16 << 20) + CONFIG_SYS_DFU_DATA_BUF_SIZE)
-#else
-#define CONFIG_SYS_MALLOC_LEN	(16 << 20)
+#define CONFIG_SYS_MALLOC_LEN		SZ_32M
 #endif
 #define CONFIG_SYS_CONSOLE_INFO_QUIET
 #define CONFIG_BAUDRATE			115200
@@ -230,7 +227,7 @@
 #ifndef CONFIG_SYS_SPL_MALLOC_START
 #define CONFIG_SYS_SPL_MALLOC_START	(CONFIG_SPL_BSS_START_ADDR + \
 					 CONFIG_SPL_BSS_MAX_SIZE)
-#define CONFIG_SYS_SPL_MALLOC_SIZE	CONFIG_SYS_MALLOC_LEN
+#define CONFIG_SYS_SPL_MALLOC_SIZE	SZ_8M
 #endif
 #ifndef CONFIG_SPL_MAX_SIZE
 #define CONFIG_SPL_MAX_SIZE		(SRAM_SCRATCH_SPACE_ADDR - \
Signature · 1 line
1.9.1
author
#1 lore raw
Quoted 11 lines · Tom Rini

Previously we had been adjusting CONFIG_SYS_MALLOC_LEN based on if CONFIG_DFU_MMC has been set or not. However, for quite some time this has not been the case as we often include <configs/ti_armv7_common.h> prior to setting CONFIG_DFU_MMC so we would always use 16MiB and then not have enough room for to DFU files. Given the amount of memory we always have, setting a minimum size of 32MiB for malloc is reasonable. However, in the SPL case not only do we not need that much we start running into overlap problems and then will fail to boot. Since we don't need 16MiB in the SPL case, bring this down to 8MiB.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160927/3136e443/attachment.sig>