[U-Boot] [PATCH] Increase default of CONFIG_SYS_MALLOC_F_LEN for SPL_OF_CONTROL

Masahiro Yamada yamada.masahiro at socionext.com
Sun Sep 11 14:50:53 CEST 2016


Hi Simon,


2016-09-06 21:46 GMT+09:00 Simon Glass <sjg at chromium.org>:
> Hi Masahiro,
>
> On 6 September 2016 at 06:24, Masahiro Yamada
> <yamada.masahiro at socionext.com> wrote:
>>
>> 2016-09-06 10:04 GMT+09:00 Simon Glass <sjg at chromium.org>:
>> > On 30 August 2016 at 03:56, Stefan Roese <sr at denx.de> wrote:
>> >> On 30.08.2016 11:50, Masahiro Yamada wrote:
>> >>>
>> >>> If both SPL_DM and SPL_OF_CONTROL are enabled, SPL needs to bind
>> >>> several devices, but CONFIG_SYS_MALLOC_F_LEN=0x400 is apparently
>> >>> not enough.  Increase the default to 0x2000 for the case.  This
>> >>> will be helpful for shorter defconfigs.
>> >>>
>> >>> Signed-off-by: Masahiro Yamada <yamada.masahiro at socionext.com>
>> >>
>> >>
>> >> Reviewed-by: Stefan Roese <sr at denx.de>
>> >
>> > Reviewed-by: Simon Glass <sjg at chromium.org>
>> >
>> > It would be worth checking why. I fixed a bug where simple-bus would
>> > bring in all devices regardless of the u-boot,dm-pre-reloc flag.
>> > Perhaps that was it?
>>
>> I do not think so.
>>
>> Recently I tested this.  In spite of "u-boot,dm-pre-reloc"
>> in the SPL device tree, my board failed in SPL.
>>
>> I guess CONFIG_SYS_MALLOC_F_LEN=0x400 is not enough
>> for binding/probing UART, pinctrl, MMC in SPL.
>>
>> I increased the malloc size and it worked fine.
>
> You could turn on DEBUG in common/spl/spl.c and it will print out how
> much memory is used. But by making it the default you are affecting a
> lot of boards which don't use pinctrl, etc. 8KB is a lot for some
> boards.

I tried this, and found I was a bit exaggerating.

0x400 was too small for my boards, but 0x800 worked.
Given SYS_MALLOC_F_LEN specifies the sum of malloc and stack,
so perhaps 0x800 is on the border.
However, 0x2000 is too much.

This patch is in the mainline, so revert it?

--
Best Regards
Masahiro Yamada


More information about the U-Boot mailing list