On 6/30/22 15:36, Tom Rini wrote:
Hi,
[...]
In case the MALLOC_F_ADDR is set to non-zero value, the early malloc area is
not going to be placed just below stack top, but elsewhere. Do not reserve
MALLOC_F bytes in this case, as that wastes stack space and may even cause
insufficient stack space in SPL.
This functionality is particularly useful on i.MX8M, where the insufficient
stack space can be triggered.
[...]
common/init/board_init.c | 2 ++
1 file changed, 2 insertions(+)
Please can you migrate the option to Kconfig first? I suspect that
will simplify the logic and avoid the #ifndef
That was my first reaction as well. But, I'm not so sure after looking
at things more. An issue is that CONFIG_MALLOC_F_ADDR should probably
be CONFIG_SPL_MALLOC_F_ADDR as it's only used in SPL. But it's also not
an either/or around CONFIG_SPL_SYS_MALLOC_F_LEN.
It would be good to move to Kconfig (but I also don't see a common
default for the handful of SoCs using it), and maybe a !CONFIG_VAL()
test instead of ifndef.
See
[PATCH] board_init: Convert CONFIG_MALLOC_F_ADDR to Kconfig