Skip to contentSkip to conversation

Add board support for hawkboard

PATCH Superseded Sughosh Ganu 3 participants 8 messages Oct 21, 2010 – Oct 26, 2010

Subsystems (4)

v1 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Add board support for hawkboard

The patch adds basic board support for TI's OMAP-L138 based Hawkboard. This board is pretty similar to the da850 EVM. Support for nand and network access is added in this version.

The following bootup procedure is used.

At reset, the Rom Boot Loader(RBL), initialises the ddr and the nand controllers and copies the second stage bootloader(nand_spl) to RAM. The secondary bootloader then copies u-boot from a predefined location in the nand flash to the RAM, and passes control to the u-boot image.

Three config options are supported
* hawkboard_config - Used to create the u-boot.bin. Tftp the u-boot.bin image to the RAM from u-boot, and flash to the nand flash at address 0xe0000.

* hawkboard_nand_config - Used to generate the secondary bootloader(nand_spl) image. This creates an elf file u-boot-spl under nand_spl/. Create an AIS signed image using this file, and flash it to the nand flash at address 0x20000. The ais file should fit in one block.

* hawkboard_uart_config - This is same as the first image, but with the TEXT_BASE as expected by the RBL(0xc1080000). Create the AIS Signed bin, as use the normal UART boot procedure to boot the image.

---
 Makefile                                     |   17 +++
 arch/arm/cpu/arm926ejs/davinci/cpu.c         |    2 +
 arch/arm/include/asm/arch-davinci/hardware.h |    5 +-
 board/davinci/common/misc.c                  |    2 +
 board/davinci/da8xxevm/Makefile              |    1 +
 board/davinci/da8xxevm/config.mk             |    3 +
 board/davinci/da8xxevm/hawkboard.c           |  201 ++++++++++++++++++++++++++
 drivers/mtd/nand/davinci_nand.c              |    1 +
 include/configs/hawkboard.h                  |  200 +++++++++++++++++++++++++
 nand_spl/board/davinci/da8xxevm/Makefile     |  141 ++++++++++++++++++
 nand_spl/board/davinci/da8xxevm/config.mk    |   40 +++++
 nand_spl/board/davinci/da8xxevm/u-boot.lds   |   75 ++++++++++
 nand_spl/nand_boot.c                         |    3 +-
 13 files changed, 689 insertions(+), 2 deletions(-)
 create mode 100644 board/davinci/da8xxevm/hawkboard.c
 create mode 100644 include/configs/hawkboard.h
 create mode 100644 nand_spl/board/davinci/da8xxevm/Makefile
 create mode 100644 nand_spl/board/davinci/da8xxevm/config.mk
 create mode 100644 nand_spl/board/davinci/da8xxevm/u-boot.lds
Makefile +17 -0
index 06c71a2..7b8152c 100644
@@ -911,6 +911,23 @@ cp922_XA10_config	\
 cp1026_config: unconfig
 	@board/armltd/integrator/split_by_variant.sh cp $@
 
+hawkboard_config \
+hawkboard_uart_config \
+hawkboard_nand_config	: unconfig
+	@mkdir -p $(obj)include
+	@mkdir -p $(obj)board/davinci/da8xxevm
+	@if [ -n "$(findstring _nand_,$@)" ]; then							\
+		echo "#define CONFIG_NAND_U_BOOT" >> $(obj)include/config.h;				\
+		echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk;				\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1080000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	elif [ -n "$(findstring _uart_,$@)" ]; then							\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1080000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	else 												\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1180000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	fi
+
+	@$(MKCONFIG) -n $@ -a hawkboard arm arm926ejs da8xxevm davinci davinci
+
 nhk8815_config \
 nhk8815_onenand_config:	unconfig
 	@mkdir -p $(obj)include
arch/arm/cpu/arm926ejs/davinci/cpu.c +2 -0
index fc3551c..b4a7382 100644
@@ -109,6 +109,7 @@ out:
 }
 #endif /* CONFIG_SOC_DA8XX */
 
+#if !defined(CONFIG_NAND_SPL)
 #ifdef CONFIG_DISPLAY_CPUINFO
 
 static unsigned pll_div(volatile void *pllbase, unsigned offset)
@@ -189,3 +190,4 @@ int cpu_eth_init(bd_t *bis)
 #endif
 	return 0;
 }
+#endif /* !CONFIG_NAND_SPL */
arch/arm/include/asm/arch-davinci/hardware.h +4 -1
index 3520cf8..d006ac1 100644
@@ -379,7 +379,10 @@ int clk_get(enum davinci_clk_ids id);
 /* Boot config */
 struct davinci_syscfg_regs {
 	dv_reg	revid;
-	dv_reg	rsvd[71];
+	dv_reg	rsvd[13];
+	dv_reg	kick0;
+	dv_reg	kick1;
+	dv_reg	rsvd1[56];
 	dv_reg	pinmux[20];
 	dv_reg	suspsrc;
 	dv_reg	chipsig;
board/davinci/common/misc.c +2 -0
index 28750b1..546fd93 100644
@@ -33,6 +33,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if !defined(CONFIG_NAND_SPL)
 #if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
 int dram_init(void)
 {
@@ -105,6 +106,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 }
 
 #endif	/* DAVINCI_EMAC */
+#endif	/* !CONFIG_NAND_SPL */
 
 /*
  * Change the setting of a pin multiplexer field.
board/davinci/da8xxevm/Makefile +1 -0
index 17cbe86..1a67351 100644
@@ -30,6 +30,7 @@ LIB	= $(obj)lib$(BOARD).a
 COBJS-y	+= common.o
 COBJS-$(CONFIG_MACH_DAVINCI_DA830_EVM)	+= da830evm.o
 COBJS-$(CONFIG_MACH_DAVINCI_DA850_EVM)	+= da850evm.o
+COBJS-$(CONFIG_MACH_DAVINCI_HAWK)	+= hawkboard.o
 
 COBJS   := $(COBJS-y)
 
board/davinci/da8xxevm/config.mk +3 -0
index e176f7d..9fc7ad9 100644
@@ -38,6 +38,9 @@
 #
 # we load ourself to C108 '0000
 
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 #Provide at least 16MB spacing between us and the Linux Kernel image
+ifndef CONFIG_SYS_TEXT_BASE
 CONFIG_SYS_TEXT_BASE = 0xC1080000
+endif
board/davinci/da8xxevm/hawkboard.c new file +201 -0

201 lines not on this page · raw message

drivers/mtd/nand/davinci_nand.c +1 -0
index d41579c..ad70dd9 100644
@@ -635,6 +635,7 @@ void davinci_nand_init(struct nand_chip *nand)
 	nand->write_buf = nand_davinci_write_buf;
 
 	nand->dev_ready = nand_davinci_dev_ready;
+	nand->select_chip = NULL;
 
 	nand_flash_init();
 }
include/configs/hawkboard.h new file +200 -0

200 lines not on this page · raw message

nand_spl/board/davinci/da8xxevm/Makefile new file +141 -0

141 lines not on this page · raw message

nand_spl/board/davinci/da8xxevm/config.mk new file +40 -0
new file mode 100644
index 0000000..ea071eb
@@ -0,0 +1,40 @@
+#
+# (C) Copyright 2006
+# Stefan Roese, DENX Software Engineering, sr at 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
+#
+#
+# TI OMAP-L138 based Hawkboard
+
+# TEXT_BASE for SPL:
+#
+# On hawkboard the SPL is located in SRAM@0xc1080000.
+#
+# TEXT_BASE = 0xc1080000
+
+include $(TOPDIR)/board/$(BOARDDIR)/config.mk
+
+# PAD_TO used to generate a 4kByte binary needed for the combined image
+# -> PAD_TO = TEXT_BASE + 4096
+PAD_TO	:= $(shell expr $$[$(CONFIG_SYS_TEXT_BASE) + 4096])
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif
nand_spl/board/davinci/da8xxevm/u-boot.lds new file +75 -0

75 lines not on this page · raw message

nand_spl/nand_boot.c +2 -1
index ccd0af2..3cda41c 100644
@@ -222,11 +222,12 @@ static int nand_load(struct mtd_info *mtd, unsigned int offs,
 }
 
 #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
-void board_init_f (ulong bootflag)
+void __board_init_f (ulong bootflag)
 {
 	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
 		       CONFIG_SYS_TEXT_BASE);
 }
+void board_init_f (ulong bootflag)__attribute__((weak, alias("__board_init_f")));
 #endif
 
 /*
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 2/2 Add board support for hawkboard

Dear Sughosh Ganu,

Quoted 40 lines · In message <[email protected]> you wrote:

The patch adds basic board support for TI's OMAP-L138 based Hawkboard. This board is pretty similar to the da850 EVM. Support for nand and network access is added in this version.

The following bootup procedure is used.

At reset, the Rom Boot Loader(RBL), initialises the ddr and the nand controllers and copies the second stage bootloader(nand_spl) to RAM. The secondary bootloader then copies u-boot from a predefined location in the nand flash to the RAM, and passes control to the u-boot image.

Three config options are supported
* hawkboard_config - Used to create the u-boot.bin. Tftp the u-boot.bin image to the RAM from u-boot, and flash to the nand flash at address 0xe0000.

* hawkboard_nand_config - Used to generate the secondary bootloader(nand_spl) image. This creates an elf file u-boot-spl under nand_spl/. Create an AIS signed image using this file, and flash it to the nand flash at address 0x20000. The ais file should fit in one block.

* hawkboard_uart_config - This is same as the first image, but with the TEXT_BASE as expected by the RBL(0xc1080000). Create the AIS Signed bin, as use the normal UART boot procedure to boot the image.

---
 Makefile                                     |   17 +++
 arch/arm/cpu/arm926ejs/davinci/cpu.c         |    2 +
 arch/arm/include/asm/arch-davinci/hardware.h |    5 +-
 board/davinci/common/misc.c                  |    2 +
 board/davinci/da8xxevm/Makefile              |    1 +
 board/davinci/da8xxevm/config.mk             |    3 +
 board/davinci/da8xxevm/hawkboard.c           |  201 ++++++++++++++++++++++++++
 drivers/mtd/nand/davinci_nand.c              |    1 +
 include/configs/hawkboard.h                  |  200 +++++++++++++++++++++++++
 nand_spl/board/davinci/da8xxevm/Makefile     |  141 ++++++++++++++++++
 nand_spl/board/davinci/da8xxevm/config.mk    |   40 +++++
Quoted 8 lines
 nand_spl/board/davinci/da8xxevm/u-boot.lds   |   75 ++++++++++
 nand_spl/nand_boot.c                         |    3 +-
 13 files changed, 689 insertions(+), 2 deletions(-)
 create mode 100644 board/davinci/da8xxevm/hawkboard.c
 create mode 100644 include/configs/hawkboard.h
 create mode 100644 nand_spl/board/davinci/da8xxevm/Makefile
 create mode 100644 nand_spl/board/davinci/da8xxevm/config.mk
 create mode 100644 nand_spl/board/davinci/da8xxevm/u-boot.lds

Entries to MAINTAINERS and boards.cfg missing.

Quoted 12 lines
Makefile +4 -0
index 06c71a2..7b8152c 100644
@@ -911,6 +911,23 @@ cp922_XA10_config	\
 cp1026_config: unconfig
 	@board/armltd/integrator/split_by_variant.sh cp $@
 
+hawkboard_config \
+hawkboard_uart_config \
+hawkboard_nand_config	: unconfig
+	@mkdir -p $(obj)include

Makefile cp922_XA10_config \ · line 927

Quoted 10 lines
Makefile +10 -0
+	@mkdir -p $(obj)board/davinci/da8xxevm
+	@if [ -n "$(findstring _nand_,$@)" ]; then							\
+		echo "#define CONFIG_NAND_U_BOOT" >> $(obj)include/config.h;				\
+		echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk;				\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1080000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	elif [ -n "$(findstring _uart_,$@)" ]; then							\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1080000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	else 												\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1180000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	fi

We don;t allow and don;t need any such scripting in the Makefile any more. Please add your board to boards.cfg instead..

Quoted 13 lines
arch/arm/cpu/arm926ejs/davinci/cpu.c +1 -0
index fc3551c..b4a7382 100644
@@ -109,6 +109,7 @@ out:
 }
 #endif /* CONFIG_SOC_DA8XX */
 
+#if !defined(CONFIG_NAND_SPL)
 #ifdef CONFIG_DISPLAY_CPUINFO
 
 static unsigned pll_div(volatile void *pllbase, unsigned offset)

arch/arm/cpu/arm926ejs/davinci/cpu.c int cpu_eth_init(bd_t *bis) · line 193

Quoted 4 lines
arch/arm/cpu/arm926ejs/davinci/cpu.c +1 -0
@@ -189,3 +190,4 @@ int cpu_eth_init(bd_t *bis)
 #endif
 	return 0;
 }
+#endif /* !CONFIG_NAND_SPL */

Why exactly is this change needed? What happens if you just do not define CONFIG_DISPLAY_CPUINFO in your NAND config?

Quoted 12 lines

index 28750b1..546fd93 100644

board/davinci/common/misc.c +1 -0
@@ -33,6 +33,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if !defined(CONFIG_NAND_SPL)
 #if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
 int dram_init(void)
 {

board/davinci/common/misc.c void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr) · line 109

Quoted 4 lines
board/davinci/common/misc.c +1 -0
@@ -105,6 +106,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 }
 
 #endif	/* DAVINCI_EMAC */
+#endif	/* !CONFIG_NAND_SPL */

Is there not a better way than adding such a huge #ifdef block?

board/davinci/da8xxevm/config.mk line 46

Quoted 13 lines

index e176f7d..9fc7ad9 100644

board/davinci/da8xxevm/config.mk +3 -0
@@ -38,6 +38,9 @@
 #
 # we load ourself to C108 '0000
 
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
 #Provide at least 16MB spacing between us and the Linux Kernel image
+ifndef CONFIG_SYS_TEXT_BASE
 CONFIG_SYS_TEXT_BASE = 0xC1080000
+endif

No. We don't need config.mk files for this any more. Please move settings to board config file.

Quoted 2 lines
board/davinci/da8xxevm/hawkboard.c new file +0 -0
new file mode 100644

....

board/davinci/da8xxevm/hawkboard.c line 100

Quoted 2 lines
board/davinci/da8xxevm/hawkboard.c new file +2 -0
+#if !defined(CONFIG_NAND_SPL)
+int board_init(void)

Again: can we not avoid such a huge #ifdef block here?

board/davinci/da8xxevm/hawkboard.c line 128

Quoted 3 lines
board/davinci/da8xxevm/hawkboard.c new file +3 -0
+int misc_init_r (void)
+{
+	printf ("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));

Would it make sense to use strmhz() here?

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 638

Quoted 9 lines
drivers/mtd/nand/davinci_nand.c +1 -0
index d41579c..ad70dd9 100644
@@ -635,6 +635,7 @@ void davinci_nand_init(struct nand_chip *nand)
 	nand->write_buf = nand_davinci_write_buf;
 
 	nand->dev_ready = nand_davinci_dev_ready;
+	nand->select_chip = NULL;

Hm... maybe we should rather use memset() to set the whole struct nand_chip to zero?

...

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand)

Quoted 4 lines
drivers/mtd/nand/davinci_nand.c +4 -0
+#define CONFIG_SYS_NAND_ECCBYTES	10
+#define CONFIG_SYS_NAND_ECCSTEPS	(CONFIG_SYS_NAND_PAGE_SIZE/ CONFIG_SYS_NAND_ECCSIZE)
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SYS_NAND_ECCTOTAL	(CONFIG_SYS_NAND_ECCBYTES * CONFIG_SYS_NAND_ECCSTEPS)

Lines too long; please fix globally.

Quoted 5 lines
nand_spl/board/davinci/da8xxevm/config.mk new file +0 -0
new file mode 100644
index 0000000..ea071eb

...

nand_spl/board/davinci/da8xxevm/config.mk line 40

Quoted 9 lines
nand_spl/board/davinci/da8xxevm/config.mk new file +9 -0
+include $(TOPDIR)/board/$(BOARDDIR)/config.mk
+
+# PAD_TO used to generate a 4kByte binary needed for the combined image
+# -> PAD_TO = TEXT_BASE + 4096
+PAD_TO	:= $(shell expr $$[$(CONFIG_SYS_TEXT_BASE) + 4096])
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif

Is this really needed? Please get rid of this file.

Quoted 6 lines
nand_spl/nand_boot.c +0 -0
index ccd0af2..3cda41c 100644
@@ -222,11 +222,12 @@ static int nand_load(struct mtd_info *mtd, unsigned int offs,
 }

nand_spl/nand_boot.c static int nand_load(struct mtd_info *mtd, unsigned int offs, · line 231

Quoted 10 lines
nand_spl/nand_boot.c +2 -1
 
 #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
-void board_init_f (ulong bootflag)
+void __board_init_f (ulong bootflag)
 {
 	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
 		       CONFIG_SYS_TEXT_BASE);
 }
+void board_init_f (ulong bootflag)__attribute__((weak, alias("__board_init_f")));
 #endif

This is a global change that affects all NAND booting boards. This must be submitted spearately, and you must explain in detail why you think you need that. Also please mention on which systems this change has been tested.

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"An open mind has but one disadvantage: it collects dirt."
                                                    - a saying at RPI
#2 lore raw

PATCH 2/2 Add board support for hawkboard

hi Wolfgang,

Quoted 3 lines · Wolfgang Denk

Dear Sughosh Ganu,

In message <[email protected]> you wrote:

<snip>

Quoted 22 lines
Quoted 13 lines
---
 Makefile                                     |   17 +++
 arch/arm/cpu/arm926ejs/davinci/cpu.c         |    2 +
 arch/arm/include/asm/arch-davinci/hardware.h |    5 +-
 board/davinci/common/misc.c                  |    2 +
 board/davinci/da8xxevm/Makefile              |    1 +
 board/davinci/da8xxevm/config.mk             |    3 +
 board/davinci/da8xxevm/hawkboard.c           |  201 ++++++++++++++++++++++++++
 drivers/mtd/nand/davinci_nand.c              |    1 +
 include/configs/hawkboard.h                  |  200 +++++++++++++++++++++++++
 nand_spl/board/davinci/da8xxevm/Makefile     |  141 ++++++++++++++++++
 nand_spl/board/davinci/da8xxevm/config.mk    |   40 +++++
Quoted 8 lines
 nand_spl/board/davinci/da8xxevm/u-boot.lds   |   75 ++++++++++
 nand_spl/nand_boot.c                         |    3 +-
 13 files changed, 689 insertions(+), 2 deletions(-)
 create mode 100644 board/davinci/da8xxevm/hawkboard.c
 create mode 100644 include/configs/hawkboard.h
 create mode 100644 nand_spl/board/davinci/da8xxevm/Makefile
 create mode 100644 nand_spl/board/davinci/da8xxevm/config.mk
 create mode 100644 nand_spl/board/davinci/da8xxevm/u-boot.lds
Quoted 1 line

Entries to MAINTAINERS and boards.cfg missing.

Will add.

Quoted 18 lines
Quoted 18 lines
Makefile +9 -0
index 06c71a2..7b8152c 100644
@@ -911,6 +911,23 @@ cp922_XA10_config	\
 cp1026_config: unconfig
 	@board/armltd/integrator/split_by_variant.sh cp $@
 
+hawkboard_config \
+hawkboard_uart_config \
+hawkboard_nand_config	: unconfig
+	@mkdir -p $(obj)include
+	@mkdir -p $(obj)board/davinci/da8xxevm
+	@if [ -n "$(findstring _nand_,$@)" ]; then							\
+		echo "#define CONFIG_NAND_U_BOOT" >> $(obj)include/config.h;				\
+		echo "CONFIG_NAND_U_BOOT = y" >> $(obj)include/config.mk;				\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1080000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
Quoted 8 lines

Makefile cp922_XA10_config \ · line 927

Quoted 5 lines
Makefile +5 -0
+	elif [ -n "$(findstring _uart_,$@)" ]; then							\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1080000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	else 												\
+		echo "CONFIG_SYS_TEXT_BASE = 0xc1180000" >$(obj)board/davinci/da8xxevm/config.tmp;	\
+	fi

We don;t allow and don;t need any such scripting in the Makefile any more. Please add your board to boards.cfg instead..

I had tried adding the entries in the boards.cfg file but could not get nand_spl to build. Will check this out and get back.

Quoted 11 lines
Quoted 11 lines
arch/arm/cpu/arm926ejs/davinci/cpu.c +1 -0
index fc3551c..b4a7382 100644
@@ -109,6 +109,7 @@ out:
 }
 #endif /* CONFIG_SOC_DA8XX */
 
+#if !defined(CONFIG_NAND_SPL)
 #ifdef CONFIG_DISPLAY_CPUINFO
 
Quoted 9 lines

arch/arm/cpu/arm926ejs/davinci/cpu.c int cpu_eth_init(bd_t *bis) · line 193

Quoted 6 lines
arch/arm/cpu/arm926ejs/davinci/cpu.c +1 -0
 static unsigned pll_div(volatile void *pllbase, unsigned offset)
@@ -189,3 +190,4 @@ int cpu_eth_init(bd_t *bis)
 #endif
 	return 0;
 }
+#endif /* !CONFIG_NAND_SPL */

Why exactly is this change needed? What happens if you just do not define CONFIG_DISPLAY_CPUINFO in your NAND config?

I was getting an error with the davinci_emac_initialize function. I guess i can also not define CONFIG_DRIVER_TI_EMAC for the nand spl case and get rid of the check completely.

Quoted 14 lines
Quoted 14 lines

index 28750b1..546fd93 100644

board/davinci/common/misc.c +1 -0
@@ -33,6 +33,7 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
+#if !defined(CONFIG_NAND_SPL)
 #if defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
 int dram_init(void)
 {
@@ -105,6 +106,7 @@ void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr)
 }
 
Quoted 4 lines

board/davinci/common/misc.c void davinci_sync_env_enetaddr(uint8_t *rom_enetaddr) · line 109

Quoted 2 lines
board/davinci/common/misc.c +1 -0
 #endif	/* DAVINCI_EMAC */
+#endif	/* !CONFIG_NAND_SPL */

Is there not a better way than adding such a huge #ifdef block?

Not sure about this one. I need the pinmux configuration functions from this file.

Quoted 10 lines
Quoted 10 lines

index e176f7d..9fc7ad9 100644

board/davinci/da8xxevm/config.mk +1 -0
@@ -38,6 +38,9 @@
 #
 # we load ourself to C108 '0000
 
+sinclude $(OBJTREE)/board/$(BOARDDIR)/config.tmp
 
Quoted 7 lines

board/davinci/da8xxevm/config.mk line 46

Quoted 4 lines
board/davinci/da8xxevm/config.mk +2 -0
 #Provide at least 16MB spacing between us and the Linux Kernel image
+ifndef CONFIG_SYS_TEXT_BASE
 CONFIG_SYS_TEXT_BASE = 0xC1080000
+endif

No. We don't need config.mk files for this any more. Please move settings to board config file.

This is currently being used by da830evm and da850evm too. If ok, i can cleanup for those files too, although i cannot test it on these boards.

Quoted 8 lines
Quoted 3 lines
board/davinci/da8xxevm/hawkboard.c new file +0 -0
new file mode 100644

....

board/davinci/da8xxevm/hawkboard.c line 100

Quoted 2 lines
board/davinci/da8xxevm/hawkboard.c new file +2 -0
+#if !defined(CONFIG_NAND_SPL)
+int board_init(void)

Again: can we not avoid such a huge #ifdef block here?

We need this initialisation for the nand spl part alone, and this is board specific. Can you please suggest any better way of handling this.

Quoted 6 lines

board/davinci/da8xxevm/hawkboard.c line 128

Quoted 4 lines
board/davinci/da8xxevm/hawkboard.c new file +3 -0
+int misc_init_r (void)
+{
+	printf ("ARM Clock : %d Hz\n", clk_get(DAVINCI_ARM_CLKID));

Would it make sense to use strmhz() here?

Will check on this.

Quoted 8 lines
Quoted 8 lines
drivers/mtd/nand/davinci_nand.c +0 -0
index d41579c..ad70dd9 100644
@@ -635,6 +635,7 @@ void davinci_nand_init(struct nand_chip *nand)
 	nand->write_buf = nand_davinci_write_buf;
 
Quoted 5 lines

drivers/mtd/nand/davinci_nand.c void davinci_nand_init(struct nand_chip *nand) · line 638

Quoted 2 lines
drivers/mtd/nand/davinci_nand.c +1 -0
 	nand->dev_ready = nand_davinci_dev_ready;
+	nand->select_chip = NULL;

Hm... maybe we should rather use memset() to set the whole struct nand_chip to zero?

Will initialise the nand chip structure.

Quoted 8 lines

...

drivers/mtd/nand/davinci_nand.c

Quoted 4 lines
drivers/mtd/nand/davinci_nand.c +4 -0
+#define CONFIG_SYS_NAND_ECCBYTES	10
+#define CONFIG_SYS_NAND_ECCSTEPS	(CONFIG_SYS_NAND_PAGE_SIZE/ CONFIG_SYS_NAND_ECCSIZE)
+#define CONFIG_SYS_NAND_OOBSIZE		64
+#define CONFIG_SYS_NAND_ECCTOTAL	(CONFIG_SYS_NAND_ECCBYTES * CONFIG_SYS_NAND_ECCSTEPS)

Lines too long; please fix globally.

Ok, will check.

Quoted 7 lines
Quoted 6 lines
nand_spl/board/davinci/da8xxevm/config.mk new file +0 -0
new file mode 100644
index 0000000..ea071eb

...

Quoted 11 lines

nand_spl/board/davinci/da8xxevm/config.mk line 40

Quoted 9 lines
nand_spl/board/davinci/da8xxevm/config.mk new file +9 -0
+include $(TOPDIR)/board/$(BOARDDIR)/config.mk
+
+# PAD_TO used to generate a 4kByte binary needed for the combined image
+# -> PAD_TO = TEXT_BASE + 4096
+PAD_TO	:= $(shell expr $$[$(CONFIG_SYS_TEXT_BASE) + 4096])
+
+ifeq ($(debug),1)
+PLATFORM_CPPFLAGS += -DDEBUG
+endif

Is this really needed? Please get rid of this file.

Will check.

Quoted 9 lines
Quoted 9 lines
nand_spl/nand_boot.c +0 -0
index ccd0af2..3cda41c 100644
@@ -222,11 +222,12 @@ static int nand_load(struct mtd_info *mtd, unsigned int offs,
 }
 
Quoted 14 lines

nand_spl/nand_boot.c static int nand_load(struct mtd_info *mtd, unsigned int offs, · line 231

Quoted 9 lines
nand_spl/nand_boot.c +2 -1
 #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
-void board_init_f (ulong bootflag)
+void __board_init_f (ulong bootflag)
 {
 	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
 		       CONFIG_SYS_TEXT_BASE);
 }
+void board_init_f (ulong bootflag)__attribute__((weak, alias("__board_init_f")));
 #endif

This is a global change that affects all NAND booting boards. This must be submitted spearately, and you must explain in detail why you think you need that. Also please mention on which systems this change has been tested.

For hawkboard, we need to do some board specific initialisation which can be included in board_init_f. The freescale boards which use the nand spl mechanism to boot define their board specific init functions, but we do not do this for the arm boards. I am afraid i cannot test this on any other boards, but i have compile tested this on the tx25 board.

-sughosh

#3 lore raw

PATCH 2/2 Add board support for hawkboard

Dear Sughosh Ganu,

Quoted 5 lines · In message <20101022075016.GB8597@Hardy> you wrote:
Quoted 2 lines

Is there not a better way than adding such a huge #ifdef block?

Not sure about this one. I need the pinmux configuration functions from this file.

How about splitting the file, and using a separate file for the pinmux stuff?

Quoted 6 lines
Quoted 2 lines

No. We don't need config.mk files for this any more. Please move settings to board config file.

This is currently being used by da830evm and da850evm too. If ok, i can cleanup for those files too, although i cannot test it on these boards.

Yes, cleanup patches (separate from this one) are welcome.

Quoted 6 lines
Quoted 1 line

Again: can we not avoid such a huge #ifdef block here?

We need this initialisation for the nand spl part alone, and this is board specific. Can you please suggest any better way of handling this.

If it turns out that we have code that is common to NAND SPL and normal U-Boot, and other code that is not shared, these parts should be separated into different files so NAND SPL can build and use the common stuff and normal U-Boot additionally build and use the other stuff.

Quoted 15 lines
Quoted 6 lines
Quoted 6 lines

#if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)

nand_spl/nand_boot.c +1 -1
-void board_init_f (ulong bootflag)
+void __board_init_f (ulong bootflag)
 {
 	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
 		       CONFIG_SYS_TEXT_BASE);
Quoted 8 lines
Quoted 3 lines

}
+void board_init_f (ulong bootflag)__attribute__((weak, alias("__board_init_f")));
#endif

This is a global change that affects all NAND booting boards. This must be submitted spearately, and you must explain in detail why you think you need that. Also please mention on which systems this change has been tested.

Quoted 2 lines

For hawkboard, we need to do some board specific initialisation which can be included in board_init_f. The freescale boards which

Can you probably do it in any of the other, board dependent init functions?

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Buy land. They've stopped making it."                   - Mark Twain
#4 lore raw

PATCH 2/2 Add board support for hawkboard

hi Wolfgang,

Quoted 11 lines · Wolfgang Denk

Dear Sughosh Ganu,

Quoted 5 lines · In message <20101022075016.GB8597@Hardy> you wrote:
Quoted 2 lines

Is there not a better way than adding such a huge #ifdef block?

Not sure about this one. I need the pinmux configuration functions from this file.

How about splitting the file, and using a separate file for the pinmux stuff?

Fine, will implement this.

Quoted 7 lines
Quoted 6 lines
Quoted 1 line

Again: can we not avoid such a huge #ifdef block here?

We need this initialisation for the nand spl part alone, and this is board specific. Can you please suggest any better way of handling this.

Quoted 5 lines

If it turns out that we have code that is common to NAND SPL and normal U-Boot, and other code that is not shared, these parts should be separated into different files so NAND SPL can build and use the common stuff and normal U-Boot additionally build and use the other stuff.

Ok. Will split out the code that is specific to nand spl in a different file, which would not be compiled in for the normal u-boot.

Quoted 15 lines
Quoted 15 lines
Quoted 14 lines

nand_spl/nand_boot.c static int nand_load(struct mtd_info *mtd, unsigned int offs, · line 231

Quoted 9 lines

#if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)

nand_spl/nand_boot.c +2 -1
-void board_init_f (ulong bootflag)
+void __board_init_f (ulong bootflag)
 {
 	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
 		       CONFIG_SYS_TEXT_BASE);
 }
+void board_init_f (ulong bootflag)__attribute__((weak, alias("__board_init_f")));
 #endif

This is a global change that affects all NAND booting boards. This must be submitted spearately, and you must explain in detail why you think you need that. Also please mention on which systems this change has been tested.

Quoted 5 lines
Quoted 2 lines

For hawkboard, we need to do some board specific initialisation which can be included in board_init_f. The freescale boards which

Can you probably do it in any of the other, board dependent init functions?

Not sure on this one. The only board specific function that gets called in the nand spl stage is board_init_f.

-sughosh

#5 lore raw

PATCH 2/2 Add board support for hawkboard

hi Wolfgang,

Quoted 22 lines · Sughosh Ganu

hi Wolfgang,

Quoted 5 lines · Wolfgang Denk
Quoted 5 lines
Quoted 5 lines

#if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)

nand_spl/nand_boot.c static int nand_load(struct mtd_info *mtd, unsigned int offs,

Quoted 4 lines
nand_spl/nand_boot.c +1 -1
-void board_init_f (ulong bootflag)
+void __board_init_f (ulong bootflag)
 {
        relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN,

NULL,

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
                       CONFIG_SYS_TEXT_BASE);

}
+void board_init_f (ulong bootflag)__attribute__((weak,

alias("__board_init_f")));

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 1 line

#endif

This is a global change that affects all NAND booting boards. This must be submitted spearately, and you must explain in detail why you think you need that. Also please mention on which systems this

change

Quoted 2 lines
Quoted 2 lines
Quoted 1 line

has been tested.

Quoted 9 lines
Quoted 5 lines
Quoted 2 lines

For hawkboard, we need to do some board specific initialisation which can be included in board_init_f. The freescale boards which

Can you probably do it in any of the other, board dependent init functions?

Not sure on this one. The only board specific function that gets
called in the nand spl stage is board_init_f.

I was checking the usage of board_init_f in the nand_spl/nand_boot.c file,
and currently only the smdk6400 board uses it. Can we then remove this function definition from the nand_boot.c file and put it in the respective board file, like the freescale boards. I think this is a cleaner way of implementing this. Please le me know, and i will base my changes accordingly. Thanks.

-sughosh

#6 lore raw

PATCH 2/2 Add board support for hawkboard

Dear sughosh ganu,

Quoted 7 lines · In message <[email protected]> you…

I was checking the usage of board_init_f in the nand_spl/nand_boot.c file,
and currently only the smdk6400 board uses it. Can we then remove this function definition from the nand_boot.c file and put it in the respective board file, like the freescale boards. I think this is a cleaner way of implementing this. Please le me know, and i will base my changes accordingly. Thanks.

I'm not sure I understnad your plan correctly. If you don't mind please submit a patch; this is easier to review then.

Best regards,

Wolfgang Denk

Signature · 9 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The project was large enough and management communication poor enough
to prompt many members of the team to see themselves  as  contestants
making  brownie  points,  rather  than as builders making programming
products. Each suboptimized  his  piece  to  meet  his  targets;  few
stopped to think about the total effect on the customer.
                              - Fred Brooks, "The Mythical Man Month"
#7 lore raw

PATCH 2/2 Add board support for hawkboard

In reply to Sughosh Ganu
Quoted 4 lines · Sughosh Ganu

[...]
?This is currently being used by da830evm and da850evm too. If ok, i ?can cleanup for those files too, although i cannot test it on these ?boards.

I would be happy to test any patches for da850evm.

Best Regards,
Ben Gardiner

---
Nanometrics Inc.
http://www.nanometrics.ca