Skip to contentSkip to conversation

*** SUBJECT HERE ***

RFC PATCH Superseded Christian Riesch 4 participants 23 messages Nov 21, 2011 – Nov 22, 2011 1 message not in the archive

Subsystems (5)

v2 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

v2 cover *** SUBJECT HERE ***

*** BLURB HERE ***

Christian Riesch (12):
arm, davinci: Move pinmux functions from board to arch tree arm, hawkboard: Remove obsolete struct pinmux_config i2c_pins arm, da850: Move the definitions of pinmux configurations to the arch
tree
arm, da830: Move the definitions of pinmux configurations to 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
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                                           |   10 ++
 arch/arm/cpu/arm926ejs/davinci/Makefile            |    5 +-
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c    |   36 +----
 .../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/da830_pinmux.h   |  131 +++++++++++++++++
 arch/arm/include/asm/arch-davinci/da850_pinmux.h   |  152 ++++++++++++++++++++
 arch/arm/include/asm/arch-davinci/hardware.h       |    2 +
 arch/arm/lib/eabi_compat.c                         |    3 +
 board/davinci/common/Makefile                      |    2 +-
 board/davinci/da8xxevm/config.mk                   |    5 +
 board/davinci/da8xxevm/da830evm.c                  |  116 +--------------
 board/davinci/da8xxevm/da850evm.c                  |  141 ++----------------
 board/davinci/da8xxevm/hawkboard_nand_spl.c        |   51 +-------
 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                     |   60 ++++++++
 include/configs/da850evm.h                         |   53 +++++++-
 include/spi_flash.h                                |    2 +
 lib/Makefile                                       |    2 +
 nand_spl/board/davinci/da8xxevm/Makefile           |    6 +-
 tools/mkimage.c                                    |   97 +++++++------
 26 files changed, 622 insertions(+), 377 deletions(-)
 rename board/davinci/common/davinci_pinmux.c => arch/arm/cpu/arm926ejs/davinci/pinmux.c (100%)
 create mode 100644 arch/arm/include/asm/arch-davinci/da830_pinmux.h
 create mode 100644 arch/arm/include/asm/arch-davinci/da850_pinmux.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
#2 lore raw

RFC PATCH v2 1/12 arm, davinci: Move pinmux functions from board to arch tree

In reply to a message not in the archive
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
#3 lore raw

RFC PATCH v2 2/12 arm, hawkboard: Remove obsolete struct pinmux_config i2c_pins

In reply to a message not in the archive

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
#4 lore raw

RFC PATCH v2 3/12 arm, da850: Move the definitions of pinmux configurations to the arch tree

In reply to a message not in the archive

The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors that contain pinmux configurations for emac, uarts, memory controllers... This patch moves common configurations to a header file in the arch tree for the da850evm and the hawkboard.

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]>
---
 arch/arm/include/asm/arch-davinci/da850_pinmux.h |  152 ++++++++++++++++++++++
 board/davinci/da8xxevm/da850evm.c                |  135 ++------------------
 board/davinci/da8xxevm/hawkboard_nand_spl.c      |   43 +------
 3 files changed, 165 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-davinci/da850_pinmux.h
arch/arm/include/asm/arch-davinci/da850_pinmux.h new file +152 -0
new file mode 100644
index 0000000..53df3f7
@@ -0,0 +1,152 @@
+/*
+ * Pinmux configurations for the DA850 SoCs
+ *
+ * Copyright (C) 2011 OMICRON electronics GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ASM_ARCH_DA850_PINMUX_H
+#define __ASM_ARCH_DA850_PINMUX_H
+
+#include <asm/arch/hardware.h>
+#include <asm/arch/davinci_misc.h>
+
+/* SPI pin muxer settings */
+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 */
+const struct pinmux_config uart2_pins[] = {
+	{ pinmux(0), 4, 6 },
+	{ pinmux(0), 4, 7 },
+	{ pinmux(4), 2, 4 },
+	{ pinmux(4), 2, 5 }
+};
+
+/* EMAC pin muxer settings*/
+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 */
+const struct pinmux_config i2c0_pins[] = {
+	{ pinmux(4), 2, 2 },
+	{ pinmux(4), 2, 3 }
+};
+
+const struct pinmux_config i2c1_pins[] = {
+	{ pinmux(4), 4, 4 },
+	{ pinmux(4), 4, 5 }
+};
+
+/* NAND pin muxer settings */
+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 }
+};
+
+/* NOR pin muxer settings */
+const struct pinmux_config nor_pins[] = {
+	{ 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
board/davinci/da8xxevm/da850evm.c +11 -124

163 lines not on this page · raw message

board/davinci/da8xxevm/hawkboard_nand_spl.c +2 -41

55 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#5 lore raw

RFC PATCH v2 3/12 arm, da850: Move the definitions of pinmux configurations to the arch tree

arch/arm/include/asm/arch-davinci/da850_pinmux.h line 33

Quoted 9 lines · On Monday 21 November 2011 11:33:38 Christian Riesch wrote:
arch/arm/include/asm/arch-davinci/da850_pinmux.h new file +6 -0
 
+const struct pinmux_config spi1_pins[] = {
+	{ pinmux(5), 1, 1 },
+	{ pinmux(5), 1, 2 },
+	{ pinmux(5), 1, 4 },
+	{ pinmux(5), 1, 5 }
+};

variable storage should not be in headers. why can't this be in a C file ? -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/20111121/57537a51/attachment.pgp>

#6 lore raw

RFC PATCH v2 3/12 arm, da850: Move the definitions of pinmux configurations to the arch tree

Hello Mike,
Thank you for your comments.

Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Monday 21 November 2011 11:33:38 Christian Riesch wrote:
arch/arm/include/asm/arch-davinci/da850_pinmux.h new file +0 -0
Quoted 8 lines

arch/arm/include/asm/arch-davinci/da850_pinmux.h

Quoted 6 lines
arch/arm/include/asm/arch-davinci/da850_pinmux.h new file +6 -0
+const struct pinmux_config spi1_pins[] = {
+ ? ? { pinmux(5), 1, 1 },
+ ? ? { pinmux(5), 1, 2 },
+ ? ? { pinmux(5), 1, 4 },
+ ? ? { pinmux(5), 1, 5 }
+};

variable storage should not be in headers. ?why can't this be in a C file ?

Ok, I'll move them to a C file.
Regards, Christian

#7 lore raw

RFC PATCH v2 4/12 arm, da830: Move the definitions of pinmux configurations to the arch tree

In reply to a message not in the archive

The boards in board/davinci/da8xxevm/ define pinmux_config[] vectors that contain pinmux configurations for emac, uarts, memory controllers... This patch moves the pinmux configurations to a header file in the arch tree for the da830evm.

Cc Sandeep Paulraj <[email protected]>
Cc Heiko Schocher <[email protected]>
Cc Nick Thompson <[email protected]>
---
 arch/arm/include/asm/arch-davinci/da830_pinmux.h |  131 ++++++++++++++++++++++
 board/davinci/da8xxevm/da830evm.c                |  114 +------------------
 2 files changed, 135 insertions(+), 110 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-davinci/da830_pinmux.h
arch/arm/include/asm/arch-davinci/da830_pinmux.h new file +131 -0
new file mode 100644
index 0000000..2900b6c
@@ -0,0 +1,131 @@
+/*
+ * Pinmux configurations for the DA830 SoCs
+ *
+ * Copyright (C) 2011 OMICRON electronics GmbH
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#ifndef __ASM_ARCH_DA830_PINMUX_H
+#define __ASM_ARCH_DA830_PINMUX_H
+
+#include <asm/arch/hardware.h>
+#include <asm/arch/davinci_misc.h>
+
+/* SPI pin muxer settings */
+const struct pinmux_config spi0_pins[] = {
+	{ pinmux(7), 1, 3 },
+	{ pinmux(7), 1, 4 },
+	{ pinmux(7), 1, 5 },
+	{ pinmux(7), 1, 6 },
+	{ pinmux(7), 1, 7 }
+};
+
+/* EMIF-A bus pins for 8-bit NAND support on CS3 */
+const struct pinmux_config emifa_nand_8bit_cs3_pins[] = {
+	{ pinmux(13), 1, 6 },
+	{ pinmux(13), 1, 7 },
+	{ pinmux(14), 1, 0 },
+	{ pinmux(14), 1, 1 },
+	{ pinmux(14), 1, 2 },
+	{ pinmux(14), 1, 3 },
+	{ pinmux(14), 1, 4 },
+	{ pinmux(14), 1, 5 },
+	{ pinmux(15), 1, 7 },
+	{ pinmux(16), 1, 0 },
+	{ pinmux(18), 1, 1 },
+	{ pinmux(18), 1, 4 },
+	{ pinmux(18), 1, 5 },
+};
+
+/* EMAC PHY interface pins */
+const struct pinmux_config emac_pins[] = {
+	{ pinmux(9), 0, 5 },
+	{ pinmux(10), 2, 1 },
+	{ pinmux(10), 2, 2 },
+	{ pinmux(10), 2, 3 },
+	{ pinmux(10), 2, 4 },
+	{ pinmux(10), 2, 5 },
+	{ pinmux(10), 2, 6 },
+	{ pinmux(10), 2, 7 },
+	{ pinmux(11), 2, 0 },
+	{ pinmux(11), 2, 1 },
+};
+
+/* UART pin muxer settings */
+const struct pinmux_config uart2_pins[] = {
+	{ pinmux(8), 2, 7 },
+	{ pinmux(9), 2, 0 }
+};
+
+/* I2C pin muxer settings */
+const struct pinmux_config i2c0_pins[] = {
+	{ pinmux(8), 2, 3 },
+	{ pinmux(8), 2, 4 }
+};
+
+/* NAND pin muxer settings */
+const struct pinmux_config aemif_pins[] = {
+	{ pinmux(13), 1, 6 },
+	{ pinmux(13), 1, 7 },
+	{ pinmux(14), 1, 0 },
+	{ pinmux(14), 1, 1 },
+	{ pinmux(14), 1, 2 },
+	{ pinmux(14), 1, 3 },
+	{ pinmux(14), 1, 4 },
+	{ pinmux(14), 1, 5 },
+	{ pinmux(14), 1, 6 },
+	{ pinmux(14), 1, 7 },
+	{ pinmux(15), 1, 0 },
+	{ pinmux(15), 1, 1 },
+	{ pinmux(15), 1, 2 },
+	{ pinmux(15), 1, 3 },
+	{ pinmux(15), 1, 4 },
+	{ pinmux(15), 1, 5 },
+	{ pinmux(15), 1, 6 },
+	{ pinmux(15), 1, 7 },
+	{ pinmux(16), 1, 0 },
+	{ pinmux(16), 1, 1 },
+	{ pinmux(16), 1, 2 },
+	{ pinmux(16), 1, 3 },
+	{ pinmux(16), 1, 4 },
+	{ pinmux(16), 1, 5 },
+	{ pinmux(16), 1, 6 },
+	{ pinmux(16), 1, 7 },
+	{ pinmux(17), 1, 0 },
+	{ pinmux(17), 1, 1 },
+	{ pinmux(17), 1, 2 },
+	{ pinmux(17), 1, 3 },
+	{ pinmux(17), 1, 4 },
+	{ pinmux(17), 1, 5 },
+	{ pinmux(17), 1, 6 },
+	{ pinmux(17), 1, 7 },
+	{ pinmux(18), 1, 0 },
+	{ pinmux(18), 1, 1 },
+	{ pinmux(18), 1, 2 },
+	{ pinmux(18), 1, 3 },
+	{ pinmux(18), 1, 4 },
+	{ pinmux(18), 1, 5 },
+	{ pinmux(18), 1, 6 },
+	{ pinmux(18), 1, 7 },
+	{ pinmux(10), 1, 0 }
+};
+
+/* USB0_DRVVBUS pin muxer settings */
+const struct pinmux_config usb_pins[] = {
+	{ pinmux(9), 1, 1 }
+};
+
+#endif
board/davinci/da8xxevm/da830evm.c +4 -110

134 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#8 lore raw

RFC PATCH v2 5/12 arm, davinci: Remove duplication of pinmux configuration code

In reply to a message not in the archive

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 Sudhakar Rajashekhara <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 arch/arm/cpu/arm926ejs/davinci/da850_lowlevel.c |   36 +++++-----------------
 board/davinci/da8xxevm/da850evm.c               |    4 ++-
 2 files changed, 11 insertions(+), 29 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);
board/davinci/da8xxevm/da850evm.c +3 -1
index 7bc16e7..bcea7b9 100644
@@ -108,7 +108,7 @@ const struct pinmux_config gpio_pins[] = {
 #endif
 };
 
-static const struct pinmux_resource pinmuxes[] = {
+const struct pinmux_resource pinmuxes[] = {
 #ifdef CONFIG_SPI_FLASH
 	PINMUX_ITEM(spi1_pins),
 #endif
@@ -122,6 +122,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 */
Signature · 1 line
1.7.0.4
#9 lore raw

RFC PATCH v2 6/12 arm, davinci: Fix clear bss loop for zero length bss

In reply to a message not in the archive

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
#10 lore raw

RFC PATCH v2 7/12 arm: printf() is not available in some SPL configurations

In reply to a message not in the archive

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

---
 arch/arm/lib/eabi_compat.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
arch/arm/lib/eabi_compat.c +3 -0
index eb3e26d..748c808 100644
@@ -13,10 +13,13 @@
 
 int raise (int signum)
 {
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 	printf("raise: Signal # %d caught\n", signum);
+#endif
 	return 0;
 }
 
+
 /* Dummy function to avoid linker complaints */
 void __aeabi_unwind_cpp_pr0(void)
 {
Signature · 1 line
1.7.0.4
#11 lore raw

RFC PATCH v2 7/12 arm: printf() is not available in some SPL configurations

Quoted 24 lines · Christian Riesch

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

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

arch/arm/lib/eabi_compat.c +3 -0
index eb3e26d..748c808 100644
@@ -13,10 +13,13 @@
 
 ?int raise (int signum)
 ?{
+#if !defined(CONFIG_SPL_BUILD) || defined(CONFIG_SPL_LIBCOMMON_SUPPORT)
 ? ? ? ?printf("raise: Signal # %d caught\n", signum);
+#endif
 ? ? ? ?return 0;
 ?}
 
+
Quoted 3 lines

?/* Dummy function to avoid linker complaints */
?void __aeabi_unwind_cpp_pr0(void)
?{

No extra white space adding please :) Otherwise

Signature · 1 line
Tom
#12 lore raw

RFC PATCH v2 7/12 arm: printf() is not available in some SPL configurations

Hello Tom,

Quoted 25 lines · Tom Rini
Quoted 23 lines · Christian Riesch

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

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

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

?/* Dummy function to avoid linker complaints */
?void __aeabi_unwind_cpp_pr0(void)
?{

No extra white space adding please :) ?Otherwise

Ok, I'll remove that line and resubmit the patch.

Quoted 1 line

Thanks, Christian

#13 lore raw

RFC PATCH v2 8/12 sf: Add spi_boot() to allow booting from SPI flash in an SPL

In reply to a message not in the archive
---
 doc/README.SPL                 |    1 +
 drivers/mtd/spi/Makefile       |    6 ++++
 drivers/mtd/spi/spi_spl_load.c |   60 ++++++++++++++++++++++++++++++++++++++++
 include/spi_flash.h            |    2 +
 lib/Makefile                   |    2 +
 5 files changed, 71 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 +60 -0

60 lines not on this page · raw message

include/spi_flash.h +2 -0
index 2671ab5..e22e294 100644
@@ -68,4 +68,6 @@ static inline int spi_flash_erase(struct spi_flash *flash, u32 offset,
 	return flash->erase(flash, offset, len);
 }
 
+__attribute__((noreturn)) void spi_boot(void);
+
 #endif /* _SPI_FLASH_H_ */
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
#14 lore raw

RFC PATCH v2 8/12 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 Monday 21 November 2011 11:33:43 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

if it's SPL only, then it should probably be in the spl/ tree somewhere ?

drivers/mtd/spi/spi_spl_load.c

Quoted 4 lines
drivers/mtd/spi/spi_spl_load.c new file +1 -0
 
+	puts("Probing SPI flash...\n");

useless noise ?

drivers/mtd/spi/spi_spl_load.c line 43

Quoted 1 line
drivers/mtd/spi/spi_spl_load.c new file +1 -0
+	flash = spi_flash_probe(0, 0, CONFIG_SF_DEFAULT_SPEED, SPI_MODE_3);

hardcoding bus/cs 0:0 doesn't make much sense. push them it into the arguments to the func, or add dedicated SPL defines for them which default to 0:0.

include/spi_flash.h static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, · line 71

Quoted 4 lines
include/spi_flash.h +1 -0
 
+__attribute__((noreturn)) void spi_boot(void);

void spi_boot(void) __noreturn;

lib/Makefile COBJS-$(CONFIG_SHA1) += sha1.o · line 55

Quoted 9 lines
lib/Makefile +2 -0
 
 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

unrelated change ?
-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/20111121/db04d994/attachment.pgp>

#15 lore raw

RFC PATCH v2 8/12 sf: Add spi_boot() to allow booting from SPI flash in an SPL

Quoted 11 lines · Mike Frysinger

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

Quoted 8 lines · On Monday 21 November 2011 11:33:43 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

if it's SPL only, then it should probably be in the spl/ tree somewhere ?

That's not how the NAND stuff got done -- we should be consistent here.
I think it's nice to keep all drivers, SPL or not, for a given type of
hardware in one place.

-Scott

#16 lore raw

RFC PATCH v2 8/12 sf: Add spi_boot() to allow booting from SPI flash in an SPL

In reply to Mike Frysinger

Hello Mike,
Thank you for your comments.

Quoted 11 lines · Mike Frysinger

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

Quoted 8 lines · On Monday 21 November 2011 11:33:43 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

if it's SPL only, then it should probably be in the spl/ tree somewhere ?

As Scott already posted, something similar was introduced for nand in commit 435199f38020c294659a44607ca0e1b6f0ed1542 and it is in drivers/mtd/nand.

Quoted 6 lines

drivers/mtd/spi/spi_spl_load.c

Quoted 4 lines
drivers/mtd/spi/spi_spl_load.c new file +1 -0
 
+ ? ? puts("Probing SPI flash...\n");

useless noise ?

Yes :-) Will be removed.

Quoted 6 lines
Quoted 2 lines

+ ? ? flash = spi_flash_probe(0, 0, CONFIG_SF_DEFAULT_SPEED, SPI_MODE_3);

hardcoding bus/cs 0:0 doesn't make much sense. ?push them it into the arguments to the func, or add dedicated SPL defines for them which default to 0:0.

Ok, I'll change that.

Quoted 10 lines

include/spi_flash.h static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, · line 71

Quoted 4 lines
include/spi_flash.h +1 -0
 
+__attribute__((noreturn)) void spi_boot(void);

void spi_boot(void) __noreturn;

Quoted 3 lines
lib/Makefile +0 -0
Quoted 8 lines
Quoted 6 lines

?COBJS-$(CONFIG_SHA256) += sha256.o
?COBJS-y ? ? ?+= strmhz.o
?COBJS-$(CONFIG_RBTREE) ? ? ? += rbtree.o

lib/Makefile +2 -0
+else
+COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += display_options.o

?endif

unrelated change ?

Not completely unrelated. It's a dependency to make CONFIG_SPL_SPI_FLASH_SUPPORT compile. But it should probably be moved to a separate patch.

Regards, Christian

#17 lore raw

RFC PATCH v2 9/12 arm, davinci: Add SPL support for DA850 SoCs

In reply to a message not in the archive

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 2105ec5..99df0df 100644
@@ -37,7 +37,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
#18 lore raw

RFC PATCH v2 10/12 arm, da850evm: Add an SPL for SPI boot

In reply to a message not in the archive
Cc Heiko Schocher <[email protected]>
Cc Sandeep Paulraj <[email protected]>
Cc Sudhakar Rajashekhara <[email protected]>
---
 board/davinci/da8xxevm/u-boot-spl.lds |   73 +++++++++++++++++++++++++++++++++
 include/configs/da850evm.h            |   53 +++++++++++++++++++++++-
 2 files changed, 125 insertions(+), 1 deletions(-)
 create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds
board/davinci/da8xxevm/u-boot-spl.lds new file +73 -0
new file mode 100644
index 0000000..6f6e065
@@ -0,0 +1,73 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <[email protected]>
+ *
+ * (C) Copyright 2008
+ * Guennadi Liakhovetki, DENX Software Engineering, <[email protected]>
+ *
+ * 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
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SPL_TEXT_BASE,\
+		LENGTH = CONFIG_SPL_MAX_SIZE }
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+	. = 0x00000000;
+
+	. = ALIGN(4);
+	.text      :
+	{
+	__start = .;
+	  arch/arm/cpu/arm926ejs/start.o	(.text)
+	  *(.text*)
+	} >.sram
+
+	. = ALIGN(4);
+	.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
+
+	. = ALIGN(4);
+	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
+	. = ALIGN(4);
+	.rel.dyn : {
+		__rel_dyn_start = .;
+		*(.rel*)
+		__rel_dyn_end = .;
+	} >.sram
+
+	.dynsym : {
+		__dynsym_start = .;
+		*(.dynsym)
+	} >.sram
+
+	.bss :
+	{
+		. = ALIGN(4);
+		__bss_start = .;
+		*(.bss*)
+		. = ALIGN(4);
+		__bss_end__ = .;
+	} >.sram
+
+	__image_copy_end = .;
+	_end = .;
+}
include/configs/da850evm.h +52 -1

79 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#19 lore raw

RFC PATCH v2 11/12 mkimage: Fix variable length header support

In reply to a message not in the archive

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
#20 lore raw

RFC PATCH v2 12/12 arm, davinci: Add support for generating AIS images to the Makefile

In reply to a message not in the archive
Cc Stefano Babic <[email protected]>
Cc Heiko Schocher <[email protected]>
---
 .gitignore                       |    1 +
 Makefile                         |   10 ++++++++++
 board/davinci/da8xxevm/config.mk |    5 +++++
 3 files changed, 16 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 +10 -0
index fb658f4..94c5fbb 100644
@@ -417,6 +417,15 @@ $(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=$(PAD_TO) -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 +797,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/{env/crc32.c,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
#21 lore raw

RFC PATCH v2 12/12 arm, davinci: Add support for generating AIS images to the Makefile

Makefile $(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin · line 428

Quoted 13 lines · On Monday 21 November 2011 11:33:47 Christian Riesch wrote:
Makefile +5 -0
 
+$(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=$(PAD_TO) -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

Makefile +2 -0
+		rm $(obj)spl/u-boot-spl-pad.ais
+

can't this live in arch/arm/.../config.mk somewhere ?

board/davinci/da8xxevm/config.mk line 4

Quoted 7 lines
board/davinci/da8xxevm/config.mk new file +4 -0
 
+# required for SPI flash SPL
+#
+
+PAD_TO	:= 32768

"PAD_TO" is way too generic a name. this should also be a CONFIG_XXX define in the board config header rather than using config.mk.
-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/20111121/c0818339/attachment.pgp>

#22 lore raw

RFC PATCH v2 12/12 arm, davinci: Add support for generating AIS images to the Makefile

Hello Mike,
Thank you for your comments.

Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Monday 21 November 2011 11:33:47 Christian Riesch wrote:
Makefile +0 -0
Quoted 12 lines
Quoted 10 lines

+$(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=$(PAD_TO) -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
+

can't this live in arch/arm/.../config.mk somewhere ?

I guess it could. I placed it in Makefile since there are already a lot of similar targets there, like $(obj)u-boot.kwb, $(obj)u-boot.imx, $(obj)u-boot.ubl...

Quoted 11 lines

board/davinci/da8xxevm/config.mk

Quoted 8 lines
board/davinci/da8xxevm/config.mk new file +4 -0
 
+# required for SPI flash SPL
+#
+
+PAD_TO ? ? ? := 32768

"PAD_TO" is way too generic a name. ?this should also be a CONFIG_XXX define in the board config header rather than using config.mk.

Ok. I'll find a different name. I used $(PAD_TO) since the $(obj)u-boot.ubl target in Makefile already uses this name. Regards, Christian

#23 lore raw

RFC PATCH v2 12/12 arm, davinci: Add support for generating AIS images to the Makefile

Quoted 21 lines · On Tuesday 22 November 2011 02:30:59 Christian Riesch wrote:

Hello Mike,
Thank you for your comments.

Quoted 4 lines · Mike Frysinger
Quoted 3 lines · On Monday 21 November 2011 11:33:47 Christian Riesch wrote:
Makefile +0 -0
Quoted 12 lines

Makefile $(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin · line 428

Quoted 10 lines

+$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin

Makefile +4 -0
+             $(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=$(PAD_TO) -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

Makefile +2 -0
+             rm $(obj)spl/u-boot-spl-pad.ais
+

can't this live in arch/arm/.../config.mk somewhere ?

Quoted 3 lines

I guess it could. I placed it in Makefile since there are already a lot of similar targets there, like $(obj)u-boot.kwb, $(obj)u-boot.imx, $(obj)u-boot.ubl...

we need to clean this up. if moving the target to a cpu config.mk doesn't work, then we can leave it alone for now until we generally clean this cruft up.

Quoted 11 lines
Quoted 10 lines

board/davinci/da8xxevm/config.mk line 4

Quoted 7 lines
board/davinci/da8xxevm/config.mk new file +4 -0
 
+# required for SPI flash SPL
+#
+
+PAD_TO       := 32768

"PAD_TO" is way too generic a name. this should also be a CONFIG_XXX define in the board config header rather than using config.mk.

Quoted 2 lines

Ok. I'll find a different name. I used $(PAD_TO) since the $(obj)u-boot.ubl target in Makefile already uses this name.

we should fix that too ;)
-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/20111122/f4282827/attachment.pgp>