[U-Boot] RFC: Aligning arch initialisation sequences

Wolfgang Denk wd at denx.de
Sat Nov 13 23:45:54 CET 2010


Dear Reinhard Meyer,

In message <4CDF137E.2000902 at emk-elektronik.de> you wrote:
>
> > This has but on tiny shortcoming: we use GD to pass data around, for
> > example to pass clock frequencies determind before relocation to the
> > code running after relocation - which means that GD must be of a
> > statically allocated storage class.
> >
> > Your stack variable above will go out of scope as soon as we leave the
> > board_early_init() function...
> 
> Correct, that's why its even now copied over to storage in SDRAM...
> (at least on ARM:
> 	debug ("relocation Offset is: %08lx\n", gd->reloc_off);
> 	memcpy (id, (void *)gd, sizeof (gd_t));
> 
> 	relocate_code (addr_sp, id, addr);
> )

At this time board_early_init_f() has terminated long ago, i. e. the
data is not available any more.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
... not meant for the weak-at-heart: /^(?=.*one)(?=.*two)/
If you can follow that, you can use it.
          - Randal L. Schwartz in <ukpw67rhl3.fsf at julie.teleport.com>


More information about the U-Boot mailing list