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

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
participants (1)
-
Jeroen Hofstee