Skip to contentSkip to conversation

ARM: SPL: Make more generic, merge DaVinci and OMAP

PATCH Superseded Tom Rini 4 participants 42 messages Aug 20, 2012 – Aug 24, 2012

Subsystems (6)

v2 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

Tom Rini

author
#0 lore raw

v2 cover ARM: SPL: Make more generic, merge DaVinci and OMAP

Hey all,

The following patch series merges the davinci and omap-common SPL frameworks into a single framework, CONFIG_SPL_FRAMEWORK along with a few small cleanups to the code to make it a little smaller and more flexible. The end result is that davinci can now opt in on SPL-boots-Linux by just setting the right defines and other platforms would just need to adapt to this framework. In my testing, davinci gains between 300 and 700 bytes for this (not enabling the SPL OS feature) and omap4/5/etc lose just a little bit (from the printf->puts changes). I've tested this on omap3_beagle (xM and classic) and omap4_panda. I don't have any davinci platforms that were previously using SPL so I can't boot-test those changes but since everyone sets CONFIG_SPL_MAX_SIZE, we're OK in that department.

To make this series easier to test I've placed it on
http://github.com/trini/u-boot WIP/spl-improvements

I've looked a little into re-reducing the size and the biggest problem I see is that SPI a lot of informational prints that we don't need, strictly speaking, but are nice in a normal U-Boot context. I'm unsure of the best way to quiet these as I don't like the idea of sprinkling
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54303 and I'm sending another email to discuss that.

Oh, and I've switched to using patman for this series now, please let me know if I made the tool do something silly :)

--
Tom

Changes in v2:
- Add CONFIG_SYS_SPL_MALLOC_START / SIZE defines from Christian Riesch
- Add arch/arm/cpu/arm926ejs/davinci/config.mk to build u-boot.ais
- Fix checkpatch warning (u32* boot_params_ptr -> u32 *boot_params_ptr)
- Place files into common/spl (due to gcc bug #54303) and include/spl.h
- Reorder all of the patches that used to follow this to precede.

Tom Rini (18):
Makefile: Move SPL files to clobber, remove from clean
spl_mmc: Make FAT checks / calls guarded with CONFIG_SPL_FAT_SUPPORT
omap-common: SPL: Add CONFIG_SPL_DISPLAY_PRINT / spl_display_print()
omap-common: Fix typo in save_boot_params() in lowlevel_init.S
ARM: SPL: Rename omap_boot_device to spl_boot_device
ARM: SPL: Rename omap_boot_mode to spl_boot_mode()
ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c
ARM: SPL: Only call mem_malloc_init if configured
ARM: SPL: Add <asm/spl.h> and <asm/arch/spl.h>
ARM: SPL: Make spl_mmc.c more generic
ARM: SPL: Clean up spl.c / spl_nand.c slightly
ARM: SPL: Start hooking in the current SPI SPL support
ARM: SPL: Move gpmc_init() to spl_board_init()
SPL: Move the omap SPL framework to common/spl
ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK
da850_am18xxevm: Add README.da850_am18xxevm
SPL: Enhance drivers/mtd/nand/nand_spl_load.c
SPL: Enhance spi_spl_load to match the other load functions

 Makefile                                           |   12 +--
 README                                             |    9 ++
 arch/arm/cpu/arm926ejs/davinci/config.mk           |   16 +++
 arch/arm/cpu/arm926ejs/davinci/spl.c               |   47 ++-------
 arch/arm/cpu/armv7/am33xx/board.c                  |    2 +-
 arch/arm/cpu/armv7/omap-common/Makefile            |   13 ---
 arch/arm/cpu/armv7/omap-common/boot-common.c       |   27 ++++-
 arch/arm/cpu/armv7/omap-common/hwinit-common.c     |    7 +-
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S     |    6 +-
 arch/arm/cpu/armv7/omap-common/spl_nand.c          |  111 --------------------
 arch/arm/cpu/armv7/omap3/board.c                   |   28 +++--
 arch/arm/include/asm/arch-am33xx/spl.h             |   31 ++++++
 arch/arm/include/asm/arch-davinci/spl.h            |   28 +++++
 arch/arm/include/asm/arch-omap3/spl.h              |   34 ++++++
 arch/arm/include/asm/arch-omap4/spl.h              |   35 ++++++
 arch/arm/include/asm/arch-omap4/sys_proto.h        |    1 -
 arch/arm/include/asm/arch-omap5/spl.h              |   35 ++++++
 arch/arm/include/asm/arch-omap5/sys_proto.h        |    1 -
 arch/arm/include/asm/omap_common.h                 |   77 --------------
 arch/arm/include/asm/spl.h                         |   29 +++++
 board/davinci/da8xxevm/README.da850_am18xxevm      |   53 ++++++++++
 board/overo/overo.c                                |   10 --
 common/spl/Makefile                                |   37 +++++++
 .../arm/cpu/armv7/omap-common => common/spl}/spl.c |   43 ++++----
 .../armv7/omap-common => common/spl}/spl_ymodem.c  |    3 +-
 doc/README.SPL                                     |    1 -
 drivers/mmc/Makefile                               |    5 +
 .../armv7/omap-common => drivers/mmc}/spl_mmc.c    |   24 ++---
 drivers/mtd/nand/Makefile                          |    7 +-
 drivers/mtd/nand/nand_spl_load.c                   |   89 +++++++++++-----
 drivers/mtd/spi/spi_spl_load.c                     |   23 ++--
 include/configs/am335x_evm.h                       |    1 +
 include/configs/am3517_crane.h                     |    2 +
 include/configs/am3517_evm.h                       |    2 +
 include/configs/cam_enc_4xx.h                      |    3 +-
 include/configs/da850evm.h                         |    5 +
 include/configs/devkit8000.h                       |    1 +
 include/configs/hawkboard.h                        |    3 +-
 include/configs/mcx.h                              |    2 +
 include/configs/omap3_beagle.h                     |    1 +
 include/configs/omap3_evm_common.h                 |    1 +
 include/configs/omap3_overo.h                      |    1 +
 include/configs/omap4_common.h                     |    2 +
 include/configs/omap5_evm.h                        |    2 +
 include/configs/tam3517-common.h                   |    2 +
 include/configs/tricorder.h                        |    1 +
 include/spl.h                                      |   69 ++++++++++++
 spl/Makefile                                       |    1 +
 48 files changed, 588 insertions(+), 355 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/config.mk
 delete mode 100644 arch/arm/cpu/armv7/omap-common/spl_nand.c
 create mode 100644 arch/arm/include/asm/arch-am33xx/spl.h
 create mode 100644 arch/arm/include/asm/arch-davinci/spl.h
 create mode 100644 arch/arm/include/asm/arch-omap3/spl.h
 create mode 100644 arch/arm/include/asm/arch-omap4/spl.h
 create mode 100644 arch/arm/include/asm/arch-omap5/spl.h
 create mode 100644 arch/arm/include/asm/spl.h
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
 create mode 100644 common/spl/Makefile
 rename {arch/arm/cpu/armv7/omap-common => common/spl}/spl.c (87%)
 rename {arch/arm/cpu/armv7/omap-common => common/spl}/spl_ymodem.c (96%)
 rename {arch/arm/cpu/armv7/omap-common => drivers/mmc}/spl_mmc.c (91%)
 create mode 100644 include/spl.h
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v2 1/18 Makefile: Move SPL files to clobber, remove from clean

The 'clean' target has been removing all of spl but not u-boot itself. For consistency and ease of testing, only remove SPL binaries / maps in the clobber target, just like for full U-Boot

---

 Makefile |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
Makefile +6 -6
index 73c8e39..57bb0b9 100644
@@ -763,12 +763,6 @@ clean:
 	@rm -f $(obj)lib/asm-offsets.s
 	@rm -f $(obj)include/generated/asm-offsets.h
 	@rm -f $(obj)$(CPUDIR)/$(SOC)/asm-offsets.s
-	@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
-	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
-	@rm -f $(ONENAND_BIN)
-	@rm -f $(obj)onenand_ipl/u-boot.lds
-	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
-	@rm -f $(obj)MLO
 	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
 	@find $(OBJTREE) -type f \
 		\( -name 'core' -o -name '*.bak' -o -name '*~' -o -name '*.su' \
@@ -793,6 +787,12 @@ clobber:	tidy
 	@rm -f $(obj)u-boot.dtb
 	@rm -f $(obj)u-boot.sb
 	@rm -f $(obj)u-boot.spr
+	@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-nand_spl.lds,u-boot-spl,u-boot-spl.map,System.map}
+	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
+	@rm -f $(ONENAND_BIN)
+	@rm -f $(obj)onenand_ipl/u-boot.lds
+	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
+	@rm -f $(obj)MLO
 	@rm -f $(obj)tools/xway-swap-bytes
 	@rm -f $(obj)arch/powerpc/cpu/mpc824x/bedbug_603e.c
 	@rm -f $(obj)arch/powerpc/cpu/mpc83xx/ddr-gen?.c
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v2 2/18 spl_mmc: Make FAT checks / calls guarded with CONFIG_SPL_FAT_SUPPORT

In reply to Tom Rini

---

 arch/arm/cpu/armv7/omap-common/spl_mmc.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/arm/cpu/armv7/omap-common/spl_mmc.c +4 -0
index 2f921bb..7552f6c 100644
@@ -84,6 +84,7 @@ end:
 	}
 }
 
+#ifdef CONFIG_SPL_FAT_SUPPORT
 static void mmc_load_image_fat(struct mmc *mmc)
 {
 	s32 err;
@@ -116,6 +117,7 @@ end:
 		hang();
 	}
 }
+#endif
 
 void spl_mmc_load_image(void)
 {
@@ -140,9 +142,11 @@ void spl_mmc_load_image(void)
 	if (boot_mode == MMCSD_MODE_RAW) {
 		debug("boot mode - RAW\n");
 		mmc_load_image_raw(mmc);
+#ifdef CONFIG_SPL_FAT_SUPPORT
 	} else if (boot_mode == MMCSD_MODE_FAT) {
 		debug("boot mode - FAT\n");
 		mmc_load_image_fat(mmc);
+#endif
 	} else {
 		puts("spl: wrong MMC boot mode\n");
 		hang();
Signature · 1 line
1.7.9.5
author
#3 lore raw

PATCH v2 3/18 omap-common: SPL: Add CONFIG_SPL_DISPLAY_PRINT / spl_display_print()

In reply to Tom Rini

Only omap4/5 currently have a meaningful set of display text and overo had been adding a function to display nothing. Change how this works to be opt-in and only turned on for omap4/5 now.

---

 README                                         |    4 ++++
 arch/arm/cpu/armv7/omap-common/hwinit-common.c |    5 +++++
 arch/arm/cpu/armv7/omap-common/spl.c           |    9 +++------
 arch/arm/include/asm/arch-omap4/sys_proto.h    |    1 -
 arch/arm/include/asm/arch-omap5/sys_proto.h    |    1 -
 arch/arm/include/asm/omap_common.h             |    2 +-
 board/overo/overo.c                            |   10 ----------
 include/configs/omap4_common.h                 |    1 +
 include/configs/omap5_evm.h                    |    1 +
 9 files changed, 15 insertions(+), 19 deletions(-)
README +4 -0
index fb9d904..f1a12a5 100644
@@ -2564,6 +2564,10 @@ FIT uImage format:
 		CONFIG_SYS_SPL_MALLOC_SIZE
 		The size of the malloc pool used in SPL.
 
+		CONFIG_SPL_DISPLAY_PRINT
+		For ARM, enable an optional function to print more information
+		about the running system.
+
 		CONFIG_SPL_LIBCOMMON_SUPPORT
 		Support for common/libcommon.o in SPL binary
 
arch/arm/cpu/armv7/omap-common/hwinit-common.c +5 -0
index 459ebb5..4d7ef5c 100644
@@ -92,6 +92,11 @@ static void init_boot_params(void)
 {
 	boot_params_ptr = (u32 *) &boot_params;
 }
+
+void spl_display_print(void)
+{
+	omap_rev_string();
+}
 #endif
 
 /*
arch/arm/cpu/armv7/omap-common/spl.c +3 -6
index 4d1ac85..b10832a 100644
@@ -219,10 +219,7 @@ void preloader_console_init(void)
 
 	printf("\nU-Boot SPL %s (%s - %s)\n", u_boot_rev, U_BOOT_DATE,
 		U_BOOT_TIME);
-	omap_rev_string();
-}
-
-void __weak omap_rev_string()
-{
-	printf("Texas Instruments Revision detection unimplemented\n");
+#ifdef CONFIG_SPL_DISPLAY_PRINT
+	spl_display_print();
+#endif
 }
arch/arm/include/asm/arch-omap4/sys_proto.h +0 -1
index d633573..b48f81d 100644
@@ -42,7 +42,6 @@ void sr32(void *, u32, u32, u32);
 u32 wait_on_value(u32, u32, void *, u32);
 void sdelay(unsigned long);
 void set_pl310_ctrl_reg(u32 val);
-void omap_rev_string(void);
 void setup_clocks_for_console(void);
 void prcm_init(void);
 void bypass_dpll(u32 *const base);
arch/arm/include/asm/arch-omap5/sys_proto.h +0 -1
index 74feb90..72e9df7 100644
@@ -42,7 +42,6 @@ void set_muxconf_regs_non_essential(void);
 void sr32(void *, u32, u32, u32);
 u32 wait_on_value(u32, u32, void *, u32);
 void sdelay(unsigned long);
-void omap_rev_string(void);
 void setup_clocks_for_console(void);
 void prcm_init(void);
 void bypass_dpll(u32 *const base);
arch/arm/include/asm/omap_common.h +1 -1
index 4e95eee..19df5ea 100644
@@ -94,9 +94,9 @@ 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);
 int spl_start_uboot(void);
+void spl_display_print(void);
 
 /* NAND SPL functions */
 void spl_nand_load_image(void);
board/overo/overo.c +0 -10
index f973870..c6d50a0 100644
@@ -101,16 +101,6 @@ int board_init(void)
 }
 
 /*
- * Routine: omap_rev_string
- * Description: For SPL builds output board rev
- */
-#ifdef CONFIG_SPL_BUILD
-void omap_rev_string(void)
-{
-}
-#endif
-
-/*
  * Routine: get_board_revision
  * Description: Returns the board revision
  */
include/configs/omap4_common.h +1 -0
index 2192c2b..685fde9 100644
@@ -249,6 +249,7 @@
 #define CONFIG_SPL_TEXT_BASE		0x40304350
 #define CONFIG_SPL_MAX_SIZE		(38 * 1024)
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
+#define CONFIG_SPL_DISPLAY_PRINT
 
 /*
  * 64 bytes before this address should be set aside for u-boot.img's
include/configs/omap5_evm.h +1 -0
index c5874bb..ef4034c 100644
@@ -246,6 +246,7 @@
 #define CONFIG_SPL_TEXT_BASE		0x40300350
 #define CONFIG_SPL_MAX_SIZE		0x19000	/* 100K */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
+#define CONFIG_SPL_DISPLAY_PRINT
 
 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR	0x300 /* address 0x60000 */
 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS	0x200 /* 256 KB */
Signature · 1 line
1.7.9.5
author
#4 lore raw

PATCH v2 4/18 omap-common: Fix typo in save_boot_params() in lowlevel_init.S

In reply to Tom Rini

---

 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/cpu/armv7/omap-common/lowlevel_init.S +1 -1
index ccc6bb6..48a296c 100644
@@ -63,7 +63,7 @@ ENTRY(save_boot_params)
 	blt	2f
 	cmp	r2, #7
 	bgt	2f
-	/* Store the boot mode (raw/FAT) in omap_boot_mode */
+	/* Store the boot mode (raw/FAT) in omap_bootmode */
 	ldr	r2, [r0, #DEV_DESC_PTR_OFFSET]	@ get the device descriptor ptr
 	ldr	r2, [r2, #DEV_DATA_PTR_OFFSET]	@ get the pDeviceData ptr
 	ldr	r2, [r2, #BOOT_MODE_OFFSET]	@ get the boot mode
Signature · 1 line
1.7.9.5
author
#5 lore raw

PATCH v2 5/18 ARM: SPL: Rename omap_boot_device to spl_boot_device

In reply to Tom Rini

---

 arch/arm/cpu/armv7/omap-common/boot-common.c   |    2 +-
 arch/arm/cpu/armv7/omap-common/lowlevel_init.S |    4 ++--
 arch/arm/cpu/armv7/omap-common/spl.c           |    2 +-
 arch/arm/cpu/armv7/omap-common/spl_mmc.c       |    2 +-
 arch/arm/cpu/armv7/omap3/board.c               |    4 ++--
 arch/arm/include/asm/omap_common.h             |    2 +-
 6 files changed, 8 insertions(+), 8 deletions(-)
arch/arm/cpu/armv7/omap-common/boot-common.c +1 -1
index f211f76..102a381 100644
@@ -37,7 +37,7 @@ struct omap_boot_parameters boot_params __attribute__ ((section(".data")));
  */
 u32 omap_bootmode = MMCSD_MODE_FAT;
 
-u32 omap_boot_device(void)
+u32 spl_boot_device(void)
 {
 	return (u32) (boot_params.omap_bootdevice);
 }
arch/arm/cpu/armv7/omap-common/lowlevel_init.S +2 -2
index 48a296c..dafe18b 100644
@@ -52,11 +52,11 @@ ENTRY(save_boot_params)
 	ldr	r1, =boot_params
 	str	r0, [r1]
 #ifdef CONFIG_SPL_BUILD
-	/* Store the boot device in omap_boot_device */
+	/* Store the boot device in spl_boot_device */
 	ldrb	r2, [r0, #BOOT_DEVICE_OFFSET]	@ r1 <- value of boot device
 	and	r2, #BOOT_DEVICE_MASK
 	ldr	r3, =boot_params
-	strb	r2, [r3, #BOOT_DEVICE_OFFSET]	@ omap_boot_device <- r1
+	strb	r2, [r3, #BOOT_DEVICE_OFFSET]	@ spl_boot_device <- r1
 
 	/* boot mode is passed only for devices that can raw/fat mode */
 	cmp	r2, #2
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index b10832a..4d33f99 100644
@@ -156,7 +156,7 @@ void board_init_r(gd_t *id, ulong dummy)
 	spl_board_init();
 #endif
 
-	boot_device = omap_boot_device();
+	boot_device = spl_boot_device();
 	debug("boot device - %d\n", boot_device);
 	switch (boot_device) {
 #ifdef CONFIG_SPL_MMC_SUPPORT
arch/arm/cpu/armv7/omap-common/spl_mmc.c +1 -1
index 7552f6c..3ad382b 100644
@@ -37,7 +37,7 @@ DECLARE_GLOBAL_DATA_PTR;
 #ifdef CONFIG_GENERIC_MMC
 int board_mmc_init(bd_t *bis)
 {
-	switch (omap_boot_device()) {
+	switch (spl_boot_device()) {
 	case BOOT_DEVICE_MMC1:
 		omap_mmc_init(0, 0, 0);
 		break;
arch/arm/cpu/armv7/omap3/board.c +2 -2
index f2e52e9..b4f4fee 100644
@@ -71,7 +71,7 @@ u32 omap3_boot_device = BOOT_DEVICE_NAND;
 /* auto boot mode detection is not possible for OMAP3 - hard code */
 u32 omap_boot_mode(void)
 {
-	switch (omap_boot_device()) {
+	switch (spl_boot_device()) {
 	case BOOT_DEVICE_MMC2:
 		return MMCSD_MODE_RAW;
 	case BOOT_DEVICE_MMC1:
@@ -86,7 +86,7 @@ u32 omap_boot_mode(void)
 	}
 }
 
-u32 omap_boot_device(void)
+u32 spl_boot_device(void)
 {
 	return omap3_boot_device;
 }
arch/arm/include/asm/omap_common.h +1 -1
index 19df5ea..a3853ce 100644
@@ -89,7 +89,7 @@ struct spl_image_info {
 extern struct spl_image_info spl_image;
 
 extern u32* boot_params_ptr;
-u32 omap_boot_device(void);
+u32 spl_boot_device(void);
 u32 omap_boot_mode(void);
 
 /* SPL common function s*/
Signature · 1 line
1.7.9.5
author
#6 lore raw

PATCH v2 6/18 ARM: SPL: Rename omap_boot_mode to spl_boot_mode()

In reply to Tom Rini

---

 arch/arm/cpu/armv7/omap-common/boot-common.c |    2 +-
 arch/arm/cpu/armv7/omap-common/spl_mmc.c     |    2 +-
 arch/arm/cpu/armv7/omap-common/spl_nand.c    |    2 +-
 arch/arm/cpu/armv7/omap3/board.c             |    2 +-
 arch/arm/include/asm/omap_common.h           |    2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/cpu/armv7/omap-common/boot-common.c +1 -1
index 102a381..53568ac 100644
@@ -42,7 +42,7 @@ u32 spl_boot_device(void)
 	return (u32) (boot_params.omap_bootdevice);
 }
 
-u32 omap_boot_mode(void)
+u32 spl_boot_mode(void)
 {
 	return omap_bootmode;
 }
arch/arm/cpu/armv7/omap-common/spl_mmc.c +1 -1
index 3ad382b..62b308b 100644
@@ -138,7 +138,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);
arch/arm/cpu/armv7/omap-common/spl_nand.c +1 -1
index 8cf55c9..ea7cc8a 100644
@@ -35,7 +35,7 @@ void spl_nand_load_image(void)
 	int *src __attribute__((unused));
 	int *dst __attribute__((unused));
 
-	switch (omap_boot_mode()) {
+	switch (spl_boot_mode()) {
 	case NAND_MODE_HW_ECC:
 		debug("spl: nand - using hw ecc\n");
 		gpmc_init();
arch/arm/cpu/armv7/omap3/board.c +1 -1
index b4f4fee..1640696 100644
@@ -69,7 +69,7 @@ const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx;
 u32 omap3_boot_device = BOOT_DEVICE_NAND;
 
 /* auto boot mode detection is not possible for OMAP3 - hard code */
-u32 omap_boot_mode(void)
+u32 spl_boot_mode(void)
 {
 	switch (spl_boot_device()) {
 	case BOOT_DEVICE_MMC2:
arch/arm/include/asm/omap_common.h +1 -1
index a3853ce..9ac0cc2 100644
@@ -90,7 +90,7 @@ extern struct spl_image_info spl_image;
 
 extern u32* boot_params_ptr;
 u32 spl_boot_device(void);
-u32 omap_boot_mode(void);
+u32 spl_boot_mode(void);
 
 /* SPL common function s*/
 void spl_parse_image_header(const struct image_header *header);
Signature · 1 line
1.7.9.5
author
#7 lore raw

PATCH v2 7/18 ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c

In reply to Tom Rini

This detection code doesn't (and can't) do anything currently, so remove.

---

 arch/arm/cpu/armv7/omap-common/spl_nand.c |   13 +++----------
 arch/arm/cpu/armv7/omap3/board.c          |    3 ---
 arch/arm/include/asm/omap_common.h        |    1 -
 3 files changed, 3 insertions(+), 14 deletions(-)
arch/arm/cpu/armv7/omap-common/spl_nand.c +3 -10
index ea7cc8a..39221d5 100644
@@ -35,16 +35,9 @@ void spl_nand_load_image(void)
 	int *src __attribute__((unused));
 	int *dst __attribute__((unused));
 
-	switch (spl_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();
-	}
+	debug("spl: nand - using hw ecc\n");
+	gpmc_init();
+	nand_init();
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
 	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
arch/arm/cpu/armv7/omap3/board.c +0 -3
index 1640696..a487374 100644
@@ -77,9 +77,6 @@ u32 spl_boot_mode(void)
 	case BOOT_DEVICE_MMC1:
 		return MMCSD_MODE_FAT;
 		break;
-	case BOOT_DEVICE_NAND:
-		return NAND_MODE_HW_ECC;
-		break;
 	default:
 		puts("spl: ERROR:  unknown device - can't select boot mode\n");
 		hang();
arch/arm/include/asm/omap_common.h +0 -1
index 9ac0cc2..1e8f59b 100644
@@ -76,7 +76,6 @@ void preloader_console_init(void);
 #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;
Signature · 1 line
1.7.9.5
author
#8 lore raw

PATCH v2 8/18 ARM: SPL: Only call mem_malloc_init if configured

In reply to Tom Rini

We can only attempt to setup a malloc pool if CONFIG_SYS_SPL_MALLOC_START is defined, and not all boards require it. Make the call depend on the define.

---

 arch/arm/cpu/armv7/omap-common/spl.c |    2 ++
 1 file changed, 2 insertions(+)
arch/arm/cpu/armv7/omap-common/spl.c +2 -0
index 4d33f99..71a467e 100644
@@ -149,8 +149,10 @@ void board_init_r(gd_t *id, ulong dummy)
 	u32 boot_device;
 	debug(">>spl:board_init_r()\n");
 
+#ifdef CONFIG_SYS_SPL_MALLOC_START
 	mem_malloc_init(CONFIG_SYS_SPL_MALLOC_START,
 			CONFIG_SYS_SPL_MALLOC_SIZE);
+#endif
 
 #ifdef CONFIG_SPL_BOARD_INIT
 	spl_board_init();
Signature · 1 line
1.7.9.5
author
#9 lore raw

PATCH v2 9/18 ARM: SPL: Add <asm/spl.h> and <asm/arch/spl.h>

In reply to Tom Rini

Move the SPL prototypes from <asm/omap_common.h> into <asm/spl.h> and add <asm/arch/spl.h> for arch specific portions of CONFIG_SPL_FRAMEWORK.

---
Changes in v2:
- Fix checkpatch warning (u32* boot_params_ptr -> u32 *boot_params_ptr)

 arch/arm/cpu/armv7/am33xx/board.c              |    2 +-
 arch/arm/cpu/armv7/omap-common/hwinit-common.c |    2 +-
 arch/arm/cpu/armv7/omap-common/spl.c           |    2 +-
 arch/arm/cpu/armv7/omap-common/spl_mmc.c       |    1 +
 arch/arm/cpu/armv7/omap-common/spl_nand.c      |    2 +-
 arch/arm/cpu/armv7/omap-common/spl_ymodem.c    |    2 +-
 arch/arm/cpu/armv7/omap3/board.c               |    1 +
 arch/arm/include/asm/arch-am33xx/spl.h         |   31 +++++++++++
 arch/arm/include/asm/arch-omap3/spl.h          |   34 ++++++++++++
 arch/arm/include/asm/arch-omap4/spl.h          |   35 ++++++++++++
 arch/arm/include/asm/arch-omap5/spl.h          |   35 ++++++++++++
 arch/arm/include/asm/omap_common.h             |   71 ------------------------
 arch/arm/include/asm/spl.h                     |   61 ++++++++++++++++++++
 13 files changed, 203 insertions(+), 76 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-am33xx/spl.h
 create mode 100644 arch/arm/include/asm/arch-omap3/spl.h
 create mode 100644 arch/arm/include/asm/arch-omap4/spl.h
 create mode 100644 arch/arm/include/asm/arch-omap5/spl.h
 create mode 100644 arch/arm/include/asm/spl.h
arch/arm/cpu/armv7/am33xx/board.c +1 -1
index 71309a7..fadc6e7 100644
@@ -25,7 +25,7 @@
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/common_def.h>
 #include <asm/io.h>
-#include <asm/omap_common.h>
+#include <asm/spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/cpu/armv7/omap-common/hwinit-common.c +1 -1
index 4d7ef5c..d5fde38 100644
@@ -31,7 +31,7 @@
 #include <asm/arch/sys_proto.h>
 #include <asm/sizes.h>
 #include <asm/emif.h>
-#include <asm/omap_common.h>
+#include <asm/spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/cpu/armv7/omap-common/spl.c +1 -1
index 71a467e..81991b2 100644
@@ -23,6 +23,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <asm/spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
@@ -30,7 +31,6 @@
 #include <mmc.h>
 #include <fat.h>
 #include <version.h>
-#include <asm/omap_common.h>
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <image.h>
arch/arm/cpu/armv7/omap-common/spl_mmc.c +1 -0
index 62b308b..fe44538 100644
@@ -23,6 +23,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <asm/spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
arch/arm/cpu/armv7/omap-common/spl_nand.c +1 -1
index 39221d5..6552a5d 100644
@@ -21,13 +21,13 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <asm/spl.h>
 #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>
 
 void spl_nand_load_image(void)
 {
arch/arm/cpu/armv7/omap-common/spl_ymodem.c +1 -1
index 47663f7..65565e3 100644
@@ -26,11 +26,11 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <asm/spl.h>
 #include <xyzModem.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
-#include <asm/omap_common.h>
 
 #define BUF_SIZE 1024
 
arch/arm/cpu/armv7/omap3/board.c +1 -0
index a487374..45976f9 100644
@@ -39,6 +39,7 @@
 #include <asm/cache.h>
 #include <asm/armv7.h>
 #include <asm/arch/gpio.h>
+#include <asm/spl.h>
 #include <asm/omap_common.h>
 #include <i2c.h>
 #include <linux/compiler.h>
arch/arm/include/asm/arch-am33xx/spl.h new file +31 -0
new file mode 100644
index 0000000..f25afe4
@@ -0,0 +1,31 @@
+/*
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ *
+ * 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	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NAND	5
+#define BOOT_DEVICE_MMC1	8
+#define BOOT_DEVICE_MMC2	0
+#define BOOT_DEVICE_UART	65
+#define BOOT_DEVICE_MMC2_2      0xFF
+#endif
arch/arm/include/asm/arch-omap3/spl.h new file +34 -0
new file mode 100644
index 0000000..404e16a
@@ -0,0 +1,34 @@
+/*
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ *
+ * 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	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NONE	0
+#define BOOT_DEVICE_XIP		1
+#define BOOT_DEVICE_NAND	2
+#define BOOT_DEVICE_ONE_NAND	3
+#define BOOT_DEVICE_MMC2	5 /*emmc*/
+#define BOOT_DEVICE_MMC1	6
+#define BOOT_DEVICE_XIPWAIT	7
+#define BOOT_DEVICE_MMC2_2      0xFF
+#endif
arch/arm/include/asm/arch-omap4/spl.h new file +35 -0
new file mode 100644
index 0000000..cec84dc
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ *
+ * 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	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NONE	0
+#define BOOT_DEVICE_XIP		1
+#define BOOT_DEVICE_XIPWAIT	2
+#define BOOT_DEVICE_NAND	3
+#define BOOT_DEVICE_ONE_NAND	4
+#define BOOT_DEVICE_MMC1	5
+#define BOOT_DEVICE_MMC2	6
+#define BOOT_DEVICE_MMC2_2	0xFF
+
+#endif
arch/arm/include/asm/arch-omap5/spl.h new file +35 -0
new file mode 100644
index 0000000..d125c61
@@ -0,0 +1,35 @@
+/*
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ *
+ * 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	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NONE        0
+#define BOOT_DEVICE_XIP         1
+#define BOOT_DEVICE_XIPWAIT     2
+#define BOOT_DEVICE_NAND        3
+#define BOOT_DEVICE_ONE_NAND    4
+#define BOOT_DEVICE_MMC1        5
+#define BOOT_DEVICE_MMC2        6
+#define BOOT_DEVICE_MMC2_2	7
+
+#endif
arch/arm/include/asm/omap_common.h +0 -71

82 lines not on this page · raw message

arch/arm/include/asm/spl.h new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
1.7.9.5
author
#10 lore raw

PATCH v2 10/18 ARM: SPL: Make spl_mmc.c more generic

In reply to Tom Rini

Move the default omap/related-centric board_mmc_init to arch/arm/cpu/armv7/omap-common/boot-common.c and move the type defines to <asm/spl.h>

---

 arch/arm/cpu/armv7/omap-common/boot-common.c |   16 ++++++++++++++++
 arch/arm/cpu/armv7/omap-common/spl_mmc.c     |   17 -----------------
 arch/arm/cpu/armv7/omap3/board.c             |   15 +++++++++++++++
 arch/arm/include/asm/omap_common.h           |    5 -----
 arch/arm/include/asm/spl.h                   |    5 +++++
 5 files changed, 36 insertions(+), 22 deletions(-)
arch/arm/cpu/armv7/omap-common/boot-common.c +16 -0
index 53568ac..3406cfb 100644
@@ -17,8 +17,10 @@
  */
 
 #include <common.h>
+#include <asm/spl.h>
 #include <asm/omap_common.h>
 #include <asm/arch/omap.h>
+#include <asm/arch/mmc_host_def.h>
 
 /*
  * This is used to verify if the configuration header
@@ -46,4 +48,18 @@ u32 spl_boot_mode(void)
 {
 	return omap_bootmode;
 }
+
+int board_mmc_init(bd_t *bis)
+{
+	switch (spl_boot_device()) {
+	case BOOT_DEVICE_MMC1:
+		omap_mmc_init(0, 0, 0);
+		break;
+	case BOOT_DEVICE_MMC2:
+	case BOOT_DEVICE_MMC2_2:
+		omap_mmc_init(1, 0, 0);
+		break;
+	}
+	return 0;
+}
 #endif
arch/arm/cpu/armv7/omap-common/spl_mmc.c +0 -17
index fe44538..5c65ba5 100644
@@ -30,27 +30,10 @@
 #include <mmc.h>
 #include <fat.h>
 #include <version.h>
-#include <asm/omap_common.h>
 #include <asm/arch/mmc_host_def.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
-#ifdef CONFIG_GENERIC_MMC
-int board_mmc_init(bd_t *bis)
-{
-	switch (spl_boot_device()) {
-	case BOOT_DEVICE_MMC1:
-		omap_mmc_init(0, 0, 0);
-		break;
-	case BOOT_DEVICE_MMC2:
-	case BOOT_DEVICE_MMC2_2:
-		omap_mmc_init(1, 0, 0);
-		break;
-	}
-	return 0;
-}
-#endif
-
 static void mmc_load_image_raw(struct mmc *mmc)
 {
 	u32 image_size_sectors, err;
arch/arm/cpu/armv7/omap3/board.c +15 -0
index 45976f9..3d74f09 100644
@@ -41,6 +41,7 @@
 #include <asm/arch/gpio.h>
 #include <asm/spl.h>
 #include <asm/omap_common.h>
+#include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <linux/compiler.h>
 
@@ -89,6 +90,20 @@ u32 spl_boot_device(void)
 	return omap3_boot_device;
 }
 
+int board_mmc_init(bd_t *bis)
+{
+	switch (spl_boot_device()) {
+	case BOOT_DEVICE_MMC1:
+		omap_mmc_init(0, 0, 0);
+		break;
+	case BOOT_DEVICE_MMC2:
+	case BOOT_DEVICE_MMC2_2:
+		omap_mmc_init(1, 0, 0);
+		break;
+	}
+	return 0;
+}
+
 void spl_board_init(void)
 {
 #ifdef CONFIG_SPL_I2C_SUPPORT
arch/arm/include/asm/omap_common.h +0 -5
index 775ab6c..2a40b89 100644
@@ -34,11 +34,6 @@
 #define OMAP_INIT_CONTEXT_UBOOT_AFTER_SPL	2
 #define OMAP_INIT_CONTEXT_UBOOT_AFTER_CH	3
 
-/* Boot type */
-#define	MMCSD_MODE_UNDEFINED	0
-#define MMCSD_MODE_RAW		1
-#define MMCSD_MODE_FAT		2
-
 static inline u32 omap_revision(void)
 {
 	extern u32 *const omap_si_rev;
arch/arm/include/asm/spl.h +5 -0
index 19e6c50..fdb78b5 100644
@@ -26,6 +26,11 @@
 /* Platform-specific defines */
 #include <asm/arch/spl.h>
 
+/* Boot type */
+#define MMCSD_MODE_UNDEFINED	0
+#define MMCSD_MODE_RAW		1
+#define MMCSD_MODE_FAT		2
+
 struct spl_image_info {
 	const char *name;
 	u8 os;
Signature · 1 line
1.7.9.5
author
#11 lore raw

PATCH v2 11/18 ARM: SPL: Clean up spl.c / spl_nand.c slightly

In reply to Tom Rini

- Remove includes we don't need
- Switch some printf statements to puts
- Convert some printf statements to debug, introduce new puts statements
- In most cases saying just "No mkimage signature, assuming u-boot.bin" or similar is sufficient. This also means the non-DEBUG case doesn't need printf, in the core of SPL.
- The other case here is that PLAIN_VERSION provided what we wanted already, so just use it.

---

 arch/arm/cpu/armv7/omap-common/spl.c      |   23 ++++++++---------------
 arch/arm/cpu/armv7/omap-common/spl_nand.c |    1 -
 2 files changed, 8 insertions(+), 16 deletions(-)
arch/arm/cpu/armv7/omap-common/spl.c +8 -15
index 81991b2..3a1029f 100644
@@ -26,12 +26,9 @@
 #include <asm/spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
-#include <asm/arch/sys_proto.h>
 #include <nand.h>
-#include <mmc.h>
 #include <fat.h>
 #include <version.h>
-#include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
 #include <image.h>
 #include <malloc.h>
@@ -78,8 +75,8 @@ void board_init_f(ulong dummy)
 #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");
+	puts("SPL: Please implement spl_start_uboot() for your board\n");
+	puts("SPL: Direct Linux boot not active!\n");
 	return 1;
 }
 #endif
@@ -99,9 +96,9 @@ void spl_parse_image_header(const struct image_header *header)
 			spl_image.name, spl_image.load_addr, spl_image.size);
 	} else {
 		/* Signature not found - assume u-boot.bin */
-		printf("mkimage signature not found - ih_magic = %x\n",
+		puts("mkimage signature not found, assuming u-boot.bin ..\n");
+		debug("mkimage signature not found - ih_magic = %x\n",
 			header->ih_magic);
-		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;
@@ -179,7 +176,8 @@ void board_init_r(gd_t *id, ulong dummy)
 		break;
 #endif
 	default:
-		printf("SPL: Un-supported Boot Device - %d!!!\n", boot_device);
+		puts("SPL: Un-supported Boot Device\n");
+		debug("Found: %d\n", boot_device);
 		hang();
 		break;
 	}
@@ -205,8 +203,6 @@ void board_init_r(gd_t *id, ulong dummy)
 /* This requires UART clocks to be enabled */
 void preloader_console_init(void)
 {
-	const char *u_boot_rev = U_BOOT_VERSION;
-
 	gd = &gdata;
 	gd->bd = &bdata;
 	gd->flags |= GD_FLG_RELOC;
@@ -216,11 +212,8 @@ void preloader_console_init(void)
 
 	gd->have_console = 1;
 
-	/* Avoid a second "U-Boot" coming from this string */
-	u_boot_rev = &u_boot_rev[7];
-
-	printf("\nU-Boot SPL %s (%s - %s)\n", u_boot_rev, U_BOOT_DATE,
-		U_BOOT_TIME);
+	puts("\nU-Boot SPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
+			U_BOOT_TIME ")\n");
 #ifdef CONFIG_SPL_DISPLAY_PRINT
 	spl_display_print();
 #endif
arch/arm/cpu/armv7/omap-common/spl_nand.c +0 -1
index 6552a5d..3e2f359 100644
@@ -24,7 +24,6 @@
 #include <asm/spl.h>
 #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>
Signature · 1 line
1.7.9.5
author
#12 lore raw

PATCH v2 12/18 ARM: SPL: Start hooking in the current SPI SPL support

In reply to Tom Rini

---

 arch/arm/cpu/armv7/omap-common/spl.c |    5 +++++
 arch/arm/include/asm/spl.h           |    3 +++
 2 files changed, 8 insertions(+)
arch/arm/cpu/armv7/omap-common/spl.c +5 -0
index 3a1029f..dc26750 100644
@@ -175,6 +175,11 @@ void board_init_r(gd_t *id, ulong dummy)
 		spl_ymodem_load_image();
 		break;
 #endif
+#ifdef CONFIG_SPL_SPI_SUPPORT
+	case BOOT_DEVICE_SPI:
+		spi_boot();
+	break;
+#endif
 	default:
 		puts("SPL: Un-supported Boot Device\n");
 		debug("Found: %d\n", boot_device);
arch/arm/include/asm/spl.h +3 -0
index fdb78b5..47ca1b6 100644
@@ -60,6 +60,9 @@ void spl_mmc_load_image(void);
 /* YMODEM SPL functions */
 void spl_ymodem_load_image(void);
 
+/* SPI SPL functions */
+void spi_boot(void);
+
 #ifdef CONFIG_SPL_BOARD_INIT
 void spl_board_init(void);
 #endif
Signature · 1 line
1.7.9.5
author
#13 lore raw

PATCH v2 13/18 ARM: SPL: Move gpmc_init() to spl_board_init()

In reply to Tom Rini

This is an OMAP/related-specific function, move calling it to spl_board_init() and turn on CONFIG_SPL_BOARD_INIT on the boards that enabled NAND and didn't enable this already.

---

 arch/arm/cpu/armv7/omap-common/boot-common.c |    7 +++++++
 arch/arm/cpu/armv7/omap-common/spl_nand.c    |    1 -
 arch/arm/cpu/armv7/omap3/board.c             |    3 +++
 include/configs/am3517_crane.h               |    1 +
 include/configs/am3517_evm.h                 |    1 +
 include/configs/mcx.h                        |    1 +
 include/configs/tam3517-common.h             |    1 +
 7 files changed, 14 insertions(+), 1 deletion(-)
arch/arm/cpu/armv7/omap-common/boot-common.c +7 -0
index 3406cfb..ed398fd 100644
@@ -49,6 +49,13 @@ u32 spl_boot_mode(void)
 	return omap_bootmode;
 }
 
+void spl_board_init(void)
+{
+#ifdef CONFIG_SPL_NAND_SUPPORT
+	gpmc_init();
+#endif
+}
+
 int board_mmc_init(bd_t *bis)
 {
 	switch (spl_boot_device()) {
arch/arm/cpu/armv7/omap-common/spl_nand.c +0 -1
index 3e2f359..1e6b5f0 100644
@@ -35,7 +35,6 @@ void spl_nand_load_image(void)
 	int *dst __attribute__((unused));
 
 	debug("spl: nand - using hw ecc\n");
-	gpmc_init();
 	nand_init();
 
 	/*use CONFIG_SYS_TEXT_BASE as temporary storage area */
arch/arm/cpu/armv7/omap3/board.c +3 -0
index 3d74f09..52196c8 100644
@@ -106,6 +106,9 @@ int board_mmc_init(bd_t *bis)
 
 void spl_board_init(void)
 {
+#ifdef CONFIG_SPL_NAND_SUPPORT
+	gpmc_init();
+#endif
 #ifdef CONFIG_SPL_I2C_SUPPORT
 	i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
 #endif
include/configs/am3517_crane.h +1 -0
index 54ab3eb..b312028 100644
@@ -322,6 +322,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_TEXT_BASE		0x40200800
 #define CONFIG_SPL_MAX_SIZE		(54 * 1024)	/* 8 KB for stack */
include/configs/am3517_evm.h +1 -0
index ed0a601..ab2ddc0 100644
@@ -321,6 +321,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_TEXT_BASE		0x40200800
 #define CONFIG_SPL_MAX_SIZE		(54 * 1024)	/* 8 KB for stack */
include/configs/mcx.h +1 -0
index 970c882..d9cfc10 100644
@@ -309,6 +309,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_SOFTECC
 
include/configs/tam3517-common.h +1 -0
index 777f77c..e194b46 100644
@@ -241,6 +241,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_CONSOLE
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_SOFTECC
Signature · 1 line
1.7.9.5
author
#14 lore raw

PATCH v2 14/18 SPL: Move the omap SPL framework to common/spl

In reply to Tom Rini

Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the common/spl SPL framework, enable on all of the previously using boards. We move the spl_ymodem.c portion to common/ and spl_mmc.c to drivers/mmc/. We leave the NAND one in-place as we plan to replace it later in this series.

We use common/spl to avoid linker problems with respect to merging
constant strings in objects. Otherwise all strings in common/ will be
linked in and kept which grows SPL in size too much.

---
Changes in v2:
- Place files into common/spl (due to gcc bug #54303) and include/spl.h
- Reorder all of the patches that used to follow this to precede.

 README                                             |    5 ++
 arch/arm/cpu/armv7/am33xx/board.c                  |    2 +-
 arch/arm/cpu/armv7/omap-common/Makefile            |    7 --
 arch/arm/cpu/armv7/omap-common/boot-common.c       |    2 +-
 arch/arm/cpu/armv7/omap-common/hwinit-common.c     |    2 +-
 arch/arm/cpu/armv7/omap-common/spl_nand.c          |    2 +-
 arch/arm/cpu/armv7/omap3/board.c                   |    2 +-
 arch/arm/include/asm/spl.h                         |   40 ------------
 common/spl/Makefile                                |   37 +++++++++++
 .../arm/cpu/armv7/omap-common => common/spl}/spl.c |    2 +-
 .../armv7/omap-common => common/spl}/spl_ymodem.c  |    3 +-
 drivers/mmc/Makefile                               |    5 ++
 .../armv7/omap-common => drivers/mmc}/spl_mmc.c    |    2 +-
 include/configs/am335x_evm.h                       |    1 +
 include/configs/am3517_crane.h                     |    1 +
 include/configs/am3517_evm.h                       |    1 +
 include/configs/devkit8000.h                       |    1 +
 include/configs/mcx.h                              |    1 +
 include/configs/omap3_beagle.h                     |    1 +
 include/configs/omap3_evm_common.h                 |    1 +
 include/configs/omap3_overo.h                      |    1 +
 include/configs/omap4_common.h                     |    1 +
 include/configs/omap5_evm.h                        |    1 +
 include/configs/tam3517-common.h                   |    1 +
 include/configs/tricorder.h                        |    1 +
 include/spl.h                                      |   69 ++++++++++++++++++++
 spl/Makefile                                       |    1 +
 27 files changed, 137 insertions(+), 56 deletions(-)
 create mode 100644 common/spl/Makefile
 rename {arch/arm/cpu/armv7/omap-common => common/spl}/spl.c (99%)
 rename {arch/arm/cpu/armv7/omap-common => common/spl}/spl_ymodem.c (97%)
 rename {arch/arm/cpu/armv7/omap-common => drivers/mmc}/spl_mmc.c (99%)
 create mode 100644 include/spl.h
README +5 -0
index f1a12a5..ddbeb1b 100644
@@ -2564,6 +2564,11 @@ FIT uImage format:
 		CONFIG_SYS_SPL_MALLOC_SIZE
 		The size of the malloc pool used in SPL.
 
+		CONFIG_SPL_FRAMEWORK
+		Enable the SPL framework under common/.  This framework
+		supports MMC, NAND and YMODEM loading of U-Boot and NAND
+		NAND loading of the Linux Kernel.
+
 		CONFIG_SPL_DISPLAY_PRINT
 		For ARM, enable an optional function to print more information
 		about the running system.
arch/arm/cpu/armv7/am33xx/board.c +1 -1
index fadc6e7..d759a98 100644
@@ -17,6 +17,7 @@
  */
 
 #include <common.h>
+#include <spl.h>
 #include <asm/arch/cpu.h>
 #include <asm/arch/hardware.h>
 #include <asm/arch/omap.h>
@@ -25,7 +26,6 @@
 #include <asm/arch/mmc_host_def.h>
 #include <asm/arch/common_def.h>
 #include <asm/io.h>
-#include <asm/spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/cpu/armv7/omap-common/Makefile +0 -7
index 2a6625f..837e22e 100644
@@ -46,16 +46,9 @@ 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
-ifdef CONFIG_SPL_YMODEM_SUPPORT
-COBJS	+= spl_ymodem.o
-endif
 endif
 
 ifndef CONFIG_SPL_BUILD
arch/arm/cpu/armv7/omap-common/boot-common.c +1 -1
index ed398fd..0f19141 100644
@@ -17,7 +17,7 @@
  */
 
 #include <common.h>
-#include <asm/spl.h>
+#include <spl.h>
 #include <asm/omap_common.h>
 #include <asm/arch/omap.h>
 #include <asm/arch/mmc_host_def.h>
arch/arm/cpu/armv7/omap-common/hwinit-common.c +1 -1
index d5fde38..ad8b5ac 100644
@@ -28,10 +28,10 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <spl.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/sizes.h>
 #include <asm/emif.h>
-#include <asm/spl.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
arch/arm/cpu/armv7/omap-common/spl_nand.c +1 -1
index 1e6b5f0..9e9206c 100644
@@ -21,7 +21,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
-#include <asm/spl.h>
+#include <spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/io.h>
arch/arm/cpu/armv7/omap3/board.c +1 -1
index 52196c8..42e2fd9 100644
@@ -33,13 +33,13 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
+#include <spl.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/mem.h>
 #include <asm/cache.h>
 #include <asm/armv7.h>
 #include <asm/arch/gpio.h>
-#include <asm/spl.h>
 #include <asm/omap_common.h>
 #include <asm/arch/mmc_host_def.h>
 #include <i2c.h>
arch/arm/include/asm/spl.h +0 -40
index 47ca1b6..ad61990 100644
@@ -26,44 +26,4 @@
 /* Platform-specific defines */
 #include <asm/arch/spl.h>
 
-/* Boot type */
-#define MMCSD_MODE_UNDEFINED	0
-#define MMCSD_MODE_RAW		1
-#define MMCSD_MODE_FAT		2
-
-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;
-
-/* SPL common functions */
-void preloader_console_init(void);
-u32 spl_boot_device(void);
-u32 spl_boot_mode(void);
-void spl_parse_image_header(const struct image_header *header);
-void spl_board_prepare_for_linux(void);
-int spl_start_uboot(void);
-void spl_display_print(void);
-
-/* NAND SPL functions */
-void spl_nand_load_image(void);
-
-/* MMC SPL functions */
-void spl_mmc_load_image(void);
-
-/* YMODEM SPL functions */
-void spl_ymodem_load_image(void);
-
-/* SPI SPL functions */
-void spi_boot(void);
-
-#ifdef CONFIG_SPL_BOARD_INIT
-void spl_board_init(void);
-#endif
 #endif
common/spl/Makefile new file +37 -0
new file mode 100644
index 0000000..b61b438
@@ -0,0 +1,37 @@
+#
+# (C) Copyright 2012
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <[email protected]>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+# Based on common/Makefile.
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)libspl.o
+
+ifdef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_SPL_FRAMEWORK) += spl.o
+COBJS-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o
+endif
+
+COBJS	:= $(sort $(COBJS-y))
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
common/spl/spl.c renamed from arch/arm/cpu/armv7/omap-common/spl.c +1 -1
similarity index 99%
rename from arch/arm/cpu/armv7/omap-common/spl.c
rename to common/spl/spl.c
index dc26750..3a2740a 100644
@@ -23,7 +23,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
-#include <asm/spl.h>
+#include <spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <nand.h>
common/spl/spl_ymodem.c renamed from arch/arm/cpu/armv7/omap-common/spl_ymodem.c +1 -2
similarity index 97%
rename from arch/arm/cpu/armv7/omap-common/spl_ymodem.c
rename to common/spl/spl_ymodem.c
index 65565e3..40e5035 100644
@@ -26,11 +26,10 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
-#include <asm/spl.h>
+#include <spl.h>
 #include <xyzModem.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
-#include <asm/arch/sys_proto.h>
 
 #define BUF_SIZE 1024
 
drivers/mmc/Makefile +5 -0
index c567737..9abaf1a 100644
@@ -25,6 +25,11 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libmmc.o
 
+ifdef CONFIG_SPL_BUILD
+ifdef CONFIG_SPL_FRAMEWORK
+COBJS-$(CONFIG_SPL_MMC_SUPPORT) += spl_mmc.o
+endif
+endif
 COBJS-$(CONFIG_BFIN_SDH) += bfin_sdh.o
 COBJS-$(CONFIG_DAVINCI_MMC) += davinci_mmc.o
 COBJS-$(CONFIG_FSL_ESDHC) += fsl_esdhc.o
drivers/mmc/spl_mmc.c renamed from arch/arm/cpu/armv7/omap-common/spl_mmc.c +1 -1
similarity index 99%
rename from arch/arm/cpu/armv7/omap-common/spl_mmc.c
rename to drivers/mmc/spl_mmc.c
index 5c65ba5..7ae7c37 100644
@@ -23,7 +23,7 @@
  * MA 02111-1307 USA
  */
 #include <common.h>
-#include <asm/spl.h>
+#include <spl.h>
 #include <asm/u-boot.h>
 #include <asm/utils.h>
 #include <asm/arch/sys_proto.h>
include/configs/am335x_evm.h +1 -0
index d0fbc88..cda2c4f 100644
@@ -126,6 +126,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE		0x402F0400
 #define CONFIG_SPL_MAX_SIZE		(46 * 1024)
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
include/configs/am3517_crane.h +1 -0
index b312028..9f4c386 100644
@@ -322,6 +322,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_TEXT_BASE		0x40200800
include/configs/am3517_evm.h +1 -0
index ab2ddc0..8f2ac89 100644
@@ -321,6 +321,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_TEXT_BASE		0x40200800
include/configs/devkit8000.h +1 -0
index 037a5bb..47187cf 100644
@@ -305,6 +305,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
 
 #define CONFIG_SPL_LIBCOMMON_SUPPORT
include/configs/mcx.h +1 -0
index d9cfc10..4f29da6 100644
@@ -309,6 +309,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_SOFTECC
include/configs/omap3_beagle.h +1 -0
index 657780e..1b4e2ee 100644
@@ -398,6 +398,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_TEXT_BASE		0x40200800
 #define CONFIG_SPL_MAX_SIZE		(54 * 1024)	/* 8 KB for stack */
include/configs/omap3_evm_common.h +1 -0
index 20192a9..22f30f4 100644
@@ -280,6 +280,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE		0x40200800
 #define CONFIG_SPL_MAX_SIZE		(54 * 1024)	/* 8 KB for stack */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
include/configs/omap3_overo.h +1 -0
index d29b326..8e63802 100644
@@ -300,6 +300,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_TEXT_BASE		0x40200800
 #define CONFIG_SPL_MAX_SIZE		(54 * 1024)	/* 8 KB for stack */
include/configs/omap4_common.h +1 -0
index 685fde9..1384522 100644
@@ -246,6 +246,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE		0x40304350
 #define CONFIG_SPL_MAX_SIZE		(38 * 1024)
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
include/configs/omap5_evm.h +1 -0
index ef4034c..65a34fa 100644
@@ -243,6 +243,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_TEXT_BASE		0x40300350
 #define CONFIG_SPL_MAX_SIZE		0x19000	/* 100K */
 #define CONFIG_SPL_STACK		LOW_LEVEL_SRAM_STACK
include/configs/tam3517-common.h +1 -0
index e194b46..bb2cb7c 100644
@@ -241,6 +241,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_CONSOLE
 #define CONFIG_SPL_NAND_SIMPLE
include/configs/tricorder.h +1 -0
index 56336ae..0679f18 100644
@@ -275,6 +275,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NAND_SIMPLE
 
 #define CONFIG_SPL_BOARD_INIT
include/spl.h new file +69 -0

69 lines not on this page · raw message

spl/Makefile +1 -0
index ea7d475..f96c08e 100644
@@ -42,6 +42,7 @@ endif
 LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
 LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
 
+LIBS-$(CONFIG_SPL_FRAMEWORK) += common/spl/libspl.o
 LIBS-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/libcommon.o
 LIBS-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/libdisk.o
 LIBS-$(CONFIG_SPL_I2C_SUPPORT) += drivers/i2c/libi2c.o
Signature · 1 line
1.7.9.5
author
#15 lore raw

PATCH v2 15/18 ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

In reply to Tom Rini

- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

---
Changes in v2:
- Add CONFIG_SYS_SPL_MALLOC_START / SIZE defines from Christian Riesch
- Add arch/arm/cpu/arm926ejs/davinci/config.mk to build u-boot.ais

 arch/arm/cpu/arm926ejs/davinci/config.mk |   16 +++++++++++
 arch/arm/cpu/arm926ejs/davinci/spl.c     |   45 +++++++-----------------------
 arch/arm/include/asm/arch-davinci/spl.h  |   28 +++++++++++++++++++
 include/configs/cam_enc_4xx.h            |    2 ++
 include/configs/da850evm.h               |    5 ++++
 include/configs/hawkboard.h              |    2 ++
 6 files changed, 63 insertions(+), 35 deletions(-)
 create mode 100644 arch/arm/cpu/arm926ejs/davinci/config.mk
 create mode 100644 arch/arm/include/asm/arch-davinci/spl.h
arch/arm/cpu/arm926ejs/davinci/config.mk new file +16 -0
new file mode 100644
index 0000000..42e55cc
@@ -0,0 +1,16 @@
+#
+# Copyright (C) 2012, Texas Instruments, Incorporated - http://www.ti.com/
+#
+# 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 "as is" WITHOUT ANY WARRANTY of any
+# kind, whether express or implied; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+ifndef CONFIG_SPL_BUILD
+ALL-y	+= $(obj)u-boot.ais
+endif
arch/arm/cpu/arm926ejs/davinci/spl.c +10 -35

72 lines not on this page · raw message

arch/arm/include/asm/arch-davinci/spl.h new file +28 -0
new file mode 100644
index 0000000..f9c5131
@@ -0,0 +1,28 @@
+/*
+ * (C) Copyright 2012
+ * Texas Instruments, <www.ti.com>
+ *
+ * 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	_ASM_ARCH_SPL_H_
+#define	_ASM_SPL_H_
+
+#define BOOT_DEVICE_NAND	1
+#define BOOT_DEVICE_SPI		2
+#endif
include/configs/cam_enc_4xx.h +2 -0
index 771ac9c..fe28278 100644
@@ -217,6 +217,8 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_SIMPLE
include/configs/da850evm.h +5 -0
index e6adb1f..290ded1 100644
@@ -313,6 +313,11 @@
 
 /* defines for SPL */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_BOARD_INIT
+#define CONFIG_SYS_SPL_MALLOC_START	(CONFIG_SYS_TEXT_BASE - \
+						CONFIG_SYS_MALLOC_LEN)
+#define CONFIG_SYS_SPL_MALLOC_SIZE	CONFIG_SYS_MALLOC_LEN
 #define CONFIG_SPL_SPI_SUPPORT
 #define CONFIG_SPL_SPI_FLASH_SUPPORT
 #define CONFIG_SPL_SPI_LOAD
include/configs/hawkboard.h +2 -0
index c6e9ce5..838e572 100644
@@ -59,6 +59,8 @@
 
 /* Spl */
 #define CONFIG_SPL
+#define CONFIG_SPL_FRAMEWORK
+#define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_SIMPLE
 #define CONFIG_SPL_NAND_LOAD
Signature · 1 line
1.7.9.5
#16 lore raw

PATCH v2 15/18 ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

Hi Tom,

Quoted 4 lines · Tom Rini

- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

I tested the patchset on the LogicPD AM1808 experimenter's kit:

make da850evm
and flashing to SPI flash with
mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 -flash_noubl u-boot.ais

The board boots up fine, but after pressing the reset button or issuing the u-boot "reset" command, it is dead. Only power-cycling helps. Before enabling the SPL framework in this patch reset works fine. Any ideas?

Regards, Christian

#17 lore raw

PATCH v2 15/18 ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

Hi Tom,

Quoted 8 lines · Christian Riesch

Hi Tom,

Quoted 4 lines · Tom Rini

- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

Quoted 7 lines

I tested the patchset on the LogicPD AM1808 experimenter's kit:

make da850evm
and flashing to SPI flash with
mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 -flash_noubl u-boot.ais

I tried testing the same on omap-l138 (the entire patch set) for SPI boot mode itsef, unfortunately the board doesn't even come up. Any Ideas ?

Thx,
--Prabhakar

Quoted 7 lines

The board boots up fine, but after pressing the reset button or issuing the u-boot "reset" command, it is dead. Only power-cycling helps. Before enabling the SPL framework in this patch reset works fine. Any ideas?

Regards, Christian

author
#18 lore raw

PATCH v2 15/18 ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

In reply to Christian Riesch
Quoted 8 lines · Christian Riesch

Hi Tom,

Quoted 4 lines · Tom Rini

- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

Quoted 6 lines

I tested the patchset on the LogicPD AM1808 experimenter's kit:

make da850evm
and flashing to SPI flash with
mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 -flash_noubl u-boot.ais

Confirmed, and I'll update the README to say that is how you can write the u-boot.ais in recovery mode.

Quoted 4 lines

The board boots up fine, but after pressing the reset button or issuing the u-boot "reset" command, it is dead. Only power-cycling helps. Before enabling the SPL framework in this patch reset works fine. Any ideas?

OK, I don't like the SPL malloc fix from before and I think it just masked, partially, a real problem. The SPI code did not change in the framework. And the very basic framework does not require malloc. I'm going to poke around and see what I can see, but more eyes would be welcome.

Signature · 1 line
Tom
author
#19 lore raw

PATCH v2 15/18 ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

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

Hi Tom,

Quoted 4 lines · Tom Rini

- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

Quoted 6 lines

I tested the patchset on the LogicPD AM1808 experimenter's kit:

make da850evm
and flashing to SPI flash with
mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 -flash_noubl u-boot.ais

Confirmed, and I'll update the README to say that is how you can write the u-boot.ais in recovery mode.

Quoted 7 lines
Quoted 4 lines

The board boots up fine, but after pressing the reset button or issuing the u-boot "reset" command, it is dead. Only power-cycling helps. Before enabling the SPL framework in this patch reset works fine. Any ideas?

OK, I don't like the SPL malloc fix from before and I think it just masked, partially, a real problem. The SPI code did not change in the

OK, I get what that fixes now, oops. But still, something is going on here, debugging more.

Signature · 1 line
Tom
author
#20 lore raw

PATCH v2 15/18 ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

Quoted 25 lines · Tom Rini
Quoted 24 lines · Tom Rini
Quoted 8 lines · Christian Riesch

Hi Tom,

Quoted 4 lines · Tom Rini

- Convert the non-relocation part of board_init_f to spl_board_init, turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

Quoted 6 lines

I tested the patchset on the LogicPD AM1808 experimenter's kit:

make da850evm
and flashing to SPI flash with
mono sfh_OMAP-L138.exe -targetType AM1808 -p /dev/ttyUSB0 -flash_noubl u-boot.ais

Confirmed, and I'll update the README to say that is how you can write the u-boot.ais in recovery mode.

Quoted 4 lines

The board boots up fine, but after pressing the reset button or issuing the u-boot "reset" command, it is dead. Only power-cycling helps. Before enabling the SPL framework in this patch reset works fine. Any ideas?

Quoted 5 lines
Quoted 2 lines

OK, I don't like the SPL malloc fix from before and I think it just masked, partially, a real problem. The SPI code did not change in the

OK, I get what that fixes now, oops. But still, something is going on here, debugging more.

OK, got it, and a v3 shortly. In short, using CONFIG_SPL_BOARD_INIT as the hook for doing our low-level init isn't completely sufficient, so I've reworked things a little more and tossed in another hook point. Now I'm also seeing the initial console output I had been missing.

Signature · 1 line
Tom
author
#21 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

In reply to Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +53 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+
+
+Recovery
+========
+
+In the case of a "bricked" board, you need to use the TI tools found
+here[1] to write a UBL file and u-boot.bin.  Once the system is running
+again from these tools a good u-boot.ais may be re-written to SPI flash.
+
+
+Links
+=====
+[1]
+ http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L137
Signature · 1 line
1.7.9.5
#22 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Hi Tom,

Thanks for the patch.

Quoted 49 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +30 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand

board/davinci/da8xxevm/README.da850_am18xxevm line 40

Quoted 10 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +10 -0
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+

Is this procedure to be done in Nand boot mode ?

Thx,
--Prabhakar

Quoted 14 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +13 -0
+
+Recovery
+========
+
+In the case of a "bricked" board, you need to use the TI tools found
+here[1] to write a UBL file and u-boot.bin.  Once the system is running
+again from these tools a good u-boot.ais may be re-written to SPI flash.
+
+
+Links
+=====
+[1]
+ http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L137
author
#23 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Quoted 57 lines · Prabhakar Lad

Hi Tom,

Thanks for the patch.

Quoted 52 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +33 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
Quoted 8 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 40

Quoted 7 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +7 -0
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+

Is this procedure to be done in Nand boot mode ?

This board, as far as I know (which isn't much) doesn't use NAND, just SPI. The USE_NAND section of da850evm.h doesn't seem reachable today at least.

Signature · 1 line
Tom
#24 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Quoted 67 lines · Tom Rini
Quoted 57 lines · Prabhakar Lad

Hi Tom,

Thanks for the patch.

Quoted 52 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +33 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
Quoted 8 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 40

Quoted 7 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +7 -0
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+

Is this procedure to be done in Nand boot mode ?

Quoted 4 lines

This board, as far as I know (which isn't much) doesn't use NAND, just SPI. The USE_NAND section of da850evm.h doesn't seem reachable today at least.

But the title for above says 'Flashing the images to Nand' ? It should
be SPI.

Thx,
--Prabhakar

author
#25 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Quoted 68 lines · Prabhakar Lad
Quoted 67 lines · Tom Rini
Quoted 65 lines · Prabhakar Lad

Hi Tom,

Thanks for the patch.

Quoted 49 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +30 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand

board/davinci/da8xxevm/README.da850_am18xxevm line 40

Quoted 10 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +10 -0
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+

Is this procedure to be done in Nand boot mode ?

Quoted 6 lines
Quoted 4 lines

This board, as far as I know (which isn't much) doesn't use NAND, just SPI. The USE_NAND section of da850evm.h doesn't seem reachable today at least.

But the title for above says 'Flashing the images to Nand' ? It should
be SPI.

You are correct, thanks.

Signature · 1 line
Tom
#26 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

In reply to Tom Rini

[cc'd Manjunath Hadli]

Hi Tom,

Quoted 35 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +16 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry

board/davinci/da8xxevm/README.da850_am18xxevm line 26

Quoted 10 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +10 -0
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

Regards, Christian

[1] http://lists.denx.de/pipermail/u-boot/2012-February/117082.html

Quoted 34 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +27 -1
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+
+
+Recovery
+========
+
+In the case of a "bricked" board, you need to use the TI tools found
+here[1] to write a UBL file and u-boot.bin.  Once the system is running
+again from these tools a good u-boot.ais may be re-written to SPI flash.
+
+
+Links
+=====
+[1]
+ http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L137
--

1.7.9.5

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#27 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Hi,

Quoted 45 lines · Christian Riesch

[cc'd Manjunath Hadli]

Hi Tom,

Quoted 40 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +21 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
Quoted 9 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 26

Quoted 5 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +5 -0
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

May be having a common README for am18x and omap-l138 would be good ?

Thx,
--Prabhakar

Quoted 44 lines

Regards, Christian

[1] http://lists.denx.de/pipermail/u-boot/2012-February/117082.html

Quoted 30 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +27 -1
+the u-boot.ais file that needs to be written to SPI flash.
+
+
+Flashing the images to Nand
+===========================
+The AIS image can be written to SPI flash using the following commands.
+Assuming that the network is configured and enabled and the u-boot.ais file
+is tftp'able.
+
+U-Boot > sf probe 0
+U-Boot > sf erase 0 +320000
+U-Boot > tftp u-boot.ais
+U-Boot > sf write c0700000 0 $filesize
+
+
+Recovery
+========
+
+In the case of a "bricked" board, you need to use the TI tools found
+here[1] to write a UBL file and u-boot.bin.  Once the system is running
+again from these tools a good u-boot.ais may be re-written to SPI flash.
+
+
+Links
+=====
+[1]
+ http://processors.wiki.ti.com/index.php/Serial_Boot_and_Flash_Loading_Utility_for_OMAP-L137
--

1.7.9.5

Quoted 4 lines

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

#28 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Hi Prabhakar,

Quoted 57 lines · Prabhakar Lad

Hi,

Quoted 45 lines · Christian Riesch

[cc'd Manjunath Hadli]

Hi Tom,

Quoted 40 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +21 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
Quoted 9 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 26

Quoted 5 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +5 -0
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

Quoted 2 lines

May be having a common README for am18x and omap-l138 would be good ?

This is a good idea.

But just to make it clear: Afaik the da850evm configuration works for both the AM1808 and the OMAP-L138 board from LogicPD (at least I am using it with the AM1808 experimenter's kit from LogicPD). The da850_am18xxevm is for the Spectrum Digital board. At least this is what I understood from the discussion with Manjunath Hadli in the in the u-boot mailing list thread I cited earlier. I hope this is correct, I haven't got other boards than the AM1808 board from LogicPD to test.

Regards, Christian

#29 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Hi Christian,

Quoted 65 lines · Christian Riesch

Hi Prabhakar,

Quoted 57 lines · Prabhakar Lad

Hi,

Quoted 45 lines · Christian Riesch

[cc'd Manjunath Hadli]

Hi Tom,

Quoted 40 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +21 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
Quoted 9 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 26

Quoted 5 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +5 -0
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

Quoted 2 lines

May be having a common README for am18x and omap-l138 would be good ?

This is a good idea.

Quoted 9 lines

But just to make it clear: Afaik the da850evm configuration works for both the AM1808 and the OMAP-L138 board from LogicPD (at least I am using it with the AM1808 experimenter's kit from LogicPD). The da850_am18xxevm is for the Spectrum Digital board. At least this is what I understood from the discussion with Manjunath Hadli in the in the u-boot mailing list thread I cited earlier. I hope this is correct, I haven't got other boards than the AM1808 board from LogicPD to test.

AFAIK the difference between AM1808 and OMAP-L138 is that, 1: The AM1808 has EEPROM and stores the MAC address in it where as OMAP-L138 stores the MAC address in SPI flash.
2: The revision number differs for both.

Thx,
--Prabhakar

Quoted 2 lines

Regards, Christian

#30 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

Hi Prabhakar,

Quoted 87 lines · Prabhakar Lad

Hi Christian,

Quoted 3 lines · Christian Riesch

Hi Prabhakar,

On Wed, Aug 22, 2012 at 11:07 AM, Prabhakar Lad <[email protected]<javascript:;>>

Quoted 8 lines · wrote:
Quoted 8 lines

Hi,

Quoted 5 lines · Christian Riesch

[cc'd Manjunath Hadli]

Hi Tom,

On Mon, Aug 20, 2012 at 6:45 PM, Tom Rini <[email protected] <javascript:;>>

Quoted 10 lines · wrote:
Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

Signed-off-by Tom Rini <[email protected] <javascript:;>>

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53

+++++++++++++++++++++++++

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

Review

Quoted 4 lines
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
(quoted diff) +0 -0

b/board/davinci/da8xxevm/README.da850_am18xxevm

Quoted 10 lines
Quoted 10 lines
Quoted 10 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 5

Quoted 10 lines

new file mode 100644
index 0000000..382b718

board/davinci/da8xxevm/README.da850_am18xxevm new file +5 -0
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which

executes

Quoted 1 line
Quoted 1 line
Quoted 1 line

board/davinci/da8xxevm/README.da850_am18xxevm line 6

Quoted 1 line
board/davinci/da8xxevm/README.da850_am18xxevm new file +1 -0
+upon reset is the Rom Boot Loader(RBL) which sits in the internal

ROM. The

Quoted 1 line
Quoted 1 line
Quoted 1 line

board/davinci/da8xxevm/README.da850_am18xxevm line 7

Quoted 1 line
board/davinci/da8xxevm/README.da850_am18xxevm new file +1 -0
+RBL initialises the memory and the SPI controller and reads the AIS

image

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +4 -0
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/davinci/da8xxevm/README.da850_am18xxevm

Quoted 8 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +8 -0
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then

loads

Quoted 1 line
Quoted 1 line
Quoted 1 line

board/davinci/da8xxevm/README.da850_am18xxevm line 20

Quoted 1 line
board/davinci/da8xxevm/README.da850_am18xxevm new file +1 -0
+the u-boot from a predefined location in SPI to DDR and jumps to the

u-boot

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

board/davinci/da8xxevm/README.da850_am18xxevm

Quoted 6 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +6 -0
+entry point.
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This

will build

Quoted 9 lines
Quoted 6 lines
Quoted 4 lines

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

May be having a common README for am18x and omap-l138 would be good ?

This is a good idea.

Quoted 9 lines

But just to make it clear: Afaik the da850evm configuration works for both the AM1808 and the OMAP-L138 board from LogicPD (at least I am using it with the AM1808 experimenter's kit from LogicPD). The da850_am18xxevm is for the Spectrum Digital board. At least this is what I understood from the discussion with Manjunath Hadli in the in the u-boot mailing list thread I cited earlier. I hope this is correct, I haven't got other boards than the AM1808 board from LogicPD to test.

Quoted 3 lines

AFAIK the difference between AM1808 and OMAP-L138 is that, 1: The AM1808 has EEPROM and stores the MAC address in it where as OMAP-L138 stores the MAC address in SPI flash.

Are you sure? I don't see that in datasheets/schematics.

Christian

Quoted 17 lines

2: The revision number differs for both.

Thx,
--Prabhakar

Quoted 2 lines

Regards, Christian

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de <javascript:;>
http://lists.denx.de/mailman/listinfo/u-boot

#31 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

CC'ed Sekhar

Quoted 102 lines · Christian Riesch

Hi Prabhakar,

On Wednesday, August 22, 2012, Prabhakar Lad wrote:

    Hi Christian,

    On Wednesday 22 August 2012 02:47 PM, Christian Riesch wrote:
    > Hi Prabhakar,
    >
    > On Wed, Aug 22, 2012 at 11:07 AM, Prabhakar Lad
    <[email protected] <javascript:;>> wrote:
    >> Hi,
    >>
    >> On Wednesday 22 August 2012 01:43 PM, Christian Riesch wrote:
    >>> [cc'd Manjunath Hadli]
    >>>
    >>> Hi Tom,
    >>>
    >>> On Mon, Aug 20, 2012 at 6:45 PM, Tom Rini <[email protected]
    <javascript:;>> wrote:
    >>>> Add a board-specific README that documents how to write
    u-boot.ais to
    >>>> the SPI found on this board.
    >>>>
    >>>> Changes-series: 2
    >>>> - Add
    >>>>
    >>>> Signed-off-by: Tom Rini <[email protected] <javascript:;>>
    >>>> ---
    >>>>
    >>>>  board/davinci/da8xxevm/README.da850_am18xxevm |   53
    +++++++++++++++++++++++++
    >>>>  1 file changed, 53 insertions(+)
    >>>>  create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
    >>>>
    >>>> diff --git a/board/davinci/da8xxevm/README.da850_am18xxevm
    b/board/davinci/da8xxevm/README.da850_am18xxevm
    >>>> new file mode 100644
    >>>> index 0000000..382b718
    >>>> --- /dev/null
    >>>> +++ b/board/davinci/da8xxevm/README.da850_am18xxevm
    >>>> @@ -0,0 +1,53 @@
    >>>> +Summary
    >>>> +=======
    >>>> +The README is for the boot procedure used for the LogicPD
    AM1808 EVM.
    >>>> +
    >>>> +The board is booted in three stages. The initial bootloader
    which executes
    >>>> +upon reset is the Rom Boot Loader(RBL) which sits in the
    internal ROM. The
    >>>> +RBL initialises the memory and the SPI controller and reads
    the AIS image
    >>>> +starting at block 0.  This image can contain both the SPL and
    U-Boot
    >>>> +binaries.
    >>>> +
    >>>> +AIS is an image format defined by TI for the images that are to be
    >>>> +loaded to memory by the RBL. The image is divided into a series of
    >>>> +sections and the image's entry point is specified. Each
    section comes
    >>>> +with meta data like the target address the section is to be
    copied to
    >>>> +and the size of the section, which is used by the RBL to load the
    >>>> +image. At the end of the image the RBL jumps to the image entry
    >>>> +point.
    >>>> +
    >>>> +The secondary stage bootloader(spl) which is loaded by the RBL
    then loads
    >>>> +the u-boot from a predefined location in SPI to DDR and jumps
    to the u-boot
    >>>> +entry point.
    >>>> +
    >>>> +
    >>>> +Compilation
    >>>> +===========
    >>>> +To build a SPI-bootable image, run 'make da850_am18xxevm'.
     This will build
    >>>
    >>> da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For
    >>> the Logic PD board you will need 'make da850evm'. See [1]
    >>>
    >>   May be having a common README for am18x and omap-l138 would be
    good ?
    >>
    >
    > This is a good idea.
    >
    > But just to make it clear: Afaik the da850evm configuration works for
    > both the AM1808 and the OMAP-L138 board from LogicPD (at least I am
    > using it with the AM1808 experimenter's kit from LogicPD). The
    > da850_am18xxevm is for the Spectrum Digital board. At least this is
    > what I understood from the discussion with Manjunath Hadli in the in
    > the u-boot mailing list thread I cited earlier. I hope this is
    > correct, I haven't got other boards than the AM1808 board from LogicPD
    > to test.
    >
    AFAIK the difference between AM1808 and OMAP-L138 is that,
    1: The AM1808 has EEPROM and stores the MAC address in it where as
    OMAP-L138 stores the MAC address in SPI flash.
Quoted 2 lines

Are you sure? I don't see that in datasheets/schematics.

Can you help here ?

Thx,
--Prabhakar

Quoted 21 lines

Christian

2: The revision number differs for both.

Thx,
--Prabhakar

> Regards, Christian
>

_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de <javascript:;>
http://lists.denx.de/mailman/listinfo/u-boot

author
#32 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

In reply to Prabhakar Lad
Quoted 77 lines · Prabhakar Lad

Hi Christian,

Quoted 65 lines · Christian Riesch

Hi Prabhakar,

Quoted 57 lines · Prabhakar Lad

Hi,

Quoted 45 lines · Christian Riesch

[cc'd Manjunath Hadli]

Hi Tom,

Quoted 40 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +21 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
Quoted 9 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 26

Quoted 5 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +5 -0
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

Quoted 2 lines

May be having a common README for am18x and omap-l138 would be good ?

This is a good idea.

Quoted 9 lines

But just to make it clear: Afaik the da850evm configuration works for both the AM1808 and the OMAP-L138 board from LogicPD (at least I am using it with the AM1808 experimenter's kit from LogicPD). The da850_am18xxevm is for the Spectrum Digital board. At least this is what I understood from the discussion with Manjunath Hadli in the in the u-boot mailing list thread I cited earlier. I hope this is correct, I haven't got other boards than the AM1808 board from LogicPD to test.

Quoted 3 lines

AFAIK the difference between AM1808 and OMAP-L138 is that, 1: The AM1808 has EEPROM and stores the MAC address in it where as OMAP-L138 stores the MAC address in SPI flash.

I don't think this is right. I believe on the Logic PD board it's stored in SPI (I know mine isn't stored in EEPROM). I think the answer is that the OMAP-L138 has DSP and the AM part does not. This would mean that Logic PD gets the most re-use out of the base-board possible :)

Signature · 1 line
Tom
author
#33 lore raw

PATCH v2 16/18 da850_am18xxevm: Add README.da850_am18xxevm

In reply to Christian Riesch
Quoted 45 lines · Christian Riesch

[cc'd Manjunath Hadli]

Hi Tom,

Quoted 40 lines · Tom Rini

Add a board-specific README that documents how to write u-boot.ais to the SPI found on this board.

Changes-series: 2
- Add

---

 board/davinci/da8xxevm/README.da850_am18xxevm |   53 +++++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 board/davinci/da8xxevm/README.da850_am18xxevm
board/davinci/da8xxevm/README.da850_am18xxevm new file +21 -0
new file mode 100644
index 0000000..382b718
@@ -0,0 +1,53 @@
+Summary
+=======
+The README is for the boot procedure used for the LogicPD AM1808 EVM.
+
+The board is booted in three stages. The initial bootloader which executes
+upon reset is the Rom Boot Loader(RBL) which sits in the internal ROM. The
+RBL initialises the memory and the SPI controller and reads the AIS image
+starting at block 0.  This image can contain both the SPL and U-Boot
+binaries.
+
+AIS is an image format defined by TI for the images that are to be
+loaded to memory by the RBL. The image is divided into a series of
+sections and the image's entry point is specified. Each section comes
+with meta data like the target address the section is to be copied to
+and the size of the section, which is used by the RBL to load the
+image. At the end of the image the RBL jumps to the image entry
+point.
+
+The secondary stage bootloader(spl) which is loaded by the RBL then loads
+the u-boot from a predefined location in SPI to DDR and jumps to the u-boot
+entry point.
Quoted 8 lines

board/davinci/da8xxevm/README.da850_am18xxevm line 26

Quoted 5 lines
board/davinci/da8xxevm/README.da850_am18xxevm new file +5 -0
+
+
+Compilation
+===========
+To build a SPI-bootable image, run 'make da850_am18xxevm'.  This will build

da850_am18xxevm is for the Spectrum Digital EVM for the AM1808. For the Logic PD board you will need 'make da850evm'. See [1]

This is funny since the Logic PD board is also called the "AM1808 Evaluation Module" rather than a "Davinci" EVM. So the README needs a little more work :) I'll update and rename.

Signature · 1 line
Tom
author
#34 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

In reply to Tom Rini

Takes the load function from arch/arm/lib/spl_nand.c instead. This will allow for easier integration of SPL-boots-Linux code on other arches. Kill off CONFIG_SPL_NAND_LOAD as a separate option.

---

 arch/arm/cpu/arm926ejs/davinci/spl.c      |    2 +-
 arch/arm/cpu/armv7/omap-common/Makefile   |    6 --
 arch/arm/cpu/armv7/omap-common/spl_nand.c |  102 -----------------------------
 doc/README.SPL                            |    1 -
 drivers/mtd/nand/Makefile                 |    7 +-
 drivers/mtd/nand/nand_spl_load.c          |   89 ++++++++++++++++++-------
 include/configs/cam_enc_4xx.h             |    1 -
 include/configs/hawkboard.h               |    1 -
 8 files changed, 67 insertions(+), 142 deletions(-)
 delete mode 100644 arch/arm/cpu/armv7/omap-common/spl_nand.c
arch/arm/cpu/arm926ejs/davinci/spl.c +1 -1
index 1848055..721ae4d 100644
@@ -60,7 +60,7 @@ void spl_board_init(void)
 
 u32 spl_boot_device(void)
 {
-#ifdef CONFIG_SPL_NAND_LOAD
+#ifdef CONFIG_SPL_NAND_SIMPLE
 	return BOOT_DEVICE_NAND;
 #elif defined(CONFIG_SPL_SPI_LOAD)
 	return BOOT_DEVICE_SPI;
arch/arm/cpu/armv7/omap-common/Makefile +0 -6
index 837e22e..0e0b641 100644
@@ -45,12 +45,6 @@ COBJS	+= boot-common.o
 SOBJS	+= lowlevel_init.o
 endif
 
-ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SUPPORT
-COBJS	+= spl_nand.o
-endif
-endif
-
 ifndef CONFIG_SPL_BUILD
 ifneq ($(CONFIG_OMAP44XX)$(CONFIG_OMAP54XX),)
 COBJS	+= mem-common.o
arch/arm/cpu/armv7/omap-common/spl_nand.c deleted +0 -102

102 lines not on this page · raw message

doc/README.SPL +0 -1
index e4a5ac3..3faf91c 100644
@@ -64,7 +64,6 @@ CONFIG_SPL_POWER_SUPPORT (drivers/power/libpower.o)
 CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o)
 CONFIG_SPL_DMA_SUPPORT (drivers/dma/libdma.o)
 CONFIG_SPL_POST_MEM_SUPPORT (post/drivers/memory.o)
-CONFIG_SPL_NAND_LOAD (drivers/mtd/nand/nand_spl_load.o)
 CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o)
 
 
drivers/mtd/nand/Makefile +1 -6
index 29dc20e..5475c8c 100644
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o
 else
 COBJS-y += nand.o
 COBJS-y += nand_bbt.o
drivers/mtd/nand/nand_spl_load.c +65 -24

101 lines not on this page · raw message

include/configs/cam_enc_4xx.h +0 -1
index fe28278..34aac8c 100644
@@ -222,7 +222,6 @@
 #define CONFIG_SPL_LIBGENERIC_SUPPORT
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_SIMPLE
-#define CONFIG_SPL_NAND_LOAD
 #define CONFIG_SYS_NAND_HW_ECC_OOBFIRST
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_POST_MEM_SUPPORT
include/configs/hawkboard.h +0 -1
index 838e572..5f2aa62 100644
@@ -63,7 +63,6 @@
 #define CONFIG_SPL_BOARD_INIT
 #define CONFIG_SPL_NAND_SUPPORT
 #define CONFIG_SPL_NAND_SIMPLE
-#define CONFIG_SPL_NAND_LOAD
 #define CONFIG_SPL_LIBGENERIC_SUPPORT	/* for udelay and __div64_32 for NAND */
 #define CONFIG_SPL_SERIAL_SUPPORT
 #define CONFIG_SPL_LDSCRIPT		"board/$(BOARDDIR)/u-boot-spl-hawk.lds"
Signature · 1 line
1.7.9.5
#35 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

Quoted 5 lines · Tom Rini
drivers/mtd/nand/Makefile +0 -0
index 29dc20e..5475c8c 100644

drivers/mtd/nand/Makefile LIB := $(obj)libnand.o · line 30

Quoted 10 lines
drivers/mtd/nand/Makefile +1 -6
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o

OK, I was wrong, I will complain. :-)

The commit message didn't mention you were changing CONFIG_SPL_NAND_SIMPLE. That needs to be able to support small SPLs. Is your new "enhanced" nand_spl_load small enough (with proper configuration) to work with all the SPLs that currently use nand_spl/nand_boot.c (e.g. PPC 44x)?

-Scott

#36 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

Quoted 19 lines · Scott Wood
Quoted 5 lines · Tom Rini
drivers/mtd/nand/Makefile +0 -0
index 29dc20e..5475c8c 100644

drivers/mtd/nand/Makefile LIB := $(obj)libnand.o · line 30

Quoted 10 lines
drivers/mtd/nand/Makefile +1 -6
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o

OK, I was wrong, I will complain. :-)

Quoted 5 lines

The commit message didn't mention you were changing CONFIG_SPL_NAND_SIMPLE. That needs to be able to support small SPLs. Is your new "enhanced" nand_spl_load small enough (with proper configuration) to work with all the SPLs that currently use nand_spl/nand_boot.c (e.g. PPC 44x)?

Oh, and please CC me on NAND patches so that I can see them sooner.

-Scott

author
#37 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

Quoted 20 lines · Scott Wood
Quoted 19 lines · Scott Wood
Quoted 5 lines · Tom Rini
drivers/mtd/nand/Makefile +0 -0
index 29dc20e..5475c8c 100644

drivers/mtd/nand/Makefile LIB := $(obj)libnand.o · line 30

Quoted 10 lines
drivers/mtd/nand/Makefile +1 -6
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o

OK, I was wrong, I will complain. :-)

Quoted 7 lines
Quoted 5 lines

The commit message didn't mention you were changing CONFIG_SPL_NAND_SIMPLE. That needs to be able to support small SPLs. Is your new "enhanced" nand_spl_load small enough (with proper configuration) to work with all the SPLs that currently use nand_spl/nand_boot.c (e.g. PPC 44x)?

Oh, and please CC me on NAND patches so that I can see them sooner.

Should have put nand in there for patman, sorry.

Signature · 1 line
Tom
author
#38 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

In reply to Scott Wood
Quoted 19 lines · Scott Wood
Quoted 5 lines · Tom Rini
drivers/mtd/nand/Makefile +0 -0
index 29dc20e..5475c8c 100644

drivers/mtd/nand/Makefile LIB := $(obj)libnand.o · line 30

Quoted 10 lines
drivers/mtd/nand/Makefile +1 -6
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o

OK, I was wrong, I will complain. :-)

Quoted 5 lines

The commit message didn't mention you were changing CONFIG_SPL_NAND_SIMPLE. That needs to be able to support small SPLs. Is your new "enhanced" nand_spl_load small enough (with proper configuration) to work with all the SPLs that currently use nand_spl/nand_boot.c (e.g. PPC 44x)?

OK, I suspect it would be close-to-fail. There's a "few" bytes overhead to parse the header and so forth, but it also allows for direct Linux booting. Is that something you want for these machines or no? It wouldn't be hard to put the enhanced version nand_spl_simple.c and leave nand_spl_load.c alone.

Signature · 1 line
Tom
#39 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

Quoted 26 lines · Tom Rini
Quoted 19 lines · Scott Wood
Quoted 5 lines · Tom Rini
drivers/mtd/nand/Makefile +0 -0
index 29dc20e..5475c8c 100644

drivers/mtd/nand/Makefile LIB := $(obj)libnand.o · line 30

Quoted 10 lines
drivers/mtd/nand/Makefile +1 -6
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o

OK, I was wrong, I will complain. :-)

Quoted 5 lines

The commit message didn't mention you were changing CONFIG_SPL_NAND_SIMPLE. That needs to be able to support small SPLs. Is your new "enhanced" nand_spl_load small enough (with proper configuration) to work with all the SPLs that currently use nand_spl/nand_boot.c (e.g. PPC 44x)?

Quoted 3 lines

OK, I suspect it would be close-to-fail. There's a "few" bytes overhead to parse the header and so forth, but it also allows for direct Linux booting. Is that something you want for these machines or no?

I don't think there's room for any new features at all. The SPL must fit in 4K. Canyonlands is at 4020 bytes currently.

Why can't the new functionality be conditionally built?

Quoted 2 lines

It wouldn't be hard to put the enhanced version nand_spl_simple.c and leave nand_spl_load.c alone.

nand_spl_simple.c is what I'm talking about needing to not expand. Why does the new stuff need to be bound to a specific NAND boot implementation?

-Scott

author
#40 lore raw

PATCH v2 17/18 SPL: Enhance drivers/mtd/nand/nand_spl_load.c

Quoted 27 lines · Scott Wood
Quoted 26 lines · Tom Rini
Quoted 24 lines · Scott Wood
Quoted 5 lines · Tom Rini
drivers/mtd/nand/Makefile +0 -0
index 29dc20e..5475c8c 100644

drivers/mtd/nand/Makefile LIB := $(obj)libnand.o · line 30

Quoted 10 lines
drivers/mtd/nand/Makefile +1 -6
@@ -27,12 +27,7 @@ LIB	:= $(obj)libnand.o
 
 ifdef CONFIG_CMD_NAND
 ifdef CONFIG_SPL_BUILD
-ifdef CONFIG_SPL_NAND_SIMPLE
-COBJS-y += nand_spl_simple.o
-endif
-ifdef CONFIG_SPL_NAND_LOAD
-COBJS-y	+= nand_spl_load.o
-endif
+COBJS-$(CONFIG_SPL_NAND_SIMPLE) += nand_spl_simple.o nand_spl_load.o

OK, I was wrong, I will complain. :-)

The commit message didn't mention you were changing CONFIG_SPL_NAND_SIMPLE. That needs to be able to support small SPLs. Is your new "enhanced" nand_spl_load small enough (with proper configuration) to work with all the SPLs that currently use nand_spl/nand_boot.c (e.g. PPC 44x)?

Quoted 8 lines
Quoted 3 lines

OK, I suspect it would be close-to-fail. There's a "few" bytes overhead to parse the header and so forth, but it also allows for direct Linux booting. Is that something you want for these machines or no?

I don't think there's room for any new features at all. The SPL must fit in 4K. Canyonlands is at 4020 bytes currently.

Why can't the new functionality be conditionally built?

I'm not sure there would be a point. The nand_boot() method is read u-boot.bin from nand, read env from nand and read redundant env from nand, boot u-boot. The spl_nand_load_image method doesn't boot u-boot, reads the image header, parses, reads the image. In short, I don't think a modified version would gain us anything more than a lot of complex #ifdefs :(

Quoted 5 lines
Quoted 2 lines

It wouldn't be hard to put the enhanced version nand_spl_simple.c and leave nand_spl_load.c alone.

nand_spl_simple.c is what I'm talking about needing to not expand. Why does the new stuff need to be bound to a specific NAND boot implementation?

Sorry, I got it backwards. I mean (and did locally) leave the very tiny and simple approach alone, add to the version where we have a little, but not a lot, of space.

Signature · 1 line
Tom
author
#41 lore raw

PATCH v2 18/18 SPL: Enhance spi_spl_load to match the other load functions

In reply to Tom Rini

---

 common/spl/spl.c               |    4 ++--
 drivers/mtd/spi/spi_spl_load.c |   23 ++++++++++++-----------
 include/spl.h                  |    2 +-
 3 files changed, 15 insertions(+), 14 deletions(-)
common/spl/spl.c +2 -2
index 3a2740a..7d15460 100644
@@ -177,8 +177,8 @@ void board_init_r(gd_t *id, ulong dummy)
 #endif
 #ifdef CONFIG_SPL_SPI_SUPPORT
 	case BOOT_DEVICE_SPI:
-		spi_boot();
-	break;
+		spl_spi_load_image();
+		break;
 #endif
 	default:
 		puts("SPL: Un-supported Boot Device\n");
drivers/mtd/spi/spi_spl_load.c +12 -11
index 1aa30ac..d4f81f2 100644
@@ -24,16 +24,17 @@
 
 #include <common.h>
 #include <spi_flash.h>
+#include <spl.h>
 
 /*
  * The main entry for SPI booting. It's necessary that SDRAM is already
  * configured and available since this code loads the main U-Boot image
  * from SPI into SDRAM and starts it from there.
  */
-void spi_boot(void)
+void spl_spi_load_image(void)
 {
 	struct spi_flash *flash;
-	void (*uboot)(void) __noreturn;
+	struct image_header *header;
 
 	/*
 	 * Load U-Boot image from SPI flash into RAM
@@ -42,17 +43,17 @@ void spi_boot(void)
 	flash = spi_flash_probe(CONFIG_SPL_SPI_BUS, CONFIG_SPL_SPI_CS,
 				CONFIG_SF_DEFAULT_SPEED, SPI_MODE_3);
 	if (!flash) {
-		puts("failed.\n");
+		puts("SPI probe failed.\n");
 		hang();
 	}
 
-	spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS,
-		       CONFIG_SYS_SPI_U_BOOT_SIZE,
-		       (void *) CONFIG_SYS_TEXT_BASE);
+	/* use CONFIG_SYS_TEXT_BASE as temporary storage area */
+	header = (struct image_header *)(CONFIG_SYS_TEXT_BASE);
 
-	/*
-	 * Jump to U-Boot image
-	 */
-	uboot = (void *) CONFIG_SYS_TEXT_BASE;
-	(*uboot)();
+	/* Load u-boot, mkimage header is 64 bytes. */
+	spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS, 0x40,
+			(void *) header);
+	spl_parse_image_header(header);
+	spi_flash_read(flash, CONFIG_SYS_SPI_U_BOOT_OFFS,
+		       spl_image.size, (void *)spl_image.load_addr);
 }
include/spl.h +1 -1
index af9ef71..c0cb62e 100644
@@ -61,7 +61,7 @@ void spl_mmc_load_image(void);
 void spl_ymodem_load_image(void);
 
 /* SPI SPL functions */
-void spi_boot(void);
+void spl_spi_load_image(void);
 
 #ifdef CONFIG_SPL_BOARD_INIT
 void spl_board_init(void);
Signature · 1 line
1.7.9.5