ARM: mxs: support full SPL framework
authorMans Rullgard <mans@mansr.com>
Sat, 21 Apr 2018 15:11:10 +0000 (16:11 +0100)
committerStefano Babic <sbabic@denx.de>
Fri, 27 Apr 2018 07:32:54 +0000 (09:32 +0200)
This allows using the full SPL framework on mxs devices.  In this
mode, the u-boot.sb image loaded by the boot ROM contains only the
SPL which then loads U-Boot proper or a kernel in falcon mode.

Signed-off-by: Mans Rullgard <mans@mansr.com>
arch/arm/Kconfig
arch/arm/cpu/arm926ejs/mxs/Makefile
arch/arm/cpu/arm926ejs/mxs/mxsimage-spl.mx23.cfg [new file with mode: 0644]
arch/arm/cpu/arm926ejs/mxs/mxsimage-spl.mx28.cfg [new file with mode: 0644]
arch/arm/cpu/arm926ejs/mxs/spl_boot.c
include/configs/mxs.h

index 7212fc5afa72c2bfeee8e5918af13b79d7c33edf..0acdd162b4b349accd99c1ca93099d7e2c00819e 100644 (file)
@@ -1352,7 +1352,7 @@ source "arch/arm/Kconfig.debug"
 endmenu
 
 config SPL_LDSCRIPT
-        default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if ARCH_MX23 || ARCH_MX28
+        default "arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds" if (ARCH_MX23 || ARCH_MX28) && !SPL_FRAMEWORK
         default "arch/arm/cpu/arm1136/u-boot-spl.lds" if CPU_ARM1136
        default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARM64
 
index 71c2c0e7b40c169be167b351b5a6e199e292efaa..83b05acfa4eb24d66efc81115f5052a5fd268e31 100644 (file)
@@ -14,8 +14,8 @@ obj-y += spl_boot.o spl_lradc_init.o spl_mem_init.o spl_power_init.o
 endif
 
 # Specify the target for use in elftosb call
-MKIMAGE_TARGET-$(CONFIG_MX23) = mxsimage.mx23.cfg
-MKIMAGE_TARGET-$(CONFIG_MX28) = mxsimage.mx28.cfg
+MKIMAGE_TARGET-$(CONFIG_MX23) = mxsimage$(CONFIG_SPL_FRAMEWORK:%=-spl).mx23.cfg
+MKIMAGE_TARGET-$(CONFIG_MX28) = mxsimage$(CONFIG_SPL_FRAMEWORK:%=-spl).mx28.cfg
 
 # Generate HAB-capable IVT
 #
diff --git a/arch/arm/cpu/arm926ejs/mxs/mxsimage-spl.mx23.cfg b/arch/arm/cpu/arm926ejs/mxs/mxsimage-spl.mx23.cfg
new file mode 100644 (file)
index 0000000..ab2183e
--- /dev/null
@@ -0,0 +1,5 @@
+DISPLAYPROGRESS
+SECTION 0x0 BOOTABLE
+ TAG LAST
+ LOAD     0x1000     spl/u-boot-spl.bin
+ CALL     0x1000     0x0
diff --git a/arch/arm/cpu/arm926ejs/mxs/mxsimage-spl.mx28.cfg b/arch/arm/cpu/arm926ejs/mxs/mxsimage-spl.mx28.cfg
new file mode 100644 (file)
index 0000000..0d95064
--- /dev/null
@@ -0,0 +1,6 @@
+DISPLAYPROGRESS
+SECTION 0x0 BOOTABLE
+ TAG LAST
+ LOAD     0x1000     spl/u-boot-spl.bin
+ LOAD IVT 0x8000     0x1000
+ CALL HAB 0x8000     0x0
index 0c3925640dc944966457332480b9b3ac0e6364a6..bc39465fc4e02d736ef9d3c4456216cbb9754da0 100644 (file)
@@ -146,6 +146,7 @@ void mxs_common_spl_init(const uint32_t arg, const uint32_t *resptr,
        }
 }
 
+#ifndef CONFIG_SPL_FRAMEWORK
 /* Support aparatus */
 inline void board_init_f(unsigned long bootflag)
 {
@@ -158,3 +159,4 @@ inline void board_init_r(gd_t *id, ulong dest_addr)
        for (;;)
                ;
 }
+#endif
index f07f81c8415c3e66f933487b8596e9dc280f7eae..0fe0770e13f0ddf13cfd68fa348733d4146f561d 100644 (file)
 /* Startup hooks */
 
 /* SPL */
+#ifndef CONFIG_SPL_FRAMEWORK
 #define CONFIG_SPL_NO_CPU_SUPPORT_CODE
 #define CONFIG_SPL_START_S_PATH        "arch/arm/cpu/arm926ejs/mxs"
+#endif
 
 /* Memory sizes */
 #define CONFIG_SYS_MALLOC_LEN          0x00400000      /* 4 MB for malloc */