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

Maxim Sloyko maxims at google.com
Fri Sep 9 23:53:27 CEST 2016


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.

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.

I suspect that this has something to do with memory configuration, do you
know what I may be missing? Also, it looks like lowlevel_init has been
called twice, i.e. again after relocation -- is this expected? This might
be what is causing the problem, because lowlevel_init does a lot of RAM
related configuration, but I don't know what to do about it.

There is some very basic support for this part in U-Boot, provided by
manufacturer, but it is basically a single platform.S assembly file that
does everything, like RAM configuration and some other peripherals support
in lowlevel_init procedure.

So, if I want to add proper support for this part, i.e. with device tree
and all, is there a way to make this a gradual process? I mean, is it
possible to leave existing RAM initialization procedure in lowlevel_init
and just add new drivers for something I'm interested in or  is this all or
nothing kind of thing?

Thank you.

-- 
*M*axim *S*loyko


More information about the U-Boot mailing list