[U-Boot] CONFIG_SYS_XIP_BOOT for when it's a choice?

Wolfgang Denk wd at denx.de
Tue Apr 8 15:02:44 CEST 2014


Dear Tom,

In message <20140407195731.GL23803 at bill-the-cat> you wrote:
> 
> Maybe, maybe not.  But it's beside the point.  The point is we have SoC
> init code that needs to be run once.  Sometimes this is true when
> CONFIG_SPL_BUILD=y, sometimes this is true when other options are set
> instead.  What should we call the option to denote one-time init?
> Should we extend CONFIG_SKIP_LOWLEVEL_INIT to cover this case?

Um... I think, if we build (and use) the SPL, then the low level init
code would always be run (if at all) in the SPL; without SPL, it would
be run in the normal U-Boot code.  CONFIG_SKIP_LOWLEVEL_INIT is
intended to skip running this low level init code.  To me this looks
independent of where this init code is located - it is yet another
orthogonal decision.

Which sort of extension do you have in mind here?


> > If you use the memory mapped mode, then it looks just like any
> > other ROM, and we should not need special code either.
>
> Well, for CONFIG_NOR_BOOT we must have it on am335x (haven't checked
> am43xx) to finish doing pinmux as only 12KiB is mapped, in addition to
> env related options.  On am43xx and QSPI it's just used to denote when
> we are doing one-time init in U-Boot proper rather than SPL.

Sorry, I lost you.  what is the "it" in both sentences referring to?

Also, I'm not sure what exactly you mean by "one-time"init - all
initialization steps in init_sequence[] are executed only once.
These settings you are referring to - can these me made here, or is
this stuff that is running before board_init_f() ?


Um... I just ran over this in "arch/arm/lib/spl.c":

 21  * In the context of SPL, board_init_f must ensure that any clocks/etc for
 22  * DDR are enabled, ensure that the stack pointer is valid, clear the BSS
 23  * and call board_init_f.  We provide this version by default but mark it
           ^^^^^^^^^^^^^^^^^
 24  * as __weak to allow for platforms to do this in their own way if needed.
 25  */
 26 void __weak board_init_f(ulong dummy)   
 27 {
 28         /* Clear the BSS. */
 29         memset(__bss_start, 0, __bss_end - __bss_start);
 30
 31         /* Set global data pointer. */
 32         gd = &gdata;
 33 
 34         board_init_r(NULL, 0);
            ^^^^^^^^^^^^

The comment says _f, the code has _r - which is right?


> This is, I guess, yet another extension of "we need to treat SPL as a
> U-Boot with x/y/z set, not a special magic build target like we do
> today" and Kconfig will help.

Yes, probabvly.

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
A fanatic is a person who can't change his mind and won't change  the
subject.                                          - Winston Churchill


More information about the U-Boot mailing list