[U-Boot] [PATCH v3 4/7] malloc_f: add ARCH_MALLOC_F_LEN to specify SoC-default malloc_f_len

Simon Glass
2015-02-20T17:11:31Z

Hi Masahiro,

On 19 February 2015 at 22:24, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> Now the default value of CONFIG_SYS_MALLOC_F_LEN can be overridden
> by SoC Kconfig file, but we still have to add the same conditional
> "if SYS_MALLOC_F" to every default. Otherwise, a broken .config
> file could be generated. It is too painful.
>
> This commit intends to solve it by introducing SoC-default
> ARCH_MALLOC_F_LEN. This works as follows:
>
> - If ARCH_MALLOC_F_LEN is defined, it overrides the default of
> SYS_MALLOC_F_LEN. If you have the SoC-optimized value,
> you might wish to do this.
>
> - If ARCH_MALLOC_F_LEN is not defined, SYS_MALLOC_F_LEN is default
> to 0x400. This is the global default and it should work well
> enough in most cases.
>
> - You can still change SYS_MALLOC_F_LEN per board, although you do
> not probably have to do so. Per-board default should be saved
> into each defconfig.
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> ---

Seems like a reasonable solution to me. I have to admit I prefer to
adding another option, but if that is the only way to avoid the broken
Kconfig (which I think works fine but could be quite confusing for
people) then so be it.

Reviewed-by: Simon Glass <sjg@chromium.org>