[U-Boot] [PATCH] ppc: transform init_sequence into a function.

Scott Wood
2010-12-07T00:21:44Z

On Tue, 7 Dec 2010 01:07:30 +0100
Joakim Tjernlund <joakim.tjernlund@transmode.se> wrote:

> Scott Wood <scottwood@freescale.com> wrote on 2010/12/06 23:49:04:
> >
> > On Tue, 7 Dec 2010 09:36:40 +1100
> > Graeme Russ <graeme.russ@gmail.com> wrote:
> >
> > > On Tue, Dec 7, 2010 at 8:33 AM, Scott Wood <scottwood@freescale.com> wrote:
> > > > I think it's easier with the function pointers -- if you want to debug
> > > > a hang in that phase of the boot, just have the loop print the address
> > > > of each function before it calls it.
> > >
> > > I agree, but you can't print the address before you have console output.
> >
> > It's usually not too hard to hack something together, even if it's too
> > early for normal console output -- but I'd expect most problems to be
> > either before the initialization list, or after the console is working.
> >
> > > I notice that console_init_f() can be up to 13th in the list of initialisation
> > > functions - How often is that the case? There seems to be a lot of SDRAM
> > > initialisation prior to getting console output which, to me, seems a little
> > > strange - surely console output can be achieved earlier (even if it is using
> > > a hard-coded baud rate)
> >
> > I don't see "a lot of SDRAM initialization" -- there's
> > adjust_sdram_tbs_8xx, but that's really just setting up a couple clock
> > registers (and it's only for 8xx). It's not the real SDRAM init.
>
> Scott, listen to yourself. You are proposing that one should turn the
> code inside out and scan the map files just do this simple thing.

It looks like you're the one turning this code inside out. :-)

No need to scan anything yourself; let the tools (gdb/addr2line/etc) do
it.

> What is so valuable with func ptrs that you think it is worth it?

As I said, I think it's at least as easy to debug the way it is. And
you admitted you found the new way uglier...

Plus, maybe someday we'll get real section-list initfuncs.

-Scott