[U-Boot] U-Boot memory allocation problems with ast2500

Simon Glass sjg at chromium.org
Thu Sep 15 16:29:28 CEST 2016


Hi Maxim,

On 14 September 2016 at 09:50, Maxim Sloyko <maxims at google.com> wrote:
>
>
>
> On Fri, Sep 9, 2016 at 4:18 PM, Simon Glass <sjg at chromium.org> wrote:
>>
>> Hi Maxim,
>>
>> On 9 September 2016 at 15:53, Maxim Sloyko <maxims at google.com> wrote:
>> >
>> > Hi all,
>> >
>> > First, disclaimer: this is the first time I'm doing something with U-Boot or the part (ast2500), so any claim I make below can be false or just plain nonsense.
>>
>> Welcome!
>>
>> >
>> > I'm working on expanding support of Aspeed ast2500 part in U-Boot.
>> >
>> > I ran into some problems, when I tried to use Linux Kernel device tree for this part in U-Boot. Looking at diagnostic messages (http://pastebin.ca/3713876) I figured out that the problem is that U-Boot continues to use malloc_simple, even after it has been relocated to RAM. As a result, it fails to allocate 130k needed for environment, because it is larger than the configured size of a memory chunk for simple malloc.
>>
>> The test for this is in dlmalloc.c - the GD_FLG_FULL_MALLOC_INIT flag.
>> The flag is set in initr_reloc() after relocation.
>>
>> I wonder if your global_data (the 'gd' pointer) is not set up
>> correctly, so it cannot write to the flag.
>
>
> OK, so you are right, this flag turned out to be a problem. Global data was setup normally, but then for some reason in board_init there was a line
>
>  gd->flags = 0;
>
> I removed it and everything works now.
>
> Thanks for your help!

OK, that's good!

[...]

Regards,
Simon


More information about the U-Boot mailing list