Add an SPL to boot the da850evm from SPI
Subsystems (4)
v6 cover Add an SPL to boot the da850evm from SPI
Hi,
this is v6 of the last part of my recent patchset
[PATCH v3 00/15] Add an SPL to boot the da850evm from SPI
http://lists.denx.de/pipermail/u-boot/2011-November/111182.html
Most of the other parts are already merged, together with this patchset they introduce an SPL for the da850evm to run u-boot directly without the need of a UBL (see doc/README.davinci).
The first patches fix dependencies and introduce a function to load the u-boot image from SPI flash. Patch #4 adds an SPL to the da850evm configuration. Finally, a simple
AIS (Application Image Script) is required to start the SPL. This AIS is generated by mkimage. Patch #5 fixes mkimage for building AIS. Finally the last patch introduces a u-boot.ais target in the Makefile.
Changes for v6:
- rebased to git://git.denx.de/u-boot.git master
Changes for v5:
- changed formatting (indentation) of the $(obj)u-boot.ais target in the Makefile
- removed useless '0 | ... ' from include/configs/da850evm.h
- added Acked-bys
Changes for v4:
- added documentation for the SPL to doc/README.davinci
- split patchset because it got too big
- use COBJS-$(CONFIG_SPL_SPI_LOAD) instead of ifdefs in drivers/mtd/spi/Makefile
- use __noreturn instead of __attribute__((noreturn))
- added Acked-by
Changes for v3:
- removed noise and hardcoded values from drivers/mtd/spi/spi_spl_load.c
- replaced $(PAD_TO) in Makefile by $(CONFIG_SPL_MAX_SIZE)
Major changes for v2:
- Added code that actually loads u-boot from SPI flash and starts it.
Prerequisites:
- This patchset builds fine on gcc version 4.5.2 (Sourcery G++ Lite 2011.03-41). However, for some toolchains, e.g., gcc 4.2.2 from ELDK 4.2, the build results in a linker error: "arm-linux-gnueabi-ld:
error: no memory region specified for loadable section `.ARM.exidx'". In this case, the following patch is required:
arm, davinci: Use lldiv for the 64-bit divisions in timer.c
http://patchwork.ozlabs.org/patch/130409/
To build run
make da850evm_config
make u-boot.ais
Then program u-boot.ais to the SPI flash on the da850evm.
Best regards,
Christian
Christian Riesch (6):
spl: display_options.o is required for SPI flash support in SPL
sf: Add spi_boot() to allow booting from SPI flash in an SPL arm, davinci: Add SPL support for DA850 SoCs
arm, da850evm: Add an SPL for SPI boot
mkimage: Fix variable length header support
arm, davinci: Add support for generating AIS images to the Makefile
.gitignore | 1 + Makefile | 13 ++++ arch/arm/cpu/arm926ejs/davinci/Makefile | 3 +- arch/arm/cpu/arm926ejs/davinci/spl.c | 34 +++++++++++- board/davinci/da8xxevm/da850evm.c | 4 +- board/davinci/da8xxevm/u-boot-spl.lds | 73 +++++++++++++++++++++++ doc/README.SPL | 1 + doc/README.davinci | 9 +++ drivers/mtd/spi/Makefile | 4 + drivers/mtd/spi/spi_spl_load.c | 58 ++++++++++++++++++ include/configs/da850evm.h | 87 +++++++++++++++++++++++++++ include/spi_flash.h | 3 + lib/Makefile | 2 + tools/mkimage.c | 97 ++++++++++++++++--------------- 14 files changed, 338 insertions(+), 51 deletions(-) create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds create mode 100644 drivers/mtd/spi/spi_spl_load.c
Signature · 1 line
1.7.4.1
PATCH v6 1/6 spl: display_options.o is required for SPI flash support in SPL
--- lib/Makefile | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
lib/Makefile +2 -0
@@ -50,6 +50,8 @@ COBJS-$(CONFIG_SHA1) += sha1.o COBJS-$(CONFIG_SHA256) += sha256.o COBJS-y += strmhz.o COBJS-$(CONFIG_RBTREE) += rbtree.o +else +COBJS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += display_options.o endif COBJS-y += ctype.o
Signature · 1 line
1.7.4.1
PATCH v6 2/6 sf: Add spi_boot() to allow booting from SPI flash in an SPL
In reply to Christian Riesch--- doc/README.SPL | 1 + drivers/mtd/spi/Makefile | 4 +++ drivers/mtd/spi/spi_spl_load.c | 58 ++++++++++++++++++++++++++++++++++++++++ include/spi_flash.h | 3 ++ 4 files changed, 66 insertions(+), 0 deletions(-) create mode 100644 drivers/mtd/spi/spi_spl_load.c
doc/README.SPL +1 -0
@@ -65,3 +65,4 @@ CONFIG_SPL_NAND_SUPPORT (drivers/mtd/nand/libnand.o) CONFIG_SPL_DMA_SUPPORT (drivers/dma/libdma.o) CONFIG_SPL_POST_MEM_SUPPORT (post/drivers/memory.o) CONFIG_SPL_NAND_LOAD (drivers/mtd/nand/nand_spl_load.o) +CONFIG_SPL_SPI_LOAD (drivers/mtd/spi/spi_spl_load.o)
drivers/mtd/spi/Makefile +4 -0
@@ -25,6 +25,10 @@ include $(TOPDIR)/config.mk LIB := $(obj)libspi_flash.o +ifdef CONFIG_SPL_BUILD +COBJS-$(CONFIG_SPL_SPI_LOAD) += spi_spl_load.o +endif + COBJS-$(CONFIG_SPI_FLASH) += spi_flash.o COBJS-$(CONFIG_SPI_FLASH_ATMEL) += atmel.o COBJS-$(CONFIG_SPI_FLASH_EON) += eon.o
drivers/mtd/spi/spi_spl_load.c new file +58 -0
58 lines not on this page · raw message
include/spi_flash.h +3 -0
@@ -25,6 +25,7 @@#include <spi.h> #include <linux/types.h> +#include <linux/compiler.h> struct spi_flash {struct spi_slave *spi;
@@ -68,4 +69,6 @@ static inline int spi_flash_erase(struct spi_flash *flash, u32 offset, return flash->erase(flash, offset, len); } +void spi_boot (void )__noreturn ; +#endif /* _SPI_FLASH_H_ */
Signature · 1 line
1.7.4.1
PATCH v6 3/6 arm, davinci: Add SPL support for DA850 SoCs
In reply to Christian RieschThis code adds an SPL for booting from SPI flash on DA850 SoCs.
--- arch/arm/cpu/arm926ejs/davinci/Makefile | 3 +- arch/arm/cpu/arm926ejs/davinci/spl.c | 34 ++++++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 2 deletions(-)
arch/arm/cpu/arm926ejs/davinci/Makefile +2 -1
@@ -38,7 +38,8 @@ COBJS-$(CONFIG_DRIVER_TI_EMAC) += lxt972.o dp83848.o et1011c.o ksz8873.o ifdef CONFIG_SPL_BUILD COBJS-y += spl.o -COBJS-y += dm365_lowlevel.o +COBJS-$(CONFIG_SOC_DM365) += dm365_lowlevel.o +COBJS-$(CONFIG_SOC_DA8XX) += da850_lowlevel.o endif SOBJS = reset.o
arch/arm/cpu/arm926ejs/davinci/spl.c +33 -1
@@ -26,6 +26,16 @@#include <nand.h> #include <asm/arch/dm365_lowlevel.h> #include <ns16550.h> +#include <malloc.h> +#include <spi_flash.h> + +DECLARE_GLOBAL_DATA_PTR ; + +/* Define global data structure pointer to it*/ +static gd_t gdata __attribute__ ((section(".data"))); +static bd_t bdata __attribute__ ((section(".data"))); + +#ifndef CONFIG_SPL_LIBCOMMON_SUPPORT void puts (const char *str) {
@@ -41,6 +51,8 @@ void putc(char c) NS16550_putc((NS16550_t)(CONFIG_SYS_NS16550_COM1), c); } +#endif /* CONFIG_SPL_LIBCOMMON_SUPPORT */ +inline void hang (void ) {puts ("### ERROR ### Please RESET the board ###\n" );
@@ -50,14 +62,34 @@ inline void hang(void)void board_init_f (ulong dummy) { +#ifdef CONFIG_SOC_DM365 dm36x_lowlevel_init (0 ); +#endif +#ifdef CONFIG_SOC_DA8XX +arch_cpu_init (); +#endif relocate_code (CONFIG_SPL_STACK ,NULL ,CONFIG_SPL_TEXT_BASE ); }void board_init_r (gd_t *id,ulong dummy) { - +#ifdef CONFIG_SOC_DM365 nand_init ();puts ("Nand boot...\n" );nand_boot (); +#endif +#ifdef CONFIG_SOC_DA8XX +mem_malloc_init (CONFIG_SYS_TEXT_BASE -CONFIG_SYS_MALLOC_LEN , +CONFIG_SYS_MALLOC_LEN ); + + gd = &gdata; + gd->bd = &bdata; + gd->flags |=GD_FLG_RELOC ; + gd->baudrate =CONFIG_BAUDRATE ; +serial_init ();/* serial communications setup */ + gd->have_console =1 ; + +puts ("SPI boot...\n" ); +spi_boot (); +#endif }
Signature · 1 line
1.7.4.1
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
In reply to Christian Riesch--- board/davinci/da8xxevm/da850evm.c | 4 +- board/davinci/da8xxevm/u-boot-spl.lds | 73 +++++++++++++++++++++++++++ doc/README.davinci | 9 +++ include/configs/da850evm.h | 87 +++++++++++++++++++++++++++++++++ 4 files changed, 172 insertions(+), 1 deletions(-) create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds
board/davinci/da8xxevm/da850evm.c +3 -1
@@ -108,7 +108,7 @@ static const struct pinmux_config gpio_pins[] = {#endif }; -static const struct pinmux_resource pinmuxes[] = { +const struct pinmux_resource pinmuxes[] = {#ifdef CONFIG_DRIVER_TI_EMAC PINMUX_ITEM (emac_pins_mdio), #ifdef CONFIG_DRIVER_TI_EMAC_USE_RMII
@@ -135,6 +135,8 @@ static const struct pinmux_resource pinmuxes[] = { PINMUX_ITEM(gpio_pins), }; +const int pinmuxes_size =ARRAY_SIZE (pinmuxes); +static const struct lpsc_resource lpsc[] = { {DAVINCI_LPSC_AEMIF },/* NAND, NOR */ {DAVINCI_LPSC_SPI1 },/* Serial Flash */
board/davinci/da8xxevm/u-boot-spl.lds new file +73 -0
73 lines not on this page · raw message
doc/README.davinci +9 -0
@@ -95,6 +95,15 @@ into the RAM. The programmers and UBL are always released as part of any standard TI software release associated with an SOC. +Alternative boot method (DA850 EVM only): +For the DA850 EVM an SPL (secondary program loader, see doc/README.SPL) +is provided to load U-Boot directly from SPI flash. In this case, the +SPL does the low level initialization that is otherwise done by the SPL. +To build U-Boot with this SPL, do +make da850evm_config +make u-boot.ais +and program the resulting u-boot.ais file to the SPI flash of the DA850 EVM. + Environment Variables =====================
include/configs/da850evm.h +87 -0
105 lines not on this page · raw message
Signature · 1 line
1.7.4.1
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
Hi,
Quoted 10 lines · Christian Riesch
Signed-off-by Christian Riesch <[email protected]>Cc Heiko Schocher <[email protected]>Cc Sandeep Paulraj <[email protected]>Cc Tom Rini <[email protected]>Cc Sudhakar Rajashekhara <[email protected]>--- board/davinci/da8xxevm/da850evm.c | 4 +- board/davinci/da8xxevm/u-boot-spl.lds | 73 +++++++++++++++++++++++++++ doc/README.davinci | 9 +++ include/configs/da850evm.h | 87
+++++++++++++++++++++++++++++++++
Quoted 2 lines
4 files changed, 172 insertions(+), 1 deletions(-) create mode 100644 board/davinci/da8xxevm/u-boot-spl.lds
Thanks for merging this into ti/next, Tom!
I'd like to submit a similar patch for the da850_am18xxevm board. Before commit 06194b6b65f701a9d6ef2d9b4123c4afe57d8783 both the da850evm and the da850_am18xxevm used the same configuration, and the differences introduced in the commit are rather small. Should I submit a patch that adds the same SPL configuration to the am18xx board config? Or should we create a header file that contains the common parts and include it in both da850evm.h and da850_am18xxevm.h? Or shall we use the Options column in boards.cfg?
Regards, Christian
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
Quoted 20 lines · Christian Riesch
Hi,
Quoted 10 lines · Christian Riesch
Signed-off-by Christian Riesch <[email protected]>Cc Heiko Schocher <[email protected]>Cc Sandeep Paulraj <[email protected]>Cc Tom Rini <[email protected]>Cc Sudhakar Rajashekhara <[email protected]>---
?board/davinci/da8xxevm/da850evm.c ? ? | ? ?4 +- ?board/davinci/da8xxevm/u-boot-spl.lds | ? 73 +++++++++++++++++++++++++++ ?doc/README.davinci ? ? ? ? ? ? ? ? ? ?| ? ?9 +++ ?include/configs/da850evm.h ? ? ? ? ? ?| ? 87+++++++++++++++++++++++++++++++++
Quoted 2 lines
?4 files changed, 172 insertions(+), 1 deletions(-) ?create mode 100644
board/davinci/da8xxevm/u-boot-spl.ldsThanks for merging this into ti/next, Tom!
Quoted 7 lines
I'd like to submit a similar patch for the
da850_am18xxevmboard. Before commit06194b6b65f701a9d6ef2d9b4123c4afe57d8783both the da850evm and theda850_am18xxevmused the same configuration, and the differences introduced in the commit are rather small. Should I submit a patch that adds the same SPL configuration to the am18xx board config? Or should we create a header file that contains the common parts and include it in bothda850evm.handda850_am18xxevm.h? Or shall we use the Options column in boards.cfg?
I'd like it if you submitted a patch for both boards. On my TODO list is seeing about cleaning up some of the config files for non-omap4/5 (which have a common.h file they start with) in 2012.03.
Signature · 1 line
Tom
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
Hi,
Quoted 5 lines · Tom Rini
Quoted 3 lines · Christian Riesch
Hi,
On Friday, December 9, 2011, Christian Riesch <
Quoted 9 lines
Quoted 9 lines
Quoted 8 lines · wrote:
Signed-off-by Christian Riesch <[email protected]>Cc Heiko Schocher <[email protected]>Cc Sandeep Paulraj <[email protected]>Cc Tom Rini <[email protected]>Cc Sudhakar Rajashekhara <[email protected]>--- board/davinci/da8xxevm/da850evm.c | 4 +- board/davinci/da8xxevm/u-boot-spl.lds | 73
+++++++++++++++++++++++++++
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
doc/README.davinci | 9 +++ include/configs/da850evm.h | 87+++++++++++++++++++++++++++++++++
Quoted 2 lines
4 files changed, 172 insertions(+), 1 deletions(-) create mode 100644 board/davinci/da8xxevm/u-boot-spl.ldsThanks for merging this into ti/next, Tom!
I'd like to submit a similar patch for the
da850_am18xxevmboard. Before commit06194b6b65f701a9d6ef2d9b4123c4afe57d8783both the da850evm and theda850_am18xxevmused the same configuration, and the differences
introduced
Quoted 1 line
Quoted 1 line
in the commit are rather small. Should I submit a patch that adds the
same
Quoted 1 line
Quoted 1 line
SPL configuration to the am18xx board config? Or should we create a
header
Quoted 6 lines
Quoted 2 lines
file that contains the common parts and include it in both
da850evm.handda850_am18xxevm.h? Or shall we use the Options column in boards.cfg?I'd like it if you submitted a patch for both boards. On my TODO list is seeing about cleaning up some of the config files for non-omap4/5 (which have a
common.hfile they start with) in 2012.03.
Ok, I'll try to provide a patch for da850_am18xxevm.h, but currently I can't get it running:
I applied the changes that I did in include/configs/da850evm.h before to da850_am18xxevm.h as well. I expected this to work on my board since the board I used to test the SPI flash SPL patchset for the da850evm was actually an AM1808 experimenter's kit.
Now my SPL reports:
SF: Unsupported manufacturer 20
failed.
Manufacturer 0x20 seems to be ST and the main difference between da850evm.h and da850_am18xxevm.h is the missing #define CONFIG_SPI_FLASH_STMICRO in da850_am18xxevm.h.
So my question is: Which boards are supported by da850_am18xxevm.h? I thought that I probably have an old revision of the board, but I couldn't find anything regarding SPI flash in LogicPD's PCNs.
Thanks for your help!
Christian
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
Quoted 58 lines · Christian Riesch
Hi,
Quoted 5 lines · On Wed, Dec 14, 2011 at 3:09 PM, Tom Rini <[email protected]…
Quoted 3 lines · On Tue, Dec 13, 2011 at 11:33 PM, Christian Riesch <christian.riesch at…
Hi,
On Friday, December 9, 2011, Christian Riesch
<christian.riesch at omicron.at <mailto:[email protected]>>
Quoted 2 lines
Quoted 2 lines
Quoted 1 line · wrote:
Signed-off-by Christian Riesch <[email protected]<mailto:[email protected]>>
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Cc Heiko Schocher <hs at denx.de <mailto:[email protected]>>Cc Sandeep Paulraj <s-paulraj at ti.com <mailto:[email protected]>>Cc Tom Rini <trini at ti.com <mailto:[email protected]>>Cc Sudhakar Rajashekhara <[email protected]<mailto:[email protected]>>
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
--- board/davinci/da8xxevm/da850evm.c | 4 +- board/davinci/da8xxevm/u-boot-spl.lds | 73+++++++++++++++++++++++++++
Quoted 11 lines
Quoted 11 lines
Quoted 2 lines
doc/README.davinci | 9 +++ include/configs/da850evm.h | 87+++++++++++++++++++++++++++++++++
Quoted 2 lines
4 files changed, 172 insertions(+), 1 deletions(-) create mode 100644 board/davinci/da8xxevm/u-boot-spl.ldsThanks for merging this into ti/next, Tom!
I'd like to submit a similar patch for the
da850_am18xxevmboard. Before commit06194b6b65f701a9d6ef2d9b4123c4afe57d8783both the da850evm and theda850_am18xxevmused the same configuration, and the differencesintroduced
Quoted 1 line
Quoted 1 line
in the commit are rather small. Should I submit a patch that adds the
same
Quoted 1 line
Quoted 1 line
SPL configuration to the am18xx board config? Or should we create a
header
Quoted 6 lines
Quoted 2 lines
file that contains the common parts and include it in both
da850evm.handda850_am18xxevm.h? Or shall we use the Options column in boards.cfg?I'd like it if you submitted a patch for both boards. On my TODO list is seeing about cleaning up some of the config files for non-omap4/5 (which have a
common.hfile they start with) in 2012.03.Ok, I'll try to provide a patch for
da850_am18xxevm.h, but currently I can't get it running:I applied the changes that I did in
include/configs/da850evm.hbefore toda850_am18xxevm.has well. I expected this to work on my board since the board I used to test the SPI flash SPL patchset for the da850evm was actually an AM1808 experimenter's kit.Now my SPL reports:
SF: Unsupported manufacturer 20
failed.
Quoted 7 lines
Manufacturer
0x20seems to be ST and the main difference betweenda850evm.handda850_am18xxevm.his the missing #defineCONFIG_SPI_FLASH_STMICROinda850_am18xxevm.h.So my question is: Which boards are supported by
da850_am18xxevm.h? I thought that I probably have an old revision of the board, but I couldn't find anything regarding SPI flash in LogicPD's PCNs.
So, the da850evm is for the OMAP-L138 and da850_am18xxevm is for the AM18xx EVM. However, the config split was done, I believe, but folks on the L138 side and might not have been tried fully on the am1808. So since you've got the AM1808 and can test it there, lets add the missing SPI_FLASH define too. I think my coworker that did a quick non-SPL check of the code the other week also noted SPI wasn't supported.
Signature · 1 line
Tom
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
Hi Tom,
thanks for your reply.
Quoted 19 lines · Tom Rini
Quoted 10 lines · Christian Riesch
I applied the changes that I did in
include/configs/da850evm.hbefore toda850_am18xxevm.has well. I expected this to work on my board since the board I used to test the SPI flash SPL patchset for the da850evm was actually an AM1808 experimenter's kit.Now my SPL reports:
SF: Unsupported manufacturer 20
failed.Quoted 7 lines
Manufacturer
0x20seems to be ST and the main difference betweenda850evm.handda850_am18xxevm.his the missing #defineCONFIG_SPI_FLASH_STMICROinda850_am18xxevm.h.So my question is: Which boards are supported by
da850_am18xxevm.h? I thought that I probably have an old revision of the board, but I couldn't find anything regarding SPI flash in LogicPD's PCNs.
Quoted 6 lines
So, the da850evm is for the OMAP-L138 and
da850_am18xxevmis for the AM18xx EVM. However, the config split was done, I believe, but folks on the L138 side and might not have been tried fully on the am1808. So since you've got the AM1808 and can test it there, lets add the missingSPI_FLASHdefine too. I think my coworker that did a quick non-SPL check of the code the other week also noted SPI wasn't supported.
Ok, I can do that.
But then I wonder why a separate .h file for the AM18xx EVM was introduced. My AM18xx EVM works just fine with the da850evm.h configuration that's currently in mainline u-boot.
I did a diff between the two:
Quoted 10 lines
da850_am18xxevm.h renamed from da850evm.h +1
-1@@ -1,5 +1,5 @@/* -* Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ +* Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/ * * Based on davinci_dvevm.h. Original Copyrights follow: *
da850_am18xxevm.h line 49
Quoted 6 lines
da850_am18xxevm.h renamed from da850evm.h +0
-3@@ -44,10 +44,7 @@#define CONFIG_SYS_HZ 1000#define CONFIG_SKIP_LOWLEVEL_INIT #define CONFIG_SYS_TEXT_BASE 0xc1080000 -#define CONFIG_SYS_ICACHE_OFF -#define CONFIG_SYS_DCACHE_OFF -#define CONFIG_SYS_L2CACHE_OFF
Pointless because of
http://thread.gmane.org/gmane.comp.boot-loaders.u-boot/116671/focus=118643
So it could be removed.
da850_am18xxevm.h line 47
Quoted 2 lines
da850_am18xxevm.h renamed from da850evm.h +1
-1- +#define CONFIG_DA850_AM18X_EVM
Afaik this is used to pass the information whether this is AM1808 or OMAP-L138 to the Linux kernel.
da850_am18xxevm.h line 63
Quoted 8 lines
da850_am18xxevm.h renamed from da850evm.h +0
-1/* * Memory Info */ @@ -60,7 +57,7 @@#define CONFIG_SYS_MEMTEST_START (PHYS_SDRAM_1 + 0x2000000)/* memtest will be run on 16MB */ -#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x2000000 +
16*1024*1024)
da850_am18xxevm.h line 60
Quoted 1 line
da850_am18xxevm.h renamed from da850evm.h +1
-0+#define CONFIG_SYS_MEMTEST_END (PHYS_SDRAM_1 + 0x2000000 + 16*1024*1024)
formatting only...
da850_am18xxevm.h line 82
Quoted 7 lines
da850_am18xxevm.h renamed from da850evm.h +0
-1#define CONFIG_NR_DRAM_BANKS 1/* we have 1 bank of DRAM */ #define CONFIG_STACKSIZE (256*1024)/* regular stack */ @@ -79,7 +76,6 @@#define CONFIG_SPI #define CONFIG_SPI_FLASH -#define CONFIG_SPI_FLASH_STMICRO
I'll add this line back because my AM1808 experimenter's kit has an ST flash.
Quoted 5 lines
da850_am18xxevm.h renamed from da850evm.h +0
-0#define CONFIG_SPI_FLASH_WINBOND #define CONFIG_DAVINCI_SPI #define CONFIG_SYS_SPI_BASE DAVINCI_SPI1_BASE@@ -122,12 +118,14 @@* Network & Ethernet Configuration
da850_am18xxevm.h line 128
Quoted 10 lines
da850_am18xxevm.h renamed from da850evm.h +2
-0*/ #ifdef CONFIG_DRIVER_TI_EMAC +#define CONFIG_EMAC_MDIO_PHY_NUM 0#define CONFIG_MII #define CONFIG_BOOTP_DEFAULT #define CONFIG_BOOTP_DNS #define CONFIG_BOOTP_DNS2 #define CONFIG_BOOTP_SEND_HOSTNAME #define CONFIG_NET_RETRY_COUNT 10 +#define CONFIG_NET_MULTI
I don't know why these two additional lines are needed. Network works fine with the da850evm.h config on my AM1808 experimenter's kit. Any ideas? Can we remove these?
da850_am18xxevm.h line 163
Quoted 8 lines
da850_am18xxevm.h renamed from da850evm.h +0
-1#endif #ifdef CONFIG_USE_NOR @@ -160,7 +158,6 @@* U-Boot general configuration */ #define CONFIG_MISC_INIT_R -#define CONFIG_BOARD_EARLY_INIT_F
I have a patch in my queue that adds this line also to da850_am1808evm.h to allow booting without the UBL (similar to commit ae5c77dd908edaf55025fa3f41095bfb9cb1b973).
da850_am18xxevm.h line 247
Quoted 8 lines
da850_am18xxevm.h renamed from da850evm.h +0
-1#define CONFIG_BOOTFILE "uImage"/* Boot file name */ #define CONFIG_SYS_PROMPT "U-Boot > "/* Command Prompt */ #define CONFIG_SYS_CBSIZE 1024/* Console I/O Buffer Size */ @@ -244,6 +241,6 @@/* additions for new relocation code, must added to all boards */ #define CONFIG_SYS_SDRAM_BASE 0xc0000000 -#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE +
0x1000 - /* Fix this */ \
da850_am18xxevm.h line 244
Quoted 2 lines
da850_am18xxevm.h renamed from da850evm.h +1
-1- GENERATED_GBL_DATA_SIZE) +#define CONFIG_SYS_INIT_SP_ADDR (CONFIG_SYS_SDRAM_BASE +
0x1000 - \
da850_am18xxevm.h line 245
Quoted 1 line
da850_am18xxevm.h renamed from da850evm.h +1
-0+/* Fix this */
GENERATED_GBL_DATA_SIZE)
Again formatting change only.
da850_am18xxevm.h line 246
Quoted 1 line
da850_am18xxevm.h renamed from da850evm.h +0
-0#endif /* __CONFIG_H */
So from my point of view it looks like we could remove the entire da850_am18xxevm.h and just find a different way to pass the AM1808-or-OMAP-L138 information to Linux.
Regards, Christian
PATCH v6 4/6 arm, da850evm: Add an SPL for SPI boot
Quoted 31 lines · Christian Riesch
Hi Tom,
thanks for your reply.Quoted 19 lines · On Wed, Dec 14, 2011 at 8:15 PM, Tom Rini <[email protected] <mailto:[email protected]>>…
Quoted 10 lines · Christian Riesch
I applied the changes that I did in
include/configs/da850evm.hbefore toda850_am18xxevm.has well. I expected this to work on my board since the board I used to test the SPI flash SPL patchset for the da850evm was actually an AM1808 experimenter's kit.Now my SPL reports:
SF: Unsupported manufacturer 20
failed.Quoted 7 lines
Manufacturer
0x20seems to be ST and the main difference betweenda850evm.handda850_am18xxevm.his the missing #defineCONFIG_SPI_FLASH_STMICROinda850_am18xxevm.h.So my question is: Which boards are supported by
da850_am18xxevm.h? I thought that I probably have an old revision of the board, but I couldn't find anything regarding SPI flash in LogicPD's PCNs.Quoted 6 lines
So, the da850evm is for the OMAP-L138 and
da850_am18xxevmis for the AM18xx EVM. However, the config split was done, I believe, but folks on the L138 side and might not have been tried fully on the am1808. So since you've got the AM1808 and can test it there, lets add the missingSPI_FLASHdefine too. I think my coworker that did a quick non-SPL check of the code the other week also noted SPI wasn't supported.
Quoted 7 lines
Ok, I can do that.
But then I wonder why a separate .h file for the AM18xx EVM was introduced. My AM18xx EVM works just fine with the
da850evm.hconfiguration that's currently in mainline u-boot.I did a diff between the two:
[snip explanation of how little is actually different]
I agree. It's on my list to unpack and get my am18xx EVM setup and see if perhaps we can't just use boards.cfg to build for L138 or AM1808.
Signature · 1 line
Tom
PATCH v6 5/6 mkimage: Fix variable length header support
In reply to Christian RieschSupport for variable length images like AIS image was introduced in commit f0662105b674a3874227316abf8536bebc9b5995. A parameter "-s" was also introduced to prohibit copying of the image file automatically in the main program. However, this parameter was implemented incorrectly and the image file was copied nevertheless.
--- tools/mkimage.c | 97 ++++++++++++++++++++++++++++--------------------------- 1 files changed, 49 insertions(+), 48 deletions(-)
tools/mkimage.c +49 -48
@@ -383,65 +383,66 @@ NXTARG: ;exit (EXIT_FAILURE ); } -if (!params.skipcpy && - (params.type ==IH_TYPE_MULTI || - params.type ==IH_TYPE_SCRIPT )) { -char *file = params.datafile; -uint32_t size; - -for (;;) { -char *sep =NULL ; - -if (file) { -if ((sep =strchr (file,':' )) !=NULL ) { - *sep ='\0' ; +if (!params.skipcpy) { +if (params.type ==IH_TYPE_MULTI || + params.type ==IH_TYPE_SCRIPT ) { +char *file = params.datafile; +uint32_t size; + +for (;;) { +char *sep =NULL ; + +if (file) { +if ((sep =strchr (file,':' )) !=NULL ) { + *sep ='\0' ; + } + +if (stat (file, &sbuf) <0 ) { +fprintf (stderr,"%s: Can't stat %s: %s\n" , + params.cmdname, file,strerror (errno)); +exit (EXIT_FAILURE ); + } + size =cpu_to_uimage (sbuf.st_size); + }else { + size =0 ; } -if (stat (file, &sbuf) <0 ) { -fprintf (stderr,"%s: Can't stat %s: %s\n" , - params.cmdname, file,strerror (errno)); +if (write (ifd, (char *)&size,sizeof (size)) !=sizeof (size)) { +fprintf (stderr,"%s: Write error on %s: %s\n" , + params.cmdname, params.imagefile, +strerror (errno));exit (EXIT_FAILURE ); } - size =cpu_to_uimage (sbuf.st_size); - }else { - size =0 ; - } -if (write (ifd, (char *)&size,sizeof (size)) !=sizeof (size)) { -fprintf (stderr,"%s: Write error on %s: %s\n" , - params.cmdname, params.imagefile, -strerror (errno)); -exit (EXIT_FAILURE ); - } +if (!file) { +break ; + } -if (!file) { -break ; +if (sep) { + *sep =':' ; + file = sep +1 ; + }else { + file =NULL ; + } } -if (sep) { - *sep =':' ; - file = sep +1 ; - }else { - file =NULL ; - } - } + file = params.datafile; - file = params.datafile; - -for (;;) { -char *sep =strchr (file,':' ); -if (sep) { - *sep ='\0' ; -copy_file (ifd, file,1 ); - *sep++ =':' ; - file = sep; - }else { -copy_file (ifd, file,0 ); -break ; +for (;;) { +char *sep =strchr (file,':' ); +if (sep) { + *sep ='\0' ; +copy_file (ifd, file,1 ); + *sep++ =':' ; + file = sep; + }else { +copy_file (ifd, file,0 ); +break ; + } } + }else { +copy_file (ifd, params.datafile,0 ); } - }else { -copy_file (ifd, params.datafile,0 ); }/* We're a bit of paranoid */
Signature · 1 line
1.7.4.1
PATCH v6 6/6 arm, davinci: Add support for generating AIS images to the Makefile
In reply to Christian Riesch--- .gitignore | 1 + Makefile | 13 +++++++++++++ 2 files changed, 14 insertions(+), 0 deletions(-)
.gitignore +1 -0
@@ -35,6 +35,7 @@ /u-boot.dis /u-boot.lds /u-boot.ubl +/u-boot.ais /u-boot.dtb /u-boot.sb
Makefile +13 -0
@@ -420,6 +420,18 @@ $(obj)u-boot.ubl: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin rm $(obj)u-boot-ubl.bin rm $(obj)spl/u-boot-spl-pad.bin +$(obj)u-boot.ais: $(obj)spl/u-boot-spl.bin $(obj)u-boot.bin + $(obj)tools/mkimage -s -n /dev/null -T aisimage \ + -e $(CONFIG_SPL_TEXT_BASE) \ + -d $(obj)spl/u-boot-spl.bin \ + $(obj)spl/u-boot-spl.ais + $(OBJCOPY) ${OBJCFLAGS} -I binary \ + --pad-to=$(CONFIG_SPL_MAX_SIZE) -O binary \ + $(obj)spl/u-boot-spl.ais $(obj)spl/u-boot-spl-pad.ais + cat $(obj)spl/u-boot-spl-pad.ais $(obj)u-boot.bin > \ + $(obj)u-boot.ais + rm $(obj)spl/u-boot-spl{,-pad}.ais + $(obj)u-boot.sb: $(obj)u-boot.bin $(obj)spl/u-boot-spl.bin elftosb -zdf imx28 -c $(TOPDIR)/board/$(BOARDDIR)/u-boot.bd \ -o $(obj)u-boot.sb
@@ -794,6 +806,7 @@ clobber: tidy @rm -f $(obj)u-boot.kwb @rm -f $(obj)u-boot.imx @rm -f $(obj)u-boot.ubl + @rm -f $(obj)u-boot.ais @rm -f $(obj)u-boot.dtb @rm -f $(obj)u-boot.sb @rm -f $(obj)tools/inca-swap-bytes
Signature · 1 line
1.7.4.1
v6 cover Add an SPL to boot the da850evm from SPI
In reply to Christian RieschQuoted 19 lines · Christian Riesch
Hi,
this is v6 of the last part of my recent patchset[PATCH v3 00/15] Add an SPL to boot the da850evm from SPI
http://lists.denx.de/pipermail/u-boot/2011-November/111182.htmlMost of the other parts are already merged, together with this patchset they introduce an SPL for the da850evm to run u-boot directly without the need of a UBL (see doc/README.davinci).
The first patches fix dependencies and introduce a function to load the u-boot image from SPI flash. Patch #4 adds an SPL to the da850evm configuration. Finally, a simple
AIS (Application Image Script) is required to start the SPL. This AIS is generated by mkimage. Patch #5 fixes mkimage for building AIS. Finally the last patch introduces a u-boot.ais target in theMakefile.
Quoted 2 lines
Changes for v6:
- rebased togit://git.denx.de/u-boot.gitmaster
Merged into u-boot-ti/next, thanks for all the hard work here!
Signature · 1 line
Tom