The FEL SPL entry point at the address 0x2000 starts execution in the ARM mode. So we need to make sure that this particular code is also compiled for the ARM mode. The rest of the SPL can be compiled as Thumb2 and benefit from the code size reduction.
Signed-off-by: Siarhei Siamashka <[email protected]> --- arch/arm/cpu/armv7/sunxi/Makefile | 2 ++ arch/arm/cpu/armv7/sunxi/s_init_arm.c | 2 ++ arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds | 4 ++-- include/configs/sunxi-common.h | 2 -- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 arch/arm/cpu/armv7/sunxi/s_init_arm.c diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile index 19e4b17..ee43589 100644 --- a/arch/arm/cpu/armv7/sunxi/Makefile +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -40,5 +40,7 @@ obj-$(CONFIG_SUN5I) += dram.o obj-$(CONFIG_SUN7I) += dram.o ifdef CONFIG_SPL_FEL obj-y += start.o +obj-y += s_init_arm.o +CFLAGS_s_init_arm.o += -marm endif endif diff --git a/arch/arm/cpu/armv7/sunxi/s_init_arm.c b/arch/arm/cpu/armv7/sunxi/s_init_arm.c new file mode 100644 index 0000000..7d8fbc1 --- /dev/null +++ b/arch/arm/cpu/armv7/sunxi/s_init_arm.c @@ -0,0 +1,2 @@ +/* FEL starts execution in the ARM mode, so we need this adapter function */ +void s_init(void); void s_init_arm(void) { s_init(); } diff --git a/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds index 364e35c..a2129c1 100644 --- a/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds +++ b/arch/arm/cpu/armv7/sunxi/u-boot-spl-fel.lds @@ -6,7 +6,7 @@ */ OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm") OUTPUT_ARCH(arm) -ENTRY(s_init) +ENTRY(s_init_arm) SECTIONS { . = 0x00002000; @@ -14,7 +14,7 @@ SECTIONS . = ALIGN(4); .text : { - *(.text.s_init) + *(.text.s_init_arm) *(.text*) } diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h index e11c4ee..f72c147 100644 --- a/include/configs/sunxi-common.h +++ b/include/configs/sunxi-common.h @@ -18,10 +18,8 @@ */ #define CONFIG_SUNXI /* sunxi family */ #ifdef CONFIG_SPL_BUILD -#ifndef CONFIG_SPL_FEL #define CONFIG_SYS_THUMB_BUILD /* Thumbs mode to save space in SPL */ #endif -#endif #include <asm/arch/cpu.h> /* get chip and board defs */ -- 1.8.3.2 -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
