[U-Boot] RFC: Aligning arch initialisation sequences

Wolfgang Denk wd at denx.de
Sun Nov 14 10:04:16 CET 2010


Dear Graeme Russ,

In message <4CDF36E3.7060505 at gmail.com> you wrote:
>
> board_early_init_f() is (in most cases) the very first entry in the
> init_sequence[]

Right.

> So if global data is defined on the stack in board_init_f() and copied to
> the heap at the end of board_init_f() we should be OK. Is global data
> needed prior to board_init_f()?

Yes, as we have no writable data segmeit before relocation. We need a
way to pass around some data.

> For x86, I allocate global data in asm and set three members. The sticking
> point for me is the single ulong parameter to board_init_f() which does not
> present enough flexibility to pass all the information I need.

Pass a pointer to a struct ?

> One nit-pick is that, in reality, the stack space used by board_init_f() is
> never reclaimed because it never returns. What we could do is reset the
> stack pointer prior to calling board_init_r()

This is not correct. After relocation, we set up a completely new
stack in RAM.

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
Remember thee Ay, thou poor ghost while memory holds a seat  In  this
distracted  globe.  Remember  thee!  Yea, from the table of my memory
I'll wipe away all trivial fond  records,  All  saws  of  books,  all
forms,  all  pressures past, That youth and observation copied there.
Hamlet, I : v : 95 William Shakespeare


More information about the U-Boot mailing list