Skip to contentSkip to conversation

SPL Linux boot

PATCH Superseded Simon Schwarz 13 participants 245 messages Aug 11, 2011 – Mar 19, 2012 10 messages not in the archive Arm (32-bit) Page 2 of 2

lore
Share & tools
lore
#174 lore raw

PATCH v12 1/14 Add cmd_spl command

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V2 changes:
CHG corrected bootm call. Now bootm is called with five parameters including
Address of FDT in RAM. This fixes the hang on savebp fdt call.
ADD debug output of the actual bootm parameter call
CHG help message

V3 changes:
FIX added missing brackets

V4 changes:
CHG Corrected argument number in comments
CHG added check for CONFIG_OF_LIBFDT
CHG squashed the README to this commit
DEL define description from commit message - unused in this patch CHG renamed to spl now with subcommand export, very different now ADD New call style with subcommands.
CHG added printf where the image is located
CHG Patched README to reflect changes
CHG parameter count
CHG usage message

V5 changes:
nothing

V6 changes:
nothing

V7 changes:
FIX multiline comment style, cosmetic changes

	(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113499)

REBASE on u-boot

V8 changes:
nothing

V9 changes:
nothing

V10 changes:
CHG list is now terminated by NULL not \0 ADD static modifiers to most of cmd_spl.c functions DEL board changes
ADD include protection to cmd_spl.h
DEL not used enum image_tyep
CHG some cosmetic
CHG images extern moved from cmd_spl.h to image.h

V11 changes:
nothing

V12 changes:
nothing

 common/Makefile         |    1 +
 common/cmd_spl.c        |  229 +++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.commands.spl |   31 +++++++
 include/cmd_spl.h       |   30 ++++++
 include/image.h         |    2 +
 5 files changed, 293 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_spl.c
 create mode 100644 doc/README.commands.spl
 create mode 100644 include/cmd_spl.h
common/Makefile +1 -0
index 1be7236..91f3f2e 100644
@@ -165,6 +165,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
 
 # others
 ifdef CONFIG_DDR_SPD
common/cmd_spl.c new file +229 -0

229 lines not on this page · raw message

doc/README.commands.spl new file +31 -0
new file mode 100644
index 0000000..818dd53
@@ -0,0 +1,31 @@
+The spl command is used to export a boot parameter image to RAM. Later
+it may implement more functions connected to the SPL.
+
+SUBCOMMAND EXPORT
+To execute the command everything has to be in place as if bootm should be
+used. (kernel image, initrd-image, fdt-image etc.)
+
+export has to subcommands:
+	atags: exports the ATAGS
+	fdt: exports the FDT
+
+Call is:
+spl export <ftd|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
+
+
+TYPICAL CALL
+
+on OMAP3:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+spl export atags 			/* export ATAGS */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
+
+call with FDT:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+spl export fdt 0x82000000 - 0x80000100	/* export FDT */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write <adress shown by spl export> 0x680000 0x20000
include/cmd_spl.h new file +30 -0
new file mode 100644
index 0000000..2845367
@@ -0,0 +1,30 @@
+/* Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <[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
+ */
+#ifndef _NAND_SPL_H_
+#define	_NAND_SPL_H_
+
+#define SPL_EXPORT	(0x00000001)
+
+#define SPL_EXPORT_FDT		(0x00000001)
+#define SPL_EXPORT_ATAGS	(0x00000002)
+
+#endif /* _NAND_SPL_H_ */
include/image.h +2 -0
index 466c980..2cc0575 100644
@@ -267,6 +267,8 @@ typedef struct bootm_headers {
 #endif
 } bootm_headers_t;
 
+extern bootm_headers_t images;
+
 /*
  * Some systems (for example LWMON) have very short watchdog periods;
  * we must make sure to split long operations like memmove() or
Signature · 1 line
1.7.5.4
#175 lore raw

PATCH v12 2/14 devki8000: add config for spl command

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds some configs for devkit8000 to use the new spl command

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V10 changes:
This is new in V10 was split from other patch

 include/configs/devkit8000.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
include/configs/devkit8000.h +8 -0
index 2b6a6ee..e323877 100644
@@ -351,4 +351,12 @@
 #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
+#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+					0x400000)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#define CONFIG_SYS_SPL_ARGS_ADDR        (PHYS_SDRAM_1 + 0x100)
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#176 lore raw

PATCH v12 2/14 devki8000: add config for spl command

Dear Stefano Babic,

I do not want to be pedantic, but the subject line contains 'devki8000' which should be 'devkit8000'.

best regards

Andreas Bie?mann

#177 lore raw

PATCH v12 2/14 devki8000: add config for spl command

Am 07/01/2012 11:21, schrieb Andreas Bie?mann:

Quoted 4 lines

Dear Stefano Babic,

I do not want to be pedantic, but the subject line contains 'devki8000' which should be 'devkit8000'.

You are not pedantic, the subject contain an error, and I will fix it - thanks !

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
=====================================================================
#178 lore raw

PATCH v13 2/14 devkit8000: add config for spl command

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds some configs for devkit8000 to use the new spl command

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V13: subject "devki8000" must be devkit8000 (A. Biessmann)

V10 changes:
This is new in V10 was split from other patch

 include/configs/devkit8000.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
include/configs/devkit8000.h +8 -0
index 758326b..d3ca0dd 100644
@@ -356,4 +356,12 @@
 #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
+#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+					0x400000)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#define CONFIG_SYS_SPL_ARGS_ADDR        (PHYS_SDRAM_1 + 0x100)
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#179 lore raw

PATCH v12 3/14 omap-common: Add NAND SPL linux booting

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This implements booting of Linux from NAND in SPL

Related config parameters:
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR

	Address where the kernel boot arguments are expected - this is
	normally RAM-start + 0x100 (on ARM)
CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V2 changes:
nothing

V3 changes:
nothing

V4 changes:
ADD define description to commit message
CHG renaming some defines - renaming SAVEBP SPL

V5 changes:
nothing

V6 changes:
nothing

V7 changes:
nothing

V8 changes:
FIX multiline comment style
REBASE on u-boot

V9 changes:
nothing

V10 changes:
ADD unused __attribute__ to src and dst because they provoked a warning
if SPL os boot was not active

V11 changes:
nothing

V12 changes:
nothing

 arch/arm/cpu/armv7/omap-common/spl_nand.c |   66 ++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 16 deletions(-)
arch/arm/cpu/armv7/omap-common/spl_nand.c +50 -16
index 38d06b1..2a66214 100644
@@ -24,6 +24,7 @@
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/io.h>
 #include <nand.h>
 #include <version.h>
 #include <asm/omap_common.h>
@@ -32,6 +33,9 @@
 void spl_nand_load_image(void)
 {
 	struct image_header *header;
+	int *src __attribute__((unused));
+	int *dst __attribute__((unused));
+
 	switch (omap_boot_mode()) {
 	case NAND_MODE_HW_ECC:
 		debug("spl: nand - using hw ecc\n");
@@ -45,26 +49,56 @@ void spl_nand_load_image(void)
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+#ifdef CONFIG_SPL_OS_BOOT
+	if (!spl_uboot_key()) {
+		/*
+		 * load parameter image
+		 * load to temp position since nand_spl_load_image reads
+		 * a whole block which is typically larger than
+		 * CONFIG_CMD_SAVEBP_WRITE_SIZE therefore may overwrite
+		 * following sections like BSS
+		 */
+		nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
+			CONFIG_CMD_SPL_WRITE_SIZE,
+			(void *)CONFIG_SYS_TEXT_BASE);
+		/* copy to destintion */
+		for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR,
+				src = (int *)CONFIG_SYS_TEXT_BASE;
+				src < (int *)(CONFIG_SYS_TEXT_BASE +
+				CONFIG_CMD_SPL_WRITE_SIZE);
+				src++, dst++) {
+			writel(readl(src), dst);
+		}
 
+		/* load linux */
+		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+			spl_image.size, (void *)spl_image.load_addr);
+	} else
+#endif
+	{
 #ifdef CONFIG_NAND_ENV_DST
-	nand_spl_load_image(CONFIG_ENV_OFFSET,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
-		(void *)image_load_addr);
+		nand_spl_load_image(CONFIG_ENV_OFFSET,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
+			(void *)spl_image.load_addr);
 #ifdef CONFIG_ENV_OFFSET_REDUND
-	nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
-		(void *)image_load_addr);
+		nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
+			(void *)spl_image.load_addr);
 #endif
 #endif
-	/* Load u-boot */
-	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		spl_image.size, (void *)spl_image.load_addr);
+		/* Load u-boot */
+		nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+			spl_image.size, (void *)spl_image.load_addr);
+	}
 	nand_deselect();
 }
Signature · 1 line
1.7.5.4
#180 lore raw

PATCH v12 4/14 devkit8000/spl: init GPMC for dm9000 in SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

Linux crashes if the GPMC isn't configured for the dm9000.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V2 changes:
nothing

V3 changes:
nothing

V4 changes:
noting

V5 changes:
nothing

V6 changes:
nothing

V7 changes:
FIX multiline comment style

	(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113500)

V8 changes:
REBASE on u-boot

V9 changes:
nothing

V10 changes:
use enable_gpmc_cs_config to config the GPMC for dm9000

 arch/arm/include/asm/omap_common.h  |    2 +
 board/timll/devkit8000/devkit8000.c |   39 +++++++++++++++++++++++++++-------
 2 files changed, 33 insertions(+), 8 deletions(-)
arch/arm/include/asm/omap_common.h +2 -0
index 1ec651b..62200e5 100644
@@ -87,6 +87,8 @@ u32 omap_boot_mode(void);
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(char *omap_rev_string);
+int spl_uboot_key(void);
+void spl_board_prepare_for_linux(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
board/timll/devkit8000/devkit8000.c +31 -8
index b06aab6..05de3c1 100644
@@ -63,6 +63,24 @@ int board_init(void)
 	return 0;
 }
 
+static u32 gpmc_net_config[GPMC_MAX_REG] = {
+	NET_GPMC_CONFIG1,
+	NET_GPMC_CONFIG2,
+	NET_GPMC_CONFIG3,
+	NET_GPMC_CONFIG4,
+	NET_GPMC_CONFIG5,
+	NET_GPMC_CONFIG6,
+	NET_GPMC_CONFIG7,
+};
+
+
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+	enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[6],
+		CONFIG_DM9000_BASE, GPMC_SIZE_16M);
+}
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -81,14 +99,7 @@ int misc_init_r(void)
 #endif
 
 #ifdef CONFIG_DRIVER_DM9000
-	/* Configure GPMC registers for DM9000 */
-	writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[6].config1);
-	writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[6].config2);
-	writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[6].config3);
-	writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[6].config4);
-	writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[6].config5);
-	writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[6].config6);
-	writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[6].config7);
+	gpmc_dm9000_config();
 
 	/* Use OMAP DIE_ID as MAC address */
 	if (!eth_getenv_enetaddr("ethaddr", enetaddr)) {
@@ -139,6 +150,18 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	gpmc_dm9000_config();
+}
+
+#endif
+
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
Signature · 1 line
1.7.5.4
#181 lore raw

PATCH v12 4/14 devkit8000/spl: init GPMC for dm9000 in SPL

Hi Stefano,

2012/1/4 Stefano Babic <[email protected]>:

Quoted 61 lines

From: Simon Schwarz <[email protected]>

Linux crashes if the GPMC isn't configured for the dm9000.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V2 changes:
nothing

V3 changes:
nothing

V4 changes:
noting

V5 changes:
nothing

V6 changes:
nothing

V7 changes:
FIX multiline comment style
? ? ? ?(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113500)

V8 changes:
REBASE on u-boot

V9 changes:
nothing

V10 changes:
use enable_gpmc_cs_config to config the GPMC for dm9000

?arch/arm/include/asm/omap_common.h ?| ? ?2 + ?board/timll/devkit8000/devkit8000.c | ? 39 +++++++++++++++++++++++++++------- ?2 files changed, 33 insertions(+), 8 deletions(-)

arch/arm/include/asm/omap_common.h +0 -0
index 1ec651b..62200e5 100644
@@ -87,6 +87,8 @@ u32 omap_boot_mode(void);

?/* SPL common function s*/
?void spl_parse_image_header(const struct image_header *header); ?void omap_rev_string(char *omap_rev_string);

arch/arm/include/asm/omap_common.h +2 -0
+int spl_uboot_key(void);
+void spl_board_prepare_for_linux(void);

?/* NAND SPL functions */
?void spl_nand_load_image(void);

board/timll/devkit8000/devkit8000.c +0 -0
index b06aab6..05de3c1 100644
@@ -63,6 +63,24 @@ int board_init(void)
 ? ? ? ?return 0;
 ?}

board/timll/devkit8000/devkit8000.c int board_init(void) · line 74

Quoted 10 lines
board/timll/devkit8000/devkit8000.c +9 -0
 
+static u32 gpmc_net_config[GPMC_MAX_REG] = {
+ ? ? ? NET_GPMC_CONFIG1,
+ ? ? ? NET_GPMC_CONFIG2,
+ ? ? ? NET_GPMC_CONFIG3,
+ ? ? ? NET_GPMC_CONFIG4,
+ ? ? ? NET_GPMC_CONFIG5,
+ ? ? ? NET_GPMC_CONFIG6,
+ ? ? ? NET_GPMC_CONFIG7,
+};

There is a patch, already mainline, doing the same thing by Thomas Weber (13b178ed) - so this part should be deleted.

Regards
Simon

#182 lore raw

PATCH v13 4/14 devkit8000/spl: init GPMC for dm9000 in SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

Linux crashes if the GPMC isn't configured for the dm9000.

---
V2 changes:
nothing

V3 changes:
nothing

V4 changes:
noting

V5 changes:
nothing

V6 changes:
nothing

V7 changes:
FIX multiline comment style

	(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113500)

V8 changes:
REBASE on u-boot

V9 changes:
nothing

V10 changes:
use enable_gpmc_cs_config to config the GPMC for dm9000

V13: Rebased on u-boot-ti (Simon Schwarz)

 arch/arm/include/asm/omap_common.h  |    2 ++
 board/timll/devkit8000/devkit8000.c |   19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
arch/arm/include/asm/omap_common.h +2 -0
index 1ec651b..62200e5 100644
@@ -87,6 +87,8 @@ u32 omap_boot_mode(void);
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(char *omap_rev_string);
+int spl_uboot_key(void);
+void spl_board_prepare_for_linux(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
board/timll/devkit8000/devkit8000.c +19 -0
index 10f189e..dded697 100644
@@ -73,6 +73,13 @@ int board_init(void)
 	return 0;
 }
 
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+	enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[6],
+		CONFIG_DM9000_BASE, GPMC_SIZE_16M);
+}
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -144,6 +151,18 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	gpmc_dm9000_config();
+}
+
+#endif
+
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
Signature · 1 line
1.7.5.4

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

A message that is not in the archive (sent off-list or not yet received): CAA5zgp-HsQZzgzxftV6GTCavpzTmvTX4PiUXfNAofcEKFVW+GA@mail.gmail.com

A message that is not in the archive (sent off-list or not yet received): CAA5zgp_9-yCVOg2b4VS-nG1En_HW3M6BFhHHKY-tiMXGrAfRcg@mail.gmail.com

#186 lore raw

PATCH v13 4/14 devkit8000/spl: init GPMC for dm9000 in SPL

Quoted 2 lines · Simon Schwarz

Jep - no one cared about the patch as far as i can see:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/119453

Bad...maybe it was woth to include it in the patchset, but it should be enough to mark it is required.

Quoted 4 lines

I did a rebase - will send it on monday, setting up git send-email is not the right thing for sunday evening....

Ok. thanks !

Stefano

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
=====================================================================
#187 lore raw

PATCH v12 5/14 omap-common/spl: Add linux boot to SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds Linux booting to the SPL

This depends on CONFIG_MACH_TYPE patch by Igor Grinberg
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)

Related CONFIGs:
CONFIG_SPL_OS_BOOT
Activates/Deactivates the OS booting feature
CONFIG_SPL_OS_BOOT_KEY
defines the IO-pin number u-boot switch - if pressed u-boot is booted
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR

	Address where the kernel boot arguments are expected - this is
	normaly RAM-begin + 0x100
CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V2 changes:
nothing

V3 changes:
nothing

V4 changes:
CHG Using CONFIG_MACH_TYPE now.
DEL CONFIG_SYS_SPL_MACHID
CHG Use CONFIG_MACH_TYPE for machine id config - This makes the patch
depending on the patch linked above

V5 changes:
FIX compile errors for OMAP4
REBASE u-boot-ti adapted new general gpio interface

V6 changes:
nothing

V7 changes:
FIX multiline comment style

	(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113501)

V8 changes:
REBASE on u-boot

V9 changes:
nothing

V10 changes:
CHG used short form to mark not returning function
DEL devkit8000 config changes from this patch
CHG spl_uboot_key renamed to spl_start_uboot and defined weak to be
implemented board specific
CHG If the Linux image for the direct OS boot is not found the SPL tries
to load a u-boot image
CHG %X in %p in debug message

V11 changes:
U-Boot was always started instead of Linux

 arch/arm/cpu/armv7/omap-common/spl.c      |   49 +++++++++++++++++++++++++-
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   53 ++++++++++++++++------------
 arch/arm/include/asm/omap_common.h        |    1 +
 3 files changed, 78 insertions(+), 25 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +47 -2
index 9c35a09..955a83b 100644
@@ -35,6 +35,7 @@
 #include <i2c.h>
 #include <image.h>
 #include <malloc.h>
+#include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -64,6 +65,25 @@ void board_init_f(ulong dummy)
 	relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
 }
 
+/*
+ * Default function to determine if u-boot or the OS should
+ * be started. This implementation always returns 1.
+ *
+ * Please implement your own board specific funcion to do this.
+ *
+ * RETURN
+ * 0 to not start u-boot
+ * positive if u-boot should start
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__weak int spl_start_uboot(void)
+{
+	printf("SPL: Please implement spl_start_uboot() for your board\n");
+	printf("SPL: Direct Linux boot not active!\n");
+	return 1;
+}
+#endif
+
 void spl_parse_image_header(const struct image_header *header)
 {
 	u32 header_size = sizeof(struct image_header);
@@ -91,7 +111,25 @@ void spl_parse_image_header(const struct image_header *header)
 	}
 }
 
-static void jump_to_image_no_args(void)
+/*
+ * This function jumps to an image with argument. Normally an FDT or ATAGS
+ * image.
+ * arg: Pointer to paramter image in RAM
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__noreturn void jump_to_image_linux(void *arg)
+{
+	debug("Entering kernel arg pointer: 0x%p\n", arg);
+	typedef void (*image_entry_arg_t)(int, int, void *)
+		__attribute__ ((noreturn));
+	image_entry_arg_t image_entry =
+		(image_entry_arg_t) spl_image.entry_point;
+	/* cleanup_before_linux(); */ /*write SPL function for that*/
+	image_entry(0, CONFIG_MACH_TYPE, arg);
+}
+#endif
+
+void jump_to_image_no_args(void)
 {
 	typedef void (*image_entry_noargs_t)(u32 *)__attribute__ ((noreturn));
 	image_entry_noargs_t image_entry =
@@ -105,8 +143,8 @@ static void jump_to_image_no_args(void)
 	u32 boot_params_ptr_addr = (u32)&boot_params_ptr;
 	image_entry((u32 *)boot_params_ptr_addr);
 }
-
 void jump_to_image_no_args(void) __attribute__ ((noreturn));
+
 void board_init_r(gd_t *id, ulong dummy)
 {
 	u32 boot_device;
@@ -146,6 +184,13 @@ void board_init_r(gd_t *id, ulong dummy)
 		debug("Jumping to U-Boot\n");
 		jump_to_image_no_args();
 		break;
+#ifdef CONFIG_SPL_OS_BOOT
+	case IH_OS_LINUX:
+		debug("Jumping to Linux\n");
+		spl_board_prepare_for_linux();
+		jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR);
+		break;
+#endif
 	default:
 		puts("Unsupported OS image.. Jumping nevertheless..\n");
 		jump_to_image_no_args();
arch/arm/cpu/armv7/omap-common/spl_nand.c +30 -23

75 lines not on this page · raw message

arch/arm/include/asm/omap_common.h +1 -0
index 62200e5..8a7d1e5 100644
@@ -89,6 +89,7 @@ void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(char *omap_rev_string);
 int spl_uboot_key(void);
 void spl_board_prepare_for_linux(void);
+int spl_start_uboot(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
Signature · 1 line
1.7.5.4
#188 lore raw

PATCH v12 6/14 omap/spl: change output of spl_parse_image_header

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This only outputs "Assuming u-boot.bin..." if debug is active.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V11: no changes

V12: no changes

 arch/arm/cpu/armv7/omap-common/spl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index 955a83b..1671a03 100644
@@ -101,7 +101,7 @@ void spl_parse_image_header(const struct image_header *header)
 		/* Signature not found - assume u-boot.bin */
 		printf("mkimage signature not found - ih_magic = %x\n",
 			header->ih_magic);
-		puts("Assuming u-boot.bin ..\n");
+		debug("Assuming u-boot.bin ..\n");
 		/* Let's assume U-Boot will not be more than 200 KB */
 		spl_image.size = 200 * 1024;
 		spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
Signature · 1 line
1.7.5.4
#189 lore raw

PATCH v12 7/14 devkit8000: Implement and activate direct OS boot

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

- Implements spl_start_uboot() for devkit8000
- Add configs to activate direct OS boot from SPL

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---
V10 changes:
sliced from the implementation
added an implementation of spl_start_uboot for devkit8000

 board/timll/devkit8000/devkit8000.c |   18 ++++++++++++++++++
 include/configs/devkit8000.h        |    7 +++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
board/timll/devkit8000/devkit8000.c +18 -0
index 05de3c1..6ca4fe2 100644
@@ -41,6 +41,7 @@
 #include <asm/arch/mem.h>
 #include <asm/mach-types.h>
 #include "devkit8000.h"
+#include <asm/gpio.h>
 #ifdef CONFIG_DRIVER_DM9000
 #include <net.h>
 #include <netdev.h>
@@ -160,6 +161,23 @@ void spl_board_prepare_for_linux(void)
 	gpmc_dm9000_config();
 }
 
+/*
+ * devkit8000 specific implementation of spl_start_uboot()
+ *
+ * RETURN
+ * 0 if the button is not pressed
+ * 1 if the button is pressed
+ */
+int spl_start_uboot(void)
+{
+	int val = 0;
+	if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+		gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+		val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+		gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+	}
+	return !val;
+}
 #endif
 
 /*
include/configs/devkit8000.h +5 -2
index e323877..eb7c376 100644
@@ -35,7 +35,7 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3_DEVKIT8000	1	/* working with DevKit8000 */
-
+#define CONFIG_MACH_TYPE	MACH_TYPE_DEVKIT8000
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  * 64 bytes before this address should be set aside for u-boot.img's
@@ -327,7 +327,7 @@
 #define CONFIG_SPL_MAX_SIZE		0xB400  /* 45 K */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_START_ADDR       0x80000500 /* leave space for bootargs*/
 #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
 
 /* NAND boot config */
@@ -352,6 +352,9 @@
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
 /* SPL OS boot options */
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY	26
+
 #define CONFIG_CMD_SPL
 #define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
 #define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
Signature · 1 line
1.7.5.4
#190 lore raw

PATCH v12 8/14 Add cache functions to SPL for armv7

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>

---

Changes since V11:

- enable cache files in Makefile after checking build for OMAP4/5

 arch/arm/cpu/armv7/Makefile |    2 --
 arch/arm/cpu/armv7/cpu.c    |    2 ++
 arch/arm/lib/Makefile       |    5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/Makefile +0 -2
index f97fa3d..6b2addc 100644
@@ -27,9 +27,7 @@ LIB	= $(obj)lib$(CPU).o
 
 START	:= start.o
 
-ifndef CONFIG_SPL_BUILD
 COBJS	+= cache_v7.o
-endif
 
 COBJS	+= cpu.o
 COBJS	+= syslib.o
arch/arm/cpu/armv7/cpu.c +2 -0
index 662c496..c6fa8ef 100644
@@ -52,7 +52,9 @@ int cleanup_before_linux(void)
 	 *
 	 * we turn off caches etc ...
 	 */
+#ifndef CONFIG_SPL_BUILD
 	disable_interrupts();
+#endif
 
 	/*
 	 * Turn off I-cache and invalidate it
arch/arm/lib/Makefile +3 -2
index 300c8fa..39a9550 100644
@@ -39,8 +39,6 @@ GLCOBJS	+= div0.o
 
 COBJS-y	+= board.o
 COBJS-y	+= bootm.o
-COBJS-y	+= cache.o
-COBJS-y	+= cache-cp15.o
 COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 COBJS-y	+= interrupts.o
 COBJS-y	+= reset.o
@@ -48,6 +46,9 @@ SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
 SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 endif
 
+COBJS-y	+= cache.o
+COBJS-y	+= cache-cp15.o
+
 SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
 	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
Signature · 1 line
1.7.5.4
#191 lore raw

PATCH v12 8/14 Add cache functions to SPL for armv7

Hi Stefano,

Quoted 9 lines · Stefano Babic
CC Tom Rini<[email protected]>
CC Wolfgang Denk<[email protected]>
CC Simon Schwarz<[email protected]>

---

Changes since V11:

- enable cache files in Makefile after checking build for OMAP4/5

How are you allocating memory for the page-tables(gd->tlb_addr)? Also we need to take care of the complexities when u-boot runs after SPL. Please have a look at this.

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/100012/match=spl+cache

Quoted 57 lines
  arch/arm/cpu/armv7/Makefile |    2 --
  arch/arm/cpu/armv7/cpu.c    |    2 ++
  arch/arm/lib/Makefile       |    5 +++--
  3 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/Makefile +0 -2
index f97fa3d..6b2addc 100644
@@ -27,9 +27,7 @@ LIB	= $(obj)lib$(CPU).o
 
  START	:= start.o
 
-ifndef CONFIG_SPL_BUILD
  COBJS	+= cache_v7.o
-endif
 
  COBJS	+= cpu.o
  COBJS	+= syslib.o
arch/arm/cpu/armv7/cpu.c +2 -0
index 662c496..c6fa8ef 100644
@@ -52,7 +52,9 @@ int cleanup_before_linux(void)
  	 *
  	 * we turn off caches etc ...
  	 */
+#ifndef CONFIG_SPL_BUILD
  	disable_interrupts();
+#endif
 
  	/*
  	 * Turn off I-cache and invalidate it
arch/arm/lib/Makefile +3 -2
index 300c8fa..39a9550 100644
@@ -39,8 +39,6 @@ GLCOBJS	+= div0.o
 
  COBJS-y	+= board.o
  COBJS-y	+= bootm.o
-COBJS-y	+= cache.o
-COBJS-y	+= cache-cp15.o
  COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
  COBJS-y	+= interrupts.o
  COBJS-y	+= reset.o
@@ -48,6 +46,9 @@ SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
  SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
  endif
 
+COBJS-y	+= cache.o
+COBJS-y	+= cache-cp15.o
+
  SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
  	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
  OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
#192 lore raw

PATCH v12 8/14 Add cache functions to SPL for armv7

Quoted 2 lines · Aneesh V

Hi Stefano,

Hi,

Quoted 7 lines · Stefano Babic
Quoted 6 lines
CC Tom Rini<[email protected]>
CC Wolfgang Denk<[email protected]>
CC Simon Schwarz<[email protected]>

---

Quoted 6 lines
Quoted 3 lines

Changes since V11:

- enable cache files in Makefile after checking build for OMAP4/5

How are you allocating memory for the page-tables(gd->tlb_addr)? Also we need to take care of the complexities when u-boot runs after SPL.

I know, and the patch can be considered a preparation for adding d-cache later - dcache is not enabled at all in this patchset. At the moment, cleanup_before_linux() is called as in U-Boot, but caches are already disabled. I know memory for the page tables must be reserved, but this part is not yet done.

Quoted 3 lines

Please have a look at this.

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/100012/match=spl+cache

I am aware of this. And this is also the reason I see caches as a second-step approach. Firstly, we should have a way to boot linux directly from SPL, without enabling cache. Then we have the possibility to increase the mumber of our testers, because, as far as I know, only me and Simon have tried with this patchset to get some measurement.

In my current tests on the twister board (AM3517 based), most time is spent really to load the kernel (~2MB, with a lot of drivers..). As answer to your point 1 in the previous thread, maybe it is really worth to enable cache to speed up the loading part respecting enabling DMA. Adding DMA means adding DMA support in each specific driver (NAND vs MMC vs..), while with d-cache we have a solution working independenlty from the supported media. But it makes sense to have a large number of boards supporting direct booting before making some wrong assumptions ;-)

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
=====================================================================

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

#194 lore raw

PATCH v12 8/14 Add cache functions to SPL for armv7

Quoted 2 lines · Simon Schwarz

Hi Stefano,

Hi Simon,

Quoted 2 lines

Just FYI: I already did this with DMA - the patch was rejected and I haven't worked on it since (as you already said it is some work...).

Yes, of course - it makes sense to find a solution that will be accepted before implementing it - this is the reason I prepared a way to enable caches, but I have not yet done and I will not do if this solution will be rejected.

Quoted 2 lines

It
was really speeding up the copy process.

I am sure it is a big improvement...

Quoted 6 lines

I have some meassurments on
this and it would be really interesting to compare them with the d-cache solution.

If you are interested I can send you my data - so you can compare it when you have d-cache ready.

Ok, understood. Let's see if we can merge soon the patchset into mainline - that opens also the possibility to add further SOCs, not only TI. And then we can proceed optimizing with DMA or d-cache.

Best regards,
Stefano

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
=====================================================================
#195 lore raw

PATCH v12 9/14 OMAP3: SPL: do not call I2C init if no I2C is set.

In reply to Stefano Babic

Call i2c initialization in spl_board_init only if I2C is configured for the board.

CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>

---

V12:
- use CONFIG_SPL_I2C_SUPPORT to protect I2C code

 arch/arm/cpu/armv7/omap3/board.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/omap3/board.c +2 -0
index 1f33c63..1f6a3e9 100644
@@ -92,7 +92,9 @@ u32 omap_boot_device(void)
 
 void spl_board_init(void)
 {
+#ifdef CONFIG_SPL_I2C_SUPPORT
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
 }
 #endif /* CONFIG_SPL_BUILD */
 
Signature · 1 line
1.7.5.4
#196 lore raw

PATCH v12 10/14 OMAP3: move SPL files to be used by other architectures.

In reply to Stefano Babic

The SPL used on OMAPx can be reused by other SOCs from different architectures. Move common files into common/ directory.

CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>

---

V12: no changes

 arch/arm/cpu/armv7/omap-common/Makefile            |   10 ----------
 common/Makefile                                    |    4 ++++
 {arch/arm/cpu/armv7/omap-common => common}/spl.c   |    0
 .../arm/cpu/armv7/omap-common => common}/spl_mmc.c |    0
 .../cpu/armv7/omap-common => common}/spl_nand.c    |    0
 5 files changed, 4 insertions(+), 10 deletions(-)
 rename {arch/arm/cpu/armv7/omap-common => common}/spl.c (100%)
 rename {arch/arm/cpu/armv7/omap-common => common}/spl_mmc.c (100%)
 rename {arch/arm/cpu/armv7/omap-common => common}/spl_nand.c (100%)
arch/arm/cpu/armv7/omap-common/Makefile +0 -10
index a684611..e65e992 100644
@@ -40,16 +40,6 @@ COBJS	+= emif-common.o
 SOBJS	+= lowlevel_init.o
 endif
 
-ifdef CONFIG_SPL_BUILD
-COBJS	+= spl.o
-ifdef CONFIG_SPL_NAND_SUPPORT
-COBJS	+= spl_nand.o
-endif
-ifdef CONFIG_SPL_MMC_SUPPORT
-COBJS	+= spl_mmc.o
-endif
-endif
-
 ifndef CONFIG_SPL_BUILD
 ifneq ($(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 COBJS	+= mem-common.o
common/Makefile +4 -0
index 91f3f2e..41b67ca 100644
@@ -186,6 +186,10 @@ COBJS-$(CONFIG_MENU) += menu.o
 COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+else
+COBJS-y += spl.o
+COBJS-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o
+COBJS-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
 endif
 
 COBJS-y += console.o
common/spl.c renamed from arch/arm/cpu/armv7/omap-common/spl.c +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/omap-common/spl.c
rename to common/spl.c
common/spl_mmc.c renamed from arch/arm/cpu/armv7/omap-common/spl_mmc.c +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/omap-common/spl_mmc.c
rename to common/spl_mmc.c
common/spl_nand.c renamed from arch/arm/cpu/armv7/omap-common/spl_nand.c +0 -0
similarity index 100%
rename from arch/arm/cpu/armv7/omap-common/spl_nand.c
rename to common/spl_nand.c
Signature · 1 line
1.7.5.4
#197 lore raw

PATCH v12 11/14 TI: SPL: make SPL available for other SOCs as TI

In reply to Stefano Babic

The SPL is developped first for TI-OMAPx. The patch move OMAP specific function into OMAP directory.

CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>

---

V12: replace tab with space defining MMCSD_MODE_UNDEFINED

 arch/arm/cpu/armv7/omap-common/Makefile   |    2 +
 arch/arm/cpu/armv7/omap-common/spl_omap.c |   71 +++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/omap3/board.c          |    4 ++
 arch/arm/include/asm/omap_common.h        |   34 --------------
 common/spl.c                              |    1 +
 common/spl_mmc.c                          |   21 ++-------
 common/spl_nand.c                         |   14 +-----
 include/spl.h                             |   68 +++++++++++++++++++++++++++
 8 files changed, 153 insertions(+), 62 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl_omap.c
 create mode 100644 include/spl.h
arch/arm/cpu/armv7/omap-common/Makefile +2 -0
index e65e992..6fb544c 100644
@@ -44,6 +44,8 @@ ifndef CONFIG_SPL_BUILD
 ifneq ($(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 COBJS	+= mem-common.o
 endif
+else
+COBJS	+= spl_omap.o
 endif
 
 SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
arch/arm/cpu/armv7/omap-common/spl_omap.c new file +71 -0

71 lines not on this page · raw message

arch/arm/cpu/armv7/omap3/board.c +4 -0
index 1f6a3e9..11a6caa 100644
@@ -42,6 +42,10 @@
 #include <asm/omap_common.h>
 #include <i2c.h>
 
+#ifdef CONFIG_SPL_BUILD
+#include <spl.h>
+#endif
+
 /* Declarations */
 extern omap3_sysinfo sysinfo;
 static void omap3_setup_aux_cr(void);
arch/arm/include/asm/omap_common.h +0 -34
index 8a7d1e5..e46e612 100644
@@ -64,43 +64,9 @@ void preloader_console_init(void);
 #define BOOT_DEVICE_XIPWAIT	7
 #endif
 
-/* Boot type */
-#define	MMCSD_MODE_UNDEFINED	0
-#define MMCSD_MODE_RAW		1
-#define MMCSD_MODE_FAT		2
-#define NAND_MODE_HW_ECC	3
-
-struct spl_image_info {
-	const char *name;
-	u8 os;
-	u32 load_addr;
-	u32 entry_point;
-	u32 size;
-};
-
-extern struct spl_image_info spl_image;
-
-extern u32* boot_params_ptr;
 u32 omap_boot_device(void);
 u32 omap_boot_mode(void);
 
-/* SPL common function s*/
-void spl_parse_image_header(const struct image_header *header);
-void omap_rev_string(char *omap_rev_string);
-int spl_uboot_key(void);
-void spl_board_prepare_for_linux(void);
-int spl_start_uboot(void);
-
-/* NAND SPL functions */
-void spl_nand_load_image(void);
-
-/* MMC SPL functions */
-void spl_mmc_load_image(void);
-
-#ifdef CONFIG_SPL_BOARD_INIT
-void spl_board_init(void);
-#endif
-
 /*
  * silicon revisions.
  * Moving this to common, so that most of code can be moved to common,
common/spl.c +1 -0
index 1671a03..5fdf3fb 100644
@@ -30,6 +30,7 @@
 #include <mmc.h>
 #include <fat.h>
 #include <version.h>
+#include <spl.h>
 #include <asm/omap_common.h>
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
common/spl_mmc.c +4 -17
index 6f5b43e..9c0086c 100644
@@ -29,25 +29,12 @@
 #include <mmc.h>
 #include <fat.h>
 #include <version.h>
-#include <asm/omap_common.h>
-#include <asm/arch/mmc_host_def.h>
+#include <spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
-{
-	switch (omap_boot_device()) {
-	case BOOT_DEVICE_MMC1:
-		omap_mmc_init(0);
-		break;
-	case BOOT_DEVICE_MMC2:
-		omap_mmc_init(1);
-		break;
-	}
-	return 0;
-}
-#endif
+/* Define the sector size, this is usually 512 bytes */
+#define MMCSD_SECTOR_SIZE	512
 
 static void mmc_load_image_raw(struct mmc *mmc)
 {
@@ -135,7 +122,7 @@ void spl_mmc_load_image(void)
 		printf("spl: mmc init failed: err - %d\n", err);
 		hang();
 	}
-	boot_mode = omap_boot_mode();
+	boot_mode = spl_boot_mode();
 	if (boot_mode == MMCSD_MODE_RAW) {
 		debug("boot mode - RAW\n");
 		mmc_load_image_raw(mmc);
common/spl_nand.c +3 -11
index 1295e88..1adaf03 100644
@@ -27,7 +27,7 @@
 #include <asm/io.h>
 #include <nand.h>
 #include <version.h>
-#include <asm/omap_common.h>
+#include <spl.h>
 
 void spl_nand_load_image(void)
 {
@@ -35,16 +35,8 @@ void spl_nand_load_image(void)
 	int *src __attribute__((unused));
 	int *dst __attribute__((unused));
 
-	switch (omap_boot_mode()) {
-	case NAND_MODE_HW_ECC:
-		debug("spl: nand - using hw ecc\n");
-		gpmc_init();
-		nand_init();
-		break;
-	default:
-		puts("spl: ERROR: This bootmode is not implemented - hanging");
-		hang();
-	}
+	/* Call the architecture NAND init function */
+	spl_arch_nand_init();
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
include/spl.h new file +68 -0

68 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#198 lore raw

PATCH v12 12/14 SPL: call cleanup_before_linux() before booting Linux

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 common/spl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
common/spl.c +1 -1
index 5fdf3fb..cf5395e 100644
@@ -125,7 +125,7 @@ __noreturn void jump_to_image_linux(void *arg)
 		__attribute__ ((noreturn));
 	image_entry_arg_t image_entry =
 		(image_entry_arg_t) spl_image.entry_point;
-	/* cleanup_before_linux(); */ /*write SPL function for that*/
+	cleanup_before_linux();
 	image_entry(0, CONFIG_MACH_TYPE, arg);
 }
 #endif
Signature · 1 line
1.7.5.4
#199 lore raw

PATCH v12 13/14 Fix build OMAP4/5

In reply to Stefano Babic
---
 arch/arm/cpu/armv7/omap-common/hwinit-common.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/omap-common/hwinit-common.c +1 -0
index f65705d..4040d02 100644
@@ -32,6 +32,7 @@
 #include <asm/sizes.h>
 #include <asm/emif.h>
 #include <asm/omap_common.h>
+#include <spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
Signature · 1 line
1.7.5.4
#200 lore raw

PATCH v12 14/14 OMAP3: twister: add support to boot Linux from SPL

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>

---

V12:
- change GPIO to select U-Boot als image

 board/technexion/twister/twister.c |   23 +++++++++++++++++++++++
 include/configs/twister.h          |   12 ++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)
board/technexion/twister/twister.c +23 -0
index 950e76c..fc88301 100644
@@ -114,3 +114,26 @@ int board_mmc_init(bd_t *bis)
 	return omap_mmc_init(0);
 }
 #endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	/* init cs for extern lan */
+	enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
+		CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
+}
+int spl_start_uboot(void)
+{
+	int val = 0;
+	if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+		gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+		val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+		gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+	}
+	return !val;
+}
+#endif
include/configs/twister.h +12 -0
index 64a886d..a852481 100644
@@ -51,4 +51,16 @@
 #define	CONFIG_EXTRA_ENV_SETTINGS	CONFIG_TAM3517_SETTINGS \
 	"bootcmd=run nandboot\0"
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE	0x400 /* 1024 byte */
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000
+#define CONFIG_CMD_SPL_NAND_OFS	(CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+						0x600000)
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY	55
+
+#define CONFIG_SYS_SPL_ARGS_ADDR	(PHYS_SDRAM_1 + 0x100)
+#define CONFIG_SPL_BOARD_INIT
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#201 lore raw

PATCH v12 15/15 SPL: wrong prototype for omap_rev_string

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>

---

After rebasing V12, I see that prototype for omap_rev_string() was changed ==> fixed

 include/spl.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/spl.h +1 -1
index 6ea3823..d060826 100644
@@ -47,7 +47,7 @@ extern u32 *boot_params_ptr;
 
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
-void omap_rev_string(char *omap_rev_string);
+void omap_rev_string(void);
 int spl_uboot_key(void);
 void spl_board_prepare_for_linux(void);
 int spl_start_uboot(void);
Signature · 1 line
1.7.5.4
#202 lore raw

[U-Boot] SPL Linux Boot V13

In reply to Stefano Babic

Rebased patchset to add Linux booting from SPL. As discussed in the ML, this patchset does not make SPL common to all SOCs to avoid breaking some architecture - this job will be done later with a different patchset.

For this reason, a couple of patches moving files in the common/ directory are dropped - the other patches are not changed from V12.
(exception due only to rebase on current u-boot-ti)

#203 lore raw

PATCH v13 1/12 Add cmd_spl command

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 common/Makefile         |    1 +
 common/cmd_spl.c        |  229 +++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.commands.spl |   31 +++++++
 include/cmd_spl.h       |   30 ++++++
 include/image.h         |    2 +
 5 files changed, 293 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_spl.c
 create mode 100644 doc/README.commands.spl
 create mode 100644 include/cmd_spl.h
common/Makefile +1 -0
index 2d9ae8c..910c056 100644
@@ -162,6 +162,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
 
 # others
 ifdef CONFIG_DDR_SPD
common/cmd_spl.c new file +229 -0

229 lines not on this page · raw message

doc/README.commands.spl new file +31 -0
new file mode 100644
index 0000000..818dd53
@@ -0,0 +1,31 @@
+The spl command is used to export a boot parameter image to RAM. Later
+it may implement more functions connected to the SPL.
+
+SUBCOMMAND EXPORT
+To execute the command everything has to be in place as if bootm should be
+used. (kernel image, initrd-image, fdt-image etc.)
+
+export has to subcommands:
+	atags: exports the ATAGS
+	fdt: exports the FDT
+
+Call is:
+spl export <ftd|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
+
+
+TYPICAL CALL
+
+on OMAP3:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+spl export atags 			/* export ATAGS */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
+
+call with FDT:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+spl export fdt 0x82000000 - 0x80000100	/* export FDT */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write <adress shown by spl export> 0x680000 0x20000
include/cmd_spl.h new file +30 -0
new file mode 100644
index 0000000..2845367
@@ -0,0 +1,30 @@
+/* Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <[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
+ */
+#ifndef _NAND_SPL_H_
+#define	_NAND_SPL_H_
+
+#define SPL_EXPORT	(0x00000001)
+
+#define SPL_EXPORT_FDT		(0x00000001)
+#define SPL_EXPORT_ATAGS	(0x00000002)
+
+#endif /* _NAND_SPL_H_ */
include/image.h +2 -0
index bbf80f0..a1c6e4e 100644
@@ -268,6 +268,8 @@ typedef struct bootm_headers {
 #endif
 } bootm_headers_t;
 
+extern bootm_headers_t images;
+
 /*
  * Some systems (for example LWMON) have very short watchdog periods;
  * we must make sure to split long operations like memmove() or
Signature · 1 line
1.7.5.4
#204 lore raw

PATCH v13 1/12 Add cmd_spl command

Quoted 20 lines · Stefano Babic

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
? ? ? ?activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
? ? ? ?Offset in NAND to use

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---

?common/Makefile ? ? ? ? | ? ?1 +
?common/cmd_spl.c ? ? ? ?| ?229 +++++++++++++++++++++++++++++++++++++++++++++++
?doc/README.commands.spl | ? 31 +++++++
?include/cmd_spl.h ? ? ? | ? 30 ++++++
?include/image.h ? ? ? ? | ? ?2 +
Quoted 4 lines

?5 files changed, 293 insertions(+), 0 deletions(-) ?create mode 100644 common/cmd_spl.c ?create mode 100644 doc/README.commands.spl ?create mode 100644 include/cmd_spl.h

The include/image.h part seems unnecessary and breaks cam_enc_4xx so I've dropped that from my tree.

Signature · 1 line
Tom
#205 lore raw

PATCH v13 1/12 Add cmd_spl command

Quoted 26 lines · Tom Rini
Quoted 20 lines · Stefano Babic

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
? ? ? ?activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
? ? ? ?Offset in NAND to use

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---

?common/Makefile ? ? ? ? | ? ?1 +
?common/cmd_spl.c ? ? ? ?| ?229 +++++++++++++++++++++++++++++++++++++++++++++++
?doc/README.commands.spl | ? 31 +++++++
?include/cmd_spl.h ? ? ? | ? 30 ++++++
?include/image.h ? ? ? ? | ? ?2 +
Quoted 4 lines

?5 files changed, 293 insertions(+), 0 deletions(-) ?create mode 100644 common/cmd_spl.c ?create mode 100644 doc/README.commands.spl ?create mode 100644 include/cmd_spl.h

Quoted 2 lines

The include/image.h part seems unnecessary and breaks cam_enc_4xx so I've dropped that from my tree.

Whoops, spoke too soon, I'll resolve the cam_enc_4xx conflict and rename one of the variables.

Signature · 1 line
Tom
#206 lore raw

PATCH v13 1/12 Add cmd_spl command

Quoted 27 lines · Tom Rini
Quoted 26 lines · Tom Rini
Quoted 24 lines · Stefano Babic

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
? ? ? ?activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
? ? ? ?Offset in NAND to use

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>

---

?common/Makefile ? ? ? ? | ? ?1 +
?common/cmd_spl.c ? ? ? ?| ?229 +++++++++++++++++++++++++++++++++++++++++++++++
?doc/README.commands.spl | ? 31 +++++++
?include/cmd_spl.h ? ? ? | ? 30 ++++++
?include/image.h ? ? ? ? | ? ?2 +

?5 files changed, 293 insertions(+), 0 deletions(-) ?create mode 100644 common/cmd_spl.c ?create mode 100644 doc/README.commands.spl ?create mode 100644 include/cmd_spl.h

Quoted 5 lines
Quoted 2 lines

The include/image.h part seems unnecessary and breaks cam_enc_4xx so I've dropped that from my tree.

Whoops, spoke too soon, I'll resolve the cam_enc_4xx conflict and rename one of the variables.

I've gone with renaming the cam_enc_4xx variable to 'imgs' and will post the patch shortly. Heiko, if the rename is OK with you can you Ack it so I can push the Linux SPL series soon? Thanks!

Signature · 1 line
Tom
#207 lore raw

PATCH v13 1/12 Add cmd_spl command

Hello Tom,

Quoted 27 lines · Tom Rini
Quoted 26 lines · Tom Rini
Quoted 25 lines · Tom Rini
Quoted 24 lines · Stefano Babic

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 common/Makefile         |    1 +
 common/cmd_spl.c        |  229 +++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.commands.spl |   31 +++++++
 include/cmd_spl.h       |   30 ++++++
 include/image.h         |    2 +
 5 files changed, 293 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_spl.c
 create mode 100644 doc/README.commands.spl
 create mode 100644 include/cmd_spl.h
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

The include/image.h part seems unnecessary and breaks cam_enc_4xx so I've dropped that from my tree.

Whoops, spoke too soon, I'll resolve the cam_enc_4xx conflict and rename one of the variables.

I've gone with renaming the cam_enc_4xx variable to 'imgs' and will post the patch shortly. Heiko, if the rename is OK with you can you Ack it so I can push the Linux SPL series soon? Thanks!

Done. Thanks for the fix!

bye,
Heiko

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

PATCH v13 1/12 Add cmd_spl command

In reply to Stefano Babic

Dear Stefano Babic,

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

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command

CONFIG_CMD_CPL??? Is this a typo, and you mean CONFIG_CMD_SPL ?

Quoted 2 lines

CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

What about other storage devices?

...

Quoted 5 lines
common/cmd_spl.c new file +5 -0
+/* Calls bootm with the parameters given */
+static int call_bootm(int argc, char * const argv[], char *subcommand[])
+{
+	char *bootm_argv[5];
+	char command[] = "do_bootm";

...

Quoted 1 line

+}

Why is this needed? Why don't you run do_bootm() directly?

Quoted 2 lines
(quoted diff) +2 -0
+static int spl_export_fdt(int argc, char * const argv[])
+{

...

Quoted 18 lines
common/cmd_spl.c new file +18 -0
+	/* inspect paramters and execute bootm */
+	argc--;
+	argv++;
+	if (call_bootm(argc, argv, subcommand))
+		return -1;
+
+	printf("Argument image is now in RAM: 0x%p\n",
+		(void *)images.ft_addr);
+	return 0;
+#else
+	printf("Das U-Boot was build without fdt support - aborting\n");
+	return -1;
+#endif
+}
+
+/* assemble the bootm patameters for atags creation */
+static int spl_export_atags(int argc, char * const argv[])
+{

...

common/cmd_spl.c line 139

Quoted 13 lines
common/cmd_spl.c new file +13 -0
+	/* inspect parameters and execute bootm */
+	argc--;
+	argv++;
+	if (call_bootm(argc, argv, subcommand))
+		return -1;
+
+	printf("Argument image is now in RAM at: 0x%p\n",
+		(void *)gd->bd->bi_boot_params);
+	return 0;
+#endif
+	printf("Das U-Boot was build without ATAGS support - aborting\n");
+	return -1;
+}

This is basicly identical code, only the data structures differ.

Please use a common function, and pass (a pointer to) the data as argument.

Quoted 4 lines
common/cmd_spl.c new file +4 -0
+	if (c) {
+		cmd = (int)c->cmd;
+		switch (cmd) {
+		case SPL_EXPORT_FDT:

common/cmd_spl.c line 169

Quoted 10 lines
common/cmd_spl.c new file +10 -0
+			argc--;
+			argv++;
+			return spl_export_fdt(argc, argv);
+			break;
+		case SPL_EXPORT_ATAGS:
+			argc--;
+			argv++;
+			return spl_export_atags(argc, argv);
+			break;
+		default:

This will also eliminate this switch() - you just have to set the pointer to the respective data to pass.

Quoted 9 lines

+/*
+ * Arguments:
+ * 1: subcommand
+ * 2: image_type
+ * 3: nand_offset
+ * 4: kernel_addr
+ * 5: initrd_addr
+ * 6: fdt_adr
+ */

I think it is broken to restrict this by design to NAND booting only.

This is a command that attemtps to deal with SPL booting in general, so it should support all possible kinds of boot media - NOR, NAND, MMC, SPI flash, USB, ...

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
That said, there may be good reasons for what you did beyond obsequi-
ous sycophantic parody. Perhaps you might be so kind as to elucidate.
         -- Tom Christiansen in <[email protected]>
#209 lore raw

PATCH v13 1/12 Add cmd_spl command

Quoted 5 lines · Wolfgang Denk

Dear Stefano Babic,

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

From: Simon Schwarz <[email protected]>

Quoted 7 lines
Quoted 5 lines

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command

CONFIG_CMD_CPL??? Is this a typo, and you mean CONFIG_CMD_SPL ?

Yes, this a type - must be fixed.

Quoted 5 lines
Quoted 3 lines

CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

What about other storage devices?

Booting from other storage devices is not yet implemented, but it is surely desired. I can imagine that after this patchset will flow into mainline, there will be more use cases, and further storages will be added.

At the moment, only NAND is implemented and for this reason only CONFIG_CMD_SPL_NAND_OFS is defined. This leaves the possibility to have different offsets from different boot devices for the kernel parameter area.

Quoted 11 lines

...

Quoted 5 lines
common/cmd_spl.c new file +5 -0
+/* Calls bootm with the parameters given */
+static int call_bootm(int argc, char * const argv[], char *subcommand[])
+{
+	char *bootm_argv[5];
+	char command[] = "do_bootm";

...

Quoted 1 line

+}

Why is this needed? Why don't you run do_bootm() directly?

Mmmhh... At least using find_cmd("do_bootm") in do_bootm should be not required,
if this is what you mind.

Quoted 38 lines
Quoted 2 lines
(quoted diff) +2 -0
+static int spl_export_fdt(int argc, char * const argv[])
+{

...

Quoted 18 lines
common/cmd_spl.c new file +18 -0
+	/* inspect paramters and execute bootm */
+	argc--;
+	argv++;
+	if (call_bootm(argc, argv, subcommand))
+		return -1;
+
+	printf("Argument image is now in RAM: 0x%p\n",
+		(void *)images.ft_addr);
+	return 0;
+#else
+	printf("Das U-Boot was build without fdt support - aborting\n");
+	return -1;
+#endif
+}
+
+/* assemble the bootm patameters for atags creation */
+static int spl_export_atags(int argc, char * const argv[])
+{

...

common/cmd_spl.c line 139

Quoted 13 lines
common/cmd_spl.c new file +13 -0
+	/* inspect parameters and execute bootm */
+	argc--;
+	argv++;
+	if (call_bootm(argc, argv, subcommand))
+		return -1;
+
+	printf("Argument image is now in RAM at: 0x%p\n",
+		(void *)gd->bd->bi_boot_params);
+	return 0;
+#endif
+	printf("Das U-Boot was build without ATAGS support - aborting\n");
+	return -1;
+}

This is basicly identical code, only the data structures differ.

Quoted 2 lines

Please use a common function, and pass (a pointer to) the data as argument.

Clear, thanks, I'll fix it.

Quoted 10 lines
Quoted 10 lines
common/cmd_spl.c new file +9 -0
+	if (c) {
+		cmd = (int)c->cmd;
+		switch (cmd) {
+		case SPL_EXPORT_FDT:
+			argc--;
+			argv++;
+			return spl_export_fdt(argc, argv);
+			break;
+		case SPL_EXPORT_ATAGS:
Quoted 8 lines

common/cmd_spl.c line 169

Quoted 5 lines
common/cmd_spl.c new file +5 -0
+			argc--;
+			argv++;
+			return spl_export_atags(argc, argv);
+			break;
+		default:

This will also eliminate this switch() - you just have to set the pointer to the respective data to pass.

You're right !

Quoted 11 lines
Quoted 10 lines

+/*
+ * Arguments:
+ * 1: subcommand
+ * 2: image_type
+ * 3: nand_offset
+ * 4: kernel_addr
+ * 5: initrd_addr
+ * 6: fdt_adr
+ */

Quoted 1 line

I think it is broken to restrict this by design to NAND booting only.

It is not. The comment is wrong and does not correspond to the implemented command. The result of spl export is not written automatically to storage, and this let the possibility to write it into the correct storage device.

"spl export <img=atags|fdt> [kernel_addr] [initrd_addr] "

nand_offset is something obsolete - and the whole comment does not add more info as we can read after the U_BOOT_CMD. I will drop it.

Quoted 4 lines

This is a command that attemtps to deal with SPL booting in general, so it should support all possible kinds of boot media - NOR, NAND, MMC, SPI flash, USB, ...

Right. However, this restriction is not in this patch (apart the wrong comment). I think the command is already general and not limited to a storage device. But there is this limitation in another patch.

The restriction about storage media is in board_init_r(), in [PATCH V13 03/12] omap-common: Add NAND SPL linux booting. Maybe you can take a look.

Here the selection if booting the kernel or u-boot is taken inside spl_nand_load_image(). So at this point we have already decided which is the storage media, and this function starts the kernel. So maybe we should also rename it to a general name, such as spl_load_image().

Really this function has not a lot to do to do with NAND, except the fact it calls nand_spl_load_image() to copy from NAND to RAM. Your comment applies very well to this function. It should be made more general, maybe adding function pointers that must be called after selecting the right device, something like:

	device_media->load_image(addr, size);

where device_media->load_image points to the specific devic media function to copy an image, for NAND it is nand_spl_load_image.

What do you think about ?

We have already discussed how we can proceed with this feature and how to merge it into mainline. Maybe it is worth to spend again a couple of words. The other main restriction is the fact that this feature is OMAP-only, and not so general as it should be. Not only, also the SPL framework runs mainly on TI SOCs, and it is really a pity. Most of part that are now hidden in omap-common/ can be generalized for the other SOCs, and duplication can be avoided. IMHO there is already some code that can be factorized between OMAp and Davinci.

Because there is a high probability to break other boards (I have already posted patches in this direction, but I broke davinci), we decided to make several steps. Firstly pushing this feature, then making SPL common - I will add now also making booting from SPL device-independent.

My question is if we proceed with several steps, or we want to push only a complete version. Any thought about this ?

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
=====================================================================
#210 lore raw

PATCH v13 1/12 Add cmd_spl command

In reply to Stefano Babic
Quoted 278 lines · Stefano Babic

From: Simon Schwarz<[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_CPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

CC Tom Rini<[email protected]>
CC Stefano Babic<[email protected]>
CC Wolfgang Denk<[email protected]>
---
  common/Makefile         |    1 +
  common/cmd_spl.c        |  229 +++++++++++++++++++++++++++++++++++++++++++++++
  doc/README.commands.spl |   31 +++++++
  include/cmd_spl.h       |   30 ++++++
  include/image.h         |    2 +
  5 files changed, 293 insertions(+), 0 deletions(-)

create mode 100644 common/cmd_spl.c
create mode 100644 doc/README.commands.spl
create mode 100644 include/cmd_spl.h

common/Makefile +1 -0
index 2d9ae8c..910c056 100644
@@ -162,6 +162,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
  endif
  COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
  COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
 
  # others
  ifdef CONFIG_DDR_SPD
common/cmd_spl.c new file +229 -0
new file mode 100644
index 0000000..deab8e9
@@ -0,0 +1,229 @@
+/*
+ * Copyright (C) 2011
+ * Corscience GmbH&  Co. KG - Simon Schwarz<[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
+ */
+
+#include<common.h>
+#include<command.h>
+#include<cmd_spl.h>
+
+DECLARE_GLOBAL_DATA_PTR;
+
+/* Calls bootm with the parameters given */
+static int call_bootm(int argc, char * const argv[], char *subcommand[])
+{
+	char *bootm_argv[5];
+	char command[] = "do_bootm";
+
+	int i = 0;
+	int ret = 0;
+
+	/* create paramter array */
+	bootm_argv[0] = command;
+	switch (argc) {
+	case 3:
+		bootm_argv[4] = argv[2]; /* fdt addr */
+	case 2:
+		bootm_argv[3] = argv[1]; /* initrd addr */
+	case 1:
+		bootm_argv[2] = argv[0]; /* kernel addr */
+	}
+
+
+	/*
+	 * - do the work -
+	 * exec subcommands of do_bootm to init the images
+	 * data structure
+	 */
+	while (subcommand[i] != NULL) {
+		bootm_argv[1] = subcommand[i];
+		debug("args: %s, %s, %s, %s, %s, %d\n", bootm_argv[0],
+			bootm_argv[1], bootm_argv[2], bootm_argv[3],
+			bootm_argv[4], argc);
+		ret = do_bootm(find_cmd("do_bootm"), 0, argc+2,
+			bootm_argv);
+		debug("Subcommand retcode: %d\n", ret);
+		i++;
+	}
+
+	if (ret) {
+		printf("ERROR prep subcommand failed!\n");
+		return -1;
+	}
+
+	return 0;
+}
+
+/* assemble the bootm paramteres for fdt creation */
+static int spl_export_fdt(int argc, char * const argv[])
+{
+#ifdef CONFIG_OF_LIBFDT
+	/* Create subcommand string */
+	char *subcommand[] = {
+	"start",
+	"loados",
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+	"ramdisk",
+#endif
+	"fdt",
+	"cmdline",
+	"bdt",
+	"prep",
+	NULL};
+
+	/* inspect paramters and execute bootm */
+	argc--;
+	argv++;
+	if (call_bootm(argc, argv, subcommand))
+		return -1;
+
+	printf("Argument image is now in RAM: 0x%p\n",
+		(void *)images.ft_addr);
+	return 0;
+#else
+	printf("Das U-Boot was build without fdt support - aborting\n");
+	return -1;
+#endif
+}
+
+/* assemble the bootm patameters for atags creation */
+static int spl_export_atags(int argc, char * const argv[])
+{
+#if defined(CONFIG_SETUP_MEMORY_TAGS) || \
+	defined(CONFIG_CMDLINE_TAG) || \
+	defined(CONFIG_INITRD_TAG) || \
+	defined(CONFIG_SERIAL_TAG) || \
+	defined(CONFIG_REVISION_TAG)
+	/* Create subcommand string */
+	char *subcommand[] = {
+		"start",
+		"loados",
+#ifdef CONFIG_SYS_BOOT_RAMDISK_HIGH
+		"ramdisk",
+#endif
+		"cmdline",
+		"bdt",
+		"prep",
+		NULL};
+
+	/* inspect parameters and execute bootm */
+	argc--;
+	argv++;
+	if (call_bootm(argc, argv, subcommand))
+		return -1;
+
+	printf("Argument image is now in RAM at: 0x%p\n",
+		(void *)gd->bd->bi_boot_params);
+	return 0;
+#endif
+	printf("Das U-Boot was build without ATAGS support - aborting\n");
+	return -1;
+}
+
+static cmd_tbl_t cmd_spl_export_sub[] = {
+	U_BOOT_CMD_MKENT(fdt, 0, 1, (void *)SPL_EXPORT_FDT, "", ""),
+	U_BOOT_CMD_MKENT(atags, 0, 1, (void *)SPL_EXPORT_ATAGS, "", ""),
+};
+
+static int spl_export(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	const cmd_tbl_t *c;
+	int cmd;
+
+	if (argc<  2) /* no subcommand */
+		return cmd_usage(cmdtp);
+
+	c = find_cmd_tbl(argv[1],&cmd_spl_export_sub[0],
+		ARRAY_SIZE(cmd_spl_export_sub));
+	if (c) {
+		cmd = (int)c->cmd;
+		switch (cmd) {
+		case SPL_EXPORT_FDT:
+			argc--;
+			argv++;
+			return spl_export_fdt(argc, argv);
+			break;
+		case SPL_EXPORT_ATAGS:
+			argc--;
+			argv++;
+			return spl_export_atags(argc, argv);
+			break;
+		default:
+			/* unrecognized command */
+			return cmd_usage(cmdtp);
+		}
+	} else {
+		/* Unrecognized command */
+		return cmd_usage(cmdtp);
+	}
+
+	return 0;
+}
+
+static cmd_tbl_t cmd_spl_sub[] = {
+	U_BOOT_CMD_MKENT(export, 0, 1, (void *)SPL_EXPORT, "", ""),
+};
+
+static int do_spl(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+	const cmd_tbl_t *c;
+	int cmd;
+
+	if (argc<  2) /* no subcommand */
+		return cmd_usage(cmdtp);
+
+	c = find_cmd_tbl(argv[1],&cmd_spl_sub[0], ARRAY_SIZE(cmd_spl_sub));
+	if (c) {
+		cmd = (int)c->cmd;
+		switch (cmd) {
+		case SPL_EXPORT:
+			argc--;
+			argv++;
+			if (spl_export(cmdtp, flag, argc, argv))
+				printf("Subcommand failed\n");
+			break;
+		default:
+			/* unrecognized command */
+			return cmd_usage(cmdtp);
+		}
+	} else {
+		/* Unrecognized command */
+		return cmd_usage(cmdtp);
+	}
+	return 0;
+}
+
+/*
+ * Arguments:
+ * 1: subcommand
+ * 2: image_type
+ * 3: nand_offset
+ * 4: kernel_addr
+ * 5: initrd_addr
+ * 6: fdt_adr
+ */
+
+U_BOOT_CMD(
+	spl, 6 , 1, do_spl, "SPL configuration",
+	"export<img=atags|fdt>  [kernel_addr] [initrd_addr] "
+	"[fdt_addr if<img>  = fdt] - export a kernel parameter image\n"
+	"\t initrd_img can be set to \"-\" if fdt_addr without initrd img is"
+	"used");
doc/README.commands.spl new file +0 -0
new file mode 100644
index 0000000..818dd53

doc/README.commands.spl line 8

Quoted 8 lines
doc/README.commands.spl new file +8 -0
@@ -0,0 +1,31 @@
+The spl command is used to export a boot parameter image to RAM. Later
+it may implement more functions connected to the SPL.
+
+SUBCOMMAND EXPORT
+To execute the command everything has to be in place as if bootm should be
+used. (kernel image, initrd-image, fdt-image etc.)
+
+export has to subcommands:

two subcommands:

Quoted 72 lines
doc/README.commands.spl new file +23 -0
+	atags: exports the ATAGS
+	fdt: exports the FDT
+
+Call is:
+spl export<ftd|atags>  [kernel_addr] [initrd_addr] [fdt_addr if fdt]
+
+
+TYPICAL CALL
+
+on OMAP3:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+spl export atags 			/* export ATAGS */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
+
+call with FDT:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+spl export fdt 0x82000000 - 0x80000100	/* export FDT */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write<adress shown by spl export>  0x680000 0x20000
include/cmd_spl.h new file +30 -0
new file mode 100644
index 0000000..2845367
@@ -0,0 +1,30 @@
+/* Copyright (C) 2011
+ * Corscience GmbH&  Co. KG - Simon Schwarz<[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
+ */
+#ifndef _NAND_SPL_H_
+#define	_NAND_SPL_H_
+
+#define SPL_EXPORT	(0x00000001)
+
+#define SPL_EXPORT_FDT		(0x00000001)
+#define SPL_EXPORT_ATAGS	(0x00000002)
+
+#endif /* _NAND_SPL_H_ */
include/image.h +2 -0
index bbf80f0..a1c6e4e 100644
@@ -268,6 +268,8 @@ typedef struct bootm_headers {
  #endif
  } bootm_headers_t;
 
+extern bootm_headers_t images;
+
  /*
   * Some systems (for example LWMON) have very short watchdog periods;
   * we must make sure to split long operations like memmove() or
#211 lore raw

PATCH v13 2/12 devkit8000: add config for spl command

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds some configs for devkit8000 to use the new spl command

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 include/configs/devkit8000.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
include/configs/devkit8000.h +8 -0
index 758326b..d3ca0dd 100644
@@ -356,4 +356,12 @@
 #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
+#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+					0x400000)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#define CONFIG_SYS_SPL_ARGS_ADDR        (PHYS_SDRAM_1 + 0x100)
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#212 lore raw

PATCH v13 3/12 omap-common: Add NAND SPL linux booting

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This implements booting of Linux from NAND in SPL

Related config parameters:
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR

	Address where the kernel boot arguments are expected - this is
	normally RAM-start + 0x100 (on ARM)
CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   66 ++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 16 deletions(-)
arch/arm/cpu/armv7/omap-common/spl_nand.c +50 -16
index 38d06b1..2a66214 100644
@@ -24,6 +24,7 @@
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/io.h>
 #include <nand.h>
 #include <version.h>
 #include <asm/omap_common.h>
@@ -32,6 +33,9 @@
 void spl_nand_load_image(void)
 {
 	struct image_header *header;
+	int *src __attribute__((unused));
+	int *dst __attribute__((unused));
+
 	switch (omap_boot_mode()) {
 	case NAND_MODE_HW_ECC:
 		debug("spl: nand - using hw ecc\n");
@@ -45,26 +49,56 @@ void spl_nand_load_image(void)
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+#ifdef CONFIG_SPL_OS_BOOT
+	if (!spl_uboot_key()) {
+		/*
+		 * load parameter image
+		 * load to temp position since nand_spl_load_image reads
+		 * a whole block which is typically larger than
+		 * CONFIG_CMD_SAVEBP_WRITE_SIZE therefore may overwrite
+		 * following sections like BSS
+		 */
+		nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
+			CONFIG_CMD_SPL_WRITE_SIZE,
+			(void *)CONFIG_SYS_TEXT_BASE);
+		/* copy to destintion */
+		for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR,
+				src = (int *)CONFIG_SYS_TEXT_BASE;
+				src < (int *)(CONFIG_SYS_TEXT_BASE +
+				CONFIG_CMD_SPL_WRITE_SIZE);
+				src++, dst++) {
+			writel(readl(src), dst);
+		}
 
+		/* load linux */
+		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+			spl_image.size, (void *)spl_image.load_addr);
+	} else
+#endif
+	{
 #ifdef CONFIG_NAND_ENV_DST
-	nand_spl_load_image(CONFIG_ENV_OFFSET,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
-		(void *)image_load_addr);
+		nand_spl_load_image(CONFIG_ENV_OFFSET,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
+			(void *)spl_image.load_addr);
 #ifdef CONFIG_ENV_OFFSET_REDUND
-	nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
-		(void *)image_load_addr);
+		nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
+			(void *)spl_image.load_addr);
 #endif
 #endif
-	/* Load u-boot */
-	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		spl_image.size, (void *)spl_image.load_addr);
+		/* Load u-boot */
+		nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+			spl_image.size, (void *)spl_image.load_addr);
+	}
 	nand_deselect();
 }
Signature · 1 line
1.7.5.4
#213 lore raw

PATCH v13 4/12 devkit8000/spl: init GPMC for dm9000 in SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

Linux crashes if the GPMC isn't configured for the dm9000.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/include/asm/omap_common.h  |    2 ++
 board/timll/devkit8000/devkit8000.c |   19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 0 deletions(-)
arch/arm/include/asm/omap_common.h +2 -0
index 34bec45..92aa4f9 100644
@@ -92,6 +92,8 @@ u32 omap_boot_mode(void);
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(void);
+int spl_uboot_key(void);
+void spl_board_prepare_for_linux(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
board/timll/devkit8000/devkit8000.c +19 -0
index 10f189e..dded697 100644
@@ -73,6 +73,13 @@ int board_init(void)
 	return 0;
 }
 
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+	enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[6],
+		CONFIG_DM9000_BASE, GPMC_SIZE_16M);
+}
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -144,6 +151,18 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	gpmc_dm9000_config();
+}
+
+#endif
+
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
Signature · 1 line
1.7.5.4
#214 lore raw

PATCH v13 4/12 devkit8000/spl: init GPMC for dm9000 in SPL

Hello Stefano,

Quoted 18 lines · Stefano Babic

From: Simon Schwarz<[email protected]>

Linux crashes if the GPMC isn't configured for the dm9000.

CC Tom Rini<[email protected]>
CC Stefano Babic<[email protected]>
CC Wolfgang Denk<[email protected]>
---
  arch/arm/include/asm/omap_common.h  |    2 ++
  board/timll/devkit8000/devkit8000.c |   19 +++++++++++++++++++
  2 files changed, 21 insertions(+), 0 deletions(-)
arch/arm/include/asm/omap_common.h +0 -0
index 34bec45..92aa4f9 100644

arch/arm/include/asm/omap_common.h u32 omap_boot_mode(void); · line 95

Quoted 4 lines
arch/arm/include/asm/omap_common.h +1 -0
@@ -92,6 +92,8 @@ u32 omap_boot_mode(void);
  /* SPL common function s*/
  void spl_parse_image_header(const struct image_header *header);
  void omap_rev_string(void);
+int spl_uboot_key(void);

shouldn't this be spl_start_uboot ? The request if the key for starting u-boot is pressed?

Thomas

Quoted 41 lines
arch/arm/include/asm/omap_common.h +1 -0
+void spl_board_prepare_for_linux(void);
 
  /* NAND SPL functions */
  void spl_nand_load_image(void);
board/timll/devkit8000/devkit8000.c +19 -0
index 10f189e..dded697 100644
@@ -73,6 +73,13 @@ int board_init(void)
  	return 0;
  }
 
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+	enable_gpmc_cs_config(gpmc_net_config,&gpmc_cfg->cs[6],
+		CONFIG_DM9000_BASE, GPMC_SIZE_16M);
+}
+
  /*
   * Routine: misc_init_r
   * Description: Configure board specific parts
@@ -144,6 +151,18 @@ int board_eth_init(bd_t *bis)
  }
  #endif
 
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	gpmc_dm9000_config();
+}
+
+#endif
+
  /*
   * Routine: get_board_mem_timings
   * Description: If we use SPL then there is no x-loader nor config header
#215 lore raw

PATCH v13 4/12 devkit8000/spl: init GPMC for dm9000 in SPL

Quoted 1 line · Thomas Weber

Hello Stefano,

Hallo Thomas,

Quoted 3 lines
Quoted 1 line

+int spl_uboot_key(void);

shouldn't this be spl_start_uboot ? The request if the key for starting u-boot is pressed?

It is - the prototype for spl_uboot_key is obsolete, I remove it for the next version, thanks.

Stefano

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
=====================================================================
#216 lore raw

PATCH v13 5/12 omap-common/spl: Add linux boot to SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds Linux booting to the SPL

This depends on CONFIG_MACH_TYPE patch by Igor Grinberg
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)

Related CONFIGs:
CONFIG_SPL_OS_BOOT
Activates/Deactivates the OS booting feature
CONFIG_SPL_OS_BOOT_KEY
defines the IO-pin number u-boot switch - if pressed u-boot is booted
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR

	Address where the kernel boot arguments are expected - this is
	normaly RAM-begin + 0x100
CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl.c      |   48 +++++++++++++++++++++++++-
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   53 ++++++++++++++++------------
 arch/arm/include/asm/omap_common.h        |    1 +
 3 files changed, 77 insertions(+), 25 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +46 -2
index 9c1f7e3..f99c0e5 100644
@@ -65,6 +65,25 @@ void board_init_f(ulong dummy)
 	relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
 }
 
+/*
+ * Default function to determine if u-boot or the OS should
+ * be started. This implementation always returns 1.
+ *
+ * Please implement your own board specific funcion to do this.
+ *
+ * RETURN
+ * 0 to not start u-boot
+ * positive if u-boot should start
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__weak int spl_start_uboot(void)
+{
+	printf("SPL: Please implement spl_start_uboot() for your board\n");
+	printf("SPL: Direct Linux boot not active!\n");
+	return 1;
+}
+#endif
+
 void spl_parse_image_header(const struct image_header *header)
 {
 	u32 header_size = sizeof(struct image_header);
@@ -92,7 +111,25 @@ void spl_parse_image_header(const struct image_header *header)
 	}
 }
 
-static void jump_to_image_no_args(void)
+/*
+ * This function jumps to an image with argument. Normally an FDT or ATAGS
+ * image.
+ * arg: Pointer to paramter image in RAM
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__noreturn void jump_to_image_linux(void *arg)
+{
+	debug("Entering kernel arg pointer: 0x%p\n", arg);
+	typedef void (*image_entry_arg_t)(int, int, void *)
+		__attribute__ ((noreturn));
+	image_entry_arg_t image_entry =
+		(image_entry_arg_t) spl_image.entry_point;
+	/* cleanup_before_linux(); */ /*write SPL function for that*/
+	image_entry(0, CONFIG_MACH_TYPE, arg);
+}
+#endif
+
+void jump_to_image_no_args(void)
 {
 	typedef void (*image_entry_noargs_t)(u32 *)__attribute__ ((noreturn));
 	image_entry_noargs_t image_entry =
@@ -106,8 +143,8 @@ static void jump_to_image_no_args(void)
 	u32 boot_params_ptr_addr = (u32)&boot_params_ptr;
 	image_entry((u32 *)boot_params_ptr_addr);
 }
-
 void jump_to_image_no_args(void) __attribute__ ((noreturn));
+
 void board_init_r(gd_t *id, ulong dummy)
 {
 	u32 boot_device;
@@ -145,6 +182,13 @@ void board_init_r(gd_t *id, ulong dummy)
 		debug("Jumping to U-Boot\n");
 		jump_to_image_no_args();
 		break;
+#ifdef CONFIG_SPL_OS_BOOT
+	case IH_OS_LINUX:
+		debug("Jumping to Linux\n");
+		spl_board_prepare_for_linux();
+		jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR);
+		break;
+#endif
 	default:
 		puts("Unsupported OS image.. Jumping nevertheless..\n");
 		jump_to_image_no_args();
arch/arm/cpu/armv7/omap-common/spl_nand.c +30 -23

75 lines not on this page · raw message

arch/arm/include/asm/omap_common.h +1 -0
index 92aa4f9..ecfd799 100644
@@ -94,6 +94,7 @@ void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(void);
 int spl_uboot_key(void);
 void spl_board_prepare_for_linux(void);
+int spl_start_uboot(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
Signature · 1 line
1.7.5.4
#217 lore raw

PATCH v13 6/12 omap/spl: change output of spl_parse_image_header

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This only outputs "Assuming u-boot.bin..." if debug is active.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index f99c0e5..5f7ba2c 100644
@@ -101,7 +101,7 @@ void spl_parse_image_header(const struct image_header *header)
 		/* Signature not found - assume u-boot.bin */
 		printf("mkimage signature not found - ih_magic = %x\n",
 			header->ih_magic);
-		puts("Assuming u-boot.bin ..\n");
+		debug("Assuming u-boot.bin ..\n");
 		/* Let's assume U-Boot will not be more than 200 KB */
 		spl_image.size = 200 * 1024;
 		spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
Signature · 1 line
1.7.5.4
#218 lore raw

PATCH v13 7/12 devkit8000: Implement and activate direct OS boot

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

- Implements spl_start_uboot() for devkit8000
- Add configs to activate direct OS boot from SPL

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 board/timll/devkit8000/devkit8000.c |   18 ++++++++++++++++++
 include/configs/devkit8000.h        |    7 +++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
board/timll/devkit8000/devkit8000.c +18 -0
index dded697..d75e86b 100644
@@ -41,6 +41,7 @@
 #include <asm/arch/mem.h>
 #include <asm/mach-types.h>
 #include "devkit8000.h"
+#include <asm/gpio.h>
 #ifdef CONFIG_DRIVER_DM9000
 #include <net.h>
 #include <netdev.h>
@@ -161,6 +162,23 @@ void spl_board_prepare_for_linux(void)
 	gpmc_dm9000_config();
 }
 
+/*
+ * devkit8000 specific implementation of spl_start_uboot()
+ *
+ * RETURN
+ * 0 if the button is not pressed
+ * 1 if the button is pressed
+ */
+int spl_start_uboot(void)
+{
+	int val = 0;
+	if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+		gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+		val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+		gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+	}
+	return !val;
+}
 #endif
 
 /*
include/configs/devkit8000.h +5 -2
index d3ca0dd..2bcab72 100644
@@ -35,7 +35,7 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3_DEVKIT8000	1	/* working with DevKit8000 */
-
+#define CONFIG_MACH_TYPE	MACH_TYPE_DEVKIT8000
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  * 64 bytes before this address should be set aside for u-boot.img's
@@ -327,7 +327,7 @@
 #define CONFIG_SPL_MAX_SIZE		0xB400  /* 45 K */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_START_ADDR       0x80000500 /* leave space for bootargs*/
 #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
 
 /* NAND boot config */
@@ -357,6 +357,9 @@
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
 /* SPL OS boot options */
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY	26
+
 #define CONFIG_CMD_SPL
 #define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
 #define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
Signature · 1 line
1.7.5.4
#219 lore raw

PATCH v13 8/12 Add cache functions to SPL for armv7

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 arch/arm/cpu/armv7/Makefile |    2 --
 arch/arm/cpu/armv7/cpu.c    |    2 ++
 arch/arm/lib/Makefile       |    5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/Makefile +0 -2
index f97fa3d..6b2addc 100644
@@ -27,9 +27,7 @@ LIB	= $(obj)lib$(CPU).o
 
 START	:= start.o
 
-ifndef CONFIG_SPL_BUILD
 COBJS	+= cache_v7.o
-endif
 
 COBJS	+= cpu.o
 COBJS	+= syslib.o
arch/arm/cpu/armv7/cpu.c +2 -0
index 662c496..c6fa8ef 100644
@@ -52,7 +52,9 @@ int cleanup_before_linux(void)
 	 *
 	 * we turn off caches etc ...
 	 */
+#ifndef CONFIG_SPL_BUILD
 	disable_interrupts();
+#endif
 
 	/*
 	 * Turn off I-cache and invalidate it
arch/arm/lib/Makefile +3 -2
index 300c8fa..39a9550 100644
@@ -39,8 +39,6 @@ GLCOBJS	+= div0.o
 
 COBJS-y	+= board.o
 COBJS-y	+= bootm.o
-COBJS-y	+= cache.o
-COBJS-y	+= cache-cp15.o
 COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 COBJS-y	+= interrupts.o
 COBJS-y	+= reset.o
@@ -48,6 +46,9 @@ SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
 SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 endif
 
+COBJS-y	+= cache.o
+COBJS-y	+= cache-cp15.o
+
 SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
 	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
Signature · 1 line
1.7.5.4
#220 lore raw

PATCH v13 9/12 OMAP3: SPL: do not call I2C init if no I2C is set.

In reply to Stefano Babic

Call i2c initialization in spl_board_init only if I2C is configured for the board.

CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 arch/arm/cpu/armv7/omap3/board.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/omap3/board.c +2 -0
index 871aa37..d942bfe 100644
@@ -92,7 +92,9 @@ u32 omap_boot_device(void)
 
 void spl_board_init(void)
 {
+#ifdef CONFIG_SPL_I2C_SUPPORT
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
 }
 #endif /* CONFIG_SPL_BUILD */
 
Signature · 1 line
1.7.5.4
#221 lore raw

PATCH v13 10/12 SPL: call cleanup_before_linux() before booting Linux

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index 5f7ba2c..d9dd864 100644
@@ -124,7 +124,7 @@ __noreturn void jump_to_image_linux(void *arg)
 		__attribute__ ((noreturn));
 	image_entry_arg_t image_entry =
 		(image_entry_arg_t) spl_image.entry_point;
-	/* cleanup_before_linux(); */ /*write SPL function for that*/
+	cleanup_before_linux();
 	image_entry(0, CONFIG_MACH_TYPE, arg);
 }
 #endif
Signature · 1 line
1.7.5.4
#222 lore raw

PATCH v13 11/12 OMAP3: twister: add support to boot Linux from SPL

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 board/technexion/twister/twister.c |   23 +++++++++++++++++++++++
 include/configs/twister.h          |   12 ++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)
board/technexion/twister/twister.c +23 -0
index 06fac7b..4d34d24 100644
@@ -114,3 +114,26 @@ int board_mmc_init(bd_t *bis)
 	return omap_mmc_init(0);
 }
 #endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	/* init cs for extern lan */
+	enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
+		CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
+}
+int spl_start_uboot(void)
+{
+	int val = 0;
+	if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+		gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+		val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+		gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+	}
+	return val;
+}
+#endif
include/configs/twister.h +12 -0
index 64a886d..a852481 100644
@@ -51,4 +51,16 @@
 #define	CONFIG_EXTRA_ENV_SETTINGS	CONFIG_TAM3517_SETTINGS \
 	"bootcmd=run nandboot\0"
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE	0x400 /* 1024 byte */
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000
+#define CONFIG_CMD_SPL_NAND_OFS	(CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+						0x600000)
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY	55
+
+#define CONFIG_SYS_SPL_ARGS_ADDR	(PHYS_SDRAM_1 + 0x100)
+#define CONFIG_SPL_BOARD_INIT
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#223 lore raw

PATCH v13 12/12 arm: Add Prep subcommand support to bootm

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

This is used in command "cmd_spl export"

---
 arch/arm/include/asm/bootm.h |   26 ++++
 arch/arm/lib/bootm.c         |  341 ++++++++++++++++++++++--------------------
 2 files changed, 202 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/include/asm/bootm.h
arch/arm/include/asm/bootm.h new file +26 -0
new file mode 100644
index 0000000..db2ff94
@@ -0,0 +1,26 @@
+/* Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <[email protected]>
+ *
+ * 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
+ *
+ */
+#ifndef ARM_BOOTM_H
+#define ARM_BOOTM_H
+
+#ifdef CONFIG_USB_DEVICE
+extern void udc_disconnect(void);
+#endif
+
+#endif
arch/arm/lib/bootm.c +176 -165

419 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#224 lore raw

PATCH v13 12/12 arm: Add Prep subcommand support to bootm

Hi all,

Le 04/02/2012 11:22, Stefano Babic a ?crit :

Quoted 6 lines

From: Simon Schwarz<[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

Quoted 6 lines

This is used in command "cmd_spl export"

---

That one's assigned to me on patchwork, but already resides in several branches of the imx tree.

Stefano, why not put it in imx master for pulling?

Amicalement,

Signature · 1 line
Albert.
#225 lore raw

PATCH v13 12/12 arm: Add Prep subcommand support to bootm

Quoted 18 lines · Albert ARIBAUD

Hi all,

Le 04/02/2012 11:22, Stefano Babic a ?crit :

Quoted 6 lines

From: Simon Schwarz<[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

Quoted 6 lines

This is used in command "cmd_spl export"

---

Quoted 4 lines

That one's assigned to me on patchwork, but already resides in several branches of the imx tree.

Stefano, why not put it in imx master for pulling?

What happened was that Stefano has working with me on getting the series into u-boot-ti (since it's just booting on OMAP*ish boards right now) so there's a branch or two for testing / avoiding a repost just to get ToT again. I expect to include it in a pull request next week (need to double check the MAKEALL -s arm before/after, then do the same for ppc).

Signature · 1 line
Tom
#226 lore raw

PATCH v13 12/12 arm: Add Prep subcommand support to bootm

Quoted 23 lines · Tom Rini
Quoted 21 lines · Albert ARIBAUD

Hi all,

Le 04/02/2012 11:22, Stefano Babic a ?crit :

Quoted 6 lines

From: Simon Schwarz<[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

Quoted 6 lines

This is used in command "cmd_spl export"

---

That one's assigned to me on patchwork, but already resides in several branches of the imx tree.

Quoted 8 lines
Quoted 1 line

Stefano, why not put it in imx master for pulling?

What happened was that Stefano has working with me on getting the series into u-boot-ti (since it's just booting on OMAP*ish boards right now) so there's a branch or two for testing / avoiding a repost just to get ToT again. I expect to include it in a pull request next week (need to double check the MAKEALL -s arm before/after, then do the same for ppc).

Right - the patches were tested and run on OMAP-3 platform at the moment. Making this code available for the other SOCs will come later.

My branches on u-boot-imx are only for testing, for anyone who wants to try booting the Kernel from SPL without having to fight with the different version of the patchset.

It is planned that the whole series will be pulled by Tom soon. It is surely right if you assign this patch to Tom on patchwork ;-).

Best regards,
Stefano

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
=====================================================================
#227 lore raw

PATCH v13 12/12 arm: Add Prep subcommand support to bootm

Quoted 36 lines · Stefano Babic
Quoted 23 lines · Tom Rini
Quoted 21 lines · Albert ARIBAUD

Hi all,

Le 04/02/2012 11:22, Stefano Babic a ?crit :

Quoted 6 lines

From: Simon Schwarz<[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

Quoted 6 lines

This is used in command "cmd_spl export"

---

That one's assigned to me on patchwork, but already resides in several branches of the imx tree.

Quoted 8 lines
Quoted 1 line

Stefano, why not put it in imx master for pulling?

What happened was that Stefano has working with me on getting the series into u-boot-ti (since it's just booting on OMAP*ish boards right now) so there's a branch or two for testing / avoiding a repost just to get ToT again. ?I expect to include it in a pull request next week (need to double check the MAKEALL -s arm before/after, then do the same for ppc).

Right - the patches were tested and run ?on OMAP-3 platform at the moment. Making this code available for the other SOCs will come later.

Quoted 6 lines

My branches on u-boot-imx are only for testing, for anyone who wants to try booting the Kernel from SPL without having to fight with the different version of the patchset.

It is planned that the whole series will be pulled by Tom soon. It is surely right if you assign this patch to Tom on patchwork ;-).

I'll hit up patchwork tomorrow since I thought I had gotten all of the old versions marked as superseded and assigned the latest to me.

Signature · 1 line
Tom
#228 lore raw

[U-Boot] SPL Linux Boot

In reply to Stefano Babic

Hi,

this should be the final version for the patchset introducing direct Linux booting from SPL.

Only Patch 1/14: "Add cmd_spl command" was modified. Patches 2/13 up to 12/13 are untouched from V13. Patch 13/13 fix a small issue by compiling the cam_enc_4xx board (Tom Rini)

Changelog
--------------

[PATCH V14 01/13] Add cmd_spl command
[PATCH V14 02/13] devkit8000: add config for spl command [PATCH V14 03/13] omap-common: Add NAND SPL linux booting [PATCH V14 04/13] devkit8000/spl: init GPMC for dm9000 in SPL [PATCH V14 05/13] omap-common/spl: Add linux boot to SPL [PATCH V14 06/13] omap/spl: change output of spl_parse_image_header [PATCH V14 07/13] devkit8000: Implement and activate direct OS boot [PATCH V14 08/13] Add cache functions to SPL for armv7 [PATCH V14 09/13] OMAP3: SPL: do not call I2C init if no I2C is set. [PATCH V14 10/13] SPL: call cleanup_before_linux() before booting [PATCH V14 11/13] OMAP3: twister: add support to boot Linux from SPL [PATCH V14 12/13] arm: Add Prep subcommand support to bootm [PATCH V14 13/13] cam_enc_4xx: Rename 'images' to 'imgs'

#229 lore raw

PATCH v14 1/13 Add cmd_spl command

From: Simon Schwarz <[email protected]>

This adds a spl command to the u-boot.

Related config:
CONFIG_CMD_SPL
activate/deactivate the command
CONFIG_CMD_SPL_NAND_OFS
Offset in NAND to use

---

Changes since V13:
- spelling in commit message (Wolfgang Denk)
- drop local variable for do_bootm (Wolfgang Denk)
- factorize common code for spl_export_* (Wolfgang Denk)
- drop wrong comments (Wolfgang Denk)
- fix bug when DEBUG is set (Stefano Babic)

 common/Makefile         |    1 +
 common/cmd_spl.c        |  188 +++++++++++++++++++++++++++++++++++++++++++++++
 doc/README.commands.spl |   31 ++++++++
 include/cmd_spl.h       |   31 ++++++++
 include/image.h         |    2 +
 5 files changed, 253 insertions(+), 0 deletions(-)
 create mode 100644 common/cmd_spl.c
 create mode 100644 doc/README.commands.spl
 create mode 100644 include/cmd_spl.h
common/Makefile +1 -0
index 0189aac..819c1f7 100644
@@ -162,6 +162,7 @@ COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
+COBJS-$(CONFIG_CMD_SPL) += cmd_spl.o
 
 # others
 ifdef CONFIG_DDR_SPD
common/cmd_spl.c new file +188 -0

188 lines not on this page · raw message

doc/README.commands.spl new file +31 -0
new file mode 100644
index 0000000..ac33273
@@ -0,0 +1,31 @@
+The spl command is used to export a boot parameter image to RAM. Later
+it may implement more functions connected to the SPL.
+
+SUBCOMMAND EXPORT
+To execute the command everything has to be in place as if bootm should be
+used. (kernel image, initrd-image, fdt-image etc.)
+
+export has two subcommands:
+	atags: exports the ATAGS
+	fdt: exports the FDT
+
+Call is:
+spl export <ftd|atags> [kernel_addr] [initrd_addr] [fdt_addr if fdt]
+
+
+TYPICAL CALL
+
+on OMAP3:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+spl export atags 			/* export ATAGS */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write 0x80000100 0x680000 0x20000	/* write the image - one page */
+
+call with FDT:
+nandecc hw
+nand read 0x82000000 0x280000 0x400000 	/* Read kernel image from NAND*/
+tftpboot 0x80000100 devkit8000.dtb /* Read fdt */
+spl export fdt 0x82000000 - 0x80000100	/* export FDT */
+nand erase 0x680000 0x20000		/* erase - one page */
+nand write <adress shown by spl export> 0x680000 0x20000
include/cmd_spl.h new file +31 -0
new file mode 100644
index 0000000..6d6206d
@@ -0,0 +1,31 @@
+/* Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <[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
+ */
+#ifndef _NAND_SPL_H_
+#define	_NAND_SPL_H_
+
+#define SPL_EXPORT	(0x00000001)
+
+#define SPL_EXPORT_FDT		(0x00000001)
+#define SPL_EXPORT_ATAGS	(0x00000002)
+#define SPL_EXPORT_LAST		SPL_EXPORT_ATAGS
+
+#endif /* _NAND_SPL_H_ */
include/image.h +2 -0
index bbf80f0..a1c6e4e 100644
@@ -268,6 +268,8 @@ typedef struct bootm_headers {
 #endif
 } bootm_headers_t;
 
+extern bootm_headers_t images;
+
 /*
  * Some systems (for example LWMON) have very short watchdog periods;
  * we must make sure to split long operations like memmove() or
Signature · 1 line
1.7.5.4
#230 lore raw

PATCH v14 2/13 devkit8000: add config for spl command

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds some configs for devkit8000 to use the new spl command

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 include/configs/devkit8000.h |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
include/configs/devkit8000.h +8 -0
index 2b6a6ee..e323877 100644
@@ -351,4 +351,12 @@
 #define CONFIG_SYS_SPL_MALLOC_START	0x80208000
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
+#define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+					0x400000)
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
+#define CONFIG_SYS_SPL_ARGS_ADDR        (PHYS_SDRAM_1 + 0x100)
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#231 lore raw

PATCH v14 3/13 omap-common: Add NAND SPL linux booting

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This implements booting of Linux from NAND in SPL

Related config parameters:
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR

	Address where the kernel boot arguments are expected - this is
	normally RAM-start + 0x100 (on ARM)
CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   66 ++++++++++++++++++++++-------
 1 files changed, 50 insertions(+), 16 deletions(-)
arch/arm/cpu/armv7/omap-common/spl_nand.c +50 -16
index 38d06b1..2a66214 100644
@@ -24,6 +24,7 @@
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
+#include <asm/io.h>
 #include <nand.h>
 #include <version.h>
 #include <asm/omap_common.h>
@@ -32,6 +33,9 @@
 void spl_nand_load_image(void)
 {
 	struct image_header *header;
+	int *src __attribute__((unused));
+	int *dst __attribute__((unused));
+
 	switch (omap_boot_mode()) {
 	case NAND_MODE_HW_ECC:
 		debug("spl: nand - using hw ecc\n");
@@ -45,26 +49,56 @@ void spl_nand_load_image(void)
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
+#ifdef CONFIG_SPL_OS_BOOT
+	if (!spl_uboot_key()) {
+		/*
+		 * load parameter image
+		 * load to temp position since nand_spl_load_image reads
+		 * a whole block which is typically larger than
+		 * CONFIG_CMD_SAVEBP_WRITE_SIZE therefore may overwrite
+		 * following sections like BSS
+		 */
+		nand_spl_load_image(CONFIG_CMD_SPL_NAND_OFS,
+			CONFIG_CMD_SPL_WRITE_SIZE,
+			(void *)CONFIG_SYS_TEXT_BASE);
+		/* copy to destintion */
+		for (dst = (int *)CONFIG_SYS_SPL_ARGS_ADDR,
+				src = (int *)CONFIG_SYS_TEXT_BASE;
+				src < (int *)(CONFIG_SYS_TEXT_BASE +
+				CONFIG_CMD_SPL_WRITE_SIZE);
+				src++, dst++) {
+			writel(readl(src), dst);
+		}
 
+		/* load linux */
+		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_SYS_NAND_SPL_KERNEL_OFFS,
+			spl_image.size, (void *)spl_image.load_addr);
+	} else
+#endif
+	{
 #ifdef CONFIG_NAND_ENV_DST
-	nand_spl_load_image(CONFIG_ENV_OFFSET,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
-		(void *)image_load_addr);
+		nand_spl_load_image(CONFIG_ENV_OFFSET,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_ENV_OFFSET, spl_image.size,
+			(void *)spl_image.load_addr);
 #ifdef CONFIG_ENV_OFFSET_REDUND
-	nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
-		(void *)image_load_addr);
+		nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_ENV_OFFSET_REDUND, spl_image.size,
+			(void *)spl_image.load_addr);
 #endif
 #endif
-	/* Load u-boot */
-	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
-	spl_parse_image_header(header);
-	nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
-		spl_image.size, (void *)spl_image.load_addr);
+		/* Load u-boot */
+		nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+			CONFIG_SYS_NAND_PAGE_SIZE, (void *)header);
+		spl_parse_image_header(header);
+		nand_spl_load_image(CONFIG_SYS_NAND_U_BOOT_OFFS,
+			spl_image.size, (void *)spl_image.load_addr);
+	}
 	nand_deselect();
 }
Signature · 1 line
1.7.5.4
#232 lore raw

PATCH v14 4/13 devkit8000/spl: init GPMC for dm9000 in SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

Linux crashes if the GPMC isn't configured for the dm9000.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/include/asm/omap_common.h  |    1 +
 board/timll/devkit8000/devkit8000.c |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)
arch/arm/include/asm/omap_common.h +1 -0
index 25f95b4..85eac7d 100644
@@ -92,6 +92,7 @@ u32 omap_boot_mode(void);
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(void);
+void spl_board_prepare_for_linux(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
board/timll/devkit8000/devkit8000.c +19 -0
index 10f189e..dded697 100644
@@ -73,6 +73,13 @@ int board_init(void)
 	return 0;
 }
 
+/* Configure GPMC registers for DM9000 */
+static void gpmc_dm9000_config(void)
+{
+	enable_gpmc_cs_config(gpmc_net_config, &gpmc_cfg->cs[6],
+		CONFIG_DM9000_BASE, GPMC_SIZE_16M);
+}
+
 /*
  * Routine: misc_init_r
  * Description: Configure board specific parts
@@ -144,6 +151,18 @@ int board_eth_init(bd_t *bis)
 }
 #endif
 
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	gpmc_dm9000_config();
+}
+
+#endif
+
 /*
  * Routine: get_board_mem_timings
  * Description: If we use SPL then there is no x-loader nor config header
Signature · 1 line
1.7.5.4
#233 lore raw

PATCH v14 5/13 omap-common/spl: Add linux boot to SPL

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This adds Linux booting to the SPL

This depends on CONFIG_MACH_TYPE patch by Igor Grinberg
(http://article.gmane.org/gmane.comp.boot-loaders.u-boot/105809)

Related CONFIGs:
CONFIG_SPL_OS_BOOT
Activates/Deactivates the OS booting feature
CONFIG_SPL_OS_BOOT_KEY
defines the IO-pin number u-boot switch - if pressed u-boot is booted
CONFIG_SYS_NAND_SPL_KERNEL_OFFS
Offset in NAND of direct boot kernel image to use in SPL
CONFIG_SYS_SPL_ARGS_ADDR

	Address where the kernel boot arguments are expected - this is
	normaly RAM-begin + 0x100
CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl.c      |   44 ++++++++++++++++++++++++
 arch/arm/cpu/armv7/omap-common/spl_nand.c |   53 ++++++++++++++++------------
 arch/arm/include/asm/omap_common.h        |    1 +
 3 files changed, 75 insertions(+), 23 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +44 -0
index 99bb382..6b54ac7 100644
@@ -65,6 +65,25 @@ void board_init_f(ulong dummy)
 	relocate_code(CONFIG_SPL_STACK, &gdata, CONFIG_SPL_TEXT_BASE);
 }
 
+/*
+ * Default function to determine if u-boot or the OS should
+ * be started. This implementation always returns 1.
+ *
+ * Please implement your own board specific funcion to do this.
+ *
+ * RETURN
+ * 0 to not start u-boot
+ * positive if u-boot should start
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+__weak int spl_start_uboot(void)
+{
+	printf("SPL: Please implement spl_start_uboot() for your board\n");
+	printf("SPL: Direct Linux boot not active!\n");
+	return 1;
+}
+#endif
+
 void spl_parse_image_header(const struct image_header *header)
 {
 	u32 header_size = sizeof(struct image_header);
@@ -92,6 +111,24 @@ void spl_parse_image_header(const struct image_header *header)
 	}
 }
 
+/*
+ * This function jumps to an image with argument. Normally an FDT or ATAGS
+ * image.
+ * arg: Pointer to paramter image in RAM
+ */
+#ifdef CONFIG_SPL_OS_BOOT
+static void __noreturn jump_to_image_linux(void *arg)
+{
+	debug("Entering kernel arg pointer: 0x%p\n", arg);
+	typedef void (*image_entry_arg_t)(int, int, void *)
+		__attribute__ ((noreturn));
+	image_entry_arg_t image_entry =
+		(image_entry_arg_t) spl_image.entry_point;
+	/* cleanup_before_linux(); */ /*write SPL function for that*/
+	image_entry(0, CONFIG_MACH_TYPE, arg);
+}
+#endif
+
 static void __noreturn jump_to_image_no_args(void)
 {
 	typedef void __noreturn (*image_entry_noargs_t)(u32 *);
@@ -149,6 +186,13 @@ void board_init_r(gd_t *id, ulong dummy)
 		debug("Jumping to U-Boot\n");
 		jump_to_image_no_args();
 		break;
+#ifdef CONFIG_SPL_OS_BOOT
+	case IH_OS_LINUX:
+		debug("Jumping to Linux\n");
+		spl_board_prepare_for_linux();
+		jump_to_image_linux((void *)CONFIG_SYS_SPL_ARGS_ADDR);
+		break;
+#endif
 	default:
 		puts("Unsupported OS image.. Jumping nevertheless..\n");
 		jump_to_image_no_args();
arch/arm/cpu/armv7/omap-common/spl_nand.c +30 -23

75 lines not on this page · raw message

arch/arm/include/asm/omap_common.h +1 -0
index 85eac7d..6f25948 100644
@@ -93,6 +93,7 @@ u32 omap_boot_mode(void);
 void spl_parse_image_header(const struct image_header *header);
 void omap_rev_string(void);
 void spl_board_prepare_for_linux(void);
+int spl_start_uboot(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
Signature · 1 line
1.7.5.4
#234 lore raw

PATCH v14 6/13 omap/spl: change output of spl_parse_image_header

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

This only outputs "Assuming u-boot.bin..." if debug is active.

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index 6b54ac7..963acb0 100644
@@ -101,7 +101,7 @@ void spl_parse_image_header(const struct image_header *header)
 		/* Signature not found - assume u-boot.bin */
 		printf("mkimage signature not found - ih_magic = %x\n",
 			header->ih_magic);
-		puts("Assuming u-boot.bin ..\n");
+		debug("Assuming u-boot.bin ..\n");
 		/* Let's assume U-Boot will not be more than 200 KB */
 		spl_image.size = 200 * 1024;
 		spl_image.entry_point = CONFIG_SYS_TEXT_BASE;
Signature · 1 line
1.7.5.4
#235 lore raw

PATCH v14 7/13 devkit8000: Implement and activate direct OS boot

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

- Implements spl_start_uboot() for devkit8000
- Add configs to activate direct OS boot from SPL

CC Tom Rini <[email protected]>
CC Stefano Babic <[email protected]>
CC Wolfgang Denk <[email protected]>
---
 board/timll/devkit8000/devkit8000.c |   18 ++++++++++++++++++
 include/configs/devkit8000.h        |    7 +++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
board/timll/devkit8000/devkit8000.c +18 -0
index dded697..d75e86b 100644
@@ -41,6 +41,7 @@
 #include <asm/arch/mem.h>
 #include <asm/mach-types.h>
 #include "devkit8000.h"
+#include <asm/gpio.h>
 #ifdef CONFIG_DRIVER_DM9000
 #include <net.h>
 #include <netdev.h>
@@ -161,6 +162,23 @@ void spl_board_prepare_for_linux(void)
 	gpmc_dm9000_config();
 }
 
+/*
+ * devkit8000 specific implementation of spl_start_uboot()
+ *
+ * RETURN
+ * 0 if the button is not pressed
+ * 1 if the button is pressed
+ */
+int spl_start_uboot(void)
+{
+	int val = 0;
+	if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+		gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+		val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+		gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+	}
+	return !val;
+}
 #endif
 
 /*
include/configs/devkit8000.h +5 -2
index e323877..eb7c376 100644
@@ -35,7 +35,7 @@
 #define CONFIG_OMAP		1	/* in a TI OMAP core */
 #define CONFIG_OMAP34XX		1	/* which is a 34XX */
 #define CONFIG_OMAP3_DEVKIT8000	1	/* working with DevKit8000 */
-
+#define CONFIG_MACH_TYPE	MACH_TYPE_DEVKIT8000
 /*
  * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
  * 64 bytes before this address should be set aside for u-boot.img's
@@ -327,7 +327,7 @@
 #define CONFIG_SPL_MAX_SIZE		0xB400  /* 45 K */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
 
-#define CONFIG_SPL_BSS_START_ADDR	0x80000000 /*CONFIG_SYS_SDRAM_BASE*/
+#define CONFIG_SPL_BSS_START_ADDR       0x80000500 /* leave space for bootargs*/
 #define CONFIG_SPL_BSS_MAX_SIZE		0x80000
 
 /* NAND boot config */
@@ -352,6 +352,9 @@
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x100000	/* 1 MB */
 
 /* SPL OS boot options */
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY	26
+
 #define CONFIG_CMD_SPL
 #define CONFIG_CMD_SPL_WRITE_SIZE       0x400 /* 1024 byte */
 #define CONFIG_CMD_SPL_NAND_OFS (CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
Signature · 1 line
1.7.5.4
#236 lore raw

PATCH v14 8/13 Add cache functions to SPL for armv7

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 arch/arm/cpu/armv7/Makefile |    2 --
 arch/arm/cpu/armv7/cpu.c    |    2 ++
 arch/arm/lib/Makefile       |    5 +++--
 3 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/Makefile +0 -2
index f97fa3d..6b2addc 100644
@@ -27,9 +27,7 @@ LIB	= $(obj)lib$(CPU).o
 
 START	:= start.o
 
-ifndef CONFIG_SPL_BUILD
 COBJS	+= cache_v7.o
-endif
 
 COBJS	+= cpu.o
 COBJS	+= syslib.o
arch/arm/cpu/armv7/cpu.c +2 -0
index 662c496..c6fa8ef 100644
@@ -52,7 +52,9 @@ int cleanup_before_linux(void)
 	 *
 	 * we turn off caches etc ...
 	 */
+#ifndef CONFIG_SPL_BUILD
 	disable_interrupts();
+#endif
 
 	/*
 	 * Turn off I-cache and invalidate it
arch/arm/lib/Makefile +3 -2
index 300c8fa..39a9550 100644
@@ -39,8 +39,6 @@ GLCOBJS	+= div0.o
 
 COBJS-y	+= board.o
 COBJS-y	+= bootm.o
-COBJS-y	+= cache.o
-COBJS-y	+= cache-cp15.o
 COBJS-$(CONFIG_SYS_L2_PL310) += cache-pl310.o
 COBJS-y	+= interrupts.o
 COBJS-y	+= reset.o
@@ -48,6 +46,9 @@ SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
 SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
 endif
 
+COBJS-y	+= cache.o
+COBJS-y	+= cache-cp15.o
+
 SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
 	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
Signature · 1 line
1.7.5.4
#237 lore raw

PATCH v14 9/13 OMAP3: SPL: do not call I2C init if no I2C is set.

In reply to Stefano Babic

Call i2c initialization in spl_board_init only if I2C is configured for the board.

CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 arch/arm/cpu/armv7/omap3/board.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/cpu/armv7/omap3/board.c +2 -0
index aabc651..1fee574 100644
@@ -92,7 +92,9 @@ u32 omap_boot_device(void)
 
 void spl_board_init(void)
 {
+#ifdef CONFIG_SPL_I2C_SUPPORT
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
+#endif
 }
 #endif /* CONFIG_SPL_BUILD */
 
Signature · 1 line
1.7.5.4
#238 lore raw

PATCH v14 10/13 SPL: call cleanup_before_linux() before booting Linux

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 arch/arm/cpu/armv7/omap-common/spl.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index 963acb0..0f2e0a2 100644
@@ -124,7 +124,7 @@ static void __noreturn jump_to_image_linux(void *arg)
 		__attribute__ ((noreturn));
 	image_entry_arg_t image_entry =
 		(image_entry_arg_t) spl_image.entry_point;
-	/* cleanup_before_linux(); */ /*write SPL function for that*/
+	cleanup_before_linux();
 	image_entry(0, CONFIG_MACH_TYPE, arg);
 }
 #endif
Signature · 1 line
1.7.5.4
#239 lore raw

PATCH v14 11/13 OMAP3: twister: add support to boot Linux from SPL

In reply to Stefano Babic
CC Tom Rini <[email protected]>
CC Wolfgang Denk <[email protected]>
CC Simon Schwarz <[email protected]>
---
 board/technexion/twister/twister.c |   23 +++++++++++++++++++++++
 include/configs/twister.h          |   12 ++++++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)
board/technexion/twister/twister.c +23 -0
index 50c70ab..b927586 100644
@@ -136,3 +136,26 @@ int board_mmc_init(bd_t *bis)
 	return omap_mmc_init(0);
 }
 #endif
+
+#ifdef CONFIG_SPL_OS_BOOT
+/*
+ * Do board specific preperation before SPL
+ * Linux boot
+ */
+void spl_board_prepare_for_linux(void)
+{
+	/* init cs for extern lan */
+	enable_gpmc_cs_config(gpmc_smc911, &gpmc_cfg->cs[5],
+		CONFIG_SMC911X_BASE, GPMC_SIZE_16M);
+}
+int spl_start_uboot(void)
+{
+	int val = 0;
+	if (!gpio_request(CONFIG_SPL_OS_BOOT_KEY, "U-Boot key")) {
+		gpio_direction_input(CONFIG_SPL_OS_BOOT_KEY);
+		val = gpio_get_value(CONFIG_SPL_OS_BOOT_KEY);
+		gpio_free(CONFIG_SPL_OS_BOOT_KEY);
+	}
+	return val;
+}
+#endif
include/configs/twister.h +12 -0
index 64a886d..a852481 100644
@@ -51,4 +51,16 @@
 #define	CONFIG_EXTRA_ENV_SETTINGS	CONFIG_TAM3517_SETTINGS \
 	"bootcmd=run nandboot\0"
 
+/* SPL OS boot options */
+#define CONFIG_CMD_SPL
+#define CONFIG_CMD_SPL_WRITE_SIZE	0x400 /* 1024 byte */
+#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000
+#define CONFIG_CMD_SPL_NAND_OFS	(CONFIG_SYS_NAND_SPL_KERNEL_OFFS+\
+						0x600000)
+#define CONFIG_SPL_OS_BOOT
+#define CONFIG_SPL_OS_BOOT_KEY	55
+
+#define CONFIG_SYS_SPL_ARGS_ADDR	(PHYS_SDRAM_1 + 0x100)
+#define CONFIG_SPL_BOARD_INIT
+
 #endif /* __CONFIG_H */
Signature · 1 line
1.7.5.4
#240 lore raw

PATCH v14 12/13 arm: Add Prep subcommand support to bootm

In reply to Stefano Babic

From: Simon Schwarz <[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

This is used in command "cmd_spl export"

---
 arch/arm/include/asm/bootm.h |   26 ++++
 arch/arm/lib/bootm.c         |  341 ++++++++++++++++++++++--------------------
 2 files changed, 202 insertions(+), 165 deletions(-)
 create mode 100644 arch/arm/include/asm/bootm.h
arch/arm/include/asm/bootm.h new file +26 -0
new file mode 100644
index 0000000..db2ff94
@@ -0,0 +1,26 @@
+/* Copyright (C) 2011
+ * Corscience GmbH & Co. KG - Simon Schwarz <[email protected]>
+ *
+ * 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
+ *
+ */
+#ifndef ARM_BOOTM_H
+#define ARM_BOOTM_H
+
+#ifdef CONFIG_USB_DEVICE
+extern void udc_disconnect(void);
+#endif
+
+#endif
arch/arm/lib/bootm.c +176 -165

419 lines not on this page · raw message

Signature · 1 line
1.7.5.4
#241 lore raw

PATCH v14 12/13 arm: Add Prep subcommand support to bootm

Quoted 7 lines · Stefano Babic

From: Simon Schwarz <[email protected]>

Adds prep subcommand to bootm implementation of ARM. When bootm is called with the subcommand prep the function stops right after ATAGS creation and before announce_and_cleanup.

This is used in command "cmd_spl export"

[snip]

Quoted 3 lines
(quoted diff) +3 -0
+static void boot_jump_linux(bootm_headers_t *images)
+{
+	int machid = gd->bd->bi_arch_number;

[snip]

Review

Quoted 4 lines
(quoted diff) +4 -0
+	if (s) {
+		strict_strtoul(s, 16, (long unsigned int *) &machid);
+		printf("Using machid 0x%x from environment\n", machid);
+	}

This upsets gcc 4.2. bi_arch_number is an unsigned long so I'm applying the following to this patch as part of my commit:

arch/arm/lib/bootm.c +3 -3
index 03c25e9..fc73ca9 100644
@@ -310,7 +310,7 @@ static void boot_prep_linux(bootm_headers_t *images)
 /* Subcommand: GO */
 static void boot_jump_linux(bootm_headers_t *images)
 {
-	int machid = gd->bd->bi_arch_number;
+	unsigned long machid = gd->bd->bi_arch_number;
 	char *s;
 	void (*kernel_entry)(int zero, int arch, uint params);
 
@@ -318,8 +318,8 @@ static void boot_jump_linux(bootm_headers_t *images)
 
 	s = getenv("machid");
 	if (s) {
-		strict_strtoul(s, 16, (long unsigned int *) &machid);
-		printf("Using machid 0x%x from environment\n", machid);
+		strict_strtoul(s, 16, &machid);
+		printf("Using machid 0x%lx from environment\n", machid);
 	}
 
 	debug("## Transferring control to Linux (at address %08lx)" \

The original code used simple_strtoul which doesn't cause a warning here and newer gcc decided the unpatched usage was fine.

Signature · 1 line
Tom
#242 lore raw

PATCH v14 13/13 cam_enc_4xx: Rename 'images' to 'imgs'

In reply to Stefano Babic

From: Tom Rini <[email protected]>

To avoid a conflict with common/cmd_bootm.c's 'images' (which is exposed as part of the Linux SPL series), rename the board-specific 'images' to 'imgs'.

---
 board/ait/cam_enc_4xx/cam_enc_4xx.c |   48 +++++++++++++++++-----------------
 1 files changed, 24 insertions(+), 24 deletions(-)
board/ait/cam_enc_4xx/cam_enc_4xx.c +24 -24
index 5586576..bb29cf3 100644
@@ -503,7 +503,7 @@ struct fit_images_info {
 	size_t size;
 };
 
-static struct fit_images_info images[10];
+static struct fit_images_info imgs[10];
 
 struct menu_display {
 	char	title[50];
@@ -688,14 +688,14 @@ static int ait_menu_install_images(void)
 	 * img_writeramdisk: write ramdisk to ubi volume
 	 */
 
-	while (images[count].type != IH_TYPE_INVALID) {
+	while (imgs[count].type != IH_TYPE_INVALID) {
 		printf("Installing %s\n",
-			genimg_get_type_name(images[count].type));
-		sprintf(s, "%p", images[count].data);
+			genimg_get_type_name(imgs[count].type));
+		sprintf(s, "%p", imgs[count].data);
 		setenv("img_addr_r", s);
-		sprintf(s, "%lx", (unsigned long)images[count].size);
+		sprintf(s, "%lx", (unsigned long)imgs[count].size);
 		setenv("filesize", s);
-		switch (images[count].subtype) {
+		switch (imgs[count].subtype) {
 		case FIT_SUBTYPE_DF_ENV_IMAGE:
 			ret = run_command2("run img_writedfenv", 0);
 			break;
@@ -865,7 +865,7 @@ static int ait_menu_check_image(void)
 	int found_uboot = -1;
 	int found_ramdisk = -1;
 
-	memset(images, 0, sizeof(images));
+	memset(imgs, 0, sizeof(imgs));
 	s = getenv("fit_addr_r");
 	fit_addr = s ? (unsigned long)simple_strtol(s, NULL, 16) : \
 			CONFIG_BOARD_IMG_ADDR_R;
@@ -911,7 +911,7 @@ static int ait_menu_check_image(void)
 			fit_image_print(addr, noffset, "");
 
 			fit_image_get_type(addr, noffset,
-				&images[count].type);
+				&imgs[count].type);
 			/* Mandatory properties */
 			ret = fit_get_desc(addr, noffset, &desc);
 			printf("Description:  ");
@@ -925,33 +925,33 @@ static int ait_menu_check_image(void)
 			if (ret) {
 				printf("unavailable\n");
 			} else {
-				images[count].subtype = ait_subtype_nr(subtype);
+				imgs[count].subtype = ait_subtype_nr(subtype);
 				printf("%s %d\n", subtype,
-					images[count].subtype);
+					imgs[count].subtype);
 			}
 
-			sprintf(images[count].desc, "%s", desc);
+			sprintf(imgs[count].desc, "%s", desc);
 
 			ret = fit_image_get_data(addr, noffset,
-				&images[count].data,
-				&images[count].size);
+				&imgs[count].data,
+				&imgs[count].size);
 
 			printf("Data Size:    ");
 			if (ret)
 				printf("unavailable\n");
 			else
-				genimg_print_size(images[count].size);
-			printf("Data @ %p\n", images[count].data);
+				genimg_print_size(imgs[count].size);
+			printf("Data @ %p\n", imgs[count].data);
 			count++;
 		}
 	}
 
 	for (i = 0; i < count; i++) {
-		if (images[i].subtype == FIT_SUBTYPE_UBOOT_IMAGE)
+		if (imgs[i].subtype == FIT_SUBTYPE_UBOOT_IMAGE)
 			found_uboot = i;
-		if (images[i].type == IH_TYPE_RAMDISK) {
+		if (imgs[i].type == IH_TYPE_RAMDISK) {
 			found_ramdisk = i;
-			images[i].subtype = FIT_SUBTYPE_RAMDISK_IMAGE;
+			imgs[i].subtype = FIT_SUBTYPE_RAMDISK_IMAGE;
 		}
 	}
 
@@ -959,31 +959,31 @@ static int ait_menu_check_image(void)
 	if (found_uboot >= 0) {
 		s = getenv("dvn_boot_vers");
 		if (s) {
-			ret = strcmp(s, images[found_uboot].desc);
+			ret = strcmp(s, imgs[found_uboot].desc);
 			if (ret != 0) {
 				setenv("dvn_boot_vers",
-					images[found_uboot].desc);
+					imgs[found_uboot].desc);
 			} else {
 				found_uboot = -1;
 				printf("no new uboot version\n");
 			}
 		} else {
-			setenv("dvn_boot_vers", images[found_uboot].desc);
+			setenv("dvn_boot_vers", imgs[found_uboot].desc);
 		}
 	}
 	if (found_ramdisk >= 0) {
 		s = getenv("dvn_app_vers");
 		if (s) {
-			ret = strcmp(s, images[found_ramdisk].desc);
+			ret = strcmp(s, imgs[found_ramdisk].desc);
 			if (ret != 0) {
 				setenv("dvn_app_vers",
-					images[found_ramdisk].desc);
+					imgs[found_ramdisk].desc);
 			} else {
 				found_ramdisk = -1;
 				printf("no new ramdisk version\n");
 			}
 		} else {
-			setenv("dvn_app_vers", images[found_ramdisk].desc);
+			setenv("dvn_app_vers", imgs[found_ramdisk].desc);
 		}
 	}
 	if ((found_uboot == -1) && (found_ramdisk == -1))
Signature · 1 line
1.7.5.4
#243 lore raw

[U-Boot] SPL Linux Boot

In reply to Stefano Babic
Quoted 9 lines · Stefano Babic

Hi,

this should be the final version for the patchset introducing direct Linux booting from SPL.

Only Patch 1/14: "Add cmd_spl command" was modified. Patches 2/13 up to 12/13 are untouched from V13. Patch 13/13 fix a small issue by compiling the cam_enc_4xx board (Tom Rini)

My first question is, are we hoping to get this in for v2012.03 or push it off one more time, but really get it in (and put it in a /next branch now'ish) ?

Signature · 1 line
Tom
#244 lore raw

[U-Boot] SPL Linux Boot

Dear Tom Rini,

Quoted 9 lines · In message <20120316172653.GD4234@bill-the-cat> you wrote:
Quoted 5 lines

Only Patch 1/14: "Add cmd_spl command" was modified. Patches 2/13 up to 12/13 are untouched from V13. Patch 13/13 fix a small issue by compiling the cam_enc_4xx board (Tom Rini)

My first question is, are we hoping to get this in for v2012.03 or push it off one more time, but really get it in (and put it in a /next branch now'ish) ?

I want to get this into the upcoming release. I rather delay the release then keeping thie queued even longer.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Often it is fatal to live too long.                          - Racine
#245 lore raw

[U-Boot] SPL Linux Boot

Quoted 9 lines · Wolfgang Denk

Dear Tom Rini,

Quoted 6 lines · In message <20120316172653.GD4234@bill-the-cat> you wrote:
Quoted 5 lines

Only Patch 1/14: "Add cmd_spl command" was modified. Patches 2/13 up to 12/13 are untouched from V13. Patch 13/13 fix a small issue by compiling the cam_enc_4xx board (Tom Rini)

Quoted 6 lines
Quoted 3 lines

My first question is, are we hoping to get this in for v2012.03 or push it off one more time, but really get it in (and put it in a /next branch now'ish) ?

I want to get this into the upcoming release. I rather delay the release then keeping thie queued even longer.

OK, that said, I'm OK with everything so far and you had the last round of "please fix/change this" comments. Are you happy with it all now?

Signature · 1 line
Tom
#246 lore raw

[U-Boot] SPL Linux Boot

Dear Tom Rini,

Quoted 3 lines · In message <20120316193030.GC31661@bill-the-cat> you wrote:

OK, that said, I'm OK with everything so far and you had the last round of "please fix/change this" comments. Are you happy with it all now?

We can iterate forever on improvements, or we can get it in now. Let's do the latter :-)

Best regards,

Wolfgang Denk

Signature · 7 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I believe you find life such a problem because you  think  there  are
the  good  people  and the bad people. You're wrong, of course. There
are, always and only, the bad people, but some of them are  on  oppo-
site sides.                      - Terry Pratchett, _Guards! Guards!_
#247 lore raw

[U-Boot] SPL Linux Boot

Quoted 9 lines · Wolfgang Denk

Dear Tom Rini,

Quoted 3 lines · In message <20120316193030.GC31661@bill-the-cat> you wrote:

OK, that said, I'm OK with everything so far and you had the last round of "please fix/change this" comments. Are you happy with it all now?

We can iterate forever on improvements, or we can get it in now. Let's do the latter :-)

OK. But now we add to the ELDK 4.2 saga. This series adds not just a warning (well, 5 for CONFIG_OMAP I guess, 1 for everything else) for everything ARM but also breaks everything else over undefined reference to 'raise'. ELDK 5.1 is fine. Now what?

Signature · 1 line
Tom
#248 lore raw

[U-Boot] SPL Linux Boot

Dear Tom Rini,

Quoted 5 lines · In message <20120316212442.GE31661@bill-the-cat> you wrote:

OK. But now we add to the ELDK 4.2 saga. This series adds not just a warning (well, 5 for CONFIG_OMAP I guess, 1 for everything else) for everything ARM but also breaks everything else over undefined reference to 'raise'. ELDK 5.1 is fine. Now what?

This raise issue is probably due to a misconfiguration.

See "arch/arm/config.mk", search for "For EABI, make sure to provide raise()".

Check why arch/arm/lib/eabi_compat.c does not get compiled / linked.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How can you tell when sour cream goes bad?
#249 lore raw

[U-Boot] SPL Linux Boot

Quoted 9 lines · Wolfgang Denk

Dear Tom Rini,

Quoted 5 lines · In message <20120316212442.GE31661@bill-the-cat> you wrote:

OK. ?But now we add to the ELDK 4.2 saga. ?This series adds not just a warning (well, 5 for CONFIG_OMAP I guess, 1 for everything else) for everything ARM but also breaks everything else over undefined reference to 'raise'. ?ELDK 5.1 is fine. ?Now what?

Quoted 6 lines

This raise issue is probably due to a misconfiguration.

See "arch/arm/config.mk", search for "For EABI, make sure to provide raise()".

Check why arch/arm/lib/eabi_compat.c does not get compiled / linked.

Even if ELDK5.1 is totally fine? And other modern toolchains as well..

Signature · 1 line
Tom
#250 lore raw

[U-Boot] SPL Linux Boot

Quoted 3 lines · Tom Rini
Quoted 2 lines · Wolfgang Denk

Dear Tom Rini,

Hi Tom,

Quoted 7 lines
Quoted 7 lines
Quoted 5 lines · In message <20120316212442.GE31661@bill-the-cat> you wrote:

OK. But now we add to the ELDK 4.2 saga. This series adds not just a warning (well, 5 for CONFIG_OMAP I guess, 1 for everything else) for everything ARM but also breaks everything else over undefined reference to 'raise'. ELDK 5.1 is fine. Now what?

Quoted 9 lines
Quoted 6 lines

This raise issue is probably due to a misconfiguration.

See "arch/arm/config.mk", search for "For EABI, make sure to provide raise()".

Check why arch/arm/lib/eabi_compat.c does not get compiled / linked.

Even if ELDK5.1 is totally fine? And other modern toolchains as well..

Compiling with ELDK-4.2, I see only a couple of warnings more. But wihout any problem with raise. Really I had to revert "Revert "config.mk: Check for -fstack-usage support", but this is another story.

Stefano

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
=====================================================================
#251 lore raw

[U-Boot] SPL Linux Boot

In reply to Tom Rini

Dear Tom Rini,

Quoted 7 lines · In message <CA+M6bXk90TfweArc-dtFo3f8RG5jBmi7iz+KXmXGcxymHzfohQ@mail.gmail.com>…
Quoted 5 lines

See "arch/arm/config.mk", search for "For EABI, make sure to provide raise()".

Check why arch/arm/lib/eabi_compat.c does not get compiled / linked.

Even if ELDK5.1 is totally fine? And other modern toolchains as well..

Yes, this problem is supposed to be handled by the code I mentioned.

There must be an error somewhere, if it doesn;t work.

Does arch/arm/lib/eabi_compat.c get compiled and linked?

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Randal said it would be tough to do in sed. He didn't say  he  didn't
understand  sed.  Randal  understands sed quite well. Which is why he
uses Perl. :-)         - Larry Wall in <[email protected]>
#252 lore raw

[U-Boot] SPL Linux Boot

In reply to Tom Rini
Quoted 8 lines · Tom Rini
Quoted 7 lines · Wolfgang Denk

Dear Tom Rini,

Quoted 3 lines · In message <20120316193030.GC31661@bill-the-cat> you wrote:

OK, that said, I'm OK with everything so far and you had the last round of "please fix/change this" comments. Are you happy with it all now?

Quoted 7 lines
Quoted 2 lines

We can iterate forever on improvements, or we can get it in now. Let's do the latter :-)

OK. But now we add to the ELDK 4.2 saga. This series adds not just a warning (well, 5 for CONFIG_OMAP I guess, 1 for everything else) for everything ARM but also breaks everything else over undefined reference to 'raise'. ELDK 5.1 is fine. Now what?

Welp, now I don't get it. I saw this Friday, I don't see it today. I blame gremlins. MAKEALL -a arm is going along rather nicely, just the one warning Stefano also sees. I'll go fix that, post what I changed and get out an updated pull request for Albert.

Signature · 1 line
Tom
Tested-by
#253 lore raw

[U-Boot] SPL Linux Boot

In reply to Stefano Babic

Hello,

Quoted 22 lines · Stefano Babic

Hi,

this should be the final version for the patchset introducing direct Linux booting from SPL.

Only Patch 1/14: "Add cmd_spl command" was modified. Patches 2/13 up to 12/13 are untouched from V13. Patch 13/13 fix a small issue by compiling the cam_enc_4xx board (Tom Rini)

Changelog
--------------

[PATCH V14 01/13] Add cmd_spl command
[PATCH V14 02/13] devkit8000: add config for spl command [PATCH V14 03/13] omap-common: Add NAND SPL linux booting [PATCH V14 04/13] devkit8000/spl: init GPMC for dm9000 in SPL [PATCH V14 05/13] omap-common/spl: Add linux boot to SPL [PATCH V14 06/13] omap/spl: change output of spl_parse_image_header [PATCH V14 07/13] devkit8000: Implement and activate direct OS boot [PATCH V14 08/13] Add cache functions to SPL for armv7 [PATCH V14 09/13] OMAP3: SPL: do not call I2C init if no I2C is set.

Quoted 8 lines

[PATCH V14 10/13] SPL: call cleanup_before_linux() before booting [PATCH V14 11/13] OMAP3: twister: add support to boot Linux from SPL [PATCH V14 12/13] arm: Add Prep subcommand support to bootm [PATCH V14 13/13] cam_enc_4xx: Rename 'images' to 'imgs'
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

It applies on TI-u-boot, but TI-u-boot is still broken for Devkit8000 (SOFT_ECC).
After merging mainline-u-boot into TI-u-boot it works fine:

Thanks,

Thomas

#254 lore raw

[U-Boot] SPL Linux Boot

Am 17/03/2012 05:34, schrieb Thomas Weber:

Quoted 4 lines

Hello,

Quoted 2 lines · Stefano Babic

Hi,

Hi Thomas,

Quoted 3 lines
Quoted 1 line

http://lists.denx.de/mailman/listinfo/u-boot

It applies on TI-u-boot, but TI-u-boot is still broken for Devkit8000 (SOFT_ECC).

Yes, I have the same problem, too. The commit breaking TI boards is reverted in u-boot mainline.

Quoted 4 lines

After merging mainline-u-boot into TI-u-boot it works fine:

Thanks for testing,

Stefano

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
=====================================================================