summaryrefslogtreecommitdiffstats
path: root/board
diff options
context:
space:
mode:
authorVikas Manocha <vikas.manocha@st.com>2017-05-28 12:55:10 -0700
committerTom Rini <trini@konsulko.com>2017-06-09 11:23:55 -0400
commitb97476965bf292c13074e01de4bd39253de0ef66 (patch)
tree98e31a42d754e9fa65073f335fd3f4f6a0845d04 /board
parentea744fca0e36e085947ad32358da60377d1966b6 (diff)
downloadu-boot-b97476965bf292c13074e01de4bd39253de0ef66.tar.gz
u-boot-b97476965bf292c13074e01de4bd39253de0ef66.tar.xz
u-boot-b97476965bf292c13074e01de4bd39253de0ef66.zip
stm32: stm32f7: add spl build support
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> [trini: Rework Kconfig logic a bit] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'board')
-rw-r--r--board/st/stm32f746-disco/stm32f746-disco.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c
index 7a6d93cb67..87fa5eb48e 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;