MLK-15286 arm: arm64: only use general regs
authorPeng Fan <peng.fan@nxp.com>
Mon, 26 Jun 2017 12:18:10 +0000 (20:18 +0800)
committerYe Li <ye.li@nxp.com>
Wed, 28 Apr 2021 20:48:55 +0000 (13:48 -0700)
When compiling with android toolchain, there is an instruction
"str     q0, [x8],#16", but x8 is not 16bytes aligned,
this instruction will trigger sync abort.

So, following Linux kernel, only use general regs option to IMX8 and
IMX8M aarch64 only.
If not, compiler may use simd registers Q[x]. We need to avoid
using simd registers in U-Boot, because load/store Q[x] has
restriction that 128bits aligned when str/ldr.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
(cherry picked from commit 186ccd8de53f986c5913432638dfaca9bdc97e89)
(cherry picked from commit 8f3f0d339783e066f7815408949677b62e465b62)
(cherry picked from commit 3002af0ff57e9db40baeefbc14a336ad206e8fea)
(cherry picked from commit ad1f02f687e208a32d89d6f7b16802da115cf27e)

arch/arm/Makefile

index 28b523b..bd02c21 100644 (file)
@@ -28,6 +28,10 @@ else
 arch-y += -D__LINUX_ARM_ARCH__=$(CONFIG_SYS_ARM_ARCH)
 endif
 
+ifneq ($(CONFIG_ARCH_IMX8)$(CONFIG_ARCH_IMX8M),)
+arch-y += -mgeneral-regs-only
+endif
+
 # Evaluate arch cc-option calls now
 arch-y := $(arch-y)