nios2: trim CONFIG_SYS_MALLOC_LEN
PATCH 1/2 nios2: trim CONFIG_SYS_MALLOC_LEN
Trim CONFIG_SYS_MALLOC_LEN size, because CONFIG_ENV_SIZE is included to total memory allocation in common.h,
--- include/configs/nios2-generic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/configs/nios2-generic.h +1 -1
@@ -82,7 +82,7 @@#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \ CONFIG_SYS_SDRAM_SIZE - \ CONFIG_SYS_MONITOR_LEN) -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000) +#define CONFIG_SYS_MALLOC_LEN 0x20000/* * MISC
Signature · 1 line
2.5.0
PATCH 1/2 nios2: trim CONFIG_SYS_MALLOC_LEN
Quoted 8 lines · Thomas Chou
Trim
CONFIG_SYS_MALLOC_LENsize, becauseCONFIG_ENV_SIZEis included to total memory allocation incommon.h,Signed-off-by Thomas Chou <[email protected]>--- include/configs/nios2-generic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to u-boot-nios.
Quoted 14 lines
include/configs/nios2-generic.h +1
-1@@ -82,7 +82,7 @@#define CONFIG_SYS_MONITOR_BASE (CONFIG_SYS_SDRAM_BASE + \ CONFIG_SYS_SDRAM_SIZE - \ CONFIG_SYS_MONITOR_LEN) -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 0x20000) +#define CONFIG_SYS_MALLOC_LEN 0x20000/* * MISC
PATCH 1/2 nios2: trim CONFIG_SYS_MALLOC_LEN
In reply to Thomas ChouQuoted 5 lines · thomas at wytron.com.tw
Trim
CONFIG_SYS_MALLOC_LENsize, becauseCONFIG_ENV_SIZEis included to total memory allocation incommon.h,Signed-off-by Thomas Chou <[email protected]>---
Thanks
Chin Liang
PATCH 2/2 nios2: trim CONFIG_SYS_MEMTEST_END
In reply to Thomas ChouTrim CONFIG_SYS_MEMTEST_END location.
CONFIG_SYS_MONITOR_LEN
Reserving 256k for U-Boot at: d7fc0000CONFIG_ENV_SIZECONFIG_SYS_MALLOC_LEN
Reserving 256k for malloc() at: d7f800000x10000 for the rest
Reserving 68 Bytes for Board Info at: d7f7ffbc Reserving 208 Bytes for Global Data at: d7f7feec Reserving 12000 Bytes for FDT at: d7f7d00c Stack
--- include/configs/nios2-generic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
include/configs/nios2-generic.h +4 -1
@@ -96,7 +96,10 @@ 16) /* Print buf size */#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE -#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000) +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MONITOR_BASE - \ + CONFIG_ENV_SIZE - \ + CONFIG_SYS_MALLOC_LEN - \ + 0x10000)#define CONFIG_CMDLINE_EDITING #define CONFIG_CMD_GPIO
Signature · 1 line
2.5.0
PATCH 2/2 nios2: trim CONFIG_SYS_MEMTEST_END
Quoted 23 lines · thomas at wytron.com.tw
Trim
CONFIG_SYS_MEMTEST_ENDlocation.
CONFIG_SYS_MONITOR_LEN
Reserving 256k for U-Boot at:d7fc0000CONFIG_ENV_SIZECONFIG_SYS_MALLOC_LEN
Reserving 256k formalloc()at:d7f800000x10000for the rest
Reserving 68 Bytes for Board Info at:d7f7ffbcReserving 208 Bytes for Global Data at:d7f7feecReserving 12000 Bytes for FDT at:d7f7d00cStackSigned-off-by Thomas Chou <[email protected]>--- include/configs/nios2-generic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)include/configs/nios2-generic.h +0
-0
include/configs/nios2-generic.h line 101
Quoted 7 lines
include/configs/nios2-generic.h +3
-1@@ -96,7 +96,10 @@ 16) /* Print buf size */#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE -#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000) +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MONITOR_BASE - \ + CONFIG_ENV_SIZE - \ + CONFIG_SYS_MALLOC_LEN - \
Since CONFIG_ENV_IS_IN_FLASH, I believe we can take out the CONFIG_ENV_SIZE here.
Thanks
Chin Liang
Quoted 4 lines
include/configs/nios2-generic.h +1
-0+ 0x10000)#define CONFIG_CMDLINE_EDITING #define CONFIG_CMD_GPIO
PATCH 2/2 nios2: trim CONFIG_SYS_MEMTEST_END
Hi Chin Liang,
Quoted 7 lines · Chin Liang See
include/configs/nios2-generic.h line 101
Quoted 3 lines
include/configs/nios2-generic.h +3
-0+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MONITOR_BASE - \ + CONFIG_ENV_SIZE - \ + CONFIG_SYS_MALLOC_LEN - \Since
CONFIG_ENV_IS_IN_FLASH, I believe we can take out theCONFIG_ENV_SIZEhere.
This comes from a very old macro in common.h,
#if defined(CONFIG_ENV_IS_EMBEDDED)
#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
#elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) < CONFIG_SYS_MONITOR_BASE) || \
(CONFIG_ENV_ADDR >= (CONFIG_SYS_MONITOR_BASE + CONFIG_SYS_MONITOR_LEN))
) || \
defined(CONFIG_ENV_IS_IN_NVRAM)
#define TOTAL_MALLOC_LEN (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE)
#else
#define TOTAL_MALLOC_LEN CONFIG_SYS_MALLOC_LEN
#endif
The TOTAL_MALLOC_LEN is (CONFIG_SYS_MALLOC_LEN + CONFIG_ENV_SIZE) for nios2. I think the macro might need fix though.
Best regards,
Thomas
PATCH 2/2 nios2: trim CONFIG_SYS_MEMTEST_END
Hi Thomas,
Quoted 24 lines · thomas at wytron.com.tw
Hi Chin Liang,
Quoted 7 lines · Chin Liang See
include/configs/nios2-generic.h line 101
Quoted 3 lines
include/configs/nios2-generic.h +3
-0+#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MONITOR_BASE - \ + CONFIG_ENV_SIZE - \ + CONFIG_SYS_MALLOC_LEN - \Since
CONFIG_ENV_IS_IN_FLASH, I believe we can take out theCONFIG_ENV_SIZEhere.This comes from a very old macro in
common.h,#if
defined(CONFIG_ENV_IS_EMBEDDED)
#defineTOTAL_MALLOC_LENCONFIG_SYS_MALLOC_LEN
#elif ( ((CONFIG_ENV_ADDR+CONFIG_ENV_SIZE) <CONFIG_SYS_MONITOR_BASE) || \
(CONFIG_ENV_ADDR>= (CONFIG_SYS_MONITOR_BASE+CONFIG_SYS_MONITOR_LEN))
) || \
defined(CONFIG_ENV_IS_IN_NVRAM)
#defineTOTAL_MALLOC_LEN(CONFIG_SYS_MALLOC_LEN+CONFIG_ENV_SIZE)
#else
#defineTOTAL_MALLOC_LENCONFIG_SYS_MALLOC_LEN
#endif
Quoted 2 lines
The
TOTAL_MALLOC_LENis (CONFIG_SYS_MALLOC_LEN+CONFIG_ENV_SIZE) for nios2. I think the macro might need fix though.
Yah. In that case, it should be ok CONFIG_ENV_SIZE is much small. The memtest should sufficiently exercise the each memory lines. Thanks again for the patch.
Thanks
Chin Liang
Quoted 3 lines
Best regards,
Thomas
PATCH 2/2 nios2: trim CONFIG_SYS_MEMTEST_END
In reply to Thomas ChouQuoted 13 lines · Thomas Chou
Trim
CONFIG_SYS_MEMTEST_ENDlocation.
CONFIG_SYS_MONITOR_LEN
Reserving 256k for U-Boot at:d7fc0000CONFIG_ENV_SIZECONFIG_SYS_MALLOC_LEN
Reserving 256k formalloc()at:d7f800000x10000for the rest
Reserving 68 Bytes for Board Info at:d7f7ffbcReserving 208 Bytes for Global Data at:d7f7feecReserving 12000 Bytes for FDT at:d7f7d00cStack
Quoted 5 lines
Signed-off-by Thomas Chou <[email protected]>--- include/configs/nios2-generic.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
Applied to u-boot-nios.
Quoted 17 lines
include/configs/nios2-generic.h +4
-1@@ -96,7 +96,10 @@ 16) /* Print buf size */#define CONFIG_SYS_LOAD_ADDR CONFIG_SYS_SDRAM_BASE#define CONFIG_SYS_MEMTEST_START CONFIG_SYS_SDRAM_BASE -#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_INIT_SP - 0x20000) +#define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MONITOR_BASE - \ + CONFIG_ENV_SIZE - \ + CONFIG_SYS_MALLOC_LEN - \ + 0x10000)#define CONFIG_CMDLINE_EDITING #define CONFIG_CMD_GPIO