[U-Boot] [PATCH v2 06/22] Add generic spl infrastructure

Scott Wood
2011-05-17T16:50:35Z

On Tue, 17 May 2011 12:24:34 +0530
Aneesh V <aneesh@ti.com> wrote:

> On Tuesday 17 May 2011 12:02 AM, Scott Wood wrote:
> > On Sun, 15 May 2011 20:51:24 +0530
> > Aneesh V<aneesh@ti.com> wrote:
> >> diff --git a/arch/arm/include/asm/global_data.h b/arch/arm/include/asm/global_data.h
> >> index 2a84d27..2ce020e 100644
> >> --- a/arch/arm/include/asm/global_data.h
> >> +++ b/arch/arm/include/asm/global_data.h
> >> @@ -89,6 +89,11 @@ typedef struct global_data {
> >> #define GD_FLG_DISABLE_CONSOLE 0x00040 /* Disable console (in& out) */
> >> #define GD_FLG_ENV_READY 0x00080 /* Environment imported into hash table */
> >>
> >> +#ifdef CONFIG_PRELOADER
> >> +/* SPL works from internal RAM. gd pointer can be in .data section */
> >> +#define DECLARE_GLOBAL_DATA_PTR extern gd_t *gd
> >> +#else
> >> #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r8")
> >> +#endif
> >
> > Is this appropriate for all ARM boards (e.g. those currently using
> > nand_spl)?
>
> None of the SPL's other than this one seems to be using global data
> today. If anybody wants to use it this seems to be the logical option
> for me because by definition SPL runs from some kind of RAM so global
> data can be placed in the .data section of SPL.

There is nand_spl code, including ARM, that uses gd. E.g. putc() in
board/davinci/da8xxevm/hawkboard_nand_spl.c.

This comment also applies to the other uses of CONFIG_PRELOADER -- are all
of those changes appropriate for the existing nand_spl users?

-Scott