[U-Boot] [PATCH v2 0/7] spl: add xip booting support

This patchset adds support for XIP (execute in place) of U-Boot or kernel image and enables it for stm32f7.
Changed in v2: - added patch to move v7m thumb mode just before next image boot - removed extra blank line.
Vikas Manocha (7): spl: armv7m: to keep ARM v7M in thumb mode before booting next image stm32f7: remove duplicate configs stm32: stm32f7: add spl build support SPL: Add XIP booting support serial: stm32f7: disable overrun spl: stm32f7: add kernel boot support spl: stm32f7: configure for xip booting
arch/arm/include/asm/spl.h | 1 + arch/arm/mach-stm32/Kconfig | 1 + arch/arm/mach-stm32/stm32f7/Kconfig | 24 ++++++++++++++++++++ board/st/stm32f746-disco/stm32f746-disco.c | 36 +++++++++++++++++++++++++++++- common/spl/Kconfig | 9 ++++++++ common/spl/Makefile | 1 + common/spl/spl.c | 6 ++--- common/spl/spl_xip.c | 28 +++++++++++++++++++++++ configs/stm32f746-disco_defconfig | 5 ----- drivers/serial/serial_stm32x7.c | 3 +++ drivers/serial/serial_stm32x7.h | 2 ++ include/configs/stm32f746-disco.h | 31 ++++++++++++++++++++++--- 12 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 common/spl/spl_xip.c

On ARM v7M, the processor will return to ARM mode when executing blx instruction with bit 0 of the address == 0. Always set it to 1 to stay in thumb mode.
At present, it is applied only for raw U-Boot. This patch moves it to just before booting next image. This way armv7m will be in thumb mode for any image like raw or image with header like zImage or standard U-Boot.
Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: Added this patch in v2
common/spl/spl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/common/spl/spl.c b/common/spl/spl.c index df984b8..1bdae3e 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -121,9 +121,6 @@ void spl_set_header_raw_uboot(struct spl_image_info *spl_image) { spl_image->size = CONFIG_SYS_MONITOR_LEN; spl_image->entry_point = CONFIG_SYS_UBOOT_START; -#ifdef CONFIG_CPU_V7M - spl_image->entry_point |= 0x1; -#endif spl_image->load_addr = CONFIG_SYS_TEXT_BASE; spl_image->os = IH_OS_U_BOOT; spl_image->name = "U-Boot"; @@ -396,6 +393,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2) hang(); }
+#ifdef CONFIG_CPU_V7M + spl_image.entry_point |= 0x1; +#endif switch (spl_image.os) { case IH_OS_U_BOOT: debug("Jumping to U-Boot\n");

On Sun, May 28, 2017 at 12:55:08PM -0700, Vikas Manocha wrote:
On ARM v7M, the processor will return to ARM mode when executing blx instruction with bit 0 of the address == 0. Always set it to 1 to stay in thumb mode.
At present, it is applied only for raw U-Boot. This patch moves it to just before booting next image. This way armv7m will be in thumb mode for any image like raw or image with header like zImage or standard U-Boot.
Signed-off-by: Vikas Manocha vikas.manocha@st.com
Reviewed-by: Tom Rini trini@konsulko.com

Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: None
configs/stm32f746-disco_defconfig | 4 ---- 1 file changed, 4 deletions(-)
diff --git a/configs/stm32f746-disco_defconfig b/configs/stm32f746-disco_defconfig index 4322aad..a334d50 100644 --- a/configs/stm32f746-disco_defconfig +++ b/configs/stm32f746-disco_defconfig @@ -44,10 +44,6 @@ CONFIG_DM_SPI=y CONFIG_STM32_QSPI=y CONFIG_OF_LIBFDT_OVERLAY=y # CONFIG_EFI_LOADER is not set -CONFIG_CLK=y -CONFIG_PINCTRL=y -# CONFIG_PINCTRL_FULL is not set -CONFIG_PINCTRL_STM32=y CONFIG_RAM=y CONFIG_STM32_SDRAM=y CONFIG_DM_GPIO=y

On Sun, May 28, 2017 at 12:55:09PM -0700, Vikas Manocha wrote:
Signed-off-by: Vikas Manocha vikas.manocha@st.com
Reviewed-by: Tom Rini trini@konsulko.com

This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
To compile u-boot without spl: Remove SUPPORT_SPL configuration (arch/arm/mach-stm32/Kconfig)
Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: None
arch/arm/mach-stm32/Kconfig | 1 + arch/arm/mach-stm32/stm32f7/Kconfig | 22 ++++++++++++++++++++++ board/st/stm32f746-disco/stm32f746-disco.c | 27 ++++++++++++++++++++++++++- configs/stm32f746-disco_defconfig | 1 - include/configs/stm32f746-disco.h | 22 +++++++++++++++++++++- 5 files changed, 70 insertions(+), 3 deletions(-)
diff --git a/arch/arm/mach-stm32/Kconfig b/arch/arm/mach-stm32/Kconfig index ec6b3ff..879383f 100644 --- a/arch/arm/mach-stm32/Kconfig +++ b/arch/arm/mach-stm32/Kconfig @@ -8,6 +8,7 @@ config STM32F1
config STM32F7 bool "stm32f7 family" + select SUPPORT_SPL
source "arch/arm/mach-stm32/stm32f4/Kconfig" source "arch/arm/mach-stm32/stm32f1/Kconfig" diff --git a/arch/arm/mach-stm32/stm32f7/Kconfig b/arch/arm/mach-stm32/stm32f7/Kconfig index 287e5ad..c13fafa 100644 --- a/arch/arm/mach-stm32/stm32f7/Kconfig +++ b/arch/arm/mach-stm32/stm32f7/Kconfig @@ -3,6 +3,28 @@ if STM32F7 config TARGET_STM32F746_DISCO bool "STM32F746 Discovery board"
+config SUPPORT_SPL + select SPL + select SPL_FRAMEWORK + select SPL_SERIAL_SUPPORT + select SPL_CLK + select SPL_OF_CONTROL + select SPL_OF_LIBFDT + select SPL_GPIO_SUPPORT + select SPL_LIBCOMMON_SUPPORT + select SPL_LIBGENERIC_SUPPORT + select SPL_DRIVERS_MISC_SUPPORT + select SPL_SYS_MALLOC_SIMPLE + select SPL_MTD_SUPPORT + select SPL_DM + select SPL_PINCTRL + select SPL_RAM + select SPL_DM_SEQ_ALIAS + select SPL_OF_TRANSLATE + +config SPL_PINCTRL_FULL + default n if TARGET_STM32F746_DISCO + source "board/st/stm32f746-disco/Kconfig"
endif diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c index dc3a9dc..4f2b677 100644 --- a/board/st/stm32f746-disco/stm32f746-disco.c +++ b/board/st/stm32f746-disco/stm32f746-disco.c @@ -8,6 +8,7 @@ #include <common.h> #include <dm.h> #include <ram.h> +#include <spl.h> #include <asm/io.h> #include <asm/armv7m.h> #include <asm/arch/stm32.h> @@ -36,16 +37,18 @@ int get_memory_base_size(fdt_addr_t *mr_base, fdt_addr_t *mr_size) } int dram_init(void) { - struct udevice *dev; int rv; fdt_addr_t mr_base, mr_size;
+#ifndef CONFIG_SUPPORT_SPL + struct udevice *dev; rv = uclass_get_device(UCLASS_RAM, 0, &dev); if (rv) { debug("DRAM init failed: %d\n", rv); return rv; }
+#endif rv = get_memory_base_size(&mr_base, &mr_size); if (rv) return rv; @@ -87,6 +90,28 @@ int board_early_init_f(void) } #endif
+#ifdef CONFIG_SPL_BUILD +int spl_dram_init(void) +{ + struct udevice *dev; + int rv; + rv = uclass_get_device(UCLASS_RAM, 0, &dev); + if (rv) + debug("DRAM init failed: %d\n", rv); + return rv; +} +void spl_board_init(void) +{ + spl_dram_init(); + preloader_console_init(); + arch_cpu_init(); /* to configure mpu for sdram rw permissions */ +} +u32 spl_boot_device(void) +{ + return BOOT_DEVICE_NOR; +} + +#endif u32 get_board_rev(void) { return 0; diff --git a/configs/stm32f746-disco_defconfig b/configs/stm32f746-disco_defconfig index a334d50..766b111 100644 --- a/configs/stm32f746-disco_defconfig +++ b/configs/stm32f746-disco_defconfig @@ -39,7 +39,6 @@ CONFIG_ETH_DESIGNWARE=y CONFIG_PINCTRL=y # CONFIG_PINCTRL_FULL is not set CONFIG_PINCTRL_STM32=y -# CONFIG_SPL_SERIAL_PRESENT is not set CONFIG_DM_SPI=y CONFIG_STM32_QSPI=y CONFIG_OF_LIBFDT_OVERLAY=y diff --git a/include/configs/stm32f746-disco.h b/include/configs/stm32f746-disco.h index 1ee5815..055fdf8 100644 --- a/include/configs/stm32f746-disco.h +++ b/include/configs/stm32f746-disco.h @@ -10,7 +10,12 @@
#define CONFIG_SYS_FLASH_BASE 0x08000000 #define CONFIG_SYS_INIT_SP_ADDR 0x20050000 -#define CONFIG_SYS_TEXT_BASE 0x08000000 + +#ifdef CONFIG_SUPPORT_SPL +#define CONFIG_SYS_TEXT_BASE 0xC0000000 +#else +#define CONFIG_SYS_TEXT_BASE CONFIG_SYS_FLASH_BASE +#endif
/* * Configuration of the external SDRAM memory @@ -69,4 +74,19 @@ #define CONFIG_CMD_CACHE #define CONFIG_BOARD_LATE_INIT #define CONFIG_DISPLAY_BOARDINFO + +/* For SPL */ +#ifdef CONFIG_SUPPORT_SPL +#define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR +#define CONFIG_SPL_FRAMEWORK +#define CONFIG_SPL_BOARD_INIT +#define CONFIG_SPL_TEXT_BASE CONFIG_SYS_FLASH_BASE +#define CONFIG_SYS_MONITOR_LEN (512 * 1024) +#define CONFIG_SYS_SPL_LEN 0x00008000 +#define CONFIG_SYS_UBOOT_START 0XC00003FD +#define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + \ + CONFIG_SYS_SPL_LEN) +#endif +/* For SPL ends */ + #endif /* __CONFIG_H */

On Sun, May 28, 2017 at 12:55:10PM -0700, Vikas Manocha wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot:
- spl U-Boot : 0x0800_0000
- standard U-Boot : 0x0800_8000
To compile u-boot without spl: Remove SUPPORT_SPL configuration (arch/arm/mach-stm32/Kconfig)
Signed-off-by: Vikas Manocha vikas.manocha@st.com
I had to rework the Kconfig locations here slightly (and in follow-up patches) to have the main select's be under STM32F7 in arch/arm/mach-stm32/Kconfig as it's not right to introduce a second 'config SUPPORT_SPL\nselect ...' stanza inside of arch/arm/mach-stm32/stm32f7/Kconfig.
Reviewed-by: Tom Rini trini@konsulko.com

Hi Tom,
-----Original Message----- From: Tom Rini [mailto:trini@konsulko.com] Sent: Saturday, June 10, 2017 6:46 AM To: Vikas MANOCHA vikas.manocha@st.com Cc: u-boot@lists.denx.de; Christophe KERELLO christophe.kerello@st.com; Alexandre TORGUE alexandre.torgue@st.com; Christophe PRIOUZEAU christophe.priouzeau@st.com Subject: Re: [U-Boot,v2,3/7] stm32: stm32f7: add spl build support
On Sun, May 28, 2017 at 12:55:10PM -0700, Vikas Manocha wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot:
- spl U-Boot : 0x0800_0000
- standard U-Boot : 0x0800_8000
To compile u-boot without spl: Remove SUPPORT_SPL configuration (arch/arm/mach-stm32/Kconfig)
Signed-off-by: Vikas Manocha vikas.manocha@st.com
I had to rework the Kconfig locations here slightly (and in follow-up patches) to have the main select's be under STM32F7 in arch/arm/mach-stm32/Kconfig as it's not right to introduce a second 'config SUPPORT_SPL\nselect ...' stanza inside of arch/arm/mach-stm32/stm32f7/Kconfig.
Thanks for the kconfig rework, appreciate it.
Cheers, Vikas
Reviewed-by: Tom Rini trini@konsulko.com
-- Tom

Hi Vikas,
On Sun, May 28, 2017 at 2:55 PM, Vikas Manocha vikas.manocha@st.com wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
Is there another patchset missing on mainline for booting via spl?
on mainline with the stm32f746-disco board:
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP Hard fault pc : 08008008 lr : 08000adb xPSR : 21000000 r12 : 2004f338 r3 : 00000005 r2 : 081c0000 r1 : ffffff9a r0 : 00000000 Resetting CPU ...
resetting ...
I'm using openocd to program
openocd -f board/stm32f7discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash write_image erase ./spl/u-boot-spl.bin 0x08000000" \ -c "flash write_image erase ./u-boot.img 0x08008000" \ -c "reset run" \ -c "shutdown"
Regards,

Hi Robert,
On 08/10/2017 11:03 AM, Robert Nelson wrote:
Hi Vikas,
On Sun, May 28, 2017 at 2:55 PM, Vikas Manocha vikas.manocha@st.com wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
Is there another patchset missing on mainline for booting via spl?
No, you just need to flash spl & next image at above mentioned addresses. By default spl expects kernel image.
To boot u-boot, press keyboard character 'c'. you might need to keep on pressing 'c' it for some time as the keyboard entry acceptance & detection window is very small.
Cheers, Vikas
on mainline with the stm32f746-disco board:
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP Hard fault pc : 08008008 lr : 08000adb xPSR : 21000000 r12 : 2004f338 r3 : 00000005 r2 : 081c0000 r1 : ffffff9a r0 : 00000000 Resetting CPU ...
resetting ...
I'm using openocd to program
openocd -f board/stm32f7discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash write_image erase ./spl/u-boot-spl.bin 0x08000000" \ -c "flash write_image erase ./u-boot.img 0x08008000" \ -c "reset run" \ -c "shutdown"
Regards,

One other point,
On 08/10/2017 11:07 AM, Vikas Manocha wrote:
Hi Robert,
On 08/10/2017 11:03 AM, Robert Nelson wrote:
Hi Vikas,
On Sun, May 28, 2017 at 2:55 PM, Vikas Manocha vikas.manocha@st.com wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
Is there another patchset missing on mainline for booting via spl?
No, you just need to flash spl & next image at above mentioned addresses. By default spl expects kernel image.
To boot u-boot, press keyboard character 'c'. you might need to keep on pressing 'c' it for some time as the keyboard entry acceptance & detection window is very small.
Cheers, Vikas
on mainline with the stm32f746-disco board:
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP Hard fault pc : 08008008 lr : 08000adb xPSR : 21000000 r12 : 2004f338 r3 : 00000005 r2 : 081c0000 r1 : ffffff9a r0 : 00000000 Resetting CPU ...
resetting ...
I'm using openocd to program
openocd -f board/stm32f7discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash write_image erase ./spl/u-boot-spl.bin 0x08000000" \ -c "flash write_image erase ./u-boot.img 0x08008000" \
it should be u-boot-dtb.bin.
Cheers, Vikas
-c "reset run" \ -c "shutdown"
Regards,

On Thu, Aug 10, 2017 at 1:10 PM, Vikas Manocha vikas.manocha@st.com wrote:
One other point,
On 08/10/2017 11:07 AM, Vikas Manocha wrote:
Hi Robert,
On 08/10/2017 11:03 AM, Robert Nelson wrote:
Hi Vikas,
On Sun, May 28, 2017 at 2:55 PM, Vikas Manocha vikas.manocha@st.com wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
Is there another patchset missing on mainline for booting via spl?
No, you just need to flash spl & next image at above mentioned addresses. By default spl expects kernel image.
To boot u-boot, press keyboard character 'c'. you might need to keep on pressing 'c' it for some time as the keyboard entry acceptance & detection window is very small.
Cheers, Vikas
on mainline with the stm32f746-disco board:
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP Hard fault pc : 08008008 lr : 08000adb xPSR : 21000000 r12 : 2004f338 r3 : 00000005 r2 : 081c0000 r1 : ffffff9a r0 : 00000000 Resetting CPU ...
resetting ...
I'm using openocd to program
openocd -f board/stm32f7discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash write_image erase ./spl/u-boot-spl.bin 0x08000000" \ -c "flash write_image erase ./u-boot.img 0x08008000" \
it should be u-boot-dtb.bin.
Bingo!
Thanks Vikas!!
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP
U-Boot 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35 -0500)
Model: STMicroelectronics STM32F746-DISCO board DRAM: 8 MiB Flash: 1 MiB Using default environment
In: serial@40011000 Out: serial@40011000 Err: serial@40011000 usr button is at LOW LEVEL Net: Warning: ethernet@40028000 (eth0) using random MAC address - 02:4a:de:c3:c8:80 eth0: ethernet@40028000 Hit SPACE in 3 seconds to stop autoboot. U-Boot >
Regards,

Hi Vikas, Try to remove this magic (press 'c' on the keyboard when at the boot time), I'd suggest to add a follow-up patch to move all the selected SPL related configuration from "arch/arm/mach-stm32/Kconfig" under STM32F7 to default configuration file (stm32f746-disco_defconfig). Then if the people want just boot up u-boot itself, what they need to do is just run "make menuconfig" and then de-select "Activate Falcon Mode" (SPL_OS_BOOT). Then everything will be fine.
Thanks.
Best Regards, Bo Shen
On 08/10/2017 11:36 AM, Robert Nelson wrote:
On Thu, Aug 10, 2017 at 1:10 PM, Vikas Manocha vikas.manocha@st.com wrote:
One other point,
On 08/10/2017 11:07 AM, Vikas Manocha wrote:
Hi Robert,
On 08/10/2017 11:03 AM, Robert Nelson wrote:
Hi Vikas,
On Sun, May 28, 2017 at 2:55 PM, Vikas Manocha vikas.manocha@st.com wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
Is there another patchset missing on mainline for booting via spl?
No, you just need to flash spl & next image at above mentioned addresses. By default spl expects kernel image.
To boot u-boot, press keyboard character 'c'. you might need to keep on pressing 'c' it for some time as the keyboard entry acceptance & detection window is very small.
Cheers, Vikas
on mainline with the stm32f746-disco board:
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP Hard fault pc : 08008008 lr : 08000adb xPSR : 21000000 r12 : 2004f338 r3 : 00000005 r2 : 081c0000 r1 : ffffff9a r0 : 00000000 Resetting CPU ...
resetting ...
I'm using openocd to program
openocd -f board/stm32f7discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash write_image erase ./spl/u-boot-spl.bin 0x08000000" \ -c "flash write_image erase ./u-boot.img 0x08008000" \
it should be u-boot-dtb.bin.
Bingo!
Thanks Vikas!!
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP
U-Boot 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35 -0500)
Model: STMicroelectronics STM32F746-DISCO board DRAM: 8 MiB Flash: 1 MiB Using default environment
In: serial@40011000 Out: serial@40011000 Err: serial@40011000 usr button is at LOW LEVEL Net: Warning: ethernet@40028000 (eth0) using random MAC address - 02:4a:de:c3:c8:80 eth0: ethernet@40028000 Hit SPACE in 3 seconds to stop autoboot. U-Boot >
Regards,

Hi Bo,
-----Original Message----- From: Bo Shen [mailto:voice.shen@gmail.com] Sent: Thursday, August 17, 2017 10:07 PM To: Robert Nelson robertcnelson@gmail.com; Vikas MANOCHA vikas.manocha@st.com Cc: U-Boot-Denx u-boot@lists.denx.de; Christophe PRIOUZEAU christophe.priouzeau@st.com; Alexandre TORGUE alexandre.torgue@st.com Subject: Re: [U-Boot] [PATCH v2 3/7] stm32: stm32f7: add spl build support
Hi Vikas, Try to remove this magic (press 'c' on the keyboard when at the boot time),
It helps to select between U-Boot or OS booting.
I'd suggest to add a follow-up patch to move all the selected SPL related configuration from "arch/arm/mach-stm32/Kconfig" under STM32F7 to default configuration file (stm32f746- disco_defconfig). Then if the people want just boot up u-boot itself, what they need to do is just run "make menuconfig" and then de- select "Activate Falcon Mode" (SPL_OS_BOOT). Then everything will be fine.
Yes, Agree. How about using "imply" instead of "select" for SPL_OS_BOOT to make it configurable.
Cheers, Vikas
Thanks.
Best Regards, Bo Shen
On 08/10/2017 11:36 AM, Robert Nelson wrote:
On Thu, Aug 10, 2017 at 1:10 PM, Vikas Manocha vikas.manocha@st.com wrote:
One other point,
On 08/10/2017 11:07 AM, Vikas Manocha wrote:
Hi Robert,
On 08/10/2017 11:03 AM, Robert Nelson wrote:
Hi Vikas,
On Sun, May 28, 2017 at 2:55 PM, Vikas Manocha vikas.manocha@st.com wrote:
This commit supports booting from stm32 internal nor flash. spl U-Boot initializes the sdram memory, copies next image (e.g. standard U-Boot) to sdram & then jumps to entry point.
Here are the flash memory addresses for U-Boot-spl & standard U-Boot: - spl U-Boot : 0x0800_0000 - standard U-Boot : 0x0800_8000
Is there another patchset missing on mainline for booting via spl?
No, you just need to flash spl & next image at above mentioned addresses. By default spl expects kernel image.
To boot u-boot, press keyboard character 'c'. you might need to keep on pressing 'c' it for some time as the keyboard entry acceptance & detection window is very small.
Cheers, Vikas
on mainline with the stm32f746-disco board:
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP Hard fault pc : 08008008 lr : 08000adb xPSR : 21000000 r12 : 2004f338 r3 : 00000005 r2 : 081c0000 r1 : ffffff9a r0 : 00000000 Resetting CPU ...
resetting ...
I'm using openocd to program
openocd -f board/stm32f7discovery.cfg \ -c "init" \ -c "reset init" \ -c "flash probe 0" \ -c "flash write_image erase ./spl/u-boot-spl.bin 0x08000000" \ -c "flash write_image erase ./u-boot.img 0x08008000" \
it should be u-boot-dtb.bin.
Bingo!
Thanks Vikas!!
U-Boot SPL 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35) Trying to boot from XIP
U-Boot 2017.09-rc1-00177-gd529124fdc (Aug 10 2017 - 12:33:35 -0500)
Model: STMicroelectronics STM32F746-DISCO board DRAM: 8 MiB Flash: 1 MiB Using default environment
In: serial@40011000 Out: serial@40011000 Err: serial@40011000 usr button is at LOW LEVEL Net: Warning: ethernet@40028000 (eth0) using random MAC address - 02:4a:de:c3:c8:80 eth0: ethernet@40028000 Hit SPACE in 3 seconds to stop autoboot. U-Boot >
Regards,

On Fri, Aug 18, 2017 at 4:28 PM, Vikas MANOCHA vikas.manocha@st.com wrote:
Hi Bo,
-----Original Message----- From: Bo Shen [mailto:voice.shen@gmail.com] Sent: Thursday, August 17, 2017 10:07 PM To: Robert Nelson robertcnelson@gmail.com; Vikas MANOCHA vikas.manocha@st.com Cc: U-Boot-Denx u-boot@lists.denx.de; Christophe PRIOUZEAU christophe.priouzeau@st.com; Alexandre TORGUE alexandre.torgue@st.com Subject: Re: [U-Boot] [PATCH v2 3/7] stm32: stm32f7: add spl build support
Hi Vikas, Try to remove this magic (press 'c' on the keyboard when at the boot time),
It helps to select between U-Boot or OS booting.
I'd suggest to add a follow-up patch to move all the selected SPL related configuration from "arch/arm/mach-stm32/Kconfig" under STM32F7 to default configuration file (stm32f746- disco_defconfig). Then if the people want just boot up u-boot itself, what they need to do is just run "make menuconfig" and then de- select "Activate Falcon Mode" (SPL_OS_BOOT). Then everything will be fine.
Yes, Agree. How about using "imply" instead of "select" for SPL_OS_BOOT to make it configurable.
Well, we really need a /doc/README.stm32 that explains this "different" default.. It's definitely different then omap/imx/tegra/atmel in this tree. But the processor is also more handicapped, so not wasting time in normal u-boot just booting the kernel via spl/falcon more makes sense.
Regards,

Hi,
On Aug 18, 2017, at 6:31 PM, Robert Nelson robertcnelson@gmail.com wrote:
On Fri, Aug 18, 2017 at 4:28 PM, Vikas MANOCHA vikas.manocha@st.com wrote: Hi Bo,
-----Original Message----- From: Bo Shen [mailto:voice.shen@gmail.com] Sent: Thursday, August 17, 2017 10:07 PM To: Robert Nelson robertcnelson@gmail.com; Vikas MANOCHA vikas.manocha@st.com Cc: U-Boot-Denx u-boot@lists.denx.de; Christophe PRIOUZEAU christophe.priouzeau@st.com; Alexandre TORGUE alexandre.torgue@st.com Subject: Re: [U-Boot] [PATCH v2 3/7] stm32: stm32f7: add spl build support
Hi Vikas, Try to remove this magic (press 'c' on the keyboard when at the boot time),
It helps to select between U-Boot or OS booting.
I'd suggest to add a follow-up patch to move all the selected SPL related configuration from "arch/arm/mach-stm32/Kconfig" under STM32F7 to default configuration file (stm32f746- disco_defconfig). Then if the people want just boot up u-boot itself, what they need to do is just run "make menuconfig" and then de- select "Activate Falcon Mode" (SPL_OS_BOOT). Then everything will be fine.
Yes, Agree. How about using "imply" instead of "select" for SPL_OS_BOOT to make it configurable.
Well, we really need a /doc/README.stm32 that explains this "different" default.. It's definitely different then omap/imx/tegra/atmel in this tree. But the processor is also more handicapped, so not wasting time in normal u-boot just booting the kernel via spl/falcon more makes sense.
That's the current configuration with one additional key entry check which is insignificant in terms of any overhead.
Making SPL_OS_BOOT configurable is also adding option to compile spl to boot UBoot directly without any overhead.
Cheers, Vikas
Regards,
-- Robert Nelson https://rcn-ee.com/

Hi Vikas,
On 08/18/2017 02:28 PM, Vikas MANOCHA wrote:
I'd suggest to add a follow-up patch to move all the selected SPL related configuration from "arch/arm/mach-stm32/Kconfig" under STM32F7 to default configuration file (stm32f746- disco_defconfig). Then if the people want just boot up u-boot itself, what they need to do is just run "make menuconfig" and then de- select "Activate Falcon Mode" (SPL_OS_BOOT). Then everything will be fine.
Yes, Agree. How about using "imply" instead of "select" for SPL_OS_BOOT to make it configurable.
I don't realize this option before. For sure, it's a great option. I'd like it. :)
Thanks.
Best Regards, Bo Shen

Enable support for XIP (execute in place) of U-Boot or kernel image. There is no need to copy image from flash to ram if flash supports execute in place.
Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: - removed v7m thumb mode for entry point, added separate patch. - removed extra blank line.
arch/arm/include/asm/spl.h | 1 + common/spl/Kconfig | 9 +++++++++ common/spl/Makefile | 1 + common/spl/spl_xip.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 common/spl/spl_xip.c
diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h index a0bda28..0a3536b 100644 --- a/arch/arm/include/asm/spl.h +++ b/arch/arm/include/asm/spl.h @@ -29,6 +29,7 @@ enum { BOOT_DEVICE_I2C, BOOT_DEVICE_BOARD, BOOT_DEVICE_DFU, + BOOT_DEVICE_XIP, BOOT_DEVICE_NONE }; #endif diff --git a/common/spl/Kconfig b/common/spl/Kconfig index f51ae2c..52a5271 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -459,6 +459,15 @@ config SPL_NOR_SUPPORT a memory-mapped device makes it very easy to access. Loading from NOR is typically achieved with just a memcpy().
+config SPL_XIP_SUPPORT + bool "Support XIP" + depends on SPL + help + Enable support for execute in place of U-Boot or kernel image. There + is no need to copy image from flash to ram if flash supports execute + in place. Its very useful in systems having enough flash but not + enough ram to load the image. + config SPL_ONENAND_SUPPORT bool "Support OneNAND flash" depends on SPL diff --git a/common/spl/Makefile b/common/spl/Makefile index 1933cbd..88deeaf 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -12,6 +12,7 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_FRAMEWORK) += spl.o obj-$(CONFIG_SPL_LOAD_FIT) += spl_fit.o obj-$(CONFIG_SPL_NOR_SUPPORT) += spl_nor.o +obj-$(CONFIG_SPL_XIP_SUPPORT) += spl_xip.o obj-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o ifndef CONFIG_SPL_UBI obj-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o diff --git a/common/spl/spl_xip.c b/common/spl/spl_xip.c new file mode 100644 index 0000000..18c7d11 --- /dev/null +++ b/common/spl/spl_xip.c @@ -0,0 +1,28 @@ +/* + * Copyright (C) 2017 Vikas Manocha vikas.manocha@st.com + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#include <common.h> +#include <spl.h> + +static int spl_xip(struct spl_image_info *spl_image, + struct spl_boot_device *bootdev) +{ +#ifdef CONFIG_SPL_OS_BOOT + if (!spl_start_uboot()) { + spl_image->arg = (void *)CONFIG_SYS_FDT_BASE; + spl_image->name = "Linux"; + spl_image->os = IH_OS_LINUX; + spl_image->load_addr = CONFIG_SYS_LOAD_ADDR; + spl_image->entry_point = CONFIG_SYS_LOAD_ADDR; + debug("spl: payload xipImage, load addr: 0x%lx\n", + spl_image->load_addr); + return 0; + } +#endif + return(spl_parse_image_header(spl_image, (const struct image_header *) + CONFIG_SYS_UBOOT_BASE)); +} +SPL_LOAD_IMAGE_METHOD("XIP", 0, BOOT_DEVICE_XIP, spl_xip);

On 05/28/2017 12:55 PM, Vikas Manocha wrote:
Enable support for XIP (execute in place) of U-Boot or kernel image. There is no need to copy image from flash to ram if flash supports execute in place.
Signed-off-by: Vikas Manocha vikas.manocha@st.com
Changed in v2:
- removed v7m thumb mode for entry point, added separate patch.
- removed extra blank line.
arch/arm/include/asm/spl.h | 1 + common/spl/Kconfig | 9 +++++++++ common/spl/Makefile | 1 + common/spl/spl_xip.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+) create mode 100644 common/spl/spl_xip.c
diff --git a/arch/arm/include/asm/spl.h b/arch/arm/include/asm/spl.h index a0bda28..0a3536b 100644 --- a/arch/arm/include/asm/spl.h +++ b/arch/arm/include/asm/spl.h @@ -29,6 +29,7 @@ enum { BOOT_DEVICE_I2C, BOOT_DEVICE_BOARD, BOOT_DEVICE_DFU,
- BOOT_DEVICE_XIP, BOOT_DEVICE_NONE
}; #endif diff --git a/common/spl/Kconfig b/common/spl/Kconfig index f51ae2c..52a5271 100644 --- a/common/spl/Kconfig +++ b/common/spl/Kconfig @@ -459,6 +459,15 @@ config SPL_NOR_SUPPORT a memory-mapped device makes it very easy to access. Loading from NOR is typically achieved with just a memcpy().
+config SPL_XIP_SUPPORT
- bool "Support XIP"
- depends on SPL
- help
Enable support for execute in place of U-Boot or kernel image. There
is no need to copy image from flash to ram if flash supports execute
in place. Its very useful in systems having enough flash but not
enough ram to load the image.
config SPL_ONENAND_SUPPORT bool "Support OneNAND flash" depends on SPL diff --git a/common/spl/Makefile b/common/spl/Makefile index 1933cbd..88deeaf 100644 --- a/common/spl/Makefile +++ b/common/spl/Makefile @@ -12,6 +12,7 @@ ifdef CONFIG_SPL_BUILD obj-$(CONFIG_SPL_FRAMEWORK) += spl.o obj-$(CONFIG_SPL_LOAD_FIT) += spl_fit.o obj-$(CONFIG_SPL_NOR_SUPPORT) += spl_nor.o +obj-$(CONFIG_SPL_XIP_SUPPORT) += spl_xip.o obj-$(CONFIG_SPL_YMODEM_SUPPORT) += spl_ymodem.o ifndef CONFIG_SPL_UBI obj-$(CONFIG_SPL_NAND_SUPPORT) += spl_nand.o diff --git a/common/spl/spl_xip.c b/common/spl/spl_xip.c new file mode 100644 index 0000000..18c7d11 --- /dev/null +++ b/common/spl/spl_xip.c @@ -0,0 +1,28 @@ +/*
- Copyright (C) 2017 Vikas Manocha vikas.manocha@st.com
- SPDX-License-Identifier: GPL-2.0+
- */
+#include <common.h> +#include <spl.h>
+static int spl_xip(struct spl_image_info *spl_image,
struct spl_boot_device *bootdev)
+{ +#ifdef CONFIG_SPL_OS_BOOT
- if (!spl_start_uboot()) {
spl_image->arg = (void *)CONFIG_SYS_FDT_BASE;
spl_image->name = "Linux";
spl_image->os = IH_OS_LINUX;
spl_image->load_addr = CONFIG_SYS_LOAD_ADDR;
spl_image->entry_point = CONFIG_SYS_LOAD_ADDR;
debug("spl: payload xipImage, load addr: 0x%lx\n",
spl_image->load_addr);
return 0;
- }
+#endif
- return(spl_parse_image_header(spl_image, (const struct image_header *)
CONFIG_SYS_UBOOT_BASE));
+} +SPL_LOAD_IMAGE_METHOD("XIP", 0, BOOT_DEVICE_XIP, spl_xip);
Reviewed-by: Alexandru Gagniuc alex.g@adaptrum.com

On Sun, May 28, 2017 at 12:55:11PM -0700, Vikas Manocha wrote:
Enable support for XIP (execute in place) of U-Boot or kernel image. There is no need to copy image from flash to ram if flash supports execute in place.
Signed-off-by: Vikas Manocha vikas.manocha@st.com Reviewed-by: Alexandru Gagniuc alex.g@adaptrum.com
Applied to u-boot/master, thanks!

With overrun enabled, serial port console freezes & stops receiving data with overun error if we keep sending data.
Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: None
drivers/serial/serial_stm32x7.c | 3 +++ drivers/serial/serial_stm32x7.h | 2 ++ 2 files changed, 5 insertions(+)
diff --git a/drivers/serial/serial_stm32x7.c b/drivers/serial/serial_stm32x7.c index 1907cef..2b305cd 100644 --- a/drivers/serial/serial_stm32x7.c +++ b/drivers/serial/serial_stm32x7.c @@ -93,6 +93,9 @@ static int stm32_serial_probe(struct udevice *dev) } #endif
+ /* Disable usart-> disable overrun-> enable usart */ + clrbits_le32(&usart->cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE); + setbits_le32(&usart->cr3, USART_CR3_OVRDIS); setbits_le32(&usart->cr1, USART_CR1_RE | USART_CR1_TE | USART_CR1_UE);
return 0; diff --git a/drivers/serial/serial_stm32x7.h b/drivers/serial/serial_stm32x7.h index 6190d67..8c02548 100644 --- a/drivers/serial/serial_stm32x7.h +++ b/drivers/serial/serial_stm32x7.h @@ -27,6 +27,8 @@ struct stm32_usart { #define USART_CR1_TE (1 << 3) #define USART_CR1_UE (1 << 0)
+#define USART_CR3_OVRDIS (1 << 12) + #define USART_SR_FLAG_RXNE (1 << 5) #define USART_SR_FLAG_TXE (1 << 7)

On Sun, May 28, 2017 at 12:55:12PM -0700, Vikas Manocha wrote:
With overrun enabled, serial port console freezes & stops receiving data with overun error if we keep sending data.
Signed-off-by: Vikas Manocha vikas.manocha@st.com
Applied to u-boot/master, thanks!

Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: None
arch/arm/mach-stm32/stm32f7/Kconfig | 1 + board/st/stm32f746-disco/stm32f746-disco.c | 9 +++++++++ include/configs/stm32f746-disco.h | 7 +++++++ 3 files changed, 17 insertions(+)
diff --git a/arch/arm/mach-stm32/stm32f7/Kconfig b/arch/arm/mach-stm32/stm32f7/Kconfig index c13fafa..3f6455e 100644 --- a/arch/arm/mach-stm32/stm32f7/Kconfig +++ b/arch/arm/mach-stm32/stm32f7/Kconfig @@ -21,6 +21,7 @@ config SUPPORT_SPL select SPL_RAM select SPL_DM_SEQ_ALIAS select SPL_OF_TRANSLATE + select SPL_OS_BOOT
config SPL_PINCTRL_FULL default n if TARGET_STM32F746_DISCO diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c index 4f2b677..335dcb9 100644 --- a/board/st/stm32f746-disco/stm32f746-disco.c +++ b/board/st/stm32f746-disco/stm32f746-disco.c @@ -91,6 +91,15 @@ int board_early_init_f(void) #endif
#ifdef CONFIG_SPL_BUILD +#ifdef CONFIG_SPL_OS_BOOT +int spl_start_uboot(void) +{ + debug("SPL: booting kernel\n"); + /* break into full u-boot on 'c' */ + return serial_tstc() && serial_getc() == 'c'; +} +#endif + int spl_dram_init(void) { struct udevice *dev; diff --git a/include/configs/stm32f746-disco.h b/include/configs/stm32f746-disco.h index 055fdf8..9052025 100644 --- a/include/configs/stm32f746-disco.h +++ b/include/configs/stm32f746-disco.h @@ -86,6 +86,13 @@ #define CONFIG_SYS_UBOOT_START 0XC00003FD #define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + \ CONFIG_SYS_SPL_LEN) + +#define CONFIG_SYS_OS_BASE 0x08040000 +/* DT blob (fdt) address */ +#define CONFIG_SYS_SPL_ARGS_ADDR 0xC0000100 +#define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \ + 0x1C0000) +#define CONFIG_SYS_FDT_SIZE (20*1024) #endif /* For SPL ends */

On Sun, May 28, 2017 at 12:55:13PM -0700, Vikas Manocha wrote:
Signed-off-by: Vikas Manocha vikas.manocha@st.com
Applied to u-boot/master, thanks!

With xip booting configuration, we don't need to copy the next image (U-Boot or linux xipimage) from flash to sdram area.
Flash memory organization is like this: spl-U-Boot: u-boot-spl.bin : 0x0800_0000 U-Boot : u-boot-dtb.bin : 0x0800_8000 linux : xipImage : 0x0800_8000
It is also possible to have U-Boot binary & linux binaries configured at different addresses of flash memory like U-Boot at 0x0800_8000 & linux xipImage at 0x0800_4000. But in any case, spl-U-Boot needs to be compiled for U-Boot as next binary with SPL_OS_BOOT option disabled. By default, spl is configured to boot linux xipImage.
Signed-off-by: Vikas Manocha vikas.manocha@st.com ---
Changed in v2: None
arch/arm/mach-stm32/stm32f7/Kconfig | 1 + board/st/stm32f746-disco/stm32f746-disco.c | 2 +- include/configs/stm32f746-disco.h | 12 +++++------- 3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-stm32/stm32f7/Kconfig b/arch/arm/mach-stm32/stm32f7/Kconfig index 3f6455e..6acf9cf 100644 --- a/arch/arm/mach-stm32/stm32f7/Kconfig +++ b/arch/arm/mach-stm32/stm32f7/Kconfig @@ -22,6 +22,7 @@ config SUPPORT_SPL select SPL_DM_SEQ_ALIAS select SPL_OF_TRANSLATE select SPL_OS_BOOT + select SPL_XIP_SUPPORT
config SPL_PINCTRL_FULL default n if TARGET_STM32F746_DISCO diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c index 335dcb9..11957e0 100644 --- a/board/st/stm32f746-disco/stm32f746-disco.c +++ b/board/st/stm32f746-disco/stm32f746-disco.c @@ -117,7 +117,7 @@ void spl_board_init(void) } u32 spl_boot_device(void) { - return BOOT_DEVICE_NOR; + return BOOT_DEVICE_XIP; }
#endif diff --git a/include/configs/stm32f746-disco.h b/include/configs/stm32f746-disco.h index 9052025..4e0edcb 100644 --- a/include/configs/stm32f746-disco.h +++ b/include/configs/stm32f746-disco.h @@ -12,17 +12,18 @@ #define CONFIG_SYS_INIT_SP_ADDR 0x20050000
#ifdef CONFIG_SUPPORT_SPL -#define CONFIG_SYS_TEXT_BASE 0xC0000000 +#define CONFIG_SYS_TEXT_BASE 0x08008000 +#define CONFIG_SYS_LOAD_ADDR 0x08008000 #else #define CONFIG_SYS_TEXT_BASE CONFIG_SYS_FLASH_BASE +#define CONFIG_SYS_LOAD_ADDR 0xC0400000 +#define CONFIG_LOADADDR 0xC0400000 #endif
/* * Configuration of the external SDRAM memory */ #define CONFIG_NR_DRAM_BANKS 1 -#define CONFIG_SYS_LOAD_ADDR 0xC0400000 -#define CONFIG_LOADADDR 0xC0400000
#define CONFIG_SYS_MAX_FLASH_SECT 8 #define CONFIG_SYS_MAX_FLASH_BANKS 1 @@ -83,16 +84,13 @@ #define CONFIG_SPL_TEXT_BASE CONFIG_SYS_FLASH_BASE #define CONFIG_SYS_MONITOR_LEN (512 * 1024) #define CONFIG_SYS_SPL_LEN 0x00008000 -#define CONFIG_SYS_UBOOT_START 0XC00003FD +#define CONFIG_SYS_UBOOT_START 0x080083FD #define CONFIG_SYS_UBOOT_BASE (CONFIG_SYS_FLASH_BASE + \ CONFIG_SYS_SPL_LEN)
-#define CONFIG_SYS_OS_BASE 0x08040000 /* DT blob (fdt) address */ -#define CONFIG_SYS_SPL_ARGS_ADDR 0xC0000100 #define CONFIG_SYS_FDT_BASE (CONFIG_SYS_FLASH_BASE + \ 0x1C0000) -#define CONFIG_SYS_FDT_SIZE (20*1024) #endif /* For SPL ends */

On Sun, May 28, 2017 at 12:55:14PM -0700, Vikas Manocha wrote:
With xip booting configuration, we don't need to copy the next image (U-Boot or linux xipimage) from flash to sdram area.
Flash memory organization is like this: spl-U-Boot: u-boot-spl.bin : 0x0800_0000 U-Boot : u-boot-dtb.bin : 0x0800_8000 linux : xipImage : 0x0800_8000
It is also possible to have U-Boot binary & linux binaries configured at different addresses of flash memory like U-Boot at 0x0800_8000 & linux xipImage at 0x0800_4000. But in any case, spl-U-Boot needs to be compiled for U-Boot as next binary with SPL_OS_BOOT option disabled. By default, spl is configured to boot linux xipImage.
Signed-off-by: Vikas Manocha vikas.manocha@st.com
Applied to u-boot/master, thanks!

Hi Tom,
-----Original Message----- From: Vikas MANOCHA Sent: Sunday, May 28, 2017 12:55 PM To: u-boot@lists.denx.de Cc: Vikas MANOCHA vikas.manocha@st.com; Patrick DELAUNAY patrick.delaunay@st.com; Patrice CHOTARD patrice.chotard@st.com; Christophe KERELLO christophe.kerello@st.com; Christophe PRIOUZEAU christophe.priouzeau@st.com; Alexandre TORGUE alexandre.torgue@st.com Subject: [PATCH v2 0/7] spl: add xip booting support
This patchset adds support for XIP (execute in place) of U-Boot or kernel image and enables it for stm32f7.
Pls apply this series whenever you get a chance. Cheers, Vikas
Changed in v2:
- added patch to move v7m thumb mode just before next image boot
- removed extra blank line.
Vikas Manocha (7): spl: armv7m: to keep ARM v7M in thumb mode before booting next image stm32f7: remove duplicate configs stm32: stm32f7: add spl build support SPL: Add XIP booting support serial: stm32f7: disable overrun spl: stm32f7: add kernel boot support spl: stm32f7: configure for xip booting
arch/arm/include/asm/spl.h | 1 + arch/arm/mach-stm32/Kconfig | 1 + arch/arm/mach-stm32/stm32f7/Kconfig | 24 ++++++++++++++++++++ board/st/stm32f746-disco/stm32f746-disco.c | 36 +++++++++++++++++++++++++++++- common/spl/Kconfig | 9 ++++++++ common/spl/Makefile | 1 + common/spl/spl.c | 6 ++--- common/spl/spl_xip.c | 28 +++++++++++++++++++++++ configs/stm32f746-disco_defconfig | 5 ----- drivers/serial/serial_stm32x7.c | 3 +++ drivers/serial/serial_stm32x7.h | 2 ++ include/configs/stm32f746-disco.h | 31 ++++++++++++++++++++++--- 12 files changed, 135 insertions(+), 12 deletions(-) create mode 100644 common/spl/spl_xip.c
-- 1.9.1
participants (6)
-
Alexandru Gagniuc
-
Bo Shen
-
Robert Nelson
-
Tom Rini
-
Vikas MANOCHA
-
Vikas Manocha