From 9395669ac0f5e05f9e9fa11591b57e67bf564811 Mon Sep 17 00:00:00 2001 From: hujun5 Date: Wed, 23 Oct 2024 14:42:21 +0800 Subject: [PATCH] arm64: fix fvp smp faild to boot reason: we should give a busy wait addr This commit fixes the regression from https://github.com/apache/nuttx/pull/13640 Signed-off-by: hujun5 --- arch/arm64/src/common/arm64_cpustart.c | 2 +- boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig | 2 ++ boards/arm64/fvp-v8r/fvp-armv8r/scripts/dramboot.ld | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/src/common/arm64_cpustart.c b/arch/arm64/src/common/arm64_cpustart.c index 5aeb600944..ef8e7a90bb 100644 --- a/arch/arm64/src/common/arm64_cpustart.c +++ b/arch/arm64/src/common/arm64_cpustart.c @@ -210,7 +210,7 @@ int up_cpu_start(int cpu) #ifdef CONFIG_ARM64_SMP_BUSY_WAIT uint32_t *address = (uint32_t *)CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR; *address = 1; - up_flush_dcache((uintptr_t)address, sizeof(address)); + up_flush_dcache((uintptr_t)address, (uintptr_t)address + sizeof(address)); #endif arm64_start_cpu(cpu); diff --git a/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig b/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig index 2aa238cb90..dd53a940a3 100644 --- a/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig +++ b/boards/arm64/fvp-v8r/fvp-armv8r/configs/nsh_smp/defconfig @@ -14,6 +14,8 @@ CONFIG_ARCH_CHIP_FVP_ARMV8R=y CONFIG_ARCH_CHIP_FVP_R82=y CONFIG_ARCH_EARLY_PRINT=y CONFIG_ARCH_INTERRUPTSTACK=4096 +CONFIG_ARM64_SMP_BUSY_WAIT=y +CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR=0x60000 CONFIG_ARM64_STRING_FUNCTION=y CONFIG_BUILTIN=y CONFIG_DEBUG_ASSERTIONS=y diff --git a/boards/arm64/fvp-v8r/fvp-armv8r/scripts/dramboot.ld b/boards/arm64/fvp-v8r/fvp-armv8r/scripts/dramboot.ld index 5153f3fb55..f65db05a23 100644 --- a/boards/arm64/fvp-v8r/fvp-armv8r/scripts/dramboot.ld +++ b/boards/arm64/fvp-v8r/fvp-armv8r/scripts/dramboot.ld @@ -18,6 +18,8 @@ * ****************************************************************************/ +#include + OUTPUT_ARCH(aarch64) ENTRY(__start) @@ -93,6 +95,10 @@ SECTIONS } :text _edata = .; /* End+1 of .data */ +#if defined(CONFIG_SMP) && defined(CONFIG_ARM64_SMP_BUSY_WAIT) + . = CONFIG_ARM64_SMP_BUSY_WAIT_FLAG_ADDR + 4; +#endif + .bss : { /* BSS */ . = ALIGN(8); _sbss = .;