From: Heiko Schocher Date: Thu, 06 Oct 2011 09:52:24 +0200 Subject: [U-Boot] [PATCH v2 04/10] arm, davinci: add support for new spl framework In-Reply-To: References: <1317824890-8642-1-git-send-email-hs@denx.de> Message-ID: <4E8D5E38.2010107@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hello Christian, Christian Riesch wrote: > Hello Heiko, > > On Wed, Oct 5, 2011 at 4:28 PM, Heiko Schocher wrote: >> Signed-off-by: Heiko Schocher >> Cc: Albert ARIBAUD >> Cc: Sandeep Paulraj >> --- >> 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