From c5472516837ab5033aba94bfeac916e5c05d76b8 Mon Sep 17 00:00:00 2001 From: john-1 Date: Wed, 22 Apr 2026 17:43:45 +0300 Subject: [PATCH] Fix hi3516av200 malloc: use literal size to avoid hi-common.h override The previous fix used CONFIG_ENV_SIZE in the malloc definition, but hi-common.h redefines CONFIG_ENV_SIZE from 0x40000 to 0x10000 after hi3516av200.h, silently shrinking the heap from 768KB to 576KB. Use a literal 0x40000 + 768KB = 1MB total heap. This value: - Fits UBI's 124KB vmalloc after TFTP (issue #5) - Stays within SPL MMU page table limits for cold NAND boot (issue #7) Tested on hardware: cold NAND boot OK, full 7-partition UBI restore OK. Closes #7 Co-Authored-By: Claude Opus 4.6 (1M context) --- include/configs/hi3516av200.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/configs/hi3516av200.h b/include/configs/hi3516av200.h index fac5730..5d94e69 100644 --- a/include/configs/hi3516av200.h +++ b/include/configs/hi3516av200.h @@ -101,7 +101,7 @@ #define FMC_TEXT_ADRS (FMC_MEM_BASE) #define MEM_BASE_DDR (DDR_MEM_BASE) -#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 2*1024*1024) +#define CONFIG_SYS_MALLOC_LEN (0x40000 + 768*1024) /* size in bytes reserved for initial data */ #define CONFIG_SYS_GBL_DATA_SIZE 128