[PATCH] ARM: Prevent the compiler from using NEON registers

Samuel Holland samuel at sholland.org
Mon Aug 16 05:14:37 CEST 2021


For ARMv8-A, NEON is standard, so the compiler can use it even when no
special target flags are provided. For example, it can use stores from
NEON registers to zero-initialize large structures. GCC 11 decides to
do this inside the DRAM init code for the Allwinner H6, which breaks
boot on that platform, as NEON is not available in SPL. Fix this by
restricting the compiler to using GPRs only, not vector registers.

Signed-off-by: Samuel Holland <samuel at sholland.org>
---
 arch/arm/config.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 16c63e12667..964c6b026ec 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -25,6 +25,7 @@ endif
 
 PLATFORM_RELFLAGS += -fno-common -ffixed-r9
 PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \
+		     $(call cc-option,-mgeneral-regs-only) \
       $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,))
 
 # LLVM support
-- 
2.31.1



More information about the U-Boot mailing list