[U-Boot] ARM, SPL: gd / sp setup mostly omap (and sunxi)

Jeroen Hofstee jeroen at myspectrum.nl
Sat Sep 27 20:58:39 CEST 2014


Hi,

In the clang serie I left out the changes regarding gd [well
almost all, besides one just to brick Toms board ;), and for the
record not intentionally], since they are not a clang problem, it
might need some general cleanup.

On ARM/omap there are several points setting up sp / gd:

- arch/arm/cpu/armv7/lowlevel_init.S sets both of them before
calling s_init.
- arch/arm/cpu/armv7/omap3/lowlevel_init.S doesn't setup gd,
so omap boards typically setup their own gd again.
- arch/arm/lib/crt0.S setups both of them again.
- the board_init_f in SPL typically sets gd again.
- the common/board_f.c used to set it again (fixed)
- the common/board_r.c used to set it again (fixed)

And to make it more interesting, they don't point to the same
location perse. My preference would be to only do this once,
preferably by calling main as soon as possible. As far as I can
see this should not cause any problem. e.g. We could add a
system_init_f in boards_f.c and arch/arm/lib/spl.c so it gets
called after sp and gd are valid, so they don't have to do their
own magic.

Perhaps I am missing something, comments are welcome.

Regards,
Jeroen



More information about the U-Boot mailing list