
Hello Simon,
On Tue, 23 Dec 2014 12:04:50 -0700, Simon Glass sjg@chromium.org wrote:
Some ARM boards use global_data in SPL before it set up by crt0.S. To achieve this they use a separate global_data variable called gdata which resides in the data section. The one set up by crt0.S is generally ignored.
This prevents crt0.S from setting up things like the early malloc() pool. It therefore prevents driver model from being used in SPL.
However gdata really isn't needed. In fact lowlevel_init() is called just before board_init_f() so, for SPL at least, there is no point in doing anything before board_init_f(). The one slightly messy area is that SPL may want to move the stack from SRAM to SDRAM at some point. But this should be done at the end of board_init_f() (or before board_init_r() is called) and is not a reason to init DRAM before board_init_f().
It isn't that difficult to get rid of gdata. This series builds on Tom Rini's recent series for omap3, and extends it to the other offenders: imx, sunxi and zynq.
I have tested so far only on sunxi. This series is available at u-boot-dm branch 'gd-working'.
Overall series:
Acked-by: Albert ARIBAUD albert.u.boot@aribaud.net
Amicalement,