Skip to contentSkip to conversation

Add an SPL to boot the da850evm from SPI

PATCH Superseded Christian Riesch 7 participants 41 messages Nov 25, 2011 – Dec 2, 2011

Subsystems (5)

v3 of 6 Superseded Latest is v6 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add an SPL to boot the da850evm from SPI

Hi all,

Heiko Schocher added support for the low level configuration of the DA850 SoCs and I would like to use this code on my board. At the same time I would like to add support for this low level configuration for the da850evm board. This makes it possible to test/use the lowlevel functions also for developers who don't have access neither to Heiko's board nor to mine.

The patchset aims at implementing SPL support for the da850evm configuration to allow booting this board from SPI flash without using the UBL (see doc/README.davinci).

Changes for v3:
- removed definition of variables from header files (pinmux configs), added .c file for these definitions instead
- removed noise and hardcoded values from drivers/mtd/spi/spi_spl_load.c
- split large patches into smaller ones
- replaced $(PAD_TO) in Makefile by $(CONFIG_SPL_MAX_SIZE)
- moving the pinmux definitions for da830 is not included anymore, I'll do this later in a separate patch

Not changed for v3:
- I kept the #if !defined... in arch/arm/lib/eabi_compat.c since I am afraid that this will cause problems when debugging SPLs, see my comment in [1].

Major changes for v2:
- Added header files that contain the definition of the pinmux structs.
- Added code that actually loads u-boot from SPI flash and starts it.

The first patches move the pinmux functions from the board tree to the arch tree and also use the in the lowlevel configuration in arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c.

Patches #8 and #9 fix two problems I had during development.

The other patches add the SPL and fix mkimage for the building of AIS images.

The patches apply on top of mainline u-boot and Heiko's patch

arm, arm926ejs: always do cpu critical inits
http://patchwork.ozlabs.org/patch/124787/

To build run

make da850evm_config
make u-boot.ais

Then program u-boot.ais to SPI flash on the da850evm.

Regards, Christian

[1] http://lists.denx.de/pipermail/u-boot/2011-November/110727.html
[2] http://lists.denx.de/pipermail/u-boot/2011-November/109997.html

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

Christian Riesch (15):
arm, davinci: Move pinmux functions from board to arch tree arm, hawkboard: Remove obsolete struct pinmux_config i2c_pins arm, da850evm: Do pinmux configuration for EMAC together with other
pinmuxes
arm, da850: Add pinmux configurations to the arch tree arm, da850evm: Use the pinmux configurations defined in the arch tree arm, hawkboard: Use the pinmux configurations defined in the arch
tree
arm, davinci: Remove duplication of pinmux configuration code arm, davinci: Fix clear bss loop for zero length bss
arm: printf() is not available in some SPL configurations
spl: display_options.o is required for SPI flash support in SPL
sf: Add spi_boot() to allow booting from SPI flash in an SPL arm, davinci: Add SPL support for DA850 SoCs
arm, da850evm: Add an SPL for SPI boot
mkimage: Fix variable length header support
arm, davinci: Add support for generating AIS images to the Makefile

 .gitignore                                         |    1 +
 Makefile                                           |   13 ++
 arch/arm/cpu/arm926ejs/davinci/Makefile            |    6 +-
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c    |   36 +----
 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c      |  166 ++++++++++++++++++++
 .../arm/cpu/arm926ejs/davinci/pinmux.c             |    0
 arch/arm/cpu/arm926ejs/davinci/spl.c               |   34 ++++-
 arch/arm/cpu/arm926ejs/start.S                     |    8 +-
 arch/arm/include/asm/arch-davinci/hardware.h       |    2 +
 arch/arm/include/asm/arch-davinci/pinmux_defs.h    |   50 ++++++
 arch/arm/lib/eabi_compat.c                         |    2 +
 board/davinci/common/Makefile                      |    2 +-
 board/davinci/da8xxevm/config.mk                   |    5 +
 board/davinci/da8xxevm/da830evm.c                  |    2 -
 board/davinci/da8xxevm/da850evm.c                  |  163 ++++----------------
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |   59 +------
 board/davinci/da8xxevm/u-boot-spl.lds              |   73 +++++++++
 board/davinci/ea20/ea20.c                          |    2 -
 doc/README.SPL                                     |    1 +
 drivers/mtd/spi/Makefile                           |    6 +
 drivers/mtd/spi/spi_spl_load.c                     |   58 +++++++
 include/configs/da850_am18xxevm.h                  |    1 +
 include/configs/da850evm.h                         |   54 +++++++
 include/configs/hawkboard.h                        |    1 +
 include/spi_flash.h                                |    3 +
 lib/Makefile                                       |    2 +
 nand_spl/board/davinci/da8xxevm/Makefile           |   11 +-
 tools/mkimage.c                                    |   97 ++++++------
 28 files changed, 584 insertions(+), 274 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
 rename board/davinci/common/davinci_pinmux.c => arch/arm/cpu/arm926ejs/davinci/pinmux.c (100%)
 create mode 100644 arch/arm/include/asm/arch-davinci/pinmux_defs.h
 create mode 100644 board/davinci/da8xxevm/config.mk
 create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds
 create mode 100644 drivers/mtd/spi/spi_spl_load.c
#1 lore raw

PATCH v3 1/15 arm, davinci: Move pinmux functions from board to arch tree

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Nick Thompson <[email protected]>
Cc Stefano Babic <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/Makefile            |    2 +-
 .../arm/cpu/arm926ejs/davinci/pinmux.c             |    0
 arch/arm/include/asm/arch-davinci/hardware.h       |    2 ++
 board/davinci/common/Makefile                      |    2 +-
 board/davinci/da8xxevm/da830evm.c                  |    2 --
 board/davinci/da8xxevm/da850evm.c                  |    2 --
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |    2 --
 board/davinci/ea20/ea20.c                          |    2 --
 nand_spl/board/davinci/da8xxevm/Makefile           |    6 +++---
 9 files changed, 7 insertions(+), 13 deletions(-)
 rename board/davinci/common/davinci_pinmux.c => arch/arm/cpu/arm926ejs/davinci/pinmux.c (100%)
arch/arm/cpu/arm926ejs/davinci/Makefile +1 -1
index aeb058a..2105ec5 100644
@@ -27,7 +27,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)lib$(SOC).o
 
-COBJS-y				+= cpu.o timer.o psc.o
+COBJS-y				+= cpu.o timer.o psc.o pinmux.o
 COBJS-$(CONFIG_DA850_LOWLEVEL)	+= da850_lowlevel.o
 COBJS-$(CONFIG_SOC_DM355)	+= dm355.o
 COBJS-$(CONFIG_SOC_DM365)	+= dm365.o
arch/arm/cpu/arm926ejs/davinci/pinmux.c renamed from board/davinci/common/davinci_pinmux.c +0 -0
similarity index 100%
rename from board/davinci/common/davinci_pinmux.c
rename to arch/arm/cpu/arm926ejs/davinci/pinmux.c
arch/arm/include/asm/arch-davinci/hardware.h +2 -0
index 3e9a3b6..06819a6 100644
@@ -480,6 +480,8 @@ struct davinci_syscfg_regs {
 #define davinci_syscfg_regs \
 	((struct davinci_syscfg_regs *)DAVINCI_BOOTCFG_BASE)
 
+#define pinmux(x)	(&davinci_syscfg_regs->pinmux[x])
+
 /* Emulation suspend bits */
 #define DAVINCI_SYSCFG_SUSPSRC_EMAC		(1 << 5)
 #define DAVINCI_SYSCFG_SUSPSRC_I2C		(1 << 16)
board/davinci/common/Makefile +1 -1
index 9d7b164..bc99da3 100644
@@ -29,7 +29,7 @@ endif
 
 LIB	= $(obj)lib$(VENDOR).o
 
-COBJS	:= misc.o davinci_pinmux.o
+COBJS	:= misc.o
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(COBJS))
board/davinci/da8xxevm/da830evm.c +0 -2
index 2021e73..c45c94b 100644
@@ -46,8 +46,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux(x)	(&davinci_syscfg_regs->pinmux[x])
-
 /* SPI0 pin muxer settings */
 static const struct pinmux_config spi0_pins[] = {
 	{ pinmux(7), 1, 3 },
board/davinci/da8xxevm/da850evm.c +0 -2
index e0a3bbe..844e585 100644
@@ -34,8 +34,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux(x)	(&davinci_syscfg_regs->pinmux[x])
-
 /* SPI0 pin muxer settings */
 static const struct pinmux_config spi1_pins[] = {
 	{ pinmux(5), 1, 1 },
board/davinci/da8xxevm/hawkboard_nand_spl.c +0 -2
index 32b17ce..0fdccac 100644
@@ -32,8 +32,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux(x)			(&davinci_syscfg_regs->pinmux[x])
-
 static const struct pinmux_config mii_pins[] = {
 	{ pinmux(2), 8, 1 },
 	{ pinmux(2), 8, 2 },
board/davinci/ea20/ea20.c +0 -2
index 720a360..9b6c4c0 100644
@@ -40,8 +40,6 @@
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#define pinmux(x)	(&davinci_syscfg_regs->pinmux[x])
-
 static const struct da8xx_panel lcd_panel = {
 	/* Casio COM57H531x */
 	.name = "Casio_COM57H531x",
nand_spl/board/davinci/da8xxevm/Makefile +3 -3
index accf716..7b06cd2 100644
@@ -42,7 +42,7 @@ SOBJS	= _divsi3.o \
 
 COBJS	= cpu.o \
 	davinci_nand.o \
-	davinci_pinmux.o \
+	pinmux.o \
 	div0.o \
 	hawkboard_nand_spl.o \
 	memsize.o \
@@ -78,9 +78,9 @@ $(nandobj)u-boot.lds: $(LDSCRIPT)
 # create symbolic links for common files
 
 # from board directory
-$(obj)davinci_pinmux.c:
+$(obj)pinmux.c:
 	@rm -f $@
-	@ln -s $(TOPDIR)/board/davinci/common/davinci_pinmux.c $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/arm926ejs/davinci/pinmux.c $@
 
 # from drivers/mtd/nand directory
 $(obj)davinci_nand.c:
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v3 1/15 arm, davinci: Move pinmux functions from board to arch tree

Hello Christian,

Quoted 8 lines · Christian Riesch
Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Nick Thompson <[email protected]>
Cc Stefano Babic <[email protected]>
Quoted 12 lines
---
 arch/arm/cpu/arm926ejs/davinci/Makefile            |    2 +-
 .../arm/cpu/arm926ejs/davinci/pinmux.c             |    0
 arch/arm/include/asm/arch-davinci/hardware.h       |    2 ++
 board/davinci/common/Makefile                      |    2 +-
 board/davinci/da8xxevm/da830evm.c                  |    2 --
 board/davinci/da8xxevm/da850evm.c                  |    2 --
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |    2 --
 board/davinci/ea20/ea20.c                          |    2 --
 nand_spl/board/davinci/da8xxevm/Makefile           |    6 +++---
 9 files changed, 7 insertions(+), 13 deletions(-)
 rename board/davinci/common/davinci_pinmux.c => arch/arm/cpu/arm926ejs/davinci/pinmux.c (100%)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#3 lore raw

PATCH v3 1/15 arm, davinci: Move pinmux functions from board to arch tree

In reply to Christian Riesch

Christian,

Quoted 8 lines · Christian Riesch
Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Nick Thompson <[email protected]>
Cc Stefano Babic <[email protected]>
Quoted 12 lines
---
 arch/arm/cpu/arm926ejs/davinci/Makefile            |    2 +-
 .../arm/cpu/arm926ejs/davinci/pinmux.c             |    0
 arch/arm/include/asm/arch-davinci/hardware.h       |    2 ++
 board/davinci/common/Makefile                      |    2 +-
 board/davinci/da8xxevm/da830evm.c                  |    2 --
 board/davinci/da8xxevm/da850evm.c                  |    2 --
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |    2 --
 board/davinci/ea20/ea20.c                          |    2 --
 nand_spl/board/davinci/da8xxevm/Makefile           |    6 +++---
 9 files changed, 7 insertions(+), 13 deletions(-)
 rename board/davinci/common/davinci_pinmux.c => arch/arm/cpu/arm926ejs/davinci/pinmux.c (100%)

The da830 parts of the complete patch set are pretty minor, but FWIW:

#4 lore raw

PATCH v3 2/15 arm, hawkboard: Remove obsolete struct pinmux_config i2c_pins

In reply to Christian Riesch

The configuration in struct pinmux_config i2c_pins does not configure the pins for i2c but for uart. Since this function is already configured by struct pinmux_config uart2_pins the i2c_pins struct is obsolete.

Cc Heiko Schocher <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Sandeep Paulraj <[email protected]>
---
 board/davinci/da8xxevm/hawkboard_nand_spl.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
board/davinci/da8xxevm/hawkboard_nand_spl.c +0 -6
index 0fdccac..fd130fa 100644
@@ -71,15 +71,9 @@ static const struct pinmux_config uart2_pins[] = {
 	{ pinmux(4), 2, 5 }
 };
 
-static const struct pinmux_config i2c_pins[] = {
-	{ pinmux(4), 2, 4 },
-	{ pinmux(4), 2, 5 }
-};
-
 static const struct pinmux_resource pinmuxes[] = {
 	PINMUX_ITEM(mii_pins),
 	PINMUX_ITEM(mdio_pins),
-	PINMUX_ITEM(i2c_pins),
 	PINMUX_ITEM(nand_pins),
 	PINMUX_ITEM(uart2_pins),
 };
Signature · 1 line
1.7.0.4
#5 lore raw

PATCH v3 2/15 arm, hawkboard: Remove obsolete struct pinmux_config i2c_pins

Hello Christian,

Quoted 5 lines · Christian Riesch

The configuration in struct pinmux_config i2c_pins does not configure the pins for i2c but for uart. Since this function is already configured by struct pinmux_config uart2_pins the i2c_pins struct is obsolete.

Quoted 8 lines
Cc Heiko Schocher <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Sandeep Paulraj <[email protected]>
---
 board/davinci/da8xxevm/hawkboard_nand_spl.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)
Acked-by Heiko Schocher<hsdenx.de>

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#6 lore raw

PATCH v3 3/15 arm, da850evm: Do pinmux configuration for EMAC together with other pinmuxes

In reply to Christian Riesch

Pinmux configuration for the EMAC was done in a separate call of davinci_configure_pin_mux(). This patch moves all the pinmux configuration that is done for this board to a common place.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
---
 board/davinci/da8xxevm/da850evm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
board/davinci/da8xxevm/da850evm.c +3 -3
index 844e585..9b68c5c 100644
@@ -223,6 +223,9 @@ int misc_init_r(void)
 }
 
 static const struct pinmux_resource pinmuxes[] = {
+#ifdef CONFIG_DRIVER_TI_EMAC
+	PINMUX_ITEM(emac_pins),
+#endif
 #ifdef CONFIG_SPI_FLASH
 	PINMUX_ITEM(spi1_pins),
 #endif
@@ -344,9 +347,6 @@ int board_init(void)
 #endif
 
 #ifdef CONFIG_DRIVER_TI_EMAC
-	if (davinci_configure_pin_mux(emac_pins, ARRAY_SIZE(emac_pins)) != 0)
-		return 1;
-
 	davinci_emac_mii_mode_sel(HAS_RMII);
 #endif /* CONFIG_DRIVER_TI_EMAC */
 
Signature · 1 line
1.7.0.4
#7 lore raw

PATCH v3 3/15 arm, da850evm: Do pinmux configuration for EMAC together with other pinmuxes

Hello Christian,

Quoted 11 lines · Christian Riesch

Pinmux configuration for the EMAC was done in a separate call of davinci_configure_pin_mux(). This patch moves all the pinmux configuration that is done for this board to a common place.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
---
 board/davinci/da8xxevm/da850evm.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#8 lore raw

PATCH v3 4/15 arm, da850: Add pinmux configurations to the arch tree

In reply to Christian Riesch

Up to now nearly every davinci board has separate code for the definition of pinmux configurations. This patch adds pinmux configurations for the DA850 SoCs to the arch tree which may later be used for all DA850 based boards.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/Makefile         |    1 +
 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |  166 +++++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |   50 +++++++
 3 files changed, 217 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
 create mode 100644 arch/arm/include/asm/arch-davinci/pinmux_defs.h
arch/arm/cpu/arm926ejs/davinci/Makefile +1 -0
index 2105ec5..4ac187a 100644
@@ -33,6 +33,7 @@ COBJS-$(CONFIG_SOC_DM355)	+= dm355.o
 COBJS-$(CONFIG_SOC_DM365)	+= dm365.o
 COBJS-$(CONFIG_SOC_DM644X)	+= dm644x.o
 COBJS-$(CONFIG_SOC_DM646X)	+= dm646x.o
+COBJS-$(CONFIG_SOC_DA850)	+= da850_pinmux.o
 COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o ksz8873.o
 
 ifdef CONFIG_SPL_BUILD
arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c new file +166 -0

166 lines not on this page · raw message

arch/arm/include/asm/arch-davinci/pinmux_defs.h new file +50 -0

50 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#9 lore raw

PATCH v3 4/15 arm, da850: Add pinmux configurations to the arch tree

Hello Christian,

Quoted 9 lines · Christian Riesch

Up to now nearly every davinci board has separate code for the definition of pinmux configurations. This patch adds pinmux configurations for the DA850 SoCs to the arch tree which may later be used for all DA850 based boards.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Mike Frysinger <[email protected]>
Quoted 7 lines
---
 arch/arm/cpu/arm926ejs/davinci/Makefile         |    1 +
 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c   |  166 +++++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/pinmux_defs.h |   50 +++++++
 3 files changed, 217 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/da850_pinmux.c
 create mode 100644 arch/arm/include/asm/arch-davinci/pinmux_defs.h

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#10 lore raw

PATCH v3 5/15 arm, da850evm: Use the pinmux configurations defined in the arch tree

In reply to Christian Riesch

The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors that contain pinmux configurations for emac, uarts, memory controllers... In an earlier patch such pinmux configurations were added to the arch tree. This patch makes the da850evm use these definitions instead of defining its own.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 board/davinci/da8xxevm/da850evm.c |  153 ++++++-------------------------------
 include/configs/da850_am18xxevm.h |    1 +
 include/configs/da850evm.h        |    1 +
 3 files changed, 27 insertions(+), 128 deletions(-)
board/davinci/da8xxevm/da850evm.c +25 -128
index 9b68c5c..e827256 100644
@@ -28,135 +28,14 @@
 #include <asm/arch/hardware.h>
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/emac_defs.h>
+#include <asm/arch/pinmux_defs.h>
 #include <asm/io.h>
 #include <asm/arch/davinci_misc.h>
 #include <hwconfig.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-/* SPI0 pin muxer settings */
-static const struct pinmux_config spi1_pins[] = {
-	{ pinmux(5), 1, 1 },
-	{ pinmux(5), 1, 2 },
-	{ pinmux(5), 1, 4 },
-	{ pinmux(5), 1, 5 }
-};
-
-/* UART pin muxer settings */
-static const struct pinmux_config uart_pins[] = {
-	{ pinmux(0), 4, 6 },
-	{ pinmux(0), 4, 7 },
-	{ pinmux(4), 2, 4 },
-	{ pinmux(4), 2, 5 }
-};
-
 #ifdef CONFIG_DRIVER_TI_EMAC
-static const struct pinmux_config emac_pins[] = {
-#ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
-	{ pinmux(14), 8, 2 },
-	{ pinmux(14), 8, 3 },
-	{ pinmux(14), 8, 4 },
-	{ pinmux(14), 8, 5 },
-	{ pinmux(14), 8, 6 },
-	{ pinmux(14), 8, 7 },
-	{ pinmux(15), 8, 1 },
-#else /* ! CONFIG_DRIVER_TI_EMAC_USE_RMII */
-	{ pinmux(2), 8, 1 },
-	{ pinmux(2), 8, 2 },
-	{ pinmux(2), 8, 3 },
-	{ pinmux(2), 8, 4 },
-	{ pinmux(2), 8, 5 },
-	{ pinmux(2), 8, 6 },
-	{ pinmux(2), 8, 7 },
-	{ pinmux(3), 8, 0 },
-	{ pinmux(3), 8, 1 },
-	{ pinmux(3), 8, 2 },
-	{ pinmux(3), 8, 3 },
-	{ pinmux(3), 8, 4 },
-	{ pinmux(3), 8, 5 },
-	{ pinmux(3), 8, 6 },
-	{ pinmux(3), 8, 7 },
-#endif /* CONFIG_DRIVER_TI_EMAC_USE_RMII */
-	{ pinmux(4), 8, 0 },
-	{ pinmux(4), 8, 1 }
-};
-
-/* I2C pin muxer settings */
-static const struct pinmux_config i2c_pins[] = {
-	{ pinmux(4), 2, 2 },
-	{ pinmux(4), 2, 3 }
-};
-
-#ifdef CONFIG_NAND_DAVINCI
-const struct pinmux_config nand_pins[] = {
-	{ pinmux(7), 1, 1 },
-	{ pinmux(7), 1, 2 },
-	{ pinmux(7), 1, 4 },
-	{ pinmux(7), 1, 5 },
-	{ pinmux(9), 1, 0 },
-	{ pinmux(9), 1, 1 },
-	{ pinmux(9), 1, 2 },
-	{ pinmux(9), 1, 3 },
-	{ pinmux(9), 1, 4 },
-	{ pinmux(9), 1, 5 },
-	{ pinmux(9), 1, 6 },
-	{ pinmux(9), 1, 7 },
-	{ pinmux(12), 1, 5 },
-	{ pinmux(12), 1, 6 }
-};
-#elif defined(CONFIG_USE_NOR)
-/* NOR pin muxer settings */
-const struct pinmux_config nor_pins[] = {
-	/* GP0[11] is required for NOR to work on Rev 3 EVMs */
-	{ pinmux(0), 8, 4 },	/* GP0[11] */
-	{ pinmux(5), 1, 6 },
-	{ pinmux(6), 1, 6 },
-	{ pinmux(7), 1, 0 },
-	{ pinmux(7), 1, 4 },
-	{ pinmux(7), 1, 5 },
-	{ pinmux(8), 1, 0 },
-	{ pinmux(8), 1, 1 },
-	{ pinmux(8), 1, 2 },
-	{ pinmux(8), 1, 3 },
-	{ pinmux(8), 1, 4 },
-	{ pinmux(8), 1, 5 },
-	{ pinmux(8), 1, 6 },
-	{ pinmux(8), 1, 7 },
-	{ pinmux(9), 1, 0 },
-	{ pinmux(9), 1, 1 },
-	{ pinmux(9), 1, 2 },
-	{ pinmux(9), 1, 3 },
-	{ pinmux(9), 1, 4 },
-	{ pinmux(9), 1, 5 },
-	{ pinmux(9), 1, 6 },
-	{ pinmux(9), 1, 7 },
-	{ pinmux(10), 1, 0 },
-	{ pinmux(10), 1, 1 },
-	{ pinmux(10), 1, 2 },
-	{ pinmux(10), 1, 3 },
-	{ pinmux(10), 1, 4 },
-	{ pinmux(10), 1, 5 },
-	{ pinmux(10), 1, 6 },
-	{ pinmux(10), 1, 7 },
-	{ pinmux(11), 1, 0 },
-	{ pinmux(11), 1, 1 },
-	{ pinmux(11), 1, 2 },
-	{ pinmux(11), 1, 3 },
-	{ pinmux(11), 1, 4 },
-	{ pinmux(11), 1, 5 },
-	{ pinmux(11), 1, 6 },
-	{ pinmux(11), 1, 7 },
-	{ pinmux(12), 1, 0 },
-	{ pinmux(12), 1, 1 },
-	{ pinmux(12), 1, 2 },
-	{ pinmux(12), 1, 3 },
-	{ pinmux(12), 1, 4 },
-	{ pinmux(12), 1, 5 },
-	{ pinmux(12), 1, 6 },
-	{ pinmux(12), 1, 7 }
-};
-#endif
-
 #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
 #define HAS_RMII 1
 #else
@@ -222,20 +101,38 @@ int misc_init_r(void)
 	return 0;
 }
 
+static const struct pinmux_config gpio_pins[] = {
+#ifdef CONFIG_USE_NOR
+	/* GP0[11] is required for NOR to work on Rev 3 EVMs */
+	{ pinmux(0), 8, 4 },	/* GP0[11] */
+#endif
+};
+
 static const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_DRIVER_TI_EMAC
-	PINMUX_ITEM(emac_pins),
+	PINMUX_ITEM(emac_pins_mdio),
+#ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
+	PINMUX_ITEM(emac_pins_rmii),
+#else
+	PINMUX_ITEM(emac_pins_mii),
+#endif
 #endif
 #ifdef CONFIG_SPI_FLASH
-	PINMUX_ITEM(spi1_pins),
+	PINMUX_ITEM(spi1_pins_base),
+	PINMUX_ITEM(spi1_pins_scs0),
 #endif
-	PINMUX_ITEM(uart_pins),
-	PINMUX_ITEM(i2c_pins),
+	PINMUX_ITEM(uart2_pins_txrx),
+	PINMUX_ITEM(uart2_pins_rtscts),
+	PINMUX_ITEM(i2c0_pins),
 #ifdef CONFIG_NAND_DAVINCI
-	PINMUX_ITEM(nand_pins),
+	PINMUX_ITEM(emifa_pins_cs3),
+	PINMUX_ITEM(emifa_pins_cs4),
+	PINMUX_ITEM(emifa_pins_nand),
 #elif defined(CONFIG_USE_NOR)
-	PINMUX_ITEM(nor_pins),
+	PINMUX_ITEM(emifa_pins_cs2),
+	PINMUX_ITEM(emifa_pins_nor),
 #endif
+	PINMUX_ITEM(gpio_pins),
 };
 
 static const struct lpsc_resource lpsc[] = {
include/configs/da850_am18xxevm.h +1 -0
index 92b83ff..2885ece 100644
@@ -36,6 +36,7 @@
 #define CONFIG_MACH_DAVINCI_DA850_EVM
 #define CONFIG_ARM926EJS		/* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
+#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
include/configs/da850evm.h +1 -0
index 4c14370..2e2aa19 100644
@@ -36,6 +36,7 @@
 #define CONFIG_MACH_DAVINCI_DA850_EVM
 #define CONFIG_ARM926EJS		/* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
+#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
Signature · 1 line
1.7.0.4
#11 lore raw

PATCH v3 5/15 arm, da850evm: Use the pinmux configurations defined in the arch tree

Hello Christian,

Quoted 11 lines · Christian Riesch

The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors that contain pinmux configurations for emac, uarts, memory controllers... In an earlier patch such pinmux configurations were added to the arch tree. This patch makes the da850evm use these definitions instead of defining its own.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
Cc Mike Frysinger <[email protected]>
Quoted 5 lines
---
 board/davinci/da8xxevm/da850evm.c |  153 ++++++-------------------------------
 include/configs/da850_am18xxevm.h |    1 +
 include/configs/da850evm.h        |    1 +
 3 files changed, 27 insertions(+), 128 deletions(-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#12 lore raw

PATCH v3 6/15 arm, hawkboard: Use the pinmux configurations defined in the arch tree

In reply to Christian Riesch

The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors that contain pinmux configurations for emac, uarts, memory controllers... In an earlier patch such pinmux configurations were added to the arch tree. This patch makes the hawkboard use these definitions instead of defining its own.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 board/davinci/da8xxevm/hawkboard_nand_spl.c |   51 ++++----------------------
 include/configs/hawkboard.h                 |    1 +
 nand_spl/board/davinci/da8xxevm/Makefile    |    5 +++
 3 files changed, 14 insertions(+), 43 deletions(-)
board/davinci/da8xxevm/hawkboard_nand_spl.c +8 -43
index fd130fa..df97963 100644
@@ -27,55 +27,20 @@
 #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_config mii_pins[] = {
-	{ pinmux(2), 8, 1 },
-	{ pinmux(2), 8, 2 },
-	{ pinmux(2), 8, 3 },
-	{ pinmux(2), 8, 4 },
-	{ pinmux(2), 8, 5 },
-	{ pinmux(2), 8, 6 },
-	{ pinmux(2), 8, 7 }
-};
-
-static const struct pinmux_config mdio_pins[] = {
-	{ pinmux(4), 8, 0 },
-	{ pinmux(4), 8, 1 }
-};
-
-static const struct pinmux_config nand_pins[] = {
-	{ pinmux(7), 1, 1 },
-	{ pinmux(7), 1, 2 },
-	{ pinmux(7), 1, 4 },
-	{ pinmux(7), 1, 5 },
-	{ pinmux(9), 1, 0 },
-	{ pinmux(9), 1, 1 },
-	{ pinmux(9), 1, 2 },
-	{ pinmux(9), 1, 3 },
-	{ pinmux(9), 1, 4 },
-	{ pinmux(9), 1, 5 },
-	{ pinmux(9), 1, 6 },
-	{ pinmux(9), 1, 7 },
-	{ pinmux(12), 1, 5 },
-	{ pinmux(12), 1, 6 }
-};
-
-static const struct pinmux_config uart2_pins[] = {
-	{ pinmux(0), 4, 6 },
-	{ pinmux(0), 4, 7 },
-	{ pinmux(4), 2, 4 },
-	{ pinmux(4), 2, 5 }
-};
-
 static const struct pinmux_resource pinmuxes[] = {
-	PINMUX_ITEM(mii_pins),
-	PINMUX_ITEM(mdio_pins),
-	PINMUX_ITEM(nand_pins),
-	PINMUX_ITEM(uart2_pins),
+	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[] = {
include/configs/hawkboard.h +1 -0
index 638643a..12acb27 100644
@@ -34,6 +34,7 @@
 #define CONFIG_MACH_DAVINCI_HAWK
 #define CONFIG_ARM926EJS		/* arm926ejs CPU core */
 #define CONFIG_SOC_DA8XX		/* TI DA8xx SoC */
+#define CONFIG_SOC_DA850		/* TI DA850 SoC */
 #define CONFIG_SYS_CLK_FREQ		clk_get(DAVINCI_ARM_CLKID)
 #define CONFIG_SYS_OSCIN_FREQ		24000000
 #define CONFIG_SYS_TIMERBASE		DAVINCI_TIMER0_BASE
nand_spl/board/davinci/da8xxevm/Makefile +5 -0
index 7b06cd2..616e6f1 100644
@@ -43,6 +43,7 @@ SOBJS	= _divsi3.o \
 COBJS	= cpu.o \
 	davinci_nand.o \
 	pinmux.o \
+	da850_pinmux.o \
 	div0.o \
 	hawkboard_nand_spl.o \
 	memsize.o \
@@ -82,6 +83,10 @@ $(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 $@
Signature · 1 line
1.7.0.4
#13 lore raw

PATCH v3 6/15 arm, hawkboard: Use the pinmux configurations defined in the arch tree

Hello Christian,

Quoted 12 lines · Christian Riesch

The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors that contain pinmux configurations for emac, uarts, memory controllers... In an earlier patch such pinmux configurations were added to the arch tree. This patch makes the hawkboard use these definitions instead of defining its own.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Syed Mohammed Khasim <[email protected]>
Cc Sughosh Ganu <[email protected]>
Cc Mike Frysinger <[email protected]>
Quoted 5 lines
---
 board/davinci/da8xxevm/hawkboard_nand_spl.c |   51 ++++----------------------
 include/configs/hawkboard.h                 |    1 +
 nand_spl/board/davinci/da8xxevm/Makefile    |    5 +++
 3 files changed, 14 insertions(+), 43 deletions(-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#14 lore raw

PATCH v3 7/15 arm, davinci: Remove duplication of pinmux configuration code

In reply to Christian Riesch

This patch replaces the pinmux configuration code in arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c by the code from arch/arm/cpu/arm926ejs/davinci/pinmux.c.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   36 +++++-----------------
 1 files changed, 8 insertions(+), 28 deletions(-)
arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c +8 -28
index c7ec70f..a532f8a 100644
@@ -27,6 +27,7 @@
 #include <post.h>
 #include <asm/arch/da850_lowlevel.h>
 #include <asm/arch/hardware.h>
+#include <asm/arch/davinci_misc.h>
 #include <asm/arch/ddr2_defs.h>
 #include <asm/arch/emif_defs.h>
 #include <asm/arch/pll_defs.h>
@@ -235,19 +236,16 @@ int da850_ddr_setup(void)
 	return 0;
 }
 
-void da850_pinmux_ctl(unsigned long offset, unsigned long mask,
-	unsigned long value)
-{
-	clrbits_le32(&davinci_syscfg_regs->pinmux[offset], mask);
-	setbits_le32(&davinci_syscfg_regs->pinmux[offset], (mask & value));
-}
-
 __attribute__((weak))
 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 */
@@ -257,27 +255,9 @@ int arch_cpu_init(void)
 	dv_maskbits(&davinci_syscfg_regs->suspsrc,
 		CONFIG_SYS_DA850_SYSCFG_SUSPSRC);
 
-	/* Setup Pinmux */
-	da850_pinmux_ctl(0, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX0);
-	da850_pinmux_ctl(1, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX1);
-	da850_pinmux_ctl(2, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX2);
-	da850_pinmux_ctl(3, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX3);
-	da850_pinmux_ctl(4, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX4);
-	da850_pinmux_ctl(5, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX5);
-	da850_pinmux_ctl(6, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX6);
-	da850_pinmux_ctl(7, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX7);
-	da850_pinmux_ctl(8, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX8);
-	da850_pinmux_ctl(9, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX9);
-	da850_pinmux_ctl(10, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX10);
-	da850_pinmux_ctl(11, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX11);
-	da850_pinmux_ctl(12, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX12);
-	da850_pinmux_ctl(13, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX13);
-	da850_pinmux_ctl(14, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX14);
-	da850_pinmux_ctl(15, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX15);
-	da850_pinmux_ctl(16, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX16);
-	da850_pinmux_ctl(17, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX17);
-	da850_pinmux_ctl(18, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX18);
-	da850_pinmux_ctl(19, 0xFFFFFFFF, CONFIG_SYS_DA850_PINMUX19);
+	/* configure pinmux settings */
+	if (davinci_configure_pin_mux_items(pinmuxes, pinmuxes_size))
+		return 1;
 
 	/* PLL setup */
 	da850_pll_init(davinci_pllc0_regs, CONFIG_SYS_DA850_PLL0_PLLM);
Signature · 1 line
1.7.0.4
#15 lore raw

PATCH v3 7/15 arm, davinci: Remove duplication of pinmux configuration code

Hello Christian,

Quoted 10 lines · Christian Riesch

This patch replaces the pinmux configuration code in arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c by the code from arch/arm/cpu/arm926ejs/davinci/pinmux.c.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   36 +++++-----------------
 1 files changed, 8 insertions(+), 28 deletions(-)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#16 lore raw

PATCH v3 8/15 arm, davinci: Fix clear bss loop for zero length bss

In reply to Christian Riesch

This patch fixes the clear bss loop for bss sections that have zero length, i.e., where __bss_start == __bss_end__.

Cc Albert Aribaud <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm926ejs/start.S |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
arch/arm/cpu/arm926ejs/start.S +5 -3
index 8b5355b..772793c 100644
@@ -299,10 +299,12 @@ clear_bss:
 #endif
 	mov	r2, #0x00000000		/* clear			    */
 
-clbss_l:str	r2, [r0]		/* clear loop...		    */
+clbss_l:cmp	r0, r1			/* clear loop...		    */
+	beq	clbss_e
+	str	r2, [r0]
 	add	r0, r0, #4
-	cmp	r0, r1
-	bne	clbss_l
+	b	clbss_l
+clbss_e:
 
 #ifndef CONFIG_SPL_BUILD
 	bl coloured_LED_init
Signature · 1 line
1.7.0.4
#17 lore raw

PATCH v3 9/15 arm: printf() is not available in some SPL configurations

In reply to Christian Riesch

This patch avoids build breakage for SPLs that do not support printf.

Cc Wolfgang Denk <[email protected]>
Cc Tom Rini <[email protected]>
Cc Andreas Bie?mann <[email protected]>
Cc Scott Wood <[email protected]>
---
 arch/arm/lib/eabi_compat.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/lib/eabi_compat.c +2 -0
index eb3e26d..e1b87be 100644
@@ -13,7 +13,9 @@
 
 int raise (int signum)
 {
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 	printf("raise: Signal # %d caught\n", signum);
+#endif
 	return 0;
 }
 
Signature · 1 line
1.7.0.4
#18 lore raw

PATCH v3 9/15 arm: printf() is not available in some SPL configurations

Dear Christian,

I can live with this solution. Therefore

Am 25.11.2011 um 13:37 schrieb Christian Riesch:

Quoted 6 lines

This patch avoids build breakage for SPLs that do not support printf.

Cc Wolfgang Denk <[email protected]>
Cc Tom Rini <[email protected]>
Cc Andreas Bie?mann <[email protected]>
Quoted 1 line
Cc Scott Wood <[email protected]>

best regards

Andreas Bie?mann

#19 lore raw

PATCH v3 9/15 arm: printf() is not available in some SPL configurations

In reply to Christian Riesch
Quoted 7 lines · Christian Riesch

This patch avoids build breakage for SPLs that do not support printf.

Cc Wolfgang Denk <[email protected]>
Cc Tom Rini <[email protected]>
Cc Andreas Bie?mann <[email protected]>
Cc Scott Wood <[email protected]>
Quoted 22 lines

---
?arch/arm/lib/eabi_compat.c | ? ?2 ++
?1 files changed, 2 insertions(+), 0 deletions(-)

arch/arm/lib/eabi_compat.c +2 -1
index eb3e26d..e1b87be 100644
@@ -13,7 +13,9 @@
 
 ?int raise (int signum)
 ?{
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 ? ? ? ?printf("raise: Signal # %d caught\n", signum);
+#endif
 ? ? ? ?return 0;
 ?}
 
--

1.7.0.4

Signature · 1 line
Tom
#20 lore raw

PATCH v3 10/15 spl: display_options.o is required for SPI flash support in SPL

In reply to Christian Riesch
Cc Heiko Schocher <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 lib/Makefile |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
lib/Makefile +2 -0
index 54708c2..35ba7ff 100644
@@ -50,6 +50,8 @@ COBJS-$(CONFIG_SHA1) += sha1.o
 COBJS-$(CONFIG_SHA256) += sha256.o
 COBJS-y	+= strmhz.o
 COBJS-$(CONFIG_RBTREE)	+= rbtree.o
+else
+COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += display_options.o
 endif
 
 COBJS-y += ctype.o
Signature · 1 line
1.7.0.4
#21 lore raw

PATCH v3 11/15 sf: Add spi_boot() to allow booting from SPI flash in an SPL

In reply to Christian Riesch
Cc Heiko Schocher <[email protected]>
Cc Mike Frysinger <[email protected]>
Cc Scott Wood <[email protected]>
---
 doc/README.SPL                 |    1 +
 drivers/mtd/spi/Makefile       |    6 ++++
 drivers/mtd/spi/spi_spl_load.c |   58 ++++++++++++++++++++++++++++++++++++++++
 include/spi_flash.h            |    3 ++
 4 files changed, 68 insertions(+), 0 deletions(-)
 create mode 100644 drivers/mtd/spi/spi_spl_load.c
doc/README.SPL +1 -0
index 89d24a7..f01a8bd 100644
@@ -65,3 +65,4 @@ CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o)
 CONFIG_SPL_DMA_SUPPORT (drivers/dma/libdma.o)
 CONFIG_SPL_POST_MEM_SUPPORT (post/drivers/memory.o)
 CONFIG_SPL_NAND_LOAD (drivers/mtd/nand/nand_spl_load.o)
+CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o)
drivers/mtd/spi/Makefile +6 -0
index 57112af..071e2b6 100644
@@ -25,6 +25,12 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libspi_flash.o
 
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_SPI_LOAD
+COBJS-y += spi_spl_load.o
+endif
+endif
+
 COBJS-$(CONFIG_SPI_FLASH)	+= spi_flash.o
 COBJS-$(CONFIG_SPI_FLASH_ATMEL)	+= atmel.o
 COBJS-$(CONFIG_SPI_FLASH_EON)	+= eon.o
drivers/mtd/spi/spi_spl_load.c new file +58 -0

58 lines not on this page · raw message

include/spi_flash.h +3 -0
index 2671ab5..9da9062 100644
@@ -25,6 +25,7 @@
 
 #include <spi.h>
 #include <linux/types.h>
+#include <linux/compiler.h>
 
 struct spi_flash {
 	struct spi_slave *spi;
@@ -68,4 +69,6 @@ static inline int spi_flash_erase(struct spi_flash *flash, u32 offset,
 	return flash->erase(flash, offset, len);
 }
 
+void spi_boot(void) __noreturn;
+
 #endif /* _SPI_FLASH_H_ */
Signature · 1 line
1.7.0.4
#22 lore raw

PATCH v3 11/15 sf: Add spi_boot() to allow booting from SPI flash in an SPL

drivers/mtd/spi/Makefile include $(TOPDIR)/config.mk · line 32

Quoted 8 lines · On Friday 25 November 2011 07:37:40 Christian Riesch wrote:
drivers/mtd/spi/Makefile +5 -0
 
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_SPI_LOAD
+COBJS-y += spi_spl_load.o
+endif
+endif

COBJS-$(CONFIG_SPL_SPI_LOAD) += spi_spl_load.o

drivers/mtd/spi/spi_spl_load.c

Quoted 4 lines
drivers/mtd/spi/spi_spl_load.c new file +1 -0
 
+	__attribute__((noreturn)) void (*uboot)(void);

__noreturn
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20111125/08f32b21/attachment.pgp>

#23 lore raw

PATCH v3 11/15 sf: Add spi_boot() to allow booting from SPI flash in an SPL

Hello Mike,
thanks for your comments!

Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Friday 25 November 2011 07:37:40 Christian Riesch wrote:
drivers/mtd/spi/Makefile +0 -0
Quoted 8 lines

drivers/mtd/spi/Makefile include $(TOPDIR)/config.mk · line 32

Quoted 5 lines
drivers/mtd/spi/Makefile +5 -0
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_SPI_LOAD
+COBJS-y += spi_spl_load.o
+endif
+endif

COBJS-$(CONFIG_SPL_SPI_LOAD) += spi_spl_load.o

Ok, I'll change that.

Quoted 8 lines

drivers/mtd/spi/spi_spl_load.c

Quoted 4 lines
drivers/mtd/spi/spi_spl_load.c new file +1 -0
 
+ ? ? __attribute__((noreturn)) void (*uboot)(void);

__noreturn
-mike

Ok.
Regards, Christian

#24 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

In reply to Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/Makefile |    3 +-
 arch/arm/cpu/arm926ejs/davinci/spl.c    |   34 ++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)
arch/arm/cpu/arm926ejs/davinci/Makefile +2 -1
index 4ac187a..3e9ac41 100644
@@ -38,7 +38,8 @@ COBJS-$(CONFIG_DRIVER_TI_EMAC)	+= lxt972.o dp83848.o et1011c.o ksz8873.o
 
 ifdef CONFIG_SPL_BUILD
 COBJS-y	+= spl.o
-COBJS-y	+= dm365_lowlevel.o
+COBJS-$(CONFIG_SOC_DM365)	+= dm365_lowlevel.o
+COBJS-$(CONFIG_SOC_DA8XX)	+= da850_lowlevel.o
 endif
 
 SOBJS	= reset.o
arch/arm/cpu/arm926ejs/davinci/spl.c +33 -1
index d9b9398..20f798e 100644
@@ -26,6 +26,16 @@
 #include <nand.h>
 #include <asm/arch/dm365_lowlevel.h>
 #include <ns16550.h>
+#include <malloc.h>
+#include <spi_flash.h>
+
+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")));
+
+#ifndef CONFIG_SPL_LIBCOMMON_SUPPORT
 
 void puts(const char *str)
 {
@@ -41,6 +51,8 @@ void putc(char c)
 	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");
@@ -50,14 +62,34 @@ inline void hang(void)
 
 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
 }
Signature · 1 line
1.7.0.4
#25 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions. Aside, what are the size limitations you're dealing with here? Thanks!

Signature · 1 line
Tom
#26 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions.

I stole some ideas from omap-common/spl.c and yes, there are similarities :-)

Quoted 2 lines

?Aside, what are the size limitations you're
dealing with here? ?Thanks!

Size limitation of the SPL? I am using the AM1808 which has 128kB internal SRAM, i think it is the same for all DA8xx SoCs.

Regards, Christian

#27 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Hello Christian,

Quoted 14 lines · Christian Riesch

Hi Tom,

Quoted 10 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions.

Quoted 7 lines

I stole some ideas from omap-common/spl.c and yes, there are similarities :-)

Quoted 2 lines

Aside, what are the size limitations you're
dealing with here? Thanks!

Size limitation of the SPL? I am using the AM1808 which has 128kB internal SRAM, i think it is the same for all DA8xx SoCs.

If we are using the "nor boot method" in "Legacy NOR Boot" mode on the am1808 we must take care, that we can copy only 16kB from NOR to the internal SRAM! (But I think, we don't need to take care of this mode, as we can use when booting from NOR the "direct NOR Boot" mode, where code is exectuted directly from NOR. This mode is used on the enbw_cmc board)

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#28 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Hello Heiko,

Quoted 21 lines · Heiko Schocher
Quoted 12 lines · Christian Riesch
Quoted 10 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions.

Quoted 7 lines

I stole some ideas from omap-common/spl.c and yes, there are similarities :-)

Quoted 2 lines

?Aside, what are the size limitations you're
dealing with here? ?Thanks!

Size limitation of the SPL? I am using the AM1808 which has 128kB internal SRAM, i think it is the same for all DA8xx SoCs.

Quoted 6 lines

If we are using the "nor boot method" in "Legacy NOR Boot" mode on the am1808 we must take care, that we can copy only 16kB from NOR to the internal SRAM! (But I think, we don't need to take care of this mode, as we can use when booting from NOR the "direct NOR Boot" mode, where code is exectuted directly from NOR. This mode is used on the enbw_cmc board)

I agree, there is a restriction for the "legacy nor boot method", but if someone can't execute the code directly from NOR with the "direct NOR boot" for some reason, the "AIS NOR boot" method could be used [1], which allows copying larger memory areas to the internal SRAM. So I think there is virtually no restriction from the ROM bootloader.

Regards, Christian

[1] http://www.ti.com/litv/pdf/spraba5b

#29 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

In reply to Christian Riesch
Quoted 11 lines · Christian Riesch

Hi Tom,

Quoted 8 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Quoted 5 lines
Quoted 3 lines

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions.

I stole some ideas from omap-common/spl.c and yes, there are similarities :-)

OK, note made on my TODO list

Quoted 5 lines
Quoted 2 lines

?Aside, what are the size limitations you're
dealing with here? ?Thanks!

Size limitation of the SPL? I am using the AM1808 which has 128kB internal SRAM, i think it is the same for all DA8xx SoCs.

That's what I figured. What's the reason behind turning off libcommon support? Mimicing existing quite boots?

Signature · 1 line
Tom
#30 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Hi Tom,

Quoted 12 lines · Tom Rini
Quoted 10 lines · Christian Riesch

Hi Tom,

Quoted 7 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

[...]

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

?Aside, what are the size limitations you're
dealing with here? ?Thanks!

Size limitation of the SPL? I am using the AM1808 which has 128kB internal SRAM, i think it is the same for all DA8xx SoCs.

That's what I figured. ?What's the reason behind turning off libcommon support? ?Mimicing existing quite boots?

I turned on libcommon in my patchset for the da850evm since I need it for the SPI flash code. Heiko, I think you wrote something about code size when I asked you the same question some weeks ago for the cam_enc_4xx board (which afaik does not use libcommon), right? Regards, Christian

#31 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Hello Christian,

Quoted 20 lines · Christian Riesch

Hi Tom,

Quoted 12 lines · Tom Rini
Quoted 10 lines · Christian Riesch

Hi Tom,

Quoted 7 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

[...]

Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

Aside, what are the size limitations you're
dealing with here? Thanks!

Size limitation of the SPL? I am using the AM1808 which has 128kB internal SRAM, i think it is the same for all DA8xx SoCs.

Quoted 7 lines
Quoted 2 lines

That's what I figured. What's the reason behind turning off libcommon support? Mimicing existing quite boots?

I turned on libcommon in my patchset for the da850evm since I need it for the SPI flash code. Heiko, I think you wrote something about code size when I asked you the same question some weeks ago for the cam_enc_4xx board (which afaik does not use libcommon), right?

Yes, on tha cam_enc_4xx board (Davinci DM368 based) I boot from NAND and we have an internal RAM size from 16K. And yes, I do not use libcommon there.

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#32 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

In reply to Tom Rini

Hi Tom,

Quoted 11 lines · Tom Rini
Quoted 9 lines · Christian Riesch
Quoted 8 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions.

I stole some ideas from omap-common/spl.c and yes, there are similarities :-)

OK, note made on my TODO list

Maybe we could then also implement this idea from Heiko to select the boot method, see
http://lists.denx.de/pipermail/u-boot/2011-November/109997.html

---snip---
Hmm.. as it is a RFC ... maybe we should go the following way:
(just a fast idea):

create new file u-boot:spl/boot.c:

/* could be board specific */
static int __weak get_boot_method(void)
{
#if defined SPL_BOOTMETHOD_NAND
return SPL_BOOTMETHOD_NAND
#endif
#if defined SPL_BOOTMETHOD_SPI
return SPL_BOOTMETHOD_SPI
#endif
[...]

/*
* if more options are defined for one board
* board specific code has to be written, to decide
* which boot method is used (gpio pin?)
* So it is possible to boot from different
* devices...
*/
}

void board_init_r(gd_t *id, ulong dummy)

{
	int boot_method;

	boot_method = get_boot_method();
	switch (boot_ethod) {
#if defined SPL_BOOTMETHOD_NAND
	case SPL_BOOTMETHOD_NAND:
		nand_init();
		puts("Nand boot...\n");
		nand_boot();
		break;
#endif
#if defined SPL_BOOTMETHOD_SPI
	case SPL_BOOTMETHOD_NAND:
		puts("SPI boot...\n");
		break;
#endif
	default:
		/* error */
		puts("no valid boot method\n");
		hang();
		break;
	}
}

That should be usable from other architectures too ... ---snip---

Regards, Christian

#33 lore raw

PATCH v3 12/15 arm, davinci: Add SPL support for DA850 SoCs

Quoted 18 lines · Christian Riesch

Hi Tom,

Quoted 15 lines · Tom Rini
Quoted 13 lines · Christian Riesch
Quoted 11 lines · Tom Rini
Quoted 5 lines · Christian Riesch

This code adds an SPL for booting from SPI flash on DA850 SoCs.

Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>

Parts of this remind me of omap-common/spl.c so I think longer term we need to figure out if we can make everyone live with a few more common SPL files and functions.

Quoted 7 lines
Quoted 3 lines
Quoted 1 line

I stole some ideas from omap-common/spl.c and yes, there are similarities :-)

OK, note made on my TODO list

Maybe we could then also implement this idea from Heiko to select the boot method, see
http://lists.denx.de/pipermail/u-boot/2011-November/109997.html

Something along these lines, yeah. We've got platforms (omap3/4/5/am33xx) that we can run-time tell who booted and Davinci stuff where I don't know off-hand, but it sounds like we don't and have special-purpose builds.

Signature · 1 line
Tom
#34 lore raw

PATCH v3 13/15 arm, da850evm: Add an SPL for SPI boot

In reply to Christian Riesch
Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
---
 board/davinci/da8xxevm/da850evm.c     |    4 +-
 board/davinci/da8xxevm/u-boot-spl.lds |   73 +++++++++++++++++++++++++++++++++
 include/configs/da850evm.h            |   53 ++++++++++++++++++++++++
 3 files changed, 129 insertions(+), 1 deletions(-)
 create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds
board/davinci/da8xxevm/da850evm.c +3 -1
index e827256..8e66c35 100644
@@ -108,7 +108,7 @@ static const struct pinmux_config gpio_pins[] = {
 #endif
 };
 
-static const struct pinmux_resource pinmuxes[] = {
+const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_DRIVER_TI_EMAC
 	PINMUX_ITEM(emac_pins_mdio),
 #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
@@ -135,6 +135,8 @@ static const struct pinmux_resource pinmuxes[] = {
 	PINMUX_ITEM(gpio_pins),
 };
 
+const int pinmuxes_size = ARRAY_SIZE(pinmuxes);
+
 static const struct lpsc_resource lpsc[] = {
 	{ DAVINCI_LPSC_AEMIF },	/* NAND, NOR */
 	{ DAVINCI_LPSC_SPI1 },	/* Serial Flash */
board/davinci/da8xxevm/u-boot-spl.lds new file +73 -0

73 lines not on this page · raw message

include/configs/da850evm.h +53 -0

71 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#35 lore raw

PATCH v3 13/15 arm, da850evm: Add an SPL for SPI boot

Hello Christian,

Quoted 11 lines · Christian Riesch
Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
---
 board/davinci/da8xxevm/da850evm.c     |    4 +-
 board/davinci/da8xxevm/u-boot-spl.lds |   73 +++++++++++++++++++++++++++++++++
 include/configs/da850evm.h            |   53 ++++++++++++++++++++++++
 3 files changed, 129 insertions(+), 1 deletions(-)
 create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds

[...]

include/configs/da850evm.h line 69

Quoted 10 lines
include/configs/da850evm.h +2 -0
index 2e2aa19..23eed0f 100644
@@ -65,6 +65,41 @@
 #define CONFIG_NR_DRAM_BANKS	1 /* we have 1 bank of DRAM */
 #define CONFIG_STACKSIZE	(256*1024) /* regular stack */
 
+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC ((1 << 27) | (1 << 22) | (1 << 20) | \
+					 (1 << 5) | (1 << 16))

Please use here the DAVINCI_SYSCFG_SUSPSRC_* defines from arch/arm/include/asm/arch-davinci/hardware.h

Quoted 21 lines
include/configs/da850evm.h +21 -0
+
+/*
+ * PLL configuration
+ */
+#define CONFIG_SYS_DV_CLKMODE          0
+#define CONFIG_SYS_DA850_PLL0_POSTDIV  1
+#define CONFIG_SYS_DA850_PLL0_PLLDIV1  0x8000
+#define CONFIG_SYS_DA850_PLL0_PLLDIV2  0x8001
+#define CONFIG_SYS_DA850_PLL0_PLLDIV3  0x8002
+#define CONFIG_SYS_DA850_PLL0_PLLDIV4  0x8003
+#define CONFIG_SYS_DA850_PLL0_PLLDIV5  0x8002
+#define CONFIG_SYS_DA850_PLL0_PLLDIV6  CONFIG_SYS_DA850_PLL0_PLLDIV1
+#define CONFIG_SYS_DA850_PLL0_PLLDIV7  0x8005
+
+#define CONFIG_SYS_DA850_PLL1_POSTDIV  1
+#define CONFIG_SYS_DA850_PLL1_PLLDIV1  0x8000
+#define CONFIG_SYS_DA850_PLL1_PLLDIV2  0x8001
+#define CONFIG_SYS_DA850_PLL1_PLLDIV3  0x8002
+
+#define CONFIG_SYS_DA850_PLL0_PLLM     24
+#define CONFIG_SYS_DA850_PLL1_PLLM     21

include/configs/da850evm.h line 100

Quoted 10 lines
include/configs/da850evm.h +10 -0
+
+/*
+ * DDR2 memory configuration
+ */
+#define CONFIG_SYS_DA850_DDR2_DDRPHYCR 0x000000C4
+#define CONFIG_SYS_DA850_DDR2_SDBCR    0x0A034622
+#define CONFIG_SYS_DA850_DDR2_SDBCR2   0x00000000
+#define CONFIG_SYS_DA850_DDR2_SDTIMR   0x184929C8
+#define CONFIG_SYS_DA850_DDR2_SDTIMR2  0xB80FC700
+#define CONFIG_SYS_DA850_DDR2_SDRCR    0x00000406

Could you use here the DV_DDR_* defines from
arch/arm/include/asm/arch-davinci/ddr2_defs.h

Quoted 27 lines
include/configs/da850evm.h +13 -0
+#define CONFIG_SYS_DA850_DDR2_PBBPR    0x30
+
 /*
  * Serial Driver info
  */
@@ -76,6 +111,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
 
 #define CONFIG_SPI
 #define CONFIG_SPI_FLASH
@@ -242,6 +278,23 @@
 #undef CONFIG_CMD_ENV
 #endif
 
+/* defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SPL_SPI_BUS 0
+#define CONFIG_SPL_SPI_CS 0
+#define CONFIG_SPL_SERIAL_SUPPORT
+#define CONFIG_SPL_LIBCOMMON_SUPPORT
+#define CONFIG_SPL_LIBGENERIC_SUPPORT

include/configs/da850evm.h line 300

Quoted 10 lines
include/configs/da850evm.h +7 -0
+#define CONFIG_SPL_LDSCRIPT	"$(BOARDDIR)/u-boot-spl.lds"
+#define CONFIG_SPL_STACK	0x8001ff00
+#define CONFIG_SPL_TEXT_BASE	0x80000000
+#define CONFIG_SPL_MAX_SIZE	32768
+#define CONFIG_SYS_SPI_U_BOOT_OFFS	0x8000
+#define CONFIG_SYS_SPI_U_BOOT_SIZE	0x30000
+
 /* additions for new relocation code, must added to all boards */
 #define CONFIG_SYS_SDRAM_BASE		0xc0000000
 #define CONFIG_SYS_INIT_SP_ADDR		(CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \

Could you use here some space from On-Chip RAM?

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#36 lore raw

PATCH v3 13/15 arm, da850evm: Add an SPL for SPI boot

Hello Heiko,
thanks for your comments!

Quoted 23 lines · Heiko Schocher

Hello Christian,

Quoted 11 lines · Christian Riesch
Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>

---

?board/davinci/da8xxevm/da850evm.c ? ? | ? ?4 +-
?board/davinci/da8xxevm/u-boot-spl.lds | ? 73 +++++++++++++++++++++++++++++++++
?include/configs/da850evm.h ? ? ? ? ? ?| ? 53 ++++++++++++++++++++++++

?3 files changed, 129 insertions(+), 1 deletions(-) ?create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds

[...]

Quoted 8 lines
include/configs/da850evm.h +0 -0
index 2e2aa19..23eed0f 100644
@@ -65,6 +65,41 @@

?#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */ ?#define CONFIG_STACKSIZE ? ? (256*1024) /* regular stack */

Quoted 5 lines
Quoted 2 lines

+#define CONFIG_SYS_DA850_SYSCFG_SUSPSRC ((1 << 27) | (1 << 22) | (1 << 20) | \
+ ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?(1 << 5) | (1 << 16))

Please use here the DAVINCI_SYSCFG_SUSPSRC_* defines from arch/arm/include/asm/arch-davinci/hardware.h

Ok.

Quoted 26 lines
Quoted 26 lines
include/configs/da850evm.h +26 -0
+
+/*
+ * PLL configuration
+ */
+#define CONFIG_SYS_DV_CLKMODE ? ? ? ? ?0
+#define CONFIG_SYS_DA850_PLL0_POSTDIV ?1
+#define CONFIG_SYS_DA850_PLL0_PLLDIV1 ?0x8000
+#define CONFIG_SYS_DA850_PLL0_PLLDIV2 ?0x8001
+#define CONFIG_SYS_DA850_PLL0_PLLDIV3 ?0x8002
+#define CONFIG_SYS_DA850_PLL0_PLLDIV4 ?0x8003
+#define CONFIG_SYS_DA850_PLL0_PLLDIV5 ?0x8002
+#define CONFIG_SYS_DA850_PLL0_PLLDIV6 ?CONFIG_SYS_DA850_PLL0_PLLDIV1
+#define CONFIG_SYS_DA850_PLL0_PLLDIV7 ?0x8005
+
+#define CONFIG_SYS_DA850_PLL1_POSTDIV ?1
+#define CONFIG_SYS_DA850_PLL1_PLLDIV1 ?0x8000
+#define CONFIG_SYS_DA850_PLL1_PLLDIV2 ?0x8001
+#define CONFIG_SYS_DA850_PLL1_PLLDIV3 ?0x8002
+
+#define CONFIG_SYS_DA850_PLL0_PLLM ? ? 24
+#define CONFIG_SYS_DA850_PLL1_PLLM ? ? 21
+
+/*
+ * DDR2 memory configuration
+ */
+#define CONFIG_SYS_DA850_DDR2_DDRPHYCR 0x000000C4
Quoted 8 lines

include/configs/da850evm.h

Quoted 5 lines
include/configs/da850evm.h +5 -0
+#define CONFIG_SYS_DA850_DDR2_SDBCR ? ?0x0A034622
+#define CONFIG_SYS_DA850_DDR2_SDBCR2 ? 0x00000000
+#define CONFIG_SYS_DA850_DDR2_SDTIMR ? 0x184929C8
+#define CONFIG_SYS_DA850_DDR2_SDTIMR2 ?0xB80FC700
+#define CONFIG_SYS_DA850_DDR2_SDRCR ? ?0x00000406

Could you use here the DV_DDR_* defines from
arch/arm/include/asm/arch-davinci/ddr2_defs.h

Yes, I'll use them.

Quoted 31 lines
Quoted 31 lines
include/configs/da850evm.h +2 -0
+#define CONFIG_SYS_DA850_DDR2_PBBPR ? ?0x30
+

?/*
? * Serial Driver info
? */

include/configs/da850evm.h +0 -0
@@ -76,6 +111,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

?#define CONFIG_SPI
?#define CONFIG_SPI_FLASH

include/configs/da850evm.h +0 -0
@@ -242,6 +278,23 @@

?#undef CONFIG_CMD_ENV
?#endif

include/configs/da850evm.h +14 -0
+/* defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SPL_SPI_SUPPORT
+#define CONFIG_SPL_SPI_FLASH_SUPPORT
+#define CONFIG_SPL_SPI_LOAD
+#define CONFIG_SPL_SPI_BUS 0
+#define CONFIG_SPL_SPI_CS 0
+#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_STACK ? ? 0x8001ff00
+#define CONFIG_SPL_TEXT_BASE 0x80000000
+#define CONFIG_SPL_MAX_SIZE ?32768
Quoted 8 lines
Quoted 6 lines
include/configs/da850evm.h +3 -0
+#define CONFIG_SYS_SPI_U_BOOT_OFFS ? 0x8000
+#define CONFIG_SYS_SPI_U_BOOT_SIZE ? 0x30000
+

?/* additions for new relocation code, must added to all boards */
?#define CONFIG_SYS_SDRAM_BASE ? ? ? ? ? ? ? ?0xc0000000
?#define CONFIG_SYS_INIT_SP_ADDR ? ? ? ? ? ? ?(CONFIG_SYS_SDRAM_BASE + 0x1000 - /* Fix this */ \

Could you use here some space from On-Chip RAM?

The SPL initializes the stack pointer with CONFIG_SPL_STACK, which is in On-Chip RAM. CONFIG_SYS_INIT_SP_ADDR is not used by my code.

Regards, Christian

#37 lore raw

PATCH v3 14/15 mkimage: Fix variable length header support

In reply to Christian Riesch

Support for variable length images like AIS image was introduced in commit f0662105b674a3874227316abf8536bebc9b5995. A parameter "-s" was also introduced to prohibit copying of the image file automatically in the main program. However, this parameter was implemented incorrectly and the image file was copied nevertheless.

Cc Stefano Babic <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 tools/mkimage.c |   97 ++++++++++++++++++++++++++++---------------------------
 1 files changed, 49 insertions(+), 48 deletions(-)
tools/mkimage.c +49 -48
index 36e28ec..eeb1b10 100644
@@ -383,65 +383,66 @@ NXTARG:		;
 		exit (EXIT_FAILURE);
 	}
 
-	if (!params.skipcpy &&
-		(params.type == IH_TYPE_MULTI ||
-			params.type == IH_TYPE_SCRIPT)) {
-		char *file = params.datafile;
-		uint32_t size;
-
-		for (;;) {
-			char *sep = NULL;
-
-			if (file) {
-				if ((sep = strchr(file, ':')) != NULL) {
-					*sep = '\0';
+	if (!params.skipcpy) {
+		if (params.type == IH_TYPE_MULTI ||
+		    params.type == IH_TYPE_SCRIPT) {
+			char *file = params.datafile;
+			uint32_t size;
+
+			for (;;) {
+				char *sep = NULL;
+
+				if (file) {
+					if ((sep = strchr(file, ':')) != NULL) {
+						*sep = '\0';
+					}
+
+					if (stat (file, &sbuf) < 0) {
+						fprintf (stderr, "%s: Can't stat %s: %s\n",
+							 params.cmdname, file, strerror(errno));
+						exit (EXIT_FAILURE);
+					}
+					size = cpu_to_uimage (sbuf.st_size);
+				} else {
+					size = 0;
 				}
 
-				if (stat (file, &sbuf) < 0) {
-					fprintf (stderr, "%s: Can't stat %s: %s\n",
-						params.cmdname, file, strerror(errno));
+				if (write(ifd, (char *)&size, sizeof(size)) != sizeof(size)) {
+					fprintf (stderr, "%s: Write error on %s: %s\n",
+						 params.cmdname, params.imagefile,
+						 strerror(errno));
 					exit (EXIT_FAILURE);
 				}
-				size = cpu_to_uimage (sbuf.st_size);
-			} else {
-				size = 0;
-			}
 
-			if (write(ifd, (char *)&size, sizeof(size)) != sizeof(size)) {
-				fprintf (stderr, "%s: Write error on %s: %s\n",
-					params.cmdname, params.imagefile,
-					strerror(errno));
-				exit (EXIT_FAILURE);
-			}
+				if (!file) {
+					break;
+				}
 
-			if (!file) {
-				break;
+				if (sep) {
+					*sep = ':';
+					file = sep + 1;
+				} else {
+					file = NULL;
+				}
 			}
 
-			if (sep) {
-				*sep = ':';
-				file = sep + 1;
-			} else {
-				file = NULL;
-			}
-		}
+			file = params.datafile;
 
-		file = params.datafile;
-
-		for (;;) {
-			char *sep = strchr(file, ':');
-			if (sep) {
-				*sep = '\0';
-				copy_file (ifd, file, 1);
-				*sep++ = ':';
-				file = sep;
-			} else {
-				copy_file (ifd, file, 0);
-				break;
+			for (;;) {
+				char *sep = strchr(file, ':');
+				if (sep) {
+					*sep = '\0';
+					copy_file (ifd, file, 1);
+					*sep++ = ':';
+					file = sep;
+				} else {
+					copy_file (ifd, file, 0);
+					break;
+				}
 			}
+		} else {
+			copy_file (ifd, params.datafile, 0);
 		}
-	} else {
-		copy_file (ifd, params.datafile, 0);
 	}
 
 	/* We're a bit of paranoid */
Signature · 1 line
1.7.0.4
#38 lore raw

PATCH v3 14/15 mkimage: Fix variable length header support

On 25/11/2011 13:37, Christian Riesch wrote:

Hi Christian,

Quoted 11 lines

Support for variable length images like AIS image was introduced in commit f0662105b674a3874227316abf8536bebc9b5995. A parameter "-s" was also introduced to prohibit copying of the image file automatically in the main program. However, this parameter was implemented incorrectly and the image file was copied nevertheless.

Cc Stefano Babic <[email protected]>
Cc Heiko Schocher <[email protected]>

---

Best regards,
Stefano Babic

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-0 Fax: +49-8142-66989-80  Email: office at denx.de
=====================================================================
#39 lore raw

PATCH v3 15/15 arm, davinci: Add support for generating AIS images to the Makefile

In reply to Christian Riesch
Cc Stefano Babic <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Mike Frysinger <[email protected]>
---
 .gitignore                       |    1 +
 Makefile                         |   13 +++++++++++++
 board/davinci/da8xxevm/config.mk |    5 +++++
 3 files changed, 19 insertions(+), 0 deletions(-)
 create mode 100644 board/davinci/da8xxevm/config.mk
.gitignore +1 -0
index ff4bae0..e4e95e2 100644
@@ -35,6 +35,7 @@
 /u-boot.dis
 /u-boot.lds
 /u-boot.ubl
+/u-boot.ais
 /u-boot.dtb
 /u-boot.sb
 
Makefile +13 -0
index d84b350..484a05c 100644
@@ -417,6 +417,18 @@ $(obj)u-boot.ubl:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
 		rm $(obj)u-boot-ubl.bin
 		rm $(obj)spl/u-boot-spl-pad.bin
 
+$(obj)u-boot.ais:       $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin
+		$(obj)tools/mkimage -s -n /dev/null -T aisimage \
+		-e $(CONFIG_SPL_TEXT_BASE) -d $(obj)spl/u-boot-spl.bin \
+		$(obj)spl/u-boot-spl.ais
+		$(OBJCOPY) ${OBJCFLAGS} -I binary \
+		--pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \
+		$(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais
+		cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin > \
+		$(obj)u-boot.ais
+		rm $(obj)spl/u-boot-spl.ais
+		rm $(obj)spl/u-boot-spl-pad.ais
+
 $(obj)u-boot.sb:       $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin
 		elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \
 			-o $(obj)u-boot.sb
@@ -788,6 +800,7 @@ clobber:	clean
 	@rm -f $(obj)u-boot.kwb
 	@rm -f $(obj)u-boot.imx
 	@rm -f $(obj)u-boot.ubl
+	@rm -f $(obj)u-boot.ais
 	@rm -f $(obj)u-boot.dtb
 	@rm -f $(obj)u-boot.sb
 	@rm -f $(obj)tools/inca-swap-bytes
board/davinci/da8xxevm/config.mk new file +5 -0
new file mode 100644
index 0000000..05cf77f
@@ -0,0 +1,5 @@
+# required for SPI flash SPL
+#
+
+PAD_TO	:= 32768
+
Signature · 1 line
1.7.0.4
#40 lore raw

PATCH v3 15/15 arm, davinci: Add support for generating AIS images to the Makefile

board/davinci/da8xxevm/config.mk line 5

Quoted 11 lines · Christian Riesch
board/davinci/da8xxevm/config.mk new file +5 -0
new file mode 100644
index 0000000..05cf77f
@@ -0,0 +1,5 @@
+# required for SPI flash SPL
+#
+
+PAD_TO := 32768
+

Uh, this file is not required anymore of course. Missed that. Christian