[U-Boot] [PATCH v2 0/4] ARM: SPL: at91: update to support DM/DT

To support the driver model and device tree in SPL, fix the boot device, bring in the serial device from device tree, and use "_image_binary_end" variable to point to the correct device tree location when CONFIG_SPL_SEPARATE_BSS is enabled.
Changes in v2: - Drop [PATCH] ARM: at91: lds: add test SPL binary size and bbs size.
Wenyou Yang (4): ARM: at91: spl: specify MMC and NAND boot device ARM: spl: atmel: bring in serial device before init ARM: spl: atmel: move mem_init() advance in SPL init. ARM: at91: lds: use "_image_binary_end" for DT location
arch/arm/mach-at91/armv7/u-boot-spl.lds | 2 ++ arch/arm/mach-at91/spl.c | 7 +++++++ arch/arm/mach-at91/spl_atmel.c | 11 ++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-)

When OF_CONTROL is enabled, MMC boot device should not be detected automatically, it should be MMC1 fixedly only the status "enabled" is available.
Add NAND Flash boot device as well.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
Changes in v2: None
arch/arm/mach-at91/spl.c | 7 +++++++ 1 file changed, 7 insertions(+)
diff --git a/arch/arm/mach-at91/spl.c b/arch/arm/mach-at91/spl.c index 98f280cbf7..e113336b7b 100644 --- a/arch/arm/mach-at91/spl.c +++ b/arch/arm/mach-at91/spl.c @@ -39,12 +39,16 @@ u32 spl_boot_device(void)
#if defined(CONFIG_SYS_USE_MMC) if (dev == ATMEL_SAMA5_BOOT_FROM_MCI) { +#if defined(CONFIG_SPL_OF_CONTROL) + return BOOT_DEVICE_MMC1; +#else if (off == 0) return BOOT_DEVICE_MMC1; if (off == 1) return BOOT_DEVICE_MMC2; printf("ERROR: MMC controller %i not present!\n", dev); hang(); +#endif } #endif
@@ -53,6 +57,9 @@ u32 spl_boot_device(void) return BOOT_DEVICE_SPI; #endif
+ if (dev == ATMEL_SAMA5_BOOT_FROM_SMC) + return BOOT_DEVICE_NAND; + if (dev == ATMEL_SAMA5_BOOT_FROM_SAMBA) return BOOT_DEVICE_USB;

On 23 March 2017 at 21:34, Wenyou Yang wenyou.yang@atmel.com wrote:
When OF_CONTROL is enabled, MMC boot device should not be detected automatically, it should be MMC1 fixedly only the status "enabled" is available.
Add NAND Flash boot device as well.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com
Changes in v2: None
arch/arm/mach-at91/spl.c | 7 +++++++ 1 file changed, 7 insertions(+)
Applied to u-boot-dm, thanks!

Before setting up the serial communications, bring in the serial device from the device tree file.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
Changes in v2: None
arch/arm/mach-at91/spl_atmel.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c index 688289e7cf..847a30b9a9 100644 --- a/arch/arm/mach-at91/spl_atmel.c +++ b/arch/arm/mach-at91/spl_atmel.c @@ -77,6 +77,8 @@ void s_init(void)
void board_init_f(ulong dummy) { + int ret; + switch_to_main_crystal_osc();
#ifdef CONFIG_SAMA5D2 @@ -99,6 +101,12 @@ void board_init_f(ulong dummy)
board_early_init_f();
+ ret = spl_init(); + if (ret) { + debug("spl_init() failed: %d\n", ret); + hang(); + } + preloader_console_init();
mem_init();

On 23 March 2017 at 21:34, Wenyou Yang wenyou.yang@atmel.com wrote:
Before setting up the serial communications, bring in the serial device from the device tree file.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com
Changes in v2: None
arch/arm/mach-at91/spl_atmel.c | 8 ++++++++ 1 file changed, 8 insertions(+)
Applied to u-boot-dm, thanks!

Because the MMC SPL puts the bbs section in the ddr memory, move calling mem_init() before calling spl_init().
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
Changes in v2: None
arch/arm/mach-at91/spl_atmel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-at91/spl_atmel.c b/arch/arm/mach-at91/spl_atmel.c index 847a30b9a9..b75c2ccefd 100644 --- a/arch/arm/mach-at91/spl_atmel.c +++ b/arch/arm/mach-at91/spl_atmel.c @@ -101,6 +101,8 @@ void board_init_f(ulong dummy)
board_early_init_f();
+ mem_init(); + ret = spl_init(); if (ret) { debug("spl_init() failed: %d\n", ret); @@ -109,5 +111,4 @@ void board_init_f(ulong dummy)
preloader_console_init();
- mem_init(); }

On 23 March 2017 at 21:34, Wenyou Yang wenyou.yang@atmel.com wrote:
Because the MMC SPL puts the bbs section in the ddr memory, move calling mem_init() before calling spl_init().
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com
Changes in v2: None
arch/arm/mach-at91/spl_atmel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-dm, thanks!

The MMC SPL locates the BSS section to a different memory region from text, then use "_image_binary_end" variable to point to the correct device tree location.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com ---
Changes in v2: - Drop [PATCH] ARM: at91: lds: add test SPL binary size and bbs size.
arch/arm/mach-at91/armv7/u-boot-spl.lds | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/arch/arm/mach-at91/armv7/u-boot-spl.lds b/arch/arm/mach-at91/armv7/u-boot-spl.lds index c667c5555b..d2e41a026c 100644 --- a/arch/arm/mach-at91/armv7/u-boot-spl.lds +++ b/arch/arm/mach-at91/armv7/u-boot-spl.lds @@ -47,6 +47,8 @@ SECTIONS *(.__end) } >.sram
+ _image_binary_end = .; + .bss : { . = ALIGN(4);

On 23 March 2017 at 21:34, Wenyou Yang wenyou.yang@atmel.com wrote:
The MMC SPL locates the BSS section to a different memory region from text, then use "_image_binary_end" variable to point to the correct device tree location.
Signed-off-by: Wenyou Yang wenyou.yang@atmel.com
Changes in v2:
- Drop [PATCH] ARM: at91: lds: add test SPL binary size and bbs size.
arch/arm/mach-at91/armv7/u-boot-spl.lds | 2 ++ 1 file changed, 2 insertions(+)
Applied to u-boot-dm, thanks!
participants (2)
-
Simon Glass
-
Wenyou Yang