public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
@ 2012-01-09 18:28 Sughosh Ganu
  2012-01-09 23:30 ` Tom Rini
  2012-01-10 18:15 ` [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure Sughosh Ganu
  0 siblings, 2 replies; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-09 18:28 UTC (permalink / raw)
  To: u-boot

This patch moves hawkboard to the new spl infrastructure from the
older nand_spl one. Making this change required some code refactoring
with a couple of davinci based platforms which use spl.

Removed the hawkboard_nand_config build option -- The spl code now
gets compiled with hawkboard_config, after building the main u-boot
image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
to reflect the same.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Tom Rini <trini@ti.com>
---
 arch/arm/cpu/arm926ejs/davinci/Makefile            |    7 +-
 .../cpu/arm926ejs/davinci/{spl.c => da850_spl.c}   |   46 +------
 .../cpu/arm926ejs/davinci/{spl.c => dm365_spl.c}   |   60 +--------
 .../cpu/arm926ejs/davinci}/hawkboard_nand_spl.c    |   34 ++---
 arch/arm/cpu/arm926ejs/davinci/spl.c               |   49 +------
 .../{u-boot-spl.lds => u-boot-spl-da850evm.lds}    |    0
 .../davinci/da8xxevm/u-boot-spl-hawk.lds           |   22 ++-
 boards.cfg                                         |    1 -
 doc/README.hawkboard                               |   43 +++---
 include/configs/cam_enc_4xx.h                      |    1 +
 include/configs/da850evm.h                         |    3 +-
 include/configs/hawkboard.h                        |   17 ++-
 nand_spl/board/davinci/da8xxevm/Makefile           |  155 --------------------
 13 files changed, 71 insertions(+), 367 deletions(-)
 copy arch/arm/cpu/arm926ejs/davinci/{spl.c => da850_spl.c} (68%)
 copy arch/arm/cpu/arm926ejs/davinci/{spl.c => dm365_spl.c} (50%)
 rename {board/davinci/da8xxevm => arch/arm/cpu/arm926ejs/davinci}/hawkboard_nand_spl.c (90%)
 rename board/davinci/da8xxevm/{u-boot-spl.lds => u-boot-spl-da850evm.lds} (100%)
 rename nand_spl/board/davinci/da8xxevm/u-boot.lds => board/davinci/da8xxevm/u-boot-spl-hawk.lds (86%)
 delete mode 100644 nand_spl/board/davinci/da8xxevm/Makefile

diff --git a/arch/arm/cpu/arm926ejs/davinci/Makefile b/arch/arm/cpu/arm926ejs/davinci/Makefile
index da7efac..66a065e 100644
--- 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
 
 SOBJS	= reset.o
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/da850_spl.c
similarity index 68%
copy from arch/arm/cpu/arm926ejs/davinci/spl.c
copy to arch/arm/cpu/arm926ejs/davinci/da850_spl.c
index f475f9b..ffea743 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_spl.c
@@ -20,66 +20,25 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+
 #include <common.h>
-#include <asm/u-boot.h>
-#include <asm/utils.h>
-#include <nand.h>
-#include <asm/arch/dm365_lowlevel.h>
-#include <ns16550.h>
 #include <malloc.h>
 #include <spi_flash.h>
 
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-
 DECLARE_GLOBAL_DATA_PTR;
+
 /* Define global data structure pointer to it*/
 static gd_t gdata __attribute__ ((section(".data")));
 static bd_t bdata __attribute__ ((section(".data")));
 
-#else
-
-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);
-}
-
-#endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
-
-inline void hang(void)
-{
-	puts("### ERROR ### Please RESET the board ###\n");
-	for (;;)
-		;
-}
-
 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_SOC_DM365
-	nand_init();
-	puts("Nand boot...\n");
-	nand_boot();
-#endif
-#ifdef CONFIG_SOC_DA8XX
 	mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
 			CONFIG_SYS_MALLOC_LEN);
 
@@ -92,5 +51,4 @@ void board_init_r(gd_t *id, ulong dummy)
 
 	puts("SPI boot...\n");
 	spi_boot();
-#endif
 }
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/dm365_spl.c
similarity index 50%
copy from arch/arm/cpu/arm926ejs/davinci/spl.c
copy to arch/arm/cpu/arm926ejs/davinci/dm365_spl.c
index f475f9b..fac14f9 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/dm365_spl.c
@@ -20,77 +20,21 @@
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  * MA 02111-1307 USA
  */
+
 #include <common.h>
-#include <asm/u-boot.h>
-#include <asm/utils.h>
 #include <nand.h>
 #include <asm/arch/dm365_lowlevel.h>
-#include <ns16550.h>
-#include <malloc.h>
-#include <spi_flash.h>
-
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-
-DECLARE_GLOBAL_DATA_PTR;
-/* Define global data structure pointer to it*/
-static gd_t gdata __attribute__ ((section(".data")));
-static bd_t bdata __attribute__ ((section(".data")));
-
-#else
-
-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);
-}
-
-#endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
-
-inline void hang(void)
-{
-	puts("### ERROR ### Please RESET the board ###\n");
-	for (;;)
-		;
-}
 
 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_SOC_DM365
+
 	nand_init();
 	puts("Nand boot...\n");
 	nand_boot();
-#endif
-#ifdef CONFIG_SOC_DA8XX
-	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
 }
diff --git a/board/davinci/da8xxevm/hawkboard_nand_spl.c b/arch/arm/cpu/arm926ejs/davinci/hawkboard_nand_spl.c
similarity index 90%
rename from board/davinci/da8xxevm/hawkboard_nand_spl.c
rename to arch/arm/cpu/arm926ejs/davinci/hawkboard_nand_spl.c
index df97963..56d7b79 100644
--- a/board/davinci/da8xxevm/hawkboard_nand_spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/hawkboard_nand_spl.c
@@ -85,31 +85,19 @@ void board_init_f(ulong bootflag)
 	NS16550_init((NS16550_t)(DAVINCI_UART2_BASE),
 			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
 
-	puts("Nand boot...\n");
-
-	nand_boot();
-}
-
-void puts(const char *str)
-{
-	while (*str)
-		putc(*str++);
+	/*
+	 * Skip relocation by passing spl's text base as
+	 * the dest address to relocate_code. We really
+	 * call this for clearing the bss before accessing
+	 * the nand functions which need a zero'ed bss.
+	 */
+	relocate_code(CONFIG_SPL_STACK, (gd_t *)gd, CONFIG_SPL_TEXT_BASE);
 }
 
-void putc(char c)
+void board_init_r(gd_t *id, ulong dest_addr)
 {
-	if (gd->flags & GD_FLG_SILENT)
-		return;
-
-	if (c == '\n')
-		NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), '\r');
-
-	NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), c);
-}
+	nand_init();
+	puts("Nand boot...\n");
 
-void hang(void)
-{
-	puts("### ERROR ### Please RESET the board ###\n");
-	for (;;)
-		;
+	nand_boot();
 }
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index f475f9b..7cb929a 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -23,21 +23,9 @@
 #include <common.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
-#include <nand.h>
-#include <asm/arch/dm365_lowlevel.h>
 #include <ns16550.h>
-#include <malloc.h>
-#include <spi_flash.h>
-
-#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
-
-DECLARE_GLOBAL_DATA_PTR;
-/* Define global data structure pointer to it*/
-static gd_t gdata __attribute__ ((section(".data")));
-static bd_t bdata __attribute__ ((section(".data")));
-
-#else
 
+#if !defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 void puts(const char *str)
 {
 	while (*str)
@@ -51,7 +39,6 @@ void putc(char c)
 
 	NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c);
 }
-
 #endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */
 
 inline void hang(void)
@@ -60,37 +47,3 @@ inline void hang(void)
 	for (;;)
 		;
 }
-
-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_SOC_DM365
-	nand_init();
-	puts("Nand boot...\n");
-	nand_boot();
-#endif
-#ifdef CONFIG_SOC_DA8XX
-	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
-}
diff --git a/board/davinci/da8xxevm/u-boot-spl.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
similarity index 100%
rename from board/davinci/da8xxevm/u-boot-spl.lds
rename to board/davinci/da8xxevm/u-boot-spl-da850evm.lds
diff --git a/nand_spl/board/davinci/da8xxevm/u-boot.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
similarity index 86%
rename from nand_spl/board/davinci/da8xxevm/u-boot.lds
rename to board/davinci/da8xxevm/u-boot-spl-hawk.lds
index 638ffd9..b3a41af 100644
--- a/nand_spl/board/davinci/da8xxevm/u-boot.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -34,11 +34,11 @@ SECTIONS
 	. = ALIGN(4);
 	.text      :
 	{
-	  start.o	(.text)
-	  cpu.o		(.text)
-	  nand_boot.o	(.text)
+	  arch/arm/cpu/arm926ejs/start.o		(.text)
+	  arch/arm/cpu/arm926ejs/davinci/libdavinci.o	(.text)
+	  drivers/mtd/nand/libnand.o			(.text)
 
-	  *(.text)
+	  *(.text*)
 	}
 
 	. = ALIGN(4);
@@ -68,10 +68,14 @@ SECTIONS
 
 	__got_end = .;
 
-	_end = .;
+	.bss :
+	{
+		. = ALIGN(4);
+		__bss_start = .;
+		*(.bss*)
+		. = ALIGN(4);
+		__bss_end__ = .;
+	}
 
-	. = ALIGN(4);
-	__bss_start = .;
-	.bss : { *(.bss) }
-	__bss_end__ = .;
+	_end = .;
 }
diff --git a/boards.cfg b/boards.cfg
index da1a3ce..643b34b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -133,7 +133,6 @@ davinci_sffsdr               arm         arm926ejs   sffsdr              davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 ea20			     arm	 arm926ejs   ea20		 davinci	davinci
 hawkboard                    arm         arm926ejs   da8xxevm            davinci        davinci
-hawkboard_nand               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:NAND_U_BOOT
 hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_DISABLE_PCI
diff --git a/doc/README.hawkboard b/doc/README.hawkboard
index b7afec4..d6ae02e 100644
--- a/doc/README.hawkboard
+++ b/doc/README.hawkboard
@@ -9,8 +9,8 @@ executes upon reset is the Rom Boot Loader(RBL) which sits in the
 internal ROM of the omap. The RBL initialises the memory and the nand
 controller, and copies the image stored at a predefined location(block
 1) of the nand flash. The image loaded by the RBL to the memory is the
-AIS signed nand_spl image. This, in turns copies the u-boot binary
-from the nand flash to the memory and jumps to the u-boot entry point.
+AIS signed spl image. This, in turns copies the u-boot binary from the
+nand flash to the memory and jumps to the u-boot entry point.
 
 AIS is an image format defined by TI for the images that are to be
 loaded to memory by the RBL. The image is divided into a series of
@@ -20,14 +20,14 @@ and the size of the section, which is used by the RBL to load the
 image. At the end of the image the RBL jumps to the image entry
 point.
 
-The secondary stage bootloader(nand_spl) which is loaded by the RBL
-then loads the u-boot from a predefined location in the nand to the
-memory and jumps to the u-boot entry point.
+The secondary stage bootloader(spl) which is loaded by the RBL then
+loads the u-boot from a predefined location in the nand to the memory
+and jumps to the u-boot entry point.
 
 The reason a secondary stage bootloader is used is because the ECC
 layout expected by the RBL is not the same as that used by
-u-boot/linux. This also implies that for flashing the nand_spl image,
-we need to use the u-boot which uses the ECC layout expected by the
+u-boot/linux. This also implies that for flashing the spl image,we
+need to use the u-boot which uses the ECC layout expected by the
 RBL[1]. Booting u-boot over UART(UART boot) is explained here[2].
 
 
@@ -35,20 +35,19 @@ Compilation
 ===========
 Three images might be needed
 
-* nand_spl - This is the secondary bootloader which boots the u-boot
+* spl - This is the secondary bootloader which boots the u-boot
   binary.
 
-  hawkboard_nand_config
-
-  The nand_spl ELF gets generated under nand_spl/u-boot-spl. This
-  needs to be processed with the AISGen tool for generating the AIS
-  signed image to be flashed. Steps for generating the AIS image are
-  explained here[3].
-
 * u-boot binary - This is the image flashed to the nand and copied to
-  the memory by the nand_spl.
+  the memory by the spl.
+
+  Both the images get compiled with hawkboard_config, with the TOPDIR
+  containing the u-boot images, and the spl image under the spl
+  directory.
 
-  hawkboard_config
+  The spl image needs to be processed with the AISGen tool for
+  generating the AIS signed image to be flashed. Steps for generating
+  the AIS image are explained here[3].
 
 * u-boot for uart boot - This is same as the u-boot binary generated
   above, with the sole difference of the CONFIG_SYS_TEXT_BASE being
@@ -59,17 +58,17 @@ Three images might be needed
 
 Flashing the images to Nand
 ===========================
-The nand_spl AIS image needs to be flashed to the block 1 of the
-Nand flash, as that is the location the RBL expects the image[4]. For
-flashing the nand_spl, boot over the u-boot specified in [1], and
-flash the image
+The spl AIS image needs to be flashed to the block 1 of the Nand
+flash, as that is the location the RBL expects the image[4]. For
+flashing the spl, boot over the u-boot specified in [1], and flash the
+image
 
 => tftpboot 0xc0700000 <nand_spl_ais.bin>
 => nand erase 0x20000 0x20000
 => nand write.e 0xc0700000 0x20000 <nand_spl_size>
 
 The u-boot binary is flashed at location 0xe0000(block 6) of the nand
-flash. The nand_spl loader expects the u-boot at this location. For
+flash. The spl loader expects the u-boot at this location. For
 flashing the u-boot binary
 
 => tftpboot 0xc0700000 u-boot.bin
diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
index a21d448..8e3a4d2 100644
--- a/include/configs/cam_enc_4xx.h
+++ b/include/configs/cam_enc_4xx.h
@@ -205,6 +205,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_DM365_SPL
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_LOAD
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index fcbbace..a44d825 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -311,6 +311,7 @@
 
 /* defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_DA850EVM_SPL
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
@@ -319,7 +320,7 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LDSCRIPT	"$(BOARDDIR)/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT	"board/$(BOARDDIR)/u-boot-spl-da850evm.lds"
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
diff --git a/include/configs/hawkboard.h b/include/configs/hawkboard.h
index 12acb27..7c8a1d9 100644
--- a/include/configs/hawkboard.h
+++ b/include/configs/hawkboard.h
@@ -43,12 +43,23 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_UART_U_BOOT)
+#if defined(CONFIG_UART_U_BOOT)
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
-#else
+#elif !defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_TEXT_BASE		0xc1180000
 #endif
 
+/* Spl */
+#define CONFIG_SPL
+#define CONFIG_HAWKBOARD_SPL
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"board/$(BOARDDIR)/u-boot-spl-hawk.lds"
+#define CONFIG_SPL_TEXT_BASE		0xc1080000
+#define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
+
 /*
  * Memory Info
  */
@@ -84,9 +95,7 @@
 /*
  * Network & Ethernet Configuration
  */
-#if !defined(CONFIG_NAND_SPL)
 #define CONFIG_DRIVER_TI_EMAC
-#endif
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
deleted file mode 100644
index 7746e41..0000000
--- a/nand_spl/board/davinci/da8xxevm/Makefile
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# (C) Copyright 2006-2007
-# Stefan Roese, DENX Software Engineering, sr at denx.de.
-#
-# (C) Copyright 2008
-# Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-CONFIG_NAND_SPL	= y
-
-include $(TOPDIR)/config.mk
-
-nandobj	:= $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS	= _divsi3.o \
-	_udivsi3.o \
-	start.o
-
-COBJS	= cpu.o \
-	davinci_nand.o \
-	pinmux.o \
-	da850_pinmux.o \
-	div0.o \
-	hawkboard_nand_spl.o \
-	misc.o \
-	nand_boot.o \
-	ns16550.o \
-	psc.o
-
-SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS	:= $(SOBJS) $(COBJS)
-LNDIR	:= $(nandobj)board/$(BOARDDIR)
-
-ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin \
-	$(nandobj)u-boot-spl-16k.bin
-
-all:	$(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:	$(OBJS) $(nandobj)u-boot.lds
-	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-		-Map $(nandobj)u-boot-spl.map \
-		-o $(nandobj)u-boot-spl
-
-$(nandobj)u-boot.lds: $(LDSCRIPT)
-	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
-
-# create symbolic links for common files
-
-# from board directory
-$(obj)pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/pinmux.c $@
-
-$(obj)da850_pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c $@
-
-# from drivers/mtd/nand directory
-$(obj)davinci_nand.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/drivers/mtd/nand/davinci_nand.c $@
-
-# from nand_spl directory
-$(obj)nand_boot.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/nand_spl/nand_boot.c $@
-
-# from drivers/serial directory
-$(obj)ns16550.c:
-	@rm -f $@
-	@ln -sf $(TOPDIR)/drivers/serial/ns16550.c $@
-
-# from cpu directory
-$(obj)start.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/start.S $@
-
-# from lib directory
-$(obj)_udivsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_udivsi3.S $@
-
-# from lib directory
-$(obj)_divsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_divsi3.S $@
-
-# from lib directory
-$(obj)div0.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/div0.c $@
-
-# from SoC directory
-$(obj)cpu.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/cpu.c $@
-
-$(obj)misc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/misc.c $@
-
-# from board directory
-$(obj)hawkboard_nand_spl.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/board/davinci/da8xxevm/hawkboard_nand_spl.c $@
-
-$(obj)psc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/psc.c $@
-
-#########################################################################
-
-$(obj)%.o:	$(obj)%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(obj)%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
  2012-01-09 18:28 [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure Sughosh Ganu
@ 2012-01-09 23:30 ` Tom Rini
  2012-01-10  6:30   ` Sughosh Ganu
  2012-01-10 18:15 ` [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure Sughosh Ganu
  1 sibling, 1 reply; 22+ messages in thread
From: Tom Rini @ 2012-01-09 23:30 UTC (permalink / raw)
  To: u-boot

On 01/09/2012 11:28 AM, Sughosh Ganu wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one. Making this change required some code refactoring
> with a couple of davinci based platforms which use spl.
> 
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
[snip]

On the whole, I'm happy, but:
[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.

-- 
Tom

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
  2012-01-09 23:30 ` Tom Rini
@ 2012-01-10  6:30   ` Sughosh Ganu
  2012-01-10  8:15     ` Christian Riesch
  0 siblings, 1 reply; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-10  6:30 UTC (permalink / raw)
  To: u-boot

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.

-sughosh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
  2012-01-10  6:30   ` Sughosh Ganu
@ 2012-01-10  8:15     ` Christian Riesch
  2012-01-10  8:42       ` Sughosh Ganu
  0 siblings, 1 reply; 22+ messages in thread
From: Christian Riesch @ 2012-01-10  8:15 UTC (permalink / raw)
  To: u-boot

Hi Sughosh and Tom,

On Tuesday, January 10, 2012, Sughosh Ganu <urwithsughosh@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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
  2012-01-10  8:15     ` Christian Riesch
@ 2012-01-10  8:42       ` Sughosh Ganu
  2012-01-10  9:42         ` Heiko Schocher
  0 siblings, 1 reply; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-10  8:42 UTC (permalink / raw)
  To: u-boot

hi Christian,
On Tue Jan 10, 2012 at 09:15:14AM +0100, Christian Riesch wrote:
> Hi Sughosh and Tom,
> 
> On Tuesday, January 10, 2012, Sughosh Ganu <urwithsughosh@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.

  I'd vote for moving the *spl.c files to their corresponding board
  directories -- infact hawkboard_nand_spl.c was earlier under it's
  board directory. This i think keeps the implementation clean, avoids
  the risk of breakage, and also makes it simpler for any newer board
  in the same soc family migrating to spl, which i think might
  increase the ifdeffery.

  Maybe Tom and Heiko can comment on how it can be done, and i'll take
  the route of the majority :).

-sughosh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
  2012-01-10  8:42       ` Sughosh Ganu
@ 2012-01-10  9:42         ` Heiko Schocher
  2012-01-10 10:13           ` Sughosh Ganu
  0 siblings, 1 reply; 22+ messages in thread
From: Heiko Schocher @ 2012-01-10  9:42 UTC (permalink / raw)
  To: u-boot

Hello Sughosh, Christian, Tom,

Sughosh Ganu wrote:
> hi Christian,
> On Tue Jan 10, 2012 at 09:15:14AM +0100, Christian Riesch wrote:
>> Hi Sughosh and Tom,
>>
>> On Tuesday, January 10, 2012, Sughosh Ganu <urwithsughosh@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.
> 
>   I'd vote for moving the *spl.c files to their corresponding board
>   directories -- infact hawkboard_nand_spl.c was earlier under it's
>   board directory. This i think keeps the implementation clean, avoids
>   the risk of breakage, and also makes it simpler for any newer board
>   in the same soc family migrating to spl, which i think might
>   increase the ifdeffery.

Hmm.. I vote against creating board specific files. I am here in line
with Christians proposal, posted here:

http://lists.denx.de/pipermail/u-boot/2012-January/115166.html

Did this work for the hawkboard? If you do not need some inits, maybe
we add here defines or better make this functions weak, and you can write
board specific functions for this parts. The code in board_init_r()
is only a "selection" from where to load u-boot, which I think in the
long term could be made more common for other SoCs too ... so I want
to prevent to split this in board specific files.

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure.
  2012-01-10  9:42         ` Heiko Schocher
@ 2012-01-10 10:13           ` Sughosh Ganu
  0 siblings, 0 replies; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-10 10:13 UTC (permalink / raw)
  To: u-boot

hi Heiko,
On Tue Jan 10, 2012 at 10:42:08AM +0100, Heiko Schocher wrote:
> Hello Sughosh, Christian, Tom,
> 
> Sughosh Ganu wrote:

> >>>  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.
> > 
> >   I'd vote for moving the *spl.c files to their corresponding board
> >   directories -- infact hawkboard_nand_spl.c was earlier under it's
> >   board directory. This i think keeps the implementation clean, avoids
> >   the risk of breakage, and also makes it simpler for any newer board
> >   in the same soc family migrating to spl, which i think might
> >   increase the ifdeffery.
> 
> Hmm.. I vote against creating board specific files. I am here in line
> with Christians proposal, posted here:
> 
> http://lists.denx.de/pipermail/u-boot/2012-January/115166.html
> 
> Did this work for the hawkboard? If you do not need some inits, maybe
> we add here defines or better make this functions weak, and you can write
> board specific functions for this parts. The code in board_init_r()
> is only a "selection" from where to load u-boot, which I think in the
> long term could be made more common for other SoCs too ... so I want
> to prevent to split this in board specific files.

  I should be able to test these changes in the evening. Will send a
  modified patch after testing.

-sughosh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure.
  2012-01-09 18:28 [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure Sughosh Ganu
  2012-01-09 23:30 ` Tom Rini
@ 2012-01-10 18:15 ` Sughosh Ganu
  2012-01-11  6:52   ` Heiko Schocher
  1 sibling, 1 reply; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-10 18:15 UTC (permalink / raw)
  To: u-boot

This patch moves hawkboard to the new spl infrastructure from the
older nand_spl one.

Removed the hawkboard_nand_config build option -- The spl code now
gets compiled with hawkboard_config, after building the main u-boot
image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
to reflect the same.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
Cc: Heiko Schocher <hs@denx.de>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Tom Rini <trini@ti.com>
---

Changes since V1
* Use a common file instead of board specific files for spl,
based on review comments from Christian and Heiko.

 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c    |   14 +-
 arch/arm/cpu/arm926ejs/davinci/spl.c               |    4 +-
 arch/arm/include/asm/arch-davinci/da850_lowlevel.h |    9 +
 board/davinci/da8xxevm/hawkboard.c                 |   23 +++
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |  115 ---------------
 .../{u-boot-spl.lds => u-boot-spl-da850evm.lds}    |    0
 .../davinci/da8xxevm/u-boot-spl-hawk.lds           |   22 ++-
 boards.cfg                                         |    1 -
 doc/README.hawkboard                               |   43 +++---
 include/configs/cam_enc_4xx.h                      |    1 +
 include/configs/da850evm.h                         |    3 +-
 include/configs/hawkboard.h                        |   24 +++-
 nand_spl/board/davinci/da8xxevm/Makefile           |  155 --------------------
 13 files changed, 100 insertions(+), 314 deletions(-)
 delete mode 100644 board/davinci/da8xxevm/hawkboard_nand_spl.c
 rename board/davinci/da8xxevm/{u-boot-spl.lds => u-boot-spl-da850evm.lds} (100%)
 rename nand_spl/board/davinci/da8xxevm/u-boot.lds => board/davinci/da8xxevm/u-boot-spl-hawk.lds (86%)
 delete mode 100644 nand_spl/board/davinci/da8xxevm/Makefile

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index a532f8a..a4778b8 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -32,6 +32,7 @@
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>
 
+#if !defined(CONFIG_MACH_DAVINCI_HAWK)
 void da850_waitloop(unsigned long loopcnt)
 {
 	unsigned long	i;
@@ -235,6 +236,7 @@ int da850_ddr_setup(void)
 
 	return 0;
 }
+#endif /* CONFIG_MACH_DAVINCI_HAWK */
 
 __attribute__((weak))
 void board_gpio_init(void)
@@ -242,10 +244,6 @@ void board_gpio_init(void)
 	return;
 }
 
-/* pinmux_resource[] vector is defined in the board specific file */
-extern const struct pinmux_resource pinmuxes[];
-extern const int pinmuxes_size;
-
 int arch_cpu_init(void)
 {
 	/* Unlock kick registers */
@@ -259,6 +257,7 @@ int arch_cpu_init(void)
 	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
 		return 1;
 
+#if defined(CONFIG_MACH_DAVINCI_DA850_EVM)
 	/* PLL setup */
 	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
 	da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
@@ -275,6 +274,12 @@ int arch_cpu_init(void)
 #endif
 
 	lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
+
+	da850_ddr_setup();
+#elif defined(CONFIG_MACH_DAVINCI_HAWK)
+	da8xx_configure_lpsc_items(lpsc, lpsc_size);
+#endif
+
 	NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
 			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
 
@@ -286,6 +291,5 @@ int arch_cpu_init(void)
 		DAVINCI_UART_PWREMU_MGMT_UTRST),
 	       &davinci_uart2_ctrl_regs->pwremu_mgmt);
 
-	da850_ddr_setup();
 	return 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index f475f9b..74632e5 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -74,12 +74,12 @@ void board_init_f(ulong dummy)
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SOC_DM365
+#ifdef CONFIG_SPL_NAND_LOAD
 	nand_init();
 	puts("Nand boot...\n");
 	nand_boot();
 #endif
-#ifdef CONFIG_SOC_DA8XX
+#ifdef CONFIG_SPL_SPI_LOAD
 	mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
 			CONFIG_SYS_MALLOC_LEN);
 
diff --git a/arch/arm/include/asm/arch-davinci/da850_lowlevel.h b/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
index e489c47..11ed91d 100644
--- a/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
+++ b/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
@@ -24,6 +24,15 @@
 #ifndef __DA850_LOWLEVEL_H
 #define __DA850_LOWLEVEL_H
 
+#include <asm/arch/pinmux_defs.h>
+
+/* pinmux_resource[] vector is defined in the board specific file */
+extern const struct pinmux_resource pinmuxes[];
+extern const int pinmuxes_size;
+
+extern const struct lpsc_resource lpsc[];
+extern const int lpsc_size;
+
 /* NOR Boot Configuration Word Field Descriptions */
 #define DA850_NORBOOT_COPY_XK(X)	((X - 1) << 8)
 #define DA850_NORBOOT_METHOD_DIRECT	(1 << 4)
diff --git a/board/davinci/da8xxevm/hawkboard.c b/board/davinci/da8xxevm/hawkboard.c
index 9d4e238..b694258 100644
--- a/board/davinci/da8xxevm/hawkboard.c
+++ b/board/davinci/da8xxevm/hawkboard.c
@@ -27,10 +27,33 @@
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 #include <asm/arch/davinci_misc.h>
+#include <asm/arch/pinmux_defs.h>
 #include <ns16550.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const struct pinmux_resource pinmuxes[] = {
+	PINMUX_ITEM(emac_pins_mii),
+	PINMUX_ITEM(emac_pins_mdio),
+	PINMUX_ITEM(emifa_pins_cs3),
+	PINMUX_ITEM(emifa_pins_cs4),
+	PINMUX_ITEM(emifa_pins_nand),
+	PINMUX_ITEM(uart2_pins_txrx),
+	PINMUX_ITEM(uart2_pins_rtscts),
+};
+
+const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
+
+const struct lpsc_resource lpsc[] = {
+	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
+	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
+	{ DAVINCI_LPSC_EMAC },	/* image download */
+	{ DAVINCI_LPSC_UART2 },	/* console */
+	{ DAVINCI_LPSC_GPIO },
+};
+
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 int board_init(void)
 {
 	/* arch number of the board */
diff --git a/board/davinci/da8xxevm/hawkboard_nand_spl.c b/board/davinci/da8xxevm/hawkboard_nand_spl.c
deleted file mode 100644
index df97963..0000000
--- a/board/davinci/da8xxevm/hawkboard_nand_spl.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Modified for Hawkboard - Syed Mohammed Khasim <khasim@beagleboard.org>
- *
- * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.  <nsekhar@ti.com>
- * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
- * Copyright (C) 2004 Texas Instruments.
- *
- * ----------------------------------------------------------------------------
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * ----------------------------------------------------------------------------
- */
-
-#include <common.h>
-#include <asm/errno.h>
-#include <asm/arch/hardware.h>
-#include <asm/io.h>
-#include <asm/arch/davinci_misc.h>
-#include <asm/arch/pinmux_defs.h>
-#include <ns16550.h>
-#include <nand.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static const struct pinmux_resource pinmuxes[] = {
-	PINMUX_ITEM(emac_pins_mii),
-	PINMUX_ITEM(emac_pins_mdio),
-	PINMUX_ITEM(emifa_pins_cs3),
-	PINMUX_ITEM(emifa_pins_cs4),
-	PINMUX_ITEM(emifa_pins_nand),
-	PINMUX_ITEM(uart2_pins_txrx),
-	PINMUX_ITEM(uart2_pins_rtscts),
-};
-
-static const struct lpsc_resource lpsc[] = {
-	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
-	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
-	{ DAVINCI_LPSC_EMAC },	/* image download */
-	{ DAVINCI_LPSC_UART2 },	/* console */
-	{ DAVINCI_LPSC_GPIO },
-};
-
-void board_init_f(ulong bootflag)
-{
-	/*
-	 * Kick Registers need to be set to allow access to Pin Mux registers
-	 */
-	writel(DV_SYSCFG_KICK0_UNLOCK, &davinci_syscfg_regs->kick0);
-	writel(DV_SYSCFG_KICK1_UNLOCK, &davinci_syscfg_regs->kick1);
-
-	/* setup the SUSPSRC for ARM to control emulation suspend */
-	writel(readl(&davinci_syscfg_regs->suspsrc) &
-	       ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
-		 DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
-		 DAVINCI_SYSCFG_SUSPSRC_UART2), &davinci_syscfg_regs->suspsrc);
-
-	/* Power on required peripherals
-	 * ARM does not have acess by default to PSC0 and PSC1
-	 * assuming here that the DSP bootloader has set the IOPU
-	 * such that PSC access is available to ARM
-	 */
-	da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc));
-
-	/* configure pinmux settings */
-	davinci_configure_pin_mux_items(pinmuxes,
-					ARRAY_SIZE(pinmuxes));
-
-	writel(readl(&davinci_uart2_ctrl_regs->pwremu_mgmt) |
-	       (DAVINCI_UART_PWREMU_MGMT_FREE) |
-	       (DAVINCI_UART_PWREMU_MGMT_URRST) |
-	       (DAVINCI_UART_PWREMU_MGMT_UTRST),
-	       &davinci_uart2_ctrl_regs->pwremu_mgmt);
-
-	NS16550_init((NS16550_t)(DAVINCI_UART2_BASE),
-			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
-
-	puts("Nand boot...\n");
-
-	nand_boot();
-}
-
-void puts(const char *str)
-{
-	while (*str)
-		putc(*str++);
-}
-
-void putc(char c)
-{
-	if (gd->flags & GD_FLG_SILENT)
-		return;
-
-	if (c == '\n')
-		NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), '\r');
-
-	NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), c);
-}
-
-void hang(void)
-{
-	puts("### ERROR ### Please RESET the board ###\n");
-	for (;;)
-		;
-}
diff --git a/board/davinci/da8xxevm/u-boot-spl.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
similarity index 100%
rename from board/davinci/da8xxevm/u-boot-spl.lds
rename to board/davinci/da8xxevm/u-boot-spl-da850evm.lds
diff --git a/nand_spl/board/davinci/da8xxevm/u-boot.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
similarity index 86%
rename from nand_spl/board/davinci/da8xxevm/u-boot.lds
rename to board/davinci/da8xxevm/u-boot-spl-hawk.lds
index 638ffd9..b3a41af 100644
--- a/nand_spl/board/davinci/da8xxevm/u-boot.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -34,11 +34,11 @@ SECTIONS
 	. = ALIGN(4);
 	.text      :
 	{
-	  start.o	(.text)
-	  cpu.o		(.text)
-	  nand_boot.o	(.text)
+	  arch/arm/cpu/arm926ejs/start.o		(.text)
+	  arch/arm/cpu/arm926ejs/davinci/libdavinci.o	(.text)
+	  drivers/mtd/nand/libnand.o			(.text)
 
-	  *(.text)
+	  *(.text*)
 	}
 
 	. = ALIGN(4);
@@ -68,10 +68,14 @@ SECTIONS
 
 	__got_end = .;
 
-	_end = .;
+	.bss :
+	{
+		. = ALIGN(4);
+		__bss_start = .;
+		*(.bss*)
+		. = ALIGN(4);
+		__bss_end__ = .;
+	}
 
-	. = ALIGN(4);
-	__bss_start = .;
-	.bss : { *(.bss) }
-	__bss_end__ = .;
+	_end = .;
 }
diff --git a/boards.cfg b/boards.cfg
index da1a3ce..643b34b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -133,7 +133,6 @@ davinci_sffsdr               arm         arm926ejs   sffsdr              davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 ea20			     arm	 arm926ejs   ea20		 davinci	davinci
 hawkboard                    arm         arm926ejs   da8xxevm            davinci        davinci
-hawkboard_nand               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:NAND_U_BOOT
 hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_DISABLE_PCI
diff --git a/doc/README.hawkboard b/doc/README.hawkboard
index b7afec4..d6ae02e 100644
--- a/doc/README.hawkboard
+++ b/doc/README.hawkboard
@@ -9,8 +9,8 @@ executes upon reset is the Rom Boot Loader(RBL) which sits in the
 internal ROM of the omap. The RBL initialises the memory and the nand
 controller, and copies the image stored at a predefined location(block
 1) of the nand flash. The image loaded by the RBL to the memory is the
-AIS signed nand_spl image. This, in turns copies the u-boot binary
-from the nand flash to the memory and jumps to the u-boot entry point.
+AIS signed spl image. This, in turns copies the u-boot binary from the
+nand flash to the memory and jumps to the u-boot entry point.
 
 AIS is an image format defined by TI for the images that are to be
 loaded to memory by the RBL. The image is divided into a series of
@@ -20,14 +20,14 @@ and the size of the section, which is used by the RBL to load the
 image. At the end of the image the RBL jumps to the image entry
 point.
 
-The secondary stage bootloader(nand_spl) which is loaded by the RBL
-then loads the u-boot from a predefined location in the nand to the
-memory and jumps to the u-boot entry point.
+The secondary stage bootloader(spl) which is loaded by the RBL then
+loads the u-boot from a predefined location in the nand to the memory
+and jumps to the u-boot entry point.
 
 The reason a secondary stage bootloader is used is because the ECC
 layout expected by the RBL is not the same as that used by
-u-boot/linux. This also implies that for flashing the nand_spl image,
-we need to use the u-boot which uses the ECC layout expected by the
+u-boot/linux. This also implies that for flashing the spl image,we
+need to use the u-boot which uses the ECC layout expected by the
 RBL[1]. Booting u-boot over UART(UART boot) is explained here[2].
 
 
@@ -35,20 +35,19 @@ Compilation
 ===========
 Three images might be needed
 
-* nand_spl - This is the secondary bootloader which boots the u-boot
+* spl - This is the secondary bootloader which boots the u-boot
   binary.
 
-  hawkboard_nand_config
-
-  The nand_spl ELF gets generated under nand_spl/u-boot-spl. This
-  needs to be processed with the AISGen tool for generating the AIS
-  signed image to be flashed. Steps for generating the AIS image are
-  explained here[3].
-
 * u-boot binary - This is the image flashed to the nand and copied to
-  the memory by the nand_spl.
+  the memory by the spl.
+
+  Both the images get compiled with hawkboard_config, with the TOPDIR
+  containing the u-boot images, and the spl image under the spl
+  directory.
 
-  hawkboard_config
+  The spl image needs to be processed with the AISGen tool for
+  generating the AIS signed image to be flashed. Steps for generating
+  the AIS image are explained here[3].
 
 * u-boot for uart boot - This is same as the u-boot binary generated
   above, with the sole difference of the CONFIG_SYS_TEXT_BASE being
@@ -59,17 +58,17 @@ Three images might be needed
 
 Flashing the images to Nand
 ===========================
-The nand_spl AIS image needs to be flashed to the block 1 of the
-Nand flash, as that is the location the RBL expects the image[4]. For
-flashing the nand_spl, boot over the u-boot specified in [1], and
-flash the image
+The spl AIS image needs to be flashed to the block 1 of the Nand
+flash, as that is the location the RBL expects the image[4]. For
+flashing the spl, boot over the u-boot specified in [1], and flash the
+image
 
 => tftpboot 0xc0700000 <nand_spl_ais.bin>
 => nand erase 0x20000 0x20000
 => nand write.e 0xc0700000 0x20000 <nand_spl_size>
 
 The u-boot binary is flashed at location 0xe0000(block 6) of the nand
-flash. The nand_spl loader expects the u-boot at this location. For
+flash. The spl loader expects the u-boot at this location. For
 flashing the u-boot binary
 
 => tftpboot 0xc0700000 u-boot.bin
diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
index a21d448..8e3a4d2 100644
--- a/include/configs/cam_enc_4xx.h
+++ b/include/configs/cam_enc_4xx.h
@@ -205,6 +205,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_DM365_SPL
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_LOAD
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index fcbbace..a44d825 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -311,6 +311,7 @@
 
 /* defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_DA850EVM_SPL
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
@@ -319,7 +320,7 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LDSCRIPT	"$(BOARDDIR)/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT	"board/$(BOARDDIR)/u-boot-spl-da850evm.lds"
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
diff --git a/include/configs/hawkboard.h b/include/configs/hawkboard.h
index 12acb27..57b1932 100644
--- a/include/configs/hawkboard.h
+++ b/include/configs/hawkboard.h
@@ -43,12 +43,30 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_UART_U_BOOT)
+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (	\
+	DAVINCI_SYSCFG_SUSPSRC_EMAC |		\
+	DAVINCI_SYSCFG_SUSPSRC_I2C  |		\
+	DAVINCI_SYSCFG_SUSPSRC_SPI1 |		\
+	DAVINCI_SYSCFG_SUSPSRC_TIMER0 |		\
+	DAVINCI_SYSCFG_SUSPSRC_UART2)
+
+#if defined(CONFIG_UART_U_BOOT)
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
-#else
+#elif !defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_TEXT_BASE		0xc1180000
 #endif
 
+/* Spl */
+#define CONFIG_SPL
+#define CONFIG_HAWKBOARD_SPL
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"board/$(BOARDDIR)/u-boot-spl-hawk.lds"
+#define CONFIG_SPL_TEXT_BASE		0xc1080000
+#define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
+
 /*
  * Memory Info
  */
@@ -84,9 +102,7 @@
 /*
  * Network & Ethernet Configuration
  */
-#if !defined(CONFIG_NAND_SPL)
 #define CONFIG_DRIVER_TI_EMAC
-#endif
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
deleted file mode 100644
index 7746e41..0000000
--- a/nand_spl/board/davinci/da8xxevm/Makefile
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# (C) Copyright 2006-2007
-# Stefan Roese, DENX Software Engineering, sr at denx.de.
-#
-# (C) Copyright 2008
-# Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-CONFIG_NAND_SPL	= y
-
-include $(TOPDIR)/config.mk
-
-nandobj	:= $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS	= _divsi3.o \
-	_udivsi3.o \
-	start.o
-
-COBJS	= cpu.o \
-	davinci_nand.o \
-	pinmux.o \
-	da850_pinmux.o \
-	div0.o \
-	hawkboard_nand_spl.o \
-	misc.o \
-	nand_boot.o \
-	ns16550.o \
-	psc.o
-
-SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS	:= $(SOBJS) $(COBJS)
-LNDIR	:= $(nandobj)board/$(BOARDDIR)
-
-ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin \
-	$(nandobj)u-boot-spl-16k.bin
-
-all:	$(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:	$(OBJS) $(nandobj)u-boot.lds
-	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-		-Map $(nandobj)u-boot-spl.map \
-		-o $(nandobj)u-boot-spl
-
-$(nandobj)u-boot.lds: $(LDSCRIPT)
-	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
-
-# create symbolic links for common files
-
-# from board directory
-$(obj)pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/pinmux.c $@
-
-$(obj)da850_pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c $@
-
-# from drivers/mtd/nand directory
-$(obj)davinci_nand.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/drivers/mtd/nand/davinci_nand.c $@
-
-# from nand_spl directory
-$(obj)nand_boot.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/nand_spl/nand_boot.c $@
-
-# from drivers/serial directory
-$(obj)ns16550.c:
-	@rm -f $@
-	@ln -sf $(TOPDIR)/drivers/serial/ns16550.c $@
-
-# from cpu directory
-$(obj)start.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/start.S $@
-
-# from lib directory
-$(obj)_udivsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_udivsi3.S $@
-
-# from lib directory
-$(obj)_divsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_divsi3.S $@
-
-# from lib directory
-$(obj)div0.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/div0.c $@
-
-# from SoC directory
-$(obj)cpu.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/cpu.c $@
-
-$(obj)misc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/misc.c $@
-
-# from board directory
-$(obj)hawkboard_nand_spl.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/board/davinci/da8xxevm/hawkboard_nand_spl.c $@
-
-$(obj)psc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/psc.c $@
-
-#########################################################################
-
-$(obj)%.o:	$(obj)%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(obj)%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure.
  2012-01-10 18:15 ` [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure Sughosh Ganu
@ 2012-01-11  6:52   ` Heiko Schocher
  2012-01-11  7:53     ` Sughosh Ganu
                       ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Heiko Schocher @ 2012-01-11  6:52 UTC (permalink / raw)
  To: u-boot

Hello Sughosh,

Sughosh Ganu wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one.
> 
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
> 
> Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Christian Riesch <christian.riesch@omicron.at>
> Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> Cc: Tom Rini <trini@ti.com>
> ---
> 
[...]
> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> index a532f8a..a4778b8 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> @@ -32,6 +32,7 @@
>  #include <asm/arch/emif_defs.h>
>  #include <asm/arch/pll_defs.h>
>  
> +#if !defined(CONFIG_MACH_DAVINCI_HAWK)

Please no board specific defines.

>  void da850_waitloop(unsigned long loopcnt)
>  {
>  	unsigned long	i;
> @@ -235,6 +236,7 @@ int da850_ddr_setup(void)
>  
>  	return 0;
>  }
> +#endif /* CONFIG_MACH_DAVINCI_HAWK */
>  
>  __attribute__((weak))
>  void board_gpio_init(void)
> @@ -242,10 +244,6 @@ void board_gpio_init(void)
>  	return;
>  }
>  
> -/* pinmux_resource[] vector is defined in the board specific file */
> -extern const struct pinmux_resource pinmuxes[];
> -extern const int pinmuxes_size;
> -
>  int arch_cpu_init(void)
>  {
>  	/* Unlock kick registers */
> @@ -259,6 +257,7 @@ int arch_cpu_init(void)
>  	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
>  		return 1;
>  
> +#if defined(CONFIG_MACH_DAVINCI_DA850_EVM)

here too. I propose here a CONFIG_SYS_DA850_PLL_INIT ...

>  	/* PLL setup */
>  	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
>  	da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
> @@ -275,6 +274,12 @@ int arch_cpu_init(void)
>  #endif
>  
>  	lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
> +
> +	da850_ddr_setup();

and around the ddr_setup a CONFIG_SYS_DA850_DDR_INIT ...

> +#elif defined(CONFIG_MACH_DAVINCI_HAWK)
> +	da8xx_configure_lpsc_items(lpsc, lpsc_size);
> +#endif

and we should use da8xx_configure_lpsc_items() for all da850 boards.

This patch breaks current enbw_cmc board compile

[hs at pollux u-boot]$ ./MAKEALL enbw_cmc
Configuring for enbw_cmc board...
enbw_cmc.c:52:35: error: static declaration of 'lpsc' follows non-static declaration
/work/hs/u-boot/include/asm/arch/da850_lowlevel.h:33:35: note: previous declaration of 'lpsc' was here
make[1]: *** [enbw_cmc.o] Fehler 1
make: *** [board/enbw/enbw_cmc/libenbw_cmc.o] Fehler 2
arm-linux-gnueabi-size: './u-boot': No such file

please remove the da8xx_configure_lpsc_items() in board_gpio_init()
in the ./board/enbw/enbw_cmc/enbw_cmc.c() file, and also move ...
before I write here a lot of text, here the patch, based on yours,
please add it to your patch, and add my

Signed-off-by: Heiko Schocher <hs@denx.de>

and tested on the enbw_cmc board, so:
Tested-by: Heiko Schocher <hs@denx.de>

to your patch, here the patch:

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index a4778b8..a404916 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -32,7 +32,7 @@
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>

-#if !defined(CONFIG_MACH_DAVINCI_HAWK)
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
 void da850_waitloop(unsigned long loopcnt)
 {
 	unsigned long	i;
@@ -236,7 +236,7 @@ int da850_ddr_setup(void)

 	return 0;
 }
-#endif /* CONFIG_MACH_DAVINCI_HAWK */
+#endif /* CONFIG_SYS_DA850_DDR_INIT */

 __attribute__((weak))
 void board_gpio_init(void)
@@ -257,14 +257,11 @@ int arch_cpu_init(void)
 	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
 		return 1;

-#if defined(CONFIG_MACH_DAVINCI_DA850_EVM)
+#if defined(CONFIG_SYS_DA850_PLL_INIT)
 	/* PLL setup */
 	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
 	da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
-
-	/* GPIO setup */
-	board_gpio_init();
-
+#endif
 	/* setup CSn config */
 #if defined(CONFIG_SYS_DA850_CS2CFG)
 	writel(CONFIG_SYS_DA850_CS2CFG, &davinci_emif_regs->ab1cr);
@@ -273,13 +270,15 @@ int arch_cpu_init(void)
 	writel(CONFIG_SYS_DA850_CS3CFG, &davinci_emif_regs->ab2cr);
 #endif

-	lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
-
-	da850_ddr_setup();
-#elif defined(CONFIG_MACH_DAVINCI_HAWK)
 	da8xx_configure_lpsc_items(lpsc, lpsc_size);
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
+	da850_ddr_setup();
 #endif

+	/* GPIO setup */
+	board_gpio_init();
+
+
 	NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
 			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);

diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 9bd3e71..34ef53d 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -137,7 +137,7 @@ const struct pinmux_resource pinmuxes[] = {

 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);

-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
 	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
 	{ DAVINCI_LPSC_EMAC },	/* image download */
@@ -145,6 +145,8 @@ static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_GPIO },
 };

+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 #ifndef CONFIG_DA850_EVM_MAX_CPU_CLK
 #define CONFIG_DA850_EVM_MAX_CPU_CLK	300000000
 #endif
diff --git a/board/enbw/enbw_cmc/enbw_cmc.c b/board/enbw/enbw_cmc/enbw_cmc.c
index 5cd5357..f6c3dd9 100644
--- a/board/enbw/enbw_cmc/enbw_cmc.c
+++ b/board/enbw/enbw_cmc/enbw_cmc.c
@@ -49,7 +49,7 @@

 DECLARE_GLOBAL_DATA_PTR;

-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },
 	{ DAVINCI_LPSC_SPI1 },
 	{ DAVINCI_LPSC_ARM_RAM_ROM },
@@ -65,6 +65,8 @@ static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_USB11 },
 };

+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 static const struct pinmux_config enbw_pins[] = {
 	{ pinmux(0), 8, 0 },
 	{ pinmux(0), 8, 1 },
@@ -549,15 +551,6 @@ void board_gpio_init(void)
 	struct davinci_gpio *gpio = davinci_gpio_bank01;

 	/*
-	 * Power on required peripherals
-	 * ARM does not have access by default to PSC0 and PSC1
-	 * assuming here that the DSP bootloader has set the IOPU
-	 * such that PSC access is available to ARM
-	 */
-	if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
-		return;
-
-	/*
 	 * set LED (gpio Interface not usable here)
 	 * set LED pins to output and state 0
 	 */
diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
index c427dc7..804846d 100644
--- a/include/configs/enbw_cmc.h
+++ b/include/configs/enbw_cmc.h
@@ -48,6 +48,8 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_DA850_LOWLEVEL
 #define CONFIG_ARCH_CPU_INIT
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 #define CONFIG_DA8XX_GPIO
 #define CONFIG_HOSTNAME		enbw_cmc
 #define CONFIG_DISPLAY_CPUINFO
-- 
1.7.7.4

[...]
> diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
> index a21d448..8e3a4d2 100644
> --- a/include/configs/cam_enc_4xx.h
> +++ b/include/configs/cam_enc_4xx.h
> @@ -205,6 +205,7 @@
>  
>  /* Defines for SPL */
>  #define CONFIG_SPL
> +#define CONFIG_DM365_SPL

Why we need this define?

[hs at pollux u-boot]$ grep -lr CONFIG_DM365_SPL .
./include/configs/cam_enc_4xx.h
[hs at pollux u-boot]$

>  #define CONFIG_SPL_NAND_SUPPORT
>  #define CONFIG_SPL_NAND_SIMPLE
>  #define CONFIG_SPL_NAND_LOAD
> diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
> index fcbbace..a44d825 100644
> --- a/include/configs/da850evm.h
> +++ b/include/configs/da850evm.h
> @@ -311,6 +311,7 @@
>  
>  /* defines for SPL */
>  #define CONFIG_SPL
> +#define CONFIG_DA850EVM_SPL

here too, why you add this define?

[hs at pollux u-boot]$ grep -lr CONFIG_DA850EVM_SPL .
./include/configs/da850evm.h
[hs at pollux u-boot]$

[...]
> diff --git a/include/configs/hawkboard.h b/include/configs/hawkboard.h
> index 12acb27..57b1932 100644
> --- a/include/configs/hawkboard.h
> +++ b/include/configs/hawkboard.h
> @@ -43,12 +43,30 @@
>  #define CONFIG_SKIP_LOWLEVEL_INIT
>  #define CONFIG_BOARD_EARLY_INIT_F
>  
> -#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_UART_U_BOOT)
> +#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (	\
> +	DAVINCI_SYSCFG_SUSPSRC_EMAC |		\
> +	DAVINCI_SYSCFG_SUSPSRC_I2C  |		\
> +	DAVINCI_SYSCFG_SUSPSRC_SPI1 |		\
> +	DAVINCI_SYSCFG_SUSPSRC_TIMER0 |		\
> +	DAVINCI_SYSCFG_SUSPSRC_UART2)
> +
> +#if defined(CONFIG_UART_U_BOOT)
>  #define CONFIG_SYS_TEXT_BASE		0xc1080000
> -#else
> +#elif !defined(CONFIG_SPL_BUILD)
>  #define CONFIG_SYS_TEXT_BASE		0xc1180000
>  #endif
>  
> +/* Spl */
> +#define CONFIG_SPL
> +#define CONFIG_HAWKBOARD_SPL

Here too, why this?

[hs at pollux u-boot]$ grep -lr CONFIG_HAWKBOARD_SPL .
./include/configs/hawkboard.h
[hs at pollux u-boot]$

> +#define CONFIG_SPL_NAND_SUPPORT
> +#define CONFIG_SPL_NAND_SIMPLE
> +#define CONFIG_SPL_NAND_LOAD
> +#define CONFIG_SPL_SERIAL_SUPPORT
> +#define CONFIG_SPL_LDSCRIPT		"board/$(BOARDDIR)/u-boot-spl-hawk.lds"
> +#define CONFIG_SPL_TEXT_BASE		0xc1080000
> +#define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
> +
>  /*
>   * Memory Info
>   */
> @@ -84,9 +102,7 @@
>  /*
>   * Network & Ethernet Configuration
>   */
> -#if !defined(CONFIG_NAND_SPL)
>  #define CONFIG_DRIVER_TI_EMAC
> -#endif
>  #define CONFIG_MII
>  #define CONFIG_BOOTP_DEFAULT
>  #define CONFIG_BOOTP_DNS

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

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure.
  2012-01-11  6:52   ` Heiko Schocher
@ 2012-01-11  7:53     ` Sughosh Ganu
  2012-01-11  8:54       ` Christian Riesch
  2012-01-11  9:17     ` Christian Riesch
  2012-01-11 14:37     ` [U-Boot] [PATCH 2/2 V3] " Sughosh Ganu
  2 siblings, 1 reply; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-11  7:53 UTC (permalink / raw)
  To: u-boot

hi Heiko,

On Wed Jan 11, 2012 at 07:52:02AM +0100, Heiko Schocher wrote:
> Hello Sughosh,
> 
> Sughosh Ganu wrote:
> > This patch moves hawkboard to the new spl infrastructure from the
> > older nand_spl one.
> > 
> > Removed the hawkboard_nand_config build option -- The spl code now
> > gets compiled with hawkboard_config, after building the main u-boot
> > image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> > to reflect the same.
> > 
> > Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> > Cc: Heiko Schocher <hs@denx.de>
> > Cc: Christian Riesch <christian.riesch@omicron.at>
> > Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> > Cc: Tom Rini <trini@ti.com>
> > ---
> > 
> [...]
> > diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> > index a532f8a..a4778b8 100644
> > --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> > +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> > @@ -32,6 +32,7 @@
> >  #include <asm/arch/emif_defs.h>
> >  #include <asm/arch/pll_defs.h>
> >  
> > +#if !defined(CONFIG_MACH_DAVINCI_HAWK)
> 
> Please no board specific defines.

  Ok, will replace with the arch specific define that you suggest.

> 
> >  void da850_waitloop(unsigned long loopcnt)
> >  {
> >  	unsigned long	i;
> > @@ -235,6 +236,7 @@ int da850_ddr_setup(void)
> >  
> >  	return 0;
> >  }
> > +#endif /* CONFIG_MACH_DAVINCI_HAWK */
> >  
> >  __attribute__((weak))
> >  void board_gpio_init(void)
> > @@ -242,10 +244,6 @@ void board_gpio_init(void)
> >  	return;
> >  }
> >  
> > -/* pinmux_resource[] vector is defined in the board specific file */
> > -extern const struct pinmux_resource pinmuxes[];
> > -extern const int pinmuxes_size;
> > -
> >  int arch_cpu_init(void)
> >  {
> >  	/* Unlock kick registers */
> > @@ -259,6 +257,7 @@ int arch_cpu_init(void)
> >  	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
> >  		return 1;
> >  
> > +#if defined(CONFIG_MACH_DAVINCI_DA850_EVM)
> 
> here too. I propose here a CONFIG_SYS_DA850_PLL_INIT ...

  Ok.

> 
> >  	/* PLL setup */
> >  	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
> >  	da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
> > @@ -275,6 +274,12 @@ int arch_cpu_init(void)
> >  #endif
> >  
> >  	lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
> > +
> > +	da850_ddr_setup();
> 
> and around the ddr_setup a CONFIG_SYS_DA850_DDR_INIT ...
> 
> > +#elif defined(CONFIG_MACH_DAVINCI_HAWK)
> > +	da8xx_configure_lpsc_items(lpsc, lpsc_size);
> > +#endif
> 
> and we should use da8xx_configure_lpsc_items() for all da850 boards.

  Ok.

> 
> This patch breaks current enbw_cmc board compile
> 
> [hs at pollux u-boot]$ ./MAKEALL enbw_cmc
> Configuring for enbw_cmc board...
> enbw_cmc.c:52:35: error: static declaration of 'lpsc' follows non-static declaration
> /work/hs/u-boot/include/asm/arch/da850_lowlevel.h:33:35: note: previous declaration of 'lpsc' was here
> make[1]: *** [enbw_cmc.o] Fehler 1
> make: *** [board/enbw/enbw_cmc/libenbw_cmc.o] Fehler 2
> arm-linux-gnueabi-size: './u-boot': No such file

  Oops, sorry about that.

<snip>

> diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
> index c427dc7..804846d 100644
> --- a/include/configs/enbw_cmc.h
> +++ b/include/configs/enbw_cmc.h
> @@ -48,6 +48,8 @@
>  #define CONFIG_SKIP_LOWLEVEL_INIT
>  #define CONFIG_DA850_LOWLEVEL
>  #define CONFIG_ARCH_CPU_INIT
> +#define CONFIG_SYS_DA850_PLL_INIT
> +#define CONFIG_SYS_DA850_DDR_INIT

  I think we'll need to add this for da850evm.h too.

>  #define CONFIG_DA8XX_GPIO
>  #define CONFIG_HOSTNAME		enbw_cmc
>  #define CONFIG_DISPLAY_CPUINFO
> -- 
> 1.7.7.4
> 
> [...]
> > diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
> > index a21d448..8e3a4d2 100644
> > --- a/include/configs/cam_enc_4xx.h
> > +++ b/include/configs/cam_enc_4xx.h
> > @@ -205,6 +205,7 @@
> >  
> >  /* Defines for SPL */
> >  #define CONFIG_SPL
> > +#define CONFIG_DM365_SPL
> 
> Why we need this define?

  Yeah, missed out cleaning these defines that i had used in V1. Will
  clean up in next version for all the cases.

-sughosh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure.
  2012-01-11  7:53     ` Sughosh Ganu
@ 2012-01-11  8:54       ` Christian Riesch
  0 siblings, 0 replies; 22+ messages in thread
From: Christian Riesch @ 2012-01-11  8:54 UTC (permalink / raw)
  To: u-boot

Hello Sughosh,
I reviewed your patch and I agree with Heiko's comments. I am looking
forward to v3 :-)
Regards, Christian

On Wed, Jan 11, 2012 at 8:53 AM, Sughosh Ganu <urwithsughosh@gmail.com> wrote:
> hi Heiko,
>
> On Wed Jan 11, 2012 at 07:52:02AM +0100, Heiko Schocher wrote:
>> Hello Sughosh,
>>
>> Sughosh Ganu wrote:
>> > This patch moves hawkboard to the new spl infrastructure from the
>> > older nand_spl one.
>> >
>> > Removed the hawkboard_nand_config build option -- The spl code now
>> > gets compiled with hawkboard_config, after building the main u-boot
>> > image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
>> > to reflect the same.
>> >
>> > Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
>> > Cc: Heiko Schocher <hs@denx.de>
>> > Cc: Christian Riesch <christian.riesch@omicron.at>
>> > Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
>> > Cc: Tom Rini <trini@ti.com>
>> > ---
>> >
>> [...]
>> > diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
>> > index a532f8a..a4778b8 100644
>> > --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
>> > +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
>> > @@ -32,6 +32,7 @@
>> > ?#include <asm/arch/emif_defs.h>
>> > ?#include <asm/arch/pll_defs.h>
>> >
>> > +#if !defined(CONFIG_MACH_DAVINCI_HAWK)
>>
>> Please no board specific defines.
>
> ?Ok, will replace with the arch specific define that you suggest.
>
>>
>> > ?void da850_waitloop(unsigned long loopcnt)
>> > ?{
>> > ? ? unsigned long ? i;
>> > @@ -235,6 +236,7 @@ int da850_ddr_setup(void)
>> >
>> > ? ? return 0;
>> > ?}
>> > +#endif /* CONFIG_MACH_DAVINCI_HAWK */
>> >
>> > ?__attribute__((weak))
>> > ?void board_gpio_init(void)
>> > @@ -242,10 +244,6 @@ void board_gpio_init(void)
>> > ? ? return;
>> > ?}
>> >
>> > -/* pinmux_resource[] vector is defined in the board specific file */
>> > -extern const struct pinmux_resource pinmuxes[];
>> > -extern const int pinmuxes_size;
>> > -
>> > ?int arch_cpu_init(void)
>> > ?{
>> > ? ? /* Unlock kick registers */
>> > @@ -259,6 +257,7 @@ int arch_cpu_init(void)
>> > ? ? if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
>> > ? ? ? ? ? ? return 1;
>> >
>> > +#if defined(CONFIG_MACH_DAVINCI_DA850_EVM)
>>
>> here too. I propose here a CONFIG_SYS_DA850_PLL_INIT ...
>
> ?Ok.
>
>>
>> > ? ? /* PLL setup */
>> > ? ? da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
>> > ? ? da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
>> > @@ -275,6 +274,12 @@ int arch_cpu_init(void)
>> > ?#endif
>> >
>> > ? ? lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
>> > +
>> > + ? da850_ddr_setup();
>>
>> and around the ddr_setup a CONFIG_SYS_DA850_DDR_INIT ...
>>
>> > +#elif defined(CONFIG_MACH_DAVINCI_HAWK)
>> > + ? da8xx_configure_lpsc_items(lpsc, lpsc_size);
>> > +#endif
>>
>> and we should use da8xx_configure_lpsc_items() for all da850 boards.
>
> ?Ok.
>
>>
>> This patch breaks current enbw_cmc board compile
>>
>> [hs at pollux u-boot]$ ./MAKEALL enbw_cmc
>> Configuring for enbw_cmc board...
>> enbw_cmc.c:52:35: error: static declaration of 'lpsc' follows non-static declaration
>> /work/hs/u-boot/include/asm/arch/da850_lowlevel.h:33:35: note: previous declaration of 'lpsc' was here
>> make[1]: *** [enbw_cmc.o] Fehler 1
>> make: *** [board/enbw/enbw_cmc/libenbw_cmc.o] Fehler 2
>> arm-linux-gnueabi-size: './u-boot': No such file
>
> ?Oops, sorry about that.
>
> <snip>
>
>> diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
>> index c427dc7..804846d 100644
>> --- a/include/configs/enbw_cmc.h
>> +++ b/include/configs/enbw_cmc.h
>> @@ -48,6 +48,8 @@
>> ?#define CONFIG_SKIP_LOWLEVEL_INIT
>> ?#define CONFIG_DA850_LOWLEVEL
>> ?#define CONFIG_ARCH_CPU_INIT
>> +#define CONFIG_SYS_DA850_PLL_INIT
>> +#define CONFIG_SYS_DA850_DDR_INIT
>
> ?I think we'll need to add this for da850evm.h too.
>
>> ?#define CONFIG_DA8XX_GPIO
>> ?#define CONFIG_HOSTNAME ? ? ? ? ? ? ?enbw_cmc
>> ?#define CONFIG_DISPLAY_CPUINFO
>> --
>> 1.7.7.4
>>
>> [...]
>> > diff --git a/include/configs/cam_enc_4xx.h b/include/configs/cam_enc_4xx.h
>> > index a21d448..8e3a4d2 100644
>> > --- a/include/configs/cam_enc_4xx.h
>> > +++ b/include/configs/cam_enc_4xx.h
>> > @@ -205,6 +205,7 @@
>> >
>> > ?/* Defines for SPL */
>> > ?#define CONFIG_SPL
>> > +#define CONFIG_DM365_SPL
>>
>> Why we need this define?
>
> ?Yeah, missed out cleaning these defines that i had used in V1. Will
> ?clean up in next version for all the cases.
>
> -sughosh
> _______________________________________________
> U-Boot mailing list
> U-Boot at lists.denx.de
> http://lists.denx.de/mailman/listinfo/u-boot

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure.
  2012-01-11  6:52   ` Heiko Schocher
  2012-01-11  7:53     ` Sughosh Ganu
@ 2012-01-11  9:17     ` Christian Riesch
  2012-01-11  9:40       ` Heiko Schocher
  2012-01-11 14:37     ` [U-Boot] [PATCH 2/2 V3] " Sughosh Ganu
  2 siblings, 1 reply; 22+ messages in thread
From: Christian Riesch @ 2012-01-11  9:17 UTC (permalink / raw)
  To: u-boot

Hello Heiko, Sughosh,

On Wed, Jan 11, 2012 at 7:52 AM, Heiko Schocher <hs@denx.de> wrote:
> please remove the da8xx_configure_lpsc_items() in board_gpio_init()
> in the ./board/enbw/enbw_cmc/enbw_cmc.c() file, and also move ...
> before I write here a lot of text, here the patch, based on yours,
> please add it to your patch, and add my
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
>
> and tested on the enbw_cmc board, so:
> Tested-by: Heiko Schocher <hs@denx.de>
>
> to your patch, here the patch:
>
> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> index a4778b8..a404916 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
[....]
> - ? ? ? lpsc_on(CONFIG_SYS_DA850_LPSC_UART);

Now we can also remove CONFIG_SYS_DA850_LPSC_UART from
include/configs/da850evm.h and include/configs/enbw_cmc.h.

Regards, Christian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure.
  2012-01-11  9:17     ` Christian Riesch
@ 2012-01-11  9:40       ` Heiko Schocher
  0 siblings, 0 replies; 22+ messages in thread
From: Heiko Schocher @ 2012-01-11  9:40 UTC (permalink / raw)
  To: u-boot

Hello Christian,

Christian Riesch wrote:
> Hello Heiko, Sughosh,
> 
> On Wed, Jan 11, 2012 at 7:52 AM, Heiko Schocher <hs@denx.de> wrote:
>> please remove the da8xx_configure_lpsc_items() in board_gpio_init()
>> in the ./board/enbw/enbw_cmc/enbw_cmc.c() file, and also move ...
>> before I write here a lot of text, here the patch, based on yours,
>> please add it to your patch, and add my
>>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>>
>> and tested on the enbw_cmc board, so:
>> Tested-by: Heiko Schocher <hs@denx.de>
>>
>> to your patch, here the patch:
>>
>> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
>> index a4778b8..a404916 100644
>> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
>> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> [....]
>> -       lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
> 
> Now we can also remove CONFIG_SYS_DA850_LPSC_UART from
> include/configs/da850evm.h and include/configs/enbw_cmc.h.

correct. Good catch!

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V3] Changes to move hawkboard to the new spl infrastructure.
  2012-01-11  6:52   ` Heiko Schocher
  2012-01-11  7:53     ` Sughosh Ganu
  2012-01-11  9:17     ` Christian Riesch
@ 2012-01-11 14:37     ` Sughosh Ganu
  2012-01-11 16:10       ` Christian Riesch
  2 siblings, 1 reply; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-11 14:37 UTC (permalink / raw)
  To: u-boot

This patch moves hawkboard to the new spl infrastructure from the
older nand_spl one.

Removed the hawkboard_nand_config build option -- The spl code now
gets compiled with hawkboard_config, after building the main u-boot
image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
to reflect the same.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Tom Rini <trini@ti.com>
---

Changes since V2
* Made changes to fix build break on enbw_cmc board.
* Replaced defines used for conditionally compiling code in
  da850_lowlevel.c to the ones suggested by Heiko.
* Removed unwanted defines from the config files which were added in
  V1.

Changes since V1
* Use a common file instead of board specific files for spl,
based on review comments from Christian and Heiko.

 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c    |   23 ++--
 arch/arm/cpu/arm926ejs/davinci/spl.c               |    4 +-
 arch/arm/include/asm/arch-davinci/da850_lowlevel.h |    9 +
 board/davinci/da8xxevm/da850evm.c                  |    4 +-
 board/davinci/da8xxevm/hawkboard.c                 |   23 +++
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |  115 ---------------
 .../{u-boot-spl.lds => u-boot-spl-da850evm.lds}    |    0
 .../davinci/da8xxevm/u-boot-spl-hawk.lds           |   22 ++-
 board/enbw/enbw_cmc/enbw_cmc.c                     |   13 +--
 boards.cfg                                         |    1 -
 doc/README.hawkboard                               |   43 +++---
 include/configs/da850evm.h                         |    5 +-
 include/configs/enbw_cmc.h                         |    2 +
 include/configs/hawkboard.h                        |   23 +++-
 nand_spl/board/davinci/da8xxevm/Makefile           |  155 --------------------
 15 files changed, 111 insertions(+), 331 deletions(-)
 delete mode 100644 board/davinci/da8xxevm/hawkboard_nand_spl.c
 rename board/davinci/da8xxevm/{u-boot-spl.lds => u-boot-spl-da850evm.lds} (100%)
 rename nand_spl/board/davinci/da8xxevm/u-boot.lds => board/davinci/da8xxevm/u-boot-spl-hawk.lds (86%)
 delete mode 100644 nand_spl/board/davinci/da8xxevm/Makefile

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index a532f8a..a404916 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -32,6 +32,7 @@
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>
 
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
 void da850_waitloop(unsigned long loopcnt)
 {
 	unsigned long	i;
@@ -235,6 +236,7 @@ int da850_ddr_setup(void)
 
 	return 0;
 }
+#endif /* CONFIG_SYS_DA850_DDR_INIT */
 
 __attribute__((weak))
 void board_gpio_init(void)
@@ -242,10 +244,6 @@ void board_gpio_init(void)
 	return;
 }
 
-/* pinmux_resource[] vector is defined in the board specific file */
-extern const struct pinmux_resource pinmuxes[];
-extern const int pinmuxes_size;
-
 int arch_cpu_init(void)
 {
 	/* Unlock kick registers */
@@ -259,13 +257,11 @@ int arch_cpu_init(void)
 	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
 		return 1;
 
+#if defined(CONFIG_SYS_DA850_PLL_INIT)
 	/* PLL setup */
 	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
 	da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
-
-	/* GPIO setup */
-	board_gpio_init();
-
+#endif
 	/* setup CSn config */
 #if defined(CONFIG_SYS_DA850_CS2CFG)
 	writel(CONFIG_SYS_DA850_CS2CFG, &davinci_emif_regs->ab1cr);
@@ -274,7 +270,15 @@ int arch_cpu_init(void)
 	writel(CONFIG_SYS_DA850_CS3CFG, &davinci_emif_regs->ab2cr);
 #endif
 
-	lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
+	da8xx_configure_lpsc_items(lpsc, lpsc_size);
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
+	da850_ddr_setup();
+#endif
+
+	/* GPIO setup */
+	board_gpio_init();
+
+
 	NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
 			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
 
@@ -286,6 +290,5 @@ int arch_cpu_init(void)
 		DAVINCI_UART_PWREMU_MGMT_UTRST),
 	       &davinci_uart2_ctrl_regs->pwremu_mgmt);
 
-	da850_ddr_setup();
 	return 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index f475f9b..74632e5 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -74,12 +74,12 @@ void board_init_f(ulong dummy)
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SOC_DM365
+#ifdef CONFIG_SPL_NAND_LOAD
 	nand_init();
 	puts("Nand boot...\n");
 	nand_boot();
 #endif
-#ifdef CONFIG_SOC_DA8XX
+#ifdef CONFIG_SPL_SPI_LOAD
 	mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
 			CONFIG_SYS_MALLOC_LEN);
 
diff --git a/arch/arm/include/asm/arch-davinci/da850_lowlevel.h b/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
index e489c47..11ed91d 100644
--- a/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
+++ b/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
@@ -24,6 +24,15 @@
 #ifndef __DA850_LOWLEVEL_H
 #define __DA850_LOWLEVEL_H
 
+#include <asm/arch/pinmux_defs.h>
+
+/* pinmux_resource[] vector is defined in the board specific file */
+extern const struct pinmux_resource pinmuxes[];
+extern const int pinmuxes_size;
+
+extern const struct lpsc_resource lpsc[];
+extern const int lpsc_size;
+
 /* NOR Boot Configuration Word Field Descriptions */
 #define DA850_NORBOOT_COPY_XK(X)	((X - 1) << 8)
 #define DA850_NORBOOT_METHOD_DIRECT	(1 << 4)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 9bd3e71..34ef53d 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -137,7 +137,7 @@ const struct pinmux_resource pinmuxes[] = {
 
 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
 
-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
 	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
 	{ DAVINCI_LPSC_EMAC },	/* image download */
@@ -145,6 +145,8 @@ static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_GPIO },
 };
 
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 #ifndef CONFIG_DA850_EVM_MAX_CPU_CLK
 #define CONFIG_DA850_EVM_MAX_CPU_CLK	300000000
 #endif
diff --git a/board/davinci/da8xxevm/hawkboard.c b/board/davinci/da8xxevm/hawkboard.c
index 9d4e238..b694258 100644
--- a/board/davinci/da8xxevm/hawkboard.c
+++ b/board/davinci/da8xxevm/hawkboard.c
@@ -27,10 +27,33 @@
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 #include <asm/arch/davinci_misc.h>
+#include <asm/arch/pinmux_defs.h>
 #include <ns16550.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const struct pinmux_resource pinmuxes[] = {
+	PINMUX_ITEM(emac_pins_mii),
+	PINMUX_ITEM(emac_pins_mdio),
+	PINMUX_ITEM(emifa_pins_cs3),
+	PINMUX_ITEM(emifa_pins_cs4),
+	PINMUX_ITEM(emifa_pins_nand),
+	PINMUX_ITEM(uart2_pins_txrx),
+	PINMUX_ITEM(uart2_pins_rtscts),
+};
+
+const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
+
+const struct lpsc_resource lpsc[] = {
+	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
+	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
+	{ DAVINCI_LPSC_EMAC },	/* image download */
+	{ DAVINCI_LPSC_UART2 },	/* console */
+	{ DAVINCI_LPSC_GPIO },
+};
+
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 int board_init(void)
 {
 	/* arch number of the board */
diff --git a/board/davinci/da8xxevm/hawkboard_nand_spl.c b/board/davinci/da8xxevm/hawkboard_nand_spl.c
deleted file mode 100644
index df97963..0000000
--- a/board/davinci/da8xxevm/hawkboard_nand_spl.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Modified for Hawkboard - Syed Mohammed Khasim <khasim@beagleboard.org>
- *
- * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.  <nsekhar@ti.com>
- * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
- * Copyright (C) 2004 Texas Instruments.
- *
- * ----------------------------------------------------------------------------
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * ----------------------------------------------------------------------------
- */
-
-#include <common.h>
-#include <asm/errno.h>
-#include <asm/arch/hardware.h>
-#include <asm/io.h>
-#include <asm/arch/davinci_misc.h>
-#include <asm/arch/pinmux_defs.h>
-#include <ns16550.h>
-#include <nand.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static const struct pinmux_resource pinmuxes[] = {
-	PINMUX_ITEM(emac_pins_mii),
-	PINMUX_ITEM(emac_pins_mdio),
-	PINMUX_ITEM(emifa_pins_cs3),
-	PINMUX_ITEM(emifa_pins_cs4),
-	PINMUX_ITEM(emifa_pins_nand),
-	PINMUX_ITEM(uart2_pins_txrx),
-	PINMUX_ITEM(uart2_pins_rtscts),
-};
-
-static const struct lpsc_resource lpsc[] = {
-	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
-	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
-	{ DAVINCI_LPSC_EMAC },	/* image download */
-	{ DAVINCI_LPSC_UART2 },	/* console */
-	{ DAVINCI_LPSC_GPIO },
-};
-
-void board_init_f(ulong bootflag)
-{
-	/*
-	 * Kick Registers need to be set to allow access to Pin Mux registers
-	 */
-	writel(DV_SYSCFG_KICK0_UNLOCK, &davinci_syscfg_regs->kick0);
-	writel(DV_SYSCFG_KICK1_UNLOCK, &davinci_syscfg_regs->kick1);
-
-	/* setup the SUSPSRC for ARM to control emulation suspend */
-	writel(readl(&davinci_syscfg_regs->suspsrc) &
-	       ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
-		 DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
-		 DAVINCI_SYSCFG_SUSPSRC_UART2), &davinci_syscfg_regs->suspsrc);
-
-	/* Power on required peripherals
-	 * ARM does not have acess by default to PSC0 and PSC1
-	 * assuming here that the DSP bootloader has set the IOPU
-	 * such that PSC access is available to ARM
-	 */
-	da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc));
-
-	/* configure pinmux settings */
-	davinci_configure_pin_mux_items(pinmuxes,
-					ARRAY_SIZE(pinmuxes));
-
-	writel(readl(&davinci_uart2_ctrl_regs->pwremu_mgmt) |
-	       (DAVINCI_UART_PWREMU_MGMT_FREE) |
-	       (DAVINCI_UART_PWREMU_MGMT_URRST) |
-	       (DAVINCI_UART_PWREMU_MGMT_UTRST),
-	       &davinci_uart2_ctrl_regs->pwremu_mgmt);
-
-	NS16550_init((NS16550_t)(DAVINCI_UART2_BASE),
-			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
-
-	puts("Nand boot...\n");
-
-	nand_boot();
-}
-
-void puts(const char *str)
-{
-	while (*str)
-		putc(*str++);
-}
-
-void putc(char c)
-{
-	if (gd->flags & GD_FLG_SILENT)
-		return;
-
-	if (c == '\n')
-		NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), '\r');
-
-	NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), c);
-}
-
-void hang(void)
-{
-	puts("### ERROR ### Please RESET the board ###\n");
-	for (;;)
-		;
-}
diff --git a/board/davinci/da8xxevm/u-boot-spl.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
similarity index 100%
rename from board/davinci/da8xxevm/u-boot-spl.lds
rename to board/davinci/da8xxevm/u-boot-spl-da850evm.lds
diff --git a/nand_spl/board/davinci/da8xxevm/u-boot.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
similarity index 86%
rename from nand_spl/board/davinci/da8xxevm/u-boot.lds
rename to board/davinci/da8xxevm/u-boot-spl-hawk.lds
index 638ffd9..b3a41af 100644
--- a/nand_spl/board/davinci/da8xxevm/u-boot.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -34,11 +34,11 @@ SECTIONS
 	. = ALIGN(4);
 	.text      :
 	{
-	  start.o	(.text)
-	  cpu.o		(.text)
-	  nand_boot.o	(.text)
+	  arch/arm/cpu/arm926ejs/start.o		(.text)
+	  arch/arm/cpu/arm926ejs/davinci/libdavinci.o	(.text)
+	  drivers/mtd/nand/libnand.o			(.text)
 
-	  *(.text)
+	  *(.text*)
 	}
 
 	. = ALIGN(4);
@@ -68,10 +68,14 @@ SECTIONS
 
 	__got_end = .;
 
-	_end = .;
+	.bss :
+	{
+		. = ALIGN(4);
+		__bss_start = .;
+		*(.bss*)
+		. = ALIGN(4);
+		__bss_end__ = .;
+	}
 
-	. = ALIGN(4);
-	__bss_start = .;
-	.bss : { *(.bss) }
-	__bss_end__ = .;
+	_end = .;
 }
diff --git a/board/enbw/enbw_cmc/enbw_cmc.c b/board/enbw/enbw_cmc/enbw_cmc.c
index 98dda1e..16d1b08 100644
--- a/board/enbw/enbw_cmc/enbw_cmc.c
+++ b/board/enbw/enbw_cmc/enbw_cmc.c
@@ -49,7 +49,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },
 	{ DAVINCI_LPSC_SPI1 },
 	{ DAVINCI_LPSC_ARM_RAM_ROM },
@@ -65,6 +65,8 @@ static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_USB11 },
 };
 
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 static const struct pinmux_config enbw_pins[] = {
 	{ pinmux(0), 8, 0 },
 	{ pinmux(0), 8, 1 },
@@ -549,15 +551,6 @@ void board_gpio_init(void)
 	struct davinci_gpio *gpio = davinci_gpio_bank01;
 
 	/*
-	 * Power on required peripherals
-	 * ARM does not have access by default to PSC0 and PSC1
-	 * assuming here that the DSP bootloader has set the IOPU
-	 * such that PSC access is available to ARM
-	 */
-	if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
-		return;
-
-	/*
 	 * set LED (gpio Interface not usable here)
 	 * set LED pins to output and state 0
 	 */
diff --git a/boards.cfg b/boards.cfg
index da1a3ce..643b34b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -133,7 +133,6 @@ davinci_sffsdr               arm         arm926ejs   sffsdr              davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 ea20			     arm	 arm926ejs   ea20		 davinci	davinci
 hawkboard                    arm         arm926ejs   da8xxevm            davinci        davinci
-hawkboard_nand               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:NAND_U_BOOT
 hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_DISABLE_PCI
diff --git a/doc/README.hawkboard b/doc/README.hawkboard
index b7afec4..d6ae02e 100644
--- a/doc/README.hawkboard
+++ b/doc/README.hawkboard
@@ -9,8 +9,8 @@ executes upon reset is the Rom Boot Loader(RBL) which sits in the
 internal ROM of the omap. The RBL initialises the memory and the nand
 controller, and copies the image stored at a predefined location(block
 1) of the nand flash. The image loaded by the RBL to the memory is the
-AIS signed nand_spl image. This, in turns copies the u-boot binary
-from the nand flash to the memory and jumps to the u-boot entry point.
+AIS signed spl image. This, in turns copies the u-boot binary from the
+nand flash to the memory and jumps to the u-boot entry point.
 
 AIS is an image format defined by TI for the images that are to be
 loaded to memory by the RBL. The image is divided into a series of
@@ -20,14 +20,14 @@ and the size of the section, which is used by the RBL to load the
 image. At the end of the image the RBL jumps to the image entry
 point.
 
-The secondary stage bootloader(nand_spl) which is loaded by the RBL
-then loads the u-boot from a predefined location in the nand to the
-memory and jumps to the u-boot entry point.
+The secondary stage bootloader(spl) which is loaded by the RBL then
+loads the u-boot from a predefined location in the nand to the memory
+and jumps to the u-boot entry point.
 
 The reason a secondary stage bootloader is used is because the ECC
 layout expected by the RBL is not the same as that used by
-u-boot/linux. This also implies that for flashing the nand_spl image,
-we need to use the u-boot which uses the ECC layout expected by the
+u-boot/linux. This also implies that for flashing the spl image,we
+need to use the u-boot which uses the ECC layout expected by the
 RBL[1]. Booting u-boot over UART(UART boot) is explained here[2].
 
 
@@ -35,20 +35,19 @@ Compilation
 ===========
 Three images might be needed
 
-* nand_spl - This is the secondary bootloader which boots the u-boot
+* spl - This is the secondary bootloader which boots the u-boot
   binary.
 
-  hawkboard_nand_config
-
-  The nand_spl ELF gets generated under nand_spl/u-boot-spl. This
-  needs to be processed with the AISGen tool for generating the AIS
-  signed image to be flashed. Steps for generating the AIS image are
-  explained here[3].
-
 * u-boot binary - This is the image flashed to the nand and copied to
-  the memory by the nand_spl.
+  the memory by the spl.
+
+  Both the images get compiled with hawkboard_config, with the TOPDIR
+  containing the u-boot images, and the spl image under the spl
+  directory.
 
-  hawkboard_config
+  The spl image needs to be processed with the AISGen tool for
+  generating the AIS signed image to be flashed. Steps for generating
+  the AIS image are explained here[3].
 
 * u-boot for uart boot - This is same as the u-boot binary generated
   above, with the sole difference of the CONFIG_SYS_TEXT_BASE being
@@ -59,17 +58,17 @@ Three images might be needed
 
 Flashing the images to Nand
 ===========================
-The nand_spl AIS image needs to be flashed to the block 1 of the
-Nand flash, as that is the location the RBL expects the image[4]. For
-flashing the nand_spl, boot over the u-boot specified in [1], and
-flash the image
+The spl AIS image needs to be flashed to the block 1 of the Nand
+flash, as that is the location the RBL expects the image[4]. For
+flashing the spl, boot over the u-boot specified in [1], and flash the
+image
 
 => tftpboot 0xc0700000 <nand_spl_ais.bin>
 => nand erase 0x20000 0x20000
 => nand write.e 0xc0700000 0x20000 <nand_spl_size>
 
 The u-boot binary is flashed at location 0xe0000(block 6) of the nand
-flash. The nand_spl loader expects the u-boot at this location. For
+flash. The spl loader expects the u-boot at this location. For
 flashing the u-boot binary
 
 => tftpboot 0xc0700000 u-boot.bin
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index fcbbace..68bdbbe 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -44,6 +44,8 @@
 #define CONFIG_SYS_HZ			1000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 
 /*
  * Memory Info
@@ -142,7 +144,6 @@
 #define CONFIG_CONS_INDEX	1		/* use UART0 for console */
 #define CONFIG_BAUDRATE		115200		/* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
-#define CONFIG_SYS_DA850_LPSC_UART DAVINCI_LPSC_UART2
 
 #define CONFIG_SPI
 #define CONFIG_SPI_FLASH
@@ -319,7 +320,7 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LDSCRIPT	"$(BOARDDIR)/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT	"board/$(BOARDDIR)/u-boot-spl-da850evm.lds"
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
index c427dc7..804846d 100644
--- a/include/configs/enbw_cmc.h
+++ b/include/configs/enbw_cmc.h
@@ -48,6 +48,8 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_DA850_LOWLEVEL
 #define CONFIG_ARCH_CPU_INIT
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 #define CONFIG_DA8XX_GPIO
 #define CONFIG_HOSTNAME		enbw_cmc
 #define CONFIG_DISPLAY_CPUINFO
diff --git a/include/configs/hawkboard.h b/include/configs/hawkboard.h
index 12acb27..9dd0516 100644
--- a/include/configs/hawkboard.h
+++ b/include/configs/hawkboard.h
@@ -43,12 +43,29 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_UART_U_BOOT)
+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (	\
+	DAVINCI_SYSCFG_SUSPSRC_EMAC |		\
+	DAVINCI_SYSCFG_SUSPSRC_I2C  |		\
+	DAVINCI_SYSCFG_SUSPSRC_SPI1 |		\
+	DAVINCI_SYSCFG_SUSPSRC_TIMER0 |		\
+	DAVINCI_SYSCFG_SUSPSRC_UART2)
+
+#if defined(CONFIG_UART_U_BOOT)
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
-#else
+#elif !defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_TEXT_BASE		0xc1180000
 #endif
 
+/* Spl */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"board/$(BOARDDIR)/u-boot-spl-hawk.lds"
+#define CONFIG_SPL_TEXT_BASE		0xc1080000
+#define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
+
 /*
  * Memory Info
  */
@@ -84,9 +101,7 @@
 /*
  * Network & Ethernet Configuration
  */
-#if !defined(CONFIG_NAND_SPL)
 #define CONFIG_DRIVER_TI_EMAC
-#endif
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
deleted file mode 100644
index 7746e41..0000000
--- a/nand_spl/board/davinci/da8xxevm/Makefile
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# (C) Copyright 2006-2007
-# Stefan Roese, DENX Software Engineering, sr at denx.de.
-#
-# (C) Copyright 2008
-# Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-CONFIG_NAND_SPL	= y
-
-include $(TOPDIR)/config.mk
-
-nandobj	:= $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS	= _divsi3.o \
-	_udivsi3.o \
-	start.o
-
-COBJS	= cpu.o \
-	davinci_nand.o \
-	pinmux.o \
-	da850_pinmux.o \
-	div0.o \
-	hawkboard_nand_spl.o \
-	misc.o \
-	nand_boot.o \
-	ns16550.o \
-	psc.o
-
-SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS	:= $(SOBJS) $(COBJS)
-LNDIR	:= $(nandobj)board/$(BOARDDIR)
-
-ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin \
-	$(nandobj)u-boot-spl-16k.bin
-
-all:	$(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:	$(OBJS) $(nandobj)u-boot.lds
-	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-		-Map $(nandobj)u-boot-spl.map \
-		-o $(nandobj)u-boot-spl
-
-$(nandobj)u-boot.lds: $(LDSCRIPT)
-	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
-
-# create symbolic links for common files
-
-# from board directory
-$(obj)pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/pinmux.c $@
-
-$(obj)da850_pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c $@
-
-# from drivers/mtd/nand directory
-$(obj)davinci_nand.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/drivers/mtd/nand/davinci_nand.c $@
-
-# from nand_spl directory
-$(obj)nand_boot.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/nand_spl/nand_boot.c $@
-
-# from drivers/serial directory
-$(obj)ns16550.c:
-	@rm -f $@
-	@ln -sf $(TOPDIR)/drivers/serial/ns16550.c $@
-
-# from cpu directory
-$(obj)start.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/start.S $@
-
-# from lib directory
-$(obj)_udivsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_udivsi3.S $@
-
-# from lib directory
-$(obj)_divsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_divsi3.S $@
-
-# from lib directory
-$(obj)div0.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/div0.c $@
-
-# from SoC directory
-$(obj)cpu.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/cpu.c $@
-
-$(obj)misc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/misc.c $@
-
-# from board directory
-$(obj)hawkboard_nand_spl.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/board/davinci/da8xxevm/hawkboard_nand_spl.c $@
-
-$(obj)psc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/psc.c $@
-
-#########################################################################
-
-$(obj)%.o:	$(obj)%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(obj)%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V3] Changes to move hawkboard to the new spl infrastructure.
  2012-01-11 14:37     ` [U-Boot] [PATCH 2/2 V3] " Sughosh Ganu
@ 2012-01-11 16:10       ` Christian Riesch
  2012-01-11 17:03         ` [U-Boot] [PATCH 2/2 V4] " Sughosh Ganu
  0 siblings, 1 reply; 22+ messages in thread
From: Christian Riesch @ 2012-01-11 16:10 UTC (permalink / raw)
  To: u-boot

Hello Sughosh,
I did a quick test on the da850evm with the SPL for booting from SPI
and it worked. I have a few comments below.

On Wed, Jan 11, 2012 at 3:37 PM, Sughosh Ganu <urwithsughosh@gmail.com> wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one.
>
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
>
> Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Christian Riesch <christian.riesch@omicron.at>
> Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> Cc: Tom Rini <trini@ti.com>
> ---
>
> Changes since V2
> * Made changes to fix build break on enbw_cmc board.
> * Replaced defines used for conditionally compiling code in
> ?da850_lowlevel.c to the ones suggested by Heiko.
> * Removed unwanted defines from the config files which were added in
> ?V1.
>
> Changes since V1
> * Use a common file instead of board specific files for spl,
> based on review comments from Christian and Heiko.
>
> ?arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c ? ?| ? 23 ++--
> ?arch/arm/cpu/arm926ejs/davinci/spl.c ? ? ? ? ? ? ? | ? ?4 +-
> ?arch/arm/include/asm/arch-davinci/da850_lowlevel.h | ? ?9 +
> ?board/davinci/da8xxevm/da850evm.c ? ? ? ? ? ? ? ? ?| ? ?4 +-
> ?board/davinci/da8xxevm/hawkboard.c ? ? ? ? ? ? ? ? | ? 23 +++
> ?board/davinci/da8xxevm/hawkboard_nand_spl.c ? ? ? ?| ?115 ---------------
> ?.../{u-boot-spl.lds => u-boot-spl-da850evm.lds} ? ?| ? ?0
> ?.../davinci/da8xxevm/u-boot-spl-hawk.lds ? ? ? ? ? | ? 22 ++-
> ?board/enbw/enbw_cmc/enbw_cmc.c ? ? ? ? ? ? ? ? ? ? | ? 13 +--
> ?boards.cfg ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? ?1 -
> ?doc/README.hawkboard ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? | ? 43 +++---
> ?include/configs/da850evm.h ? ? ? ? ? ? ? ? ? ? ? ? | ? ?5 +-
> ?include/configs/enbw_cmc.h ? ? ? ? ? ? ? ? ? ? ? ? | ? ?2 +
> ?include/configs/hawkboard.h ? ? ? ? ? ? ? ? ? ? ? ?| ? 23 +++-
> ?nand_spl/board/davinci/da8xxevm/Makefile ? ? ? ? ? | ?155 --------------------
> ?15 files changed, 111 insertions(+), 331 deletions(-)
> ?delete mode 100644 board/davinci/da8xxevm/hawkboard_nand_spl.c
> ?rename board/davinci/da8xxevm/{u-boot-spl.lds => u-boot-spl-da850evm.lds} (100%)
> ?rename nand_spl/board/davinci/da8xxevm/u-boot.lds => board/davinci/da8xxevm/u-boot-spl-hawk.lds (86%)
> ?delete mode 100644 nand_spl/board/davinci/da8xxevm/Makefile
>
> diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> index a532f8a..a404916 100644
> --- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> +++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
> @@ -32,6 +32,7 @@
> ?#include <asm/arch/emif_defs.h>
> ?#include <asm/arch/pll_defs.h>
>
> +#if defined(CONFIG_SYS_DA850_DDR_INIT)

When CONFIG_SYS_DA850_DDR_INIT is not defined, you also remove the PLL
initialization functions with this ifdef. I think this is not very
beautiful since there is a separate CONFIG_SYS_DA850_PLL_INIT. Please
put #if defined(CONFIG_SYS_DA850_DDR_INIT) only around DDR
initialization functions and #if defined(CONFIG_SYS_DA850_PLL_INIT)
around the PLL init functions instead.

> ?void da850_waitloop(unsigned long loopcnt)
> ?{
> ? ? ? ?unsigned long ? i;
> @@ -235,6 +236,7 @@ int da850_ddr_setup(void)
>
> ? ? ? ?return 0;
> ?}
> +#endif /* CONFIG_SYS_DA850_DDR_INIT */
>
> ?__attribute__((weak))
> ?void board_gpio_init(void)
> @@ -242,10 +244,6 @@ void board_gpio_init(void)
> ? ? ? ?return;
> ?}
>
> -/* pinmux_resource[] vector is defined in the board specific file */
> -extern const struct pinmux_resource pinmuxes[];
> -extern const int pinmuxes_size;
> -
> ?int arch_cpu_init(void)
> ?{
> ? ? ? ?/* Unlock kick registers */
> @@ -259,13 +257,11 @@ int arch_cpu_init(void)
> ? ? ? ?if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
> ? ? ? ? ? ? ? ?return 1;
>
> +#if defined(CONFIG_SYS_DA850_PLL_INIT)
> ? ? ? ?/* PLL setup */
> ? ? ? ?da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
> ? ? ? ?da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
> -
> - ? ? ? /* GPIO setup */
> - ? ? ? board_gpio_init();
> -
> +#endif
> ? ? ? ?/* setup CSn config */
> ?#if defined(CONFIG_SYS_DA850_CS2CFG)
> ? ? ? ?writel(CONFIG_SYS_DA850_CS2CFG, &davinci_emif_regs->ab1cr);
> @@ -274,7 +270,15 @@ int arch_cpu_init(void)
> ? ? ? ?writel(CONFIG_SYS_DA850_CS3CFG, &davinci_emif_regs->ab2cr);
> ?#endif
>
> - ? ? ? lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
> + ? ? ? da8xx_configure_lpsc_items(lpsc, lpsc_size);
> +#if defined(CONFIG_SYS_DA850_DDR_INIT)
> + ? ? ? da850_ddr_setup();
> +#endif
> +
> + ? ? ? /* GPIO setup */
> + ? ? ? board_gpio_init();
> +
> +
> ? ? ? ?NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
> ? ? ? ? ? ? ? ? ? ? ? ?CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
>
> @@ -286,6 +290,5 @@ int arch_cpu_init(void)
> ? ? ? ? ? ? ? ?DAVINCI_UART_PWREMU_MGMT_UTRST),
> ? ? ? ? ? ? ? &davinci_uart2_ctrl_regs->pwremu_mgmt);
>
> - ? ? ? da850_ddr_setup();

Why are you changing the order of these initializations? It worked on
the da850evm but I hope it doesn't break something else.

> ? ? ? ?return 0;
> ?}

[...]

> diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
> index fcbbace..68bdbbe 100644
> --- a/include/configs/da850evm.h
> +++ b/include/configs/da850evm.h
> @@ -44,6 +44,8 @@
> ?#define CONFIG_SYS_HZ ? ? ? ? ? ? ? ? ?1000
> ?#define CONFIG_SKIP_LOWLEVEL_INIT
> ?#define CONFIG_SYS_TEXT_BASE ? ? ? ? ? 0xc1080000
> +#define CONFIG_SYS_DA850_PLL_INIT
> +#define CONFIG_SYS_DA850_DDR_INIT
>
> ?/*
> ?* Memory Info
> @@ -142,7 +144,6 @@
> ?#define CONFIG_CONS_INDEX ? ? ?1 ? ? ? ? ? ? ? /* use UART0 for console */
> ?#define CONFIG_BAUDRATE ? ? ? ? ? ? ? ?115200 ? ? ? ? ?/* Default baud rate */
> ?#define CONFIG_SYS_BAUDRATE_TABLE ? ? ?{ 9600, 19200, 38400, 57600, 115200 }
> -#define CONFIG_SYS_DA850_LPSC_UART DAVINCI_LPSC_UART2

Please do this (removing the line above) also for the enbw_cmc board.

Thank you!
Regards, Christian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-11 16:10       ` Christian Riesch
@ 2012-01-11 17:03         ` Sughosh Ganu
  2012-01-12  7:24           ` Heiko Schocher
  2012-01-12  9:02           ` Christian Riesch
  0 siblings, 2 replies; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-11 17:03 UTC (permalink / raw)
  To: u-boot

This patch moves hawkboard to the new spl infrastructure from the
older nand_spl one.

Removed the hawkboard_nand_config build option -- The spl code now
gets compiled with hawkboard_config, after building the main u-boot
image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
to reflect the same.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Heiko Schocher <hs@denx.de>
Cc: Christian Riesch <christian.riesch@omicron.at>
Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Cc: Tom Rini <trini@ti.com>
---

Changes since V3
* Removed CONFIG_SYS_DA850_LPSC_UART from enbw_cmc board.
* Restored the point at which da850_ddr_setup is called in
  arch_cpu_init
* Put the pll based functions under CONFIG_SYS_DA850_PLL_INIT

Changes since V2
* Made changes to fix build break on enbw_cmc board.
* Replaced defines used for conditionally compiling code in
  da850_lowlevel.c to the ones suggested by Heiko.
* Removed unwanted defines from the config files which were added in
  V1.

Changes since V1
* Use a common file instead of board specific files for spl,
based on review comments from Christian and Heiko.

 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c    |   24 ++-
 arch/arm/cpu/arm926ejs/davinci/spl.c               |    4 +-
 arch/arm/include/asm/arch-davinci/da850_lowlevel.h |    9 +
 board/davinci/da8xxevm/da850evm.c                  |    4 +-
 board/davinci/da8xxevm/hawkboard.c                 |   23 +++
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |  115 ---------------
 .../{u-boot-spl.lds => u-boot-spl-da850evm.lds}    |    0
 .../davinci/da8xxevm/u-boot-spl-hawk.lds           |   22 ++-
 board/enbw/enbw_cmc/enbw_cmc.c                     |   13 +--
 boards.cfg                                         |    1 -
 doc/README.hawkboard                               |   43 +++---
 include/configs/da850evm.h                         |    5 +-
 include/configs/enbw_cmc.h                         |    4 +-
 include/configs/hawkboard.h                        |   23 +++-
 nand_spl/board/davinci/da8xxevm/Makefile           |  155 --------------------
 15 files changed, 114 insertions(+), 331 deletions(-)
 delete mode 100644 board/davinci/da8xxevm/hawkboard_nand_spl.c
 rename board/davinci/da8xxevm/{u-boot-spl.lds => u-boot-spl-da850evm.lds} (100%)
 rename nand_spl/board/davinci/da8xxevm/u-boot.lds => board/davinci/da8xxevm/u-boot-spl-hawk.lds (86%)
 delete mode 100644 nand_spl/board/davinci/da8xxevm/Makefile

diff --git a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
index a532f8a..01bbc4e 100644
--- a/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
+++ b/arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c
@@ -32,6 +32,7 @@
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>
 
+#if defined(CONFIG_SYS_DA850_PLL_INIT)
 void da850_waitloop(unsigned long loopcnt)
 {
 	unsigned long	i;
@@ -156,7 +157,9 @@ int da850_pll_init(struct davinci_pllc_regs *reg, unsigned long pllmult)
 
 	return 0;
 }
+#endif /* CONFIG_SYS_DA850_PLL_INIT */
 
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
 int da850_ddr_setup(void)
 {
 	unsigned long	tmp;
@@ -235,6 +238,7 @@ int da850_ddr_setup(void)
 
 	return 0;
 }
+#endif /* CONFIG_SYS_DA850_DDR_INIT */
 
 __attribute__((weak))
 void board_gpio_init(void)
@@ -242,10 +246,6 @@ void board_gpio_init(void)
 	return;
 }
 
-/* pinmux_resource[] vector is defined in the board specific file */
-extern const struct pinmux_resource pinmuxes[];
-extern const int pinmuxes_size;
-
 int arch_cpu_init(void)
 {
 	/* Unlock kick registers */
@@ -259,13 +259,11 @@ int arch_cpu_init(void)
 	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
 		return 1;
 
+#if defined(CONFIG_SYS_DA850_PLL_INIT)
 	/* PLL setup */
 	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
 	da850_pll_init(davinci_pllc1_regs, CONFIG_SYS_DA850_PLL1_PLLM);
-
-	/* GPIO setup */
-	board_gpio_init();
-
+#endif
 	/* setup CSn config */
 #if defined(CONFIG_SYS_DA850_CS2CFG)
 	writel(CONFIG_SYS_DA850_CS2CFG, &davinci_emif_regs->ab1cr);
@@ -274,7 +272,12 @@ int arch_cpu_init(void)
 	writel(CONFIG_SYS_DA850_CS3CFG, &davinci_emif_regs->ab2cr);
 #endif
 
-	lpsc_on(CONFIG_SYS_DA850_LPSC_UART);
+	da8xx_configure_lpsc_items(lpsc, lpsc_size);
+
+	/* GPIO setup */
+	board_gpio_init();
+
+
 	NS16550_init((NS16550_t)(CONFIG_SYS_NS16550_COM1),
 			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
 
@@ -286,6 +289,9 @@ int arch_cpu_init(void)
 		DAVINCI_UART_PWREMU_MGMT_UTRST),
 	       &davinci_uart2_ctrl_regs->pwremu_mgmt);
 
+#if defined(CONFIG_SYS_DA850_DDR_INIT)
 	da850_ddr_setup();
+#endif
+
 	return 0;
 }
diff --git a/arch/arm/cpu/arm926ejs/davinci/spl.c b/arch/arm/cpu/arm926ejs/davinci/spl.c
index f475f9b..74632e5 100644
--- a/arch/arm/cpu/arm926ejs/davinci/spl.c
+++ b/arch/arm/cpu/arm926ejs/davinci/spl.c
@@ -74,12 +74,12 @@ void board_init_f(ulong dummy)
 
 void board_init_r(gd_t *id, ulong dummy)
 {
-#ifdef CONFIG_SOC_DM365
+#ifdef CONFIG_SPL_NAND_LOAD
 	nand_init();
 	puts("Nand boot...\n");
 	nand_boot();
 #endif
-#ifdef CONFIG_SOC_DA8XX
+#ifdef CONFIG_SPL_SPI_LOAD
 	mem_malloc_init(CONFIG_SYS_TEXT_BASE - CONFIG_SYS_MALLOC_LEN,
 			CONFIG_SYS_MALLOC_LEN);
 
diff --git a/arch/arm/include/asm/arch-davinci/da850_lowlevel.h b/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
index e489c47..11ed91d 100644
--- a/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
+++ b/arch/arm/include/asm/arch-davinci/da850_lowlevel.h
@@ -24,6 +24,15 @@
 #ifndef __DA850_LOWLEVEL_H
 #define __DA850_LOWLEVEL_H
 
+#include <asm/arch/pinmux_defs.h>
+
+/* pinmux_resource[] vector is defined in the board specific file */
+extern const struct pinmux_resource pinmuxes[];
+extern const int pinmuxes_size;
+
+extern const struct lpsc_resource lpsc[];
+extern const int lpsc_size;
+
 /* NOR Boot Configuration Word Field Descriptions */
 #define DA850_NORBOOT_COPY_XK(X)	((X - 1) << 8)
 #define DA850_NORBOOT_METHOD_DIRECT	(1 << 4)
diff --git a/board/davinci/da8xxevm/da850evm.c b/board/davinci/da8xxevm/da850evm.c
index 9bd3e71..34ef53d 100644
--- a/board/davinci/da8xxevm/da850evm.c
+++ b/board/davinci/da8xxevm/da850evm.c
@@ -137,7 +137,7 @@ const struct pinmux_resource pinmuxes[] = {
 
 const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
 
-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
 	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
 	{ DAVINCI_LPSC_EMAC },	/* image download */
@@ -145,6 +145,8 @@ static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_GPIO },
 };
 
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 #ifndef CONFIG_DA850_EVM_MAX_CPU_CLK
 #define CONFIG_DA850_EVM_MAX_CPU_CLK	300000000
 #endif
diff --git a/board/davinci/da8xxevm/hawkboard.c b/board/davinci/da8xxevm/hawkboard.c
index 9d4e238..b694258 100644
--- a/board/davinci/da8xxevm/hawkboard.c
+++ b/board/davinci/da8xxevm/hawkboard.c
@@ -27,10 +27,33 @@
 #include <asm/arch/hardware.h>
 #include <asm/io.h>
 #include <asm/arch/davinci_misc.h>
+#include <asm/arch/pinmux_defs.h>
 #include <ns16550.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
+const struct pinmux_resource pinmuxes[] = {
+	PINMUX_ITEM(emac_pins_mii),
+	PINMUX_ITEM(emac_pins_mdio),
+	PINMUX_ITEM(emifa_pins_cs3),
+	PINMUX_ITEM(emifa_pins_cs4),
+	PINMUX_ITEM(emifa_pins_nand),
+	PINMUX_ITEM(uart2_pins_txrx),
+	PINMUX_ITEM(uart2_pins_rtscts),
+};
+
+const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
+
+const struct lpsc_resource lpsc[] = {
+	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
+	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
+	{ DAVINCI_LPSC_EMAC },	/* image download */
+	{ DAVINCI_LPSC_UART2 },	/* console */
+	{ DAVINCI_LPSC_GPIO },
+};
+
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 int board_init(void)
 {
 	/* arch number of the board */
diff --git a/board/davinci/da8xxevm/hawkboard_nand_spl.c b/board/davinci/da8xxevm/hawkboard_nand_spl.c
deleted file mode 100644
index df97963..0000000
--- a/board/davinci/da8xxevm/hawkboard_nand_spl.c
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Modified for Hawkboard - Syed Mohammed Khasim <khasim@beagleboard.org>
- *
- * Copyright (C) 2008 Sekhar Nori, Texas Instruments, Inc.  <nsekhar@ti.com>
- * Copyright (C) 2007 Sergey Kubushyn <ksi@koi8.net>
- * Copyright (C) 2004 Texas Instruments.
- *
- * ----------------------------------------------------------------------------
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- * ----------------------------------------------------------------------------
- */
-
-#include <common.h>
-#include <asm/errno.h>
-#include <asm/arch/hardware.h>
-#include <asm/io.h>
-#include <asm/arch/davinci_misc.h>
-#include <asm/arch/pinmux_defs.h>
-#include <ns16550.h>
-#include <nand.h>
-
-DECLARE_GLOBAL_DATA_PTR;
-
-static const struct pinmux_resource pinmuxes[] = {
-	PINMUX_ITEM(emac_pins_mii),
-	PINMUX_ITEM(emac_pins_mdio),
-	PINMUX_ITEM(emifa_pins_cs3),
-	PINMUX_ITEM(emifa_pins_cs4),
-	PINMUX_ITEM(emifa_pins_nand),
-	PINMUX_ITEM(uart2_pins_txrx),
-	PINMUX_ITEM(uart2_pins_rtscts),
-};
-
-static const struct lpsc_resource lpsc[] = {
-	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
-	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
-	{ DAVINCI_LPSC_EMAC },	/* image download */
-	{ DAVINCI_LPSC_UART2 },	/* console */
-	{ DAVINCI_LPSC_GPIO },
-};
-
-void board_init_f(ulong bootflag)
-{
-	/*
-	 * Kick Registers need to be set to allow access to Pin Mux registers
-	 */
-	writel(DV_SYSCFG_KICK0_UNLOCK, &davinci_syscfg_regs->kick0);
-	writel(DV_SYSCFG_KICK1_UNLOCK, &davinci_syscfg_regs->kick1);
-
-	/* setup the SUSPSRC for ARM to control emulation suspend */
-	writel(readl(&davinci_syscfg_regs->suspsrc) &
-	       ~(DAVINCI_SYSCFG_SUSPSRC_EMAC | DAVINCI_SYSCFG_SUSPSRC_I2C |
-		 DAVINCI_SYSCFG_SUSPSRC_SPI1 | DAVINCI_SYSCFG_SUSPSRC_TIMER0 |
-		 DAVINCI_SYSCFG_SUSPSRC_UART2), &davinci_syscfg_regs->suspsrc);
-
-	/* Power on required peripherals
-	 * ARM does not have acess by default to PSC0 and PSC1
-	 * assuming here that the DSP bootloader has set the IOPU
-	 * such that PSC access is available to ARM
-	 */
-	da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc));
-
-	/* configure pinmux settings */
-	davinci_configure_pin_mux_items(pinmuxes,
-					ARRAY_SIZE(pinmuxes));
-
-	writel(readl(&davinci_uart2_ctrl_regs->pwremu_mgmt) |
-	       (DAVINCI_UART_PWREMU_MGMT_FREE) |
-	       (DAVINCI_UART_PWREMU_MGMT_URRST) |
-	       (DAVINCI_UART_PWREMU_MGMT_UTRST),
-	       &davinci_uart2_ctrl_regs->pwremu_mgmt);
-
-	NS16550_init((NS16550_t)(DAVINCI_UART2_BASE),
-			CONFIG_SYS_NS16550_CLK / 16 / CONFIG_BAUDRATE);
-
-	puts("Nand boot...\n");
-
-	nand_boot();
-}
-
-void puts(const char *str)
-{
-	while (*str)
-		putc(*str++);
-}
-
-void putc(char c)
-{
-	if (gd->flags & GD_FLG_SILENT)
-		return;
-
-	if (c == '\n')
-		NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), '\r');
-
-	NS16550_putc((NS16550_t)(DAVINCI_UART2_BASE), c);
-}
-
-void hang(void)
-{
-	puts("### ERROR ### Please RESET the board ###\n");
-	for (;;)
-		;
-}
diff --git a/board/davinci/da8xxevm/u-boot-spl.lds b/board/davinci/da8xxevm/u-boot-spl-da850evm.lds
similarity index 100%
rename from board/davinci/da8xxevm/u-boot-spl.lds
rename to board/davinci/da8xxevm/u-boot-spl-da850evm.lds
diff --git a/nand_spl/board/davinci/da8xxevm/u-boot.lds b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
similarity index 86%
rename from nand_spl/board/davinci/da8xxevm/u-boot.lds
rename to board/davinci/da8xxevm/u-boot-spl-hawk.lds
index 638ffd9..b3a41af 100644
--- a/nand_spl/board/davinci/da8xxevm/u-boot.lds
+++ b/board/davinci/da8xxevm/u-boot-spl-hawk.lds
@@ -34,11 +34,11 @@ SECTIONS
 	. = ALIGN(4);
 	.text      :
 	{
-	  start.o	(.text)
-	  cpu.o		(.text)
-	  nand_boot.o	(.text)
+	  arch/arm/cpu/arm926ejs/start.o		(.text)
+	  arch/arm/cpu/arm926ejs/davinci/libdavinci.o	(.text)
+	  drivers/mtd/nand/libnand.o			(.text)
 
-	  *(.text)
+	  *(.text*)
 	}
 
 	. = ALIGN(4);
@@ -68,10 +68,14 @@ SECTIONS
 
 	__got_end = .;
 
-	_end = .;
+	.bss :
+	{
+		. = ALIGN(4);
+		__bss_start = .;
+		*(.bss*)
+		. = ALIGN(4);
+		__bss_end__ = .;
+	}
 
-	. = ALIGN(4);
-	__bss_start = .;
-	.bss : { *(.bss) }
-	__bss_end__ = .;
+	_end = .;
 }
diff --git a/board/enbw/enbw_cmc/enbw_cmc.c b/board/enbw/enbw_cmc/enbw_cmc.c
index 98dda1e..16d1b08 100644
--- a/board/enbw/enbw_cmc/enbw_cmc.c
+++ b/board/enbw/enbw_cmc/enbw_cmc.c
@@ -49,7 +49,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-static const struct lpsc_resource lpsc[] = {
+const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },
 	{ DAVINCI_LPSC_SPI1 },
 	{ DAVINCI_LPSC_ARM_RAM_ROM },
@@ -65,6 +65,8 @@ static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_USB11 },
 };
 
+const int lpsc_size = ARRAY_SIZE(lpsc);
+
 static const struct pinmux_config enbw_pins[] = {
 	{ pinmux(0), 8, 0 },
 	{ pinmux(0), 8, 1 },
@@ -549,15 +551,6 @@ void board_gpio_init(void)
 	struct davinci_gpio *gpio = davinci_gpio_bank01;
 
 	/*
-	 * Power on required peripherals
-	 * ARM does not have access by default to PSC0 and PSC1
-	 * assuming here that the DSP bootloader has set the IOPU
-	 * such that PSC access is available to ARM
-	 */
-	if (da8xx_configure_lpsc_items(lpsc, ARRAY_SIZE(lpsc)))
-		return;
-
-	/*
 	 * set LED (gpio Interface not usable here)
 	 * set LED pins to output and state 0
 	 */
diff --git a/boards.cfg b/boards.cfg
index da1a3ce..643b34b 100644
--- a/boards.cfg
+++ b/boards.cfg
@@ -133,7 +133,6 @@ davinci_sffsdr               arm         arm926ejs   sffsdr              davinci
 davinci_sonata               arm         arm926ejs   sonata              davinci        davinci
 ea20			     arm	 arm926ejs   ea20		 davinci	davinci
 hawkboard                    arm         arm926ejs   da8xxevm            davinci        davinci
-hawkboard_nand               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:NAND_U_BOOT
 hawkboard_uart               arm         arm926ejs   da8xxevm            davinci        davinci     hawkboard:UART_U_BOOT
 enbw_cmc                     arm         arm926ejs   enbw_cmc            enbw           davinci
 km_kirkwood                  arm         arm926ejs   km_arm              keymile        kirkwood	km_kirkwood:KM_DISABLE_PCI
diff --git a/doc/README.hawkboard b/doc/README.hawkboard
index b7afec4..d6ae02e 100644
--- a/doc/README.hawkboard
+++ b/doc/README.hawkboard
@@ -9,8 +9,8 @@ executes upon reset is the Rom Boot Loader(RBL) which sits in the
 internal ROM of the omap. The RBL initialises the memory and the nand
 controller, and copies the image stored at a predefined location(block
 1) of the nand flash. The image loaded by the RBL to the memory is the
-AIS signed nand_spl image. This, in turns copies the u-boot binary
-from the nand flash to the memory and jumps to the u-boot entry point.
+AIS signed spl image. This, in turns copies the u-boot binary from the
+nand flash to the memory and jumps to the u-boot entry point.
 
 AIS is an image format defined by TI for the images that are to be
 loaded to memory by the RBL. The image is divided into a series of
@@ -20,14 +20,14 @@ and the size of the section, which is used by the RBL to load the
 image. At the end of the image the RBL jumps to the image entry
 point.
 
-The secondary stage bootloader(nand_spl) which is loaded by the RBL
-then loads the u-boot from a predefined location in the nand to the
-memory and jumps to the u-boot entry point.
+The secondary stage bootloader(spl) which is loaded by the RBL then
+loads the u-boot from a predefined location in the nand to the memory
+and jumps to the u-boot entry point.
 
 The reason a secondary stage bootloader is used is because the ECC
 layout expected by the RBL is not the same as that used by
-u-boot/linux. This also implies that for flashing the nand_spl image,
-we need to use the u-boot which uses the ECC layout expected by the
+u-boot/linux. This also implies that for flashing the spl image,we
+need to use the u-boot which uses the ECC layout expected by the
 RBL[1]. Booting u-boot over UART(UART boot) is explained here[2].
 
 
@@ -35,20 +35,19 @@ Compilation
 ===========
 Three images might be needed
 
-* nand_spl - This is the secondary bootloader which boots the u-boot
+* spl - This is the secondary bootloader which boots the u-boot
   binary.
 
-  hawkboard_nand_config
-
-  The nand_spl ELF gets generated under nand_spl/u-boot-spl. This
-  needs to be processed with the AISGen tool for generating the AIS
-  signed image to be flashed. Steps for generating the AIS image are
-  explained here[3].
-
 * u-boot binary - This is the image flashed to the nand and copied to
-  the memory by the nand_spl.
+  the memory by the spl.
+
+  Both the images get compiled with hawkboard_config, with the TOPDIR
+  containing the u-boot images, and the spl image under the spl
+  directory.
 
-  hawkboard_config
+  The spl image needs to be processed with the AISGen tool for
+  generating the AIS signed image to be flashed. Steps for generating
+  the AIS image are explained here[3].
 
 * u-boot for uart boot - This is same as the u-boot binary generated
   above, with the sole difference of the CONFIG_SYS_TEXT_BASE being
@@ -59,17 +58,17 @@ Three images might be needed
 
 Flashing the images to Nand
 ===========================
-The nand_spl AIS image needs to be flashed to the block 1 of the
-Nand flash, as that is the location the RBL expects the image[4]. For
-flashing the nand_spl, boot over the u-boot specified in [1], and
-flash the image
+The spl AIS image needs to be flashed to the block 1 of the Nand
+flash, as that is the location the RBL expects the image[4]. For
+flashing the spl, boot over the u-boot specified in [1], and flash the
+image
 
 => tftpboot 0xc0700000 <nand_spl_ais.bin>
 => nand erase 0x20000 0x20000
 => nand write.e 0xc0700000 0x20000 <nand_spl_size>
 
 The u-boot binary is flashed at location 0xe0000(block 6) of the nand
-flash. The nand_spl loader expects the u-boot at this location. For
+flash. The spl loader expects the u-boot at this location. For
 flashing the u-boot binary
 
 => tftpboot 0xc0700000 u-boot.bin
diff --git a/include/configs/da850evm.h b/include/configs/da850evm.h
index fcbbace..68bdbbe 100644
--- a/include/configs/da850evm.h
+++ b/include/configs/da850evm.h
@@ -44,6 +44,8 @@
 #define CONFIG_SYS_HZ			1000
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 
 /*
  * Memory Info
@@ -142,7 +144,6 @@
 #define CONFIG_CONS_INDEX	1		/* use UART0 for console */
 #define CONFIG_BAUDRATE		115200		/* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
-#define CONFIG_SYS_DA850_LPSC_UART DAVINCI_LPSC_UART2
 
 #define CONFIG_SPI
 #define CONFIG_SPI_FLASH
@@ -319,7 +320,7 @@
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
-#define CONFIG_SPL_LDSCRIPT	"$(BOARDDIR)/u-boot-spl.lds"
+#define CONFIG_SPL_LDSCRIPT	"board/$(BOARDDIR)/u-boot-spl-da850evm.lds"
 #define CONFIG_SPL_STACK	0x8001ff00
 #define CONFIG_SPL_TEXT_BASE	0x80000000
 #define CONFIG_SPL_MAX_SIZE	32768
diff --git a/include/configs/enbw_cmc.h b/include/configs/enbw_cmc.h
index c427dc7..e0800e7 100644
--- a/include/configs/enbw_cmc.h
+++ b/include/configs/enbw_cmc.h
@@ -48,6 +48,8 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_DA850_LOWLEVEL
 #define CONFIG_ARCH_CPU_INIT
+#define CONFIG_SYS_DA850_PLL_INIT
+#define CONFIG_SYS_DA850_DDR_INIT
 #define CONFIG_DA8XX_GPIO
 #define CONFIG_HOSTNAME		enbw_cmc
 #define CONFIG_DISPLAY_CPUINFO
@@ -83,7 +85,7 @@
 #define CONFIG_CONS_INDEX	1		/* use UART0 for console */
 #define CONFIG_BAUDRATE		115200		/* Default baud rate */
 #define CONFIG_SYS_BAUDRATE_TABLE	{ 9600, 19200, 38400, 57600, 115200 }
-#define CONFIG_SYS_DA850_LPSC_UART	DAVINCI_LPSC_UART2
+
 /*
  * I2C Configuration
  */
diff --git a/include/configs/hawkboard.h b/include/configs/hawkboard.h
index 12acb27..9dd0516 100644
--- a/include/configs/hawkboard.h
+++ b/include/configs/hawkboard.h
@@ -43,12 +43,29 @@
 #define CONFIG_SKIP_LOWLEVEL_INIT
 #define CONFIG_BOARD_EARLY_INIT_F
 
-#if defined(CONFIG_NAND_U_BOOT) || defined(CONFIG_UART_U_BOOT)
+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC (	\
+	DAVINCI_SYSCFG_SUSPSRC_EMAC |		\
+	DAVINCI_SYSCFG_SUSPSRC_I2C  |		\
+	DAVINCI_SYSCFG_SUSPSRC_SPI1 |		\
+	DAVINCI_SYSCFG_SUSPSRC_TIMER0 |		\
+	DAVINCI_SYSCFG_SUSPSRC_UART2)
+
+#if defined(CONFIG_UART_U_BOOT)
 #define CONFIG_SYS_TEXT_BASE		0xc1080000
-#else
+#elif !defined(CONFIG_SPL_BUILD)
 #define CONFIG_SYS_TEXT_BASE		0xc1180000
 #endif
 
+/* Spl */
+#define CONFIG_SPL
+#define CONFIG_SPL_NAND_SUPPORT
+#define CONFIG_SPL_NAND_SIMPLE
+#define CONFIG_SPL_NAND_LOAD
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LDSCRIPT		"board/$(BOARDDIR)/u-boot-spl-hawk.lds"
+#define CONFIG_SPL_TEXT_BASE		0xc1080000
+#define CONFIG_SPL_STACK		CONFIG_SYS_INIT_SP_ADDR
+
 /*
  * Memory Info
  */
@@ -84,9 +101,7 @@
 /*
  * Network & Ethernet Configuration
  */
-#if !defined(CONFIG_NAND_SPL)
 #define CONFIG_DRIVER_TI_EMAC
-#endif
 #define CONFIG_MII
 #define CONFIG_BOOTP_DEFAULT
 #define CONFIG_BOOTP_DNS
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
deleted file mode 100644
index 7746e41..0000000
--- a/nand_spl/board/davinci/da8xxevm/Makefile
+++ /dev/null
@@ -1,155 +0,0 @@
-#
-# (C) Copyright 2006-2007
-# Stefan Roese, DENX Software Engineering, sr at denx.de.
-#
-# (C) Copyright 2008
-# Guennadi Liakhovetki, DENX Software Engineering, <lg@denx.de>
-#
-# See file CREDITS for list of people who contributed to this
-# project.
-#
-# This program is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
-# MA 02111-1307 USA
-#
-
-CONFIG_NAND_SPL	= y
-
-include $(TOPDIR)/config.mk
-
-nandobj	:= $(OBJTREE)/nand_spl/
-
-LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
-LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
-	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
-
-SOBJS	= _divsi3.o \
-	_udivsi3.o \
-	start.o
-
-COBJS	= cpu.o \
-	davinci_nand.o \
-	pinmux.o \
-	da850_pinmux.o \
-	div0.o \
-	hawkboard_nand_spl.o \
-	misc.o \
-	nand_boot.o \
-	ns16550.o \
-	psc.o
-
-SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
-__OBJS	:= $(SOBJS) $(COBJS)
-LNDIR	:= $(nandobj)board/$(BOARDDIR)
-
-ALL	= $(nandobj)u-boot-spl $(nandobj)u-boot-spl.bin \
-	$(nandobj)u-boot-spl-16k.bin
-
-all:	$(ALL)
-
-$(nandobj)u-boot-spl-16k.bin: $(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} --pad-to=$(PAD_TO) -O binary $< $@
-
-$(nandobj)u-boot-spl.bin:	$(nandobj)u-boot-spl
-	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
-
-$(nandobj)u-boot-spl:	$(OBJS) $(nandobj)u-boot.lds
-	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
-		-Map $(nandobj)u-boot-spl.map \
-		-o $(nandobj)u-boot-spl
-
-$(nandobj)u-boot.lds: $(LDSCRIPT)
-	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
-
-# create symbolic links for common files
-
-# from board directory
-$(obj)pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/pinmux.c $@
-
-$(obj)da850_pinmux.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c $@
-
-# from drivers/mtd/nand directory
-$(obj)davinci_nand.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/drivers/mtd/nand/davinci_nand.c $@
-
-# from nand_spl directory
-$(obj)nand_boot.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/nand_spl/nand_boot.c $@
-
-# from drivers/serial directory
-$(obj)ns16550.c:
-	@rm -f $@
-	@ln -sf $(TOPDIR)/drivers/serial/ns16550.c $@
-
-# from cpu directory
-$(obj)start.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/start.S $@
-
-# from lib directory
-$(obj)_udivsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_udivsi3.S $@
-
-# from lib directory
-$(obj)_divsi3.S:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/_divsi3.S $@
-
-# from lib directory
-$(obj)div0.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/lib/div0.c $@
-
-# from SoC directory
-$(obj)cpu.c:
-	@rm -f $@
-	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/cpu.c $@
-
-$(obj)misc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/misc.c $@
-
-# from board directory
-$(obj)hawkboard_nand_spl.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/board/davinci/da8xxevm/hawkboard_nand_spl.c $@
-
-$(obj)psc.c:
-	@rm -f $@
-	ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/psc.c $@
-
-#########################################################################
-
-$(obj)%.o:	$(obj)%.S
-	$(CC) $(AFLAGS) -c -o $@ $<
-
-$(obj)%.o:	$(obj)%.c
-	$(CC) $(CFLAGS) -c -o $@ $<
-
-# defines $(obj).depend target
-include $(SRCTREE)/rules.mk
-
-sinclude $(obj).depend
-
-#########################################################################
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-11 17:03         ` [U-Boot] [PATCH 2/2 V4] " Sughosh Ganu
@ 2012-01-12  7:24           ` Heiko Schocher
  2012-01-12  7:30             ` Sughosh Ganu
  2012-01-12  7:32             ` Christian Riesch
  2012-01-12  9:02           ` Christian Riesch
  1 sibling, 2 replies; 22+ messages in thread
From: Heiko Schocher @ 2012-01-12  7:24 UTC (permalink / raw)
  To: u-boot

Hello Sughosh,

Sughosh Ganu wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one.
> 
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
> 
> Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Christian Riesch <christian.riesch@omicron.at>
> Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> Cc: Tom Rini <trini@ti.com>
> ---

Patch looks good to me, but it doesn't aplly to current TOT

[hs at pollux u-boot]$ git am index.html
Applying: Changes to move hawkboard to the new spl infrastructure
error: patch failed: include/configs/da850evm.h:44
error: include/configs/da850evm.h: patch does not apply
Patch failed at 0001 Changes to move hawkboard to the new spl infrastructure
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".
[hs at pollux u-boot]$

My tree is
commit 9a420986cccc9bd2c37affd931d627b3c3e72952
Author: Rob Herring <rob.herring@calxeda.com>
Date:   Thu Dec 15 11:15:50 2011 +0000

    ARM: highbank: enable networking and pxe

Do I missing something here? (If I remember right, I had no such
issue with your v1 patch ...)

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-12  7:24           ` Heiko Schocher
@ 2012-01-12  7:30             ` Sughosh Ganu
  2012-01-12  7:32             ` Christian Riesch
  1 sibling, 0 replies; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-12  7:30 UTC (permalink / raw)
  To: u-boot

hi Heiko,

On Thu Jan 12, 2012 at 08:24:03AM +0100, Heiko Schocher wrote:
> Hello Sughosh,
> 
> Sughosh Ganu wrote:
> > This patch moves hawkboard to the new spl infrastructure from the
> > older nand_spl one.
> > 
> > Removed the hawkboard_nand_config build option -- The spl code now
> > gets compiled with hawkboard_config, after building the main u-boot
> > image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> > to reflect the same.
> > 
> > Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> > Signed-off-by: Heiko Schocher <hs@denx.de>
> > Cc: Heiko Schocher <hs@denx.de>
> > Cc: Christian Riesch <christian.riesch@omicron.at>
> > Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> > Cc: Tom Rini <trini@ti.com>
> > ---
> 
> Patch looks good to me, but it doesn't aplly to current TOT
> 
> [hs at pollux u-boot]$ git am index.html
> Applying: Changes to move hawkboard to the new spl infrastructure
> error: patch failed: include/configs/da850evm.h:44
> error: include/configs/da850evm.h: patch does not apply
> Patch failed at 0001 Changes to move hawkboard to the new spl infrastructure
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> [hs at pollux u-boot]$

  I have based this on u-boot-ti, as this would be applied to the ti
  tree.

-sughosh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-12  7:24           ` Heiko Schocher
  2012-01-12  7:30             ` Sughosh Ganu
@ 2012-01-12  7:32             ` Christian Riesch
  1 sibling, 0 replies; 22+ messages in thread
From: Christian Riesch @ 2012-01-12  7:32 UTC (permalink / raw)
  To: u-boot

Hello Heiko,

On Thu, Jan 12, 2012 at 8:24 AM, Heiko Schocher <hs@denx.de> wrote:
> Hello Sughosh,
>
> Sughosh Ganu wrote:
>> This patch moves hawkboard to the new spl infrastructure from the
>> older nand_spl one.
>>
>> Removed the hawkboard_nand_config build option -- The spl code now
>> gets compiled with hawkboard_config, after building the main u-boot
>> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
>> to reflect the same.
>>
>> Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
>> Signed-off-by: Heiko Schocher <hs@denx.de>
>> Cc: Heiko Schocher <hs@denx.de>
>> Cc: Christian Riesch <christian.riesch@omicron.at>
>> Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
>> Cc: Tom Rini <trini@ti.com>
>> ---
>
> Patch looks good to me, but it doesn't aplly to current TOT
>
> [hs at pollux u-boot]$ git am index.html
> Applying: Changes to move hawkboard to the new spl infrastructure
> error: patch failed: include/configs/da850evm.h:44
> error: include/configs/da850evm.h: patch does not apply
> Patch failed at 0001 Changes to move hawkboard to the new spl infrastructure
> When you have resolved this problem run "git am --resolved".
> If you would prefer to skip this patch, instead run "git am --skip".
> To restore the original branch and stop patching run "git am --abort".
> [hs at pollux u-boot]$
>
> My tree is
> commit 9a420986cccc9bd2c37affd931d627b3c3e72952
> Author: Rob Herring <rob.herring@calxeda.com>
> Date:   Thu Dec 15 11:15:50 2011 +0000
>
>    ARM: highbank: enable networking and pxe
>
> Do I missing something here? (If I remember right, I had no such
> issue with your v1 patch ...)

It applies only to ti/master due to commit
1091e5a65ad2710f7e53e49dd44f9613e789f9b9 in
git://git.denx.de/u-boot-ti.git

Regards, Christian

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-11 17:03         ` [U-Boot] [PATCH 2/2 V4] " Sughosh Ganu
  2012-01-12  7:24           ` Heiko Schocher
@ 2012-01-12  9:02           ` Christian Riesch
  2012-01-12  9:39             ` Sughosh Ganu
  1 sibling, 1 reply; 22+ messages in thread
From: Christian Riesch @ 2012-01-12  9:02 UTC (permalink / raw)
  To: u-boot

Hi Sughosh,

On Wed, Jan 11, 2012 at 6:03 PM, Sughosh Ganu <urwithsughosh@gmail.com> wrote:
> This patch moves hawkboard to the new spl infrastructure from the
> older nand_spl one.
>
> Removed the hawkboard_nand_config build option -- The spl code now
> gets compiled with hawkboard_config, after building the main u-boot
> image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> to reflect the same.
>
> Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Christian Riesch <christian.riesch@omicron.at>
> Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> Cc: Tom Rini <trini@ti.com>

I have tested this with both the da850evm and the calimain board (see
[1]), and the low level initialization still works :-)

Therefore

Acked-by: Christian Riesch <christian.riesch@omicron.at>

Regards, Christian


[1] http://patchwork.ozlabs.org/patch/135593/

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-12  9:02           ` Christian Riesch
@ 2012-01-12  9:39             ` Sughosh Ganu
  2012-01-12 11:19               ` Christian Riesch
  0 siblings, 1 reply; 22+ messages in thread
From: Sughosh Ganu @ 2012-01-12  9:39 UTC (permalink / raw)
  To: u-boot

hi Christian,

On Thu Jan 12, 2012 at 10:02:47AM +0100, Christian Riesch wrote:
> Hi Sughosh,
> 
> On Wed, Jan 11, 2012 at 6:03 PM, Sughosh Ganu <urwithsughosh@gmail.com> wrote:
> > This patch moves hawkboard to the new spl infrastructure from the
> > older nand_spl one.
> >
> > Removed the hawkboard_nand_config build option -- The spl code now
> > gets compiled with hawkboard_config, after building the main u-boot
> > image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
> > to reflect the same.
> >
> > Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> > Signed-off-by: Heiko Schocher <hs@denx.de>
> > Cc: Heiko Schocher <hs@denx.de>
> > Cc: Christian Riesch <christian.riesch@omicron.at>
> > Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
> > Cc: Tom Rini <trini@ti.com>
> 
> I have tested this with both the da850evm and the calimain board (see
> [1]), and the low level initialization still works :-)
> 
> Therefore
> 
> Acked-by: Christian Riesch <christian.riesch@omicron.at>

  Thanks for the review and ack :)

  Can you also please test out this patch.

  http://patchwork.ozlabs.org/patch/135275/
  
  Just wanted to make sure it does not introduce any regressions. This
  is a generic arm926ejs fix, so you should be able to test this on
  any arm926ejs based board

-sughosh

^ permalink raw reply	[flat|nested] 22+ messages in thread

* [U-Boot] [PATCH 2/2 V4] Changes to move hawkboard to the new spl infrastructure
  2012-01-12  9:39             ` Sughosh Ganu
@ 2012-01-12 11:19               ` Christian Riesch
  0 siblings, 0 replies; 22+ messages in thread
From: Christian Riesch @ 2012-01-12 11:19 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 12, 2012 at 10:39 AM, Sughosh Ganu <urwithsughosh@gmail.com> wrote:
> hi Christian,
>
> On Thu Jan 12, 2012 at 10:02:47AM +0100, Christian Riesch wrote:
>> Hi Sughosh,
>>
>> On Wed, Jan 11, 2012 at 6:03 PM, Sughosh Ganu <urwithsughosh@gmail.com> wrote:
>> > This patch moves hawkboard to the new spl infrastructure from the
>> > older nand_spl one.
>> >
>> > Removed the hawkboard_nand_config build option -- The spl code now
>> > gets compiled with hawkboard_config, after building the main u-boot
>> > image, using the CONFIG_SPL_TEXT_BASE. Modified the README.hawkboard
>> > to reflect the same.
>> >
>> > Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
>> > Signed-off-by: Heiko Schocher <hs@denx.de>
>> > Cc: Heiko Schocher <hs@denx.de>
>> > Cc: Christian Riesch <christian.riesch@omicron.at>
>> > Cc: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
>> > Cc: Tom Rini <trini@ti.com>
>>
>> I have tested this with both the da850evm and the calimain board (see
>> [1]), and the low level initialization still works :-)
>>
>> Therefore
>>
>> Acked-by: Christian Riesch <christian.riesch@omicron.at>
>
> ?Thanks for the review and ack :)
>
> ?Can you also please test out this patch.
>
> ?http://patchwork.ozlabs.org/patch/135275/
>
> ?Just wanted to make sure it does not introduce any regressions. This
> ?is a generic arm926ejs fix, so you should be able to test this on
> ?any arm926ejs based board

Ok, I'll do a few tests and reply in the other thread.
Christian

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-01-12 11:19 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-09 18:28 [U-Boot] [PATCH 2/2] Changes to move hawkboard to the new infrastructure Sughosh Ganu
2012-01-09 23:30 ` Tom Rini
2012-01-10  6:30   ` Sughosh Ganu
2012-01-10  8:15     ` Christian Riesch
2012-01-10  8:42       ` Sughosh Ganu
2012-01-10  9:42         ` Heiko Schocher
2012-01-10 10:13           ` Sughosh Ganu
2012-01-10 18:15 ` [U-Boot] [PATCH 2/2 V2] Changes to move hawkboard to the new spl infrastructure Sughosh Ganu
2012-01-11  6:52   ` Heiko Schocher
2012-01-11  7:53     ` Sughosh Ganu
2012-01-11  8:54       ` Christian Riesch
2012-01-11  9:17     ` Christian Riesch
2012-01-11  9:40       ` Heiko Schocher
2012-01-11 14:37     ` [U-Boot] [PATCH 2/2 V3] " Sughosh Ganu
2012-01-11 16:10       ` Christian Riesch
2012-01-11 17:03         ` [U-Boot] [PATCH 2/2 V4] " Sughosh Ganu
2012-01-12  7:24           ` Heiko Schocher
2012-01-12  7:30             ` Sughosh Ganu
2012-01-12  7:32             ` Christian Riesch
2012-01-12  9:02           ` Christian Riesch
2012-01-12  9:39             ` Sughosh Ganu
2012-01-12 11:19               ` Christian Riesch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox