[U-Boot] [RFC 01/10] ARM: crt0.S: clear the global data

Jeroen Hofstee jeroen at myspectrum.nl
Tue Jun 3 21:41:37 CEST 2014


Hello Simon,

On ma, 2014-06-02 at 20:02 -0600, Simon Glass wrote:
> Hi Jeroen,
> 
> On 31 May 2014 14:32, Jeroen Hofstee <jeroen at myspectrum.nl> wrote:
> > NOTE: smdk5420 snow smdkv310 apf27 arndale origen vpac270_ond_256 smdk5250
> > don't have a memset available.
> 
> You should add a message explaining the motivation for the change.
yes, I will actually check all commit messages, fix the typos and add
proper tags and cc's etc. Make the documentation a bit more generic and
add some comment about why gd needs to be treated special for llvm in
the first place.

That said, regarding this patch, the reason to clear gd at all is that
e.g. i2c depends on it and there have been issues with the serial
console flags etc as well. The reason to do it directly after allocating
gd is that there are several board_init_f's with the more wide spread
use of SPL. Another problem is that some code attempts to store values
in global data assuming it will survive relocation, but failed since gd
got reassigned again.

When just "allocating" global data once and clearing it directly, such
problem should be gone. It also matches the behavior of the generic
board CONFIG_SYS_GENERIC_GLOBAL_DATA, so this actually preserves current
behavior for the ARM boards using the generic board after the removal of
CONFIG_SYS_GENERIC_GLOBAL_DATA.

> Can you add a memset()?
Likely, one way or the other, it will be easily to fix. I posted it as
is since I was wondering what Albert thinks about it. (for completeness
a final version will include a similar change for aarch64).

Regards,
Jeroen






More information about the U-Boot mailing list