[U-Boot] [PATCH v2 04/10] arm, davinci: add support for new spl framework

Heiko Schocher hs at denx.de
Thu Oct 6 09:52:24 CEST 2011


Hello Christian,

Christian Riesch wrote:
> Hello Heiko,
> 
> On Wed, Oct 5, 2011 at 4:28 PM, Heiko Schocher <hs at denx.de> wrote:
>> Signed-off-by: Heiko Schocher <hs at denx.de>
>> Cc: Albert ARIBAUD <albert.u.boot at aribaud.net>
>> Cc: Sandeep Paulraj <s-paulraj at ti.com>
>> ---
>>  Makefile                                  |    8 +++-
>>  arch/arm/cpu/arm926ejs/davinci/Makefile   |    8 ++++
>>  arch/arm/cpu/arm926ejs/davinci/spl.c      |   63 +++++++++++++++++++++++++++++
>>  arch/arm/cpu/arm926ejs/davinci/spl_nand.c |   57 ++++++++++++++++++++++++++
>>  arch/arm/cpu/arm926ejs/start.S            |   25 +++++++++++-
>>  5 files changed, 158 insertions(+), 3 deletions(-)
>>  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl.c
>>  create mode 100644 arch/arm/cpu/arm926ejs/davinci/spl_nand.c
> 
> [...]
> 
>> diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
>> new file mode 100644
>> index 0000000..d9b9398
>> --- /dev/null
>> +++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
> 
> [...]
> 
>> +void puts(const char *str)
>> +{
>> +       while (*str)
>> +               putc(*str++);
>> +}
>> +
>> +void putc(char c)
>> +{
>> +       if (c == '\n')
>> +               NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), '\r');
>> +
>> +       NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
>> +}
>> +
> 
> Are these functions really required? I am currently also working on an
> SPL for davinci (the AM1808 SoC) and had a look at the code in
> arch/arm/cpu/armv7/omap-common/spl.c:

Yes, I know this code, but the disadvantage of it is, you need
printf(), which blows up code. I only use puts(), which result
in a smaller code.

>         gd = &gdata;
>         gd->bd = &bdata;
>         gd->flags |= GD_FLG_RELOC;
>         gd->baudrate = CONFIG_BAUDRATE;
> 
>         serial_init();          /* serial communications setup */
> 
> After that they use putc, printf... from common/console.c

see above comment, I don;t want to use this code ... also I don;t need
the gd pointer at all in spl ...

> However, I had to add a gd->have_console = true; to the code above
> since this is required due to commit
> e3e454cd72f319908355427b1a3ae54b3dd53356.

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany


More information about the U-Boot mailing list