[U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.

Christian Riesch christian.riesch at omicron.at
Tue Jan 10 09:15:14 CET 2012


Hi Sughosh and Tom,

On Tuesday, January 10, 2012, Sughosh Ganu <urwithsughosh at gmail.com> wrote:
> On Mon Jan 09, 2012 at 04:30:56PM -0700, Tom Rini wrote:
>> On 01/09/2012 11:28 AM, Sughosh Ganu wrote:
>
> <snip>
>
>> > --- a/arch/arm/cpu/arm926ejs/davinci/Makefile
>> > +++ b/arch/arm/cpu/arm926ejs/davinci/Makefile
>> > @@ -38,8 +38,11 @@ COBJS-$(CONFIG_DRIVER_TI_EMAC)   += lxt972.o
dp83848.o et1011c.o ksz8873.o
>> >
>> >  ifdef CONFIG_SPL_BUILD
>> >  COBJS-y    += spl.o
>> > -COBJS-$(CONFIG_SOC_DM365)  += dm365_lowlevel.o
>> > -COBJS-$(CONFIG_SOC_DA8XX)  += da850_lowlevel.o
>> > +COBJS-$(CONFIG_DM365_SPL)  += dm365_lowlevel.o
>> > +COBJS-$(CONFIG_DM365_SPL)  += dm365_spl.o
>> > +COBJS-$(CONFIG_DA850EVM_SPL)       += da850_lowlevel.o
>> > +COBJS-$(CONFIG_DA850EVM_SPL)       += da850_spl.o
>> > +COBJS-$(CONFIG_HAWKBOARD_SPL)      += hawkboard_nand_spl.o
>> >  endif
>>
>> CONFIG_SPL_BUILD means we'll only do this on the SPL build, not the
>> normal build, and we already have symbols for the board and the SoC so
>> we shouldn't need any new CONFIG symbols here, I'm pretty sure.
>
>  The problem here is that both da850evm and hawkboard define the
>  CONFIG_SOC_DA850, and CONFIG_SOC_DA8XX, as the hawkboard shares code
>  like pinmux with the da850.
>
>  I see a CONFIG_MACH_DAVINCI_* like define in da850evm.h and
>  hawkboard.h. Should i add a similar define for cam_enc_4xx, and use
>  these instead.

Actually the problem is that now we have a board specific file
(hawkboard_nand_spl.c) in the arch tree. Hawkboard has a DA850 SoC so if we
have a da850_spl.c hawkboard should either use it as well, or we make the
*spl.c files board specific and put them into the board tree.

board_init_f() in hawkboard_nand_spl.c is pretty much the same as in
da850_spl.c (ok, we don't do PLL and DDR configuration, but we could add an
#ifdef to da850_lowlevel.c so that DDR and PLL configuration is only done
if the required #defines are present, like it is currently done for
CONFIG_SYS_DA850_CS2CFG). And board_init_r() in hawkboard_nand_spl.c is
exactly the same as in dm365_spl.c. Therefore I think we could have only a
single spl.c that can be used for all davinci SoCs and boards until we have
an even more generic solution (see [1]).

Then, spl.c would look like this:

[,,,]
void board_init_f(ulong dummy)
{
#ifdef CONFIG_SOC_DM365
        dm36x_lowlevel_init(0);
#endif
#ifdef CONFIG_SOC_DA8XX
        arch_cpu_init();
#endif
        relocate_code(CONFIG_SPL_STACK, NULL, CONFIG_SPL_TEXT_BASE);
}

void board_init_r(gd_t *id, ulong dummy)
{
#ifdef CONFIG_SPL_NAND_LOAD
        nand_init();
        puts("Nand boot...\n");
        nand_boot();
#endif
#ifdef CONFIG_SPL_SPI_LOAD
        mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
                        CONFIG_SYS_MALLOC_LEN);
        gd = &gdata;
        gd->bd = &bdata;
        gd->flags |= GD_FLG_RELOC;
        gd->baudrate = CONFIG_BAUDRATE;
        serial_init();          /* serial communications setup */
        gd->have_console = 1;

        puts("SPI boot...\n");
        spi_boot();
#endif
}
[...]

Would this work for hawkboard?

Regards, Christian

[1]
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/118233/focus=118721


More information about the U-Boot mailing list