Skip to content

Commit 08c01b4

Browse files
author
Nicolas Pitre
committed
boards: arm: add SMP variant for Corstone-1000-A320 FVP
Add an SMP variant (fvp_corstone1000/a320/smp) that enables all 4 Cortex-A320 CPUs on the Corstone-1000-A320 FVP. Changes: - Add board variant 'smp' with DTS, defconfig, and yaml - Add PSCI node to dtsi (needed for PM_CPU_OPS_PSCI) - Enable ENABLE_MULTICORE in both TF-M and TF-A sysbuild args so TF-M boots all 4 host CPUs and TF-A provides PSCI CPU_ON - Add TF-A patch fixing secondary core hold pen cache coherency: BL2's dcsw_op_all during BL2-to-BL31 transition pushes stale cached data over WAIT values written by secondary CPUs from non-cached context Tested with tests/kernel/smp on FVP_Corstone-1000-A320: all 4 CPUs boot and all SMP test cases pass. Signed-off-by: Nicolas Pitre <npitre@baylibre.com>
1 parent bea19aa commit 08c01b4

File tree

9 files changed

+84
-2
lines changed

9 files changed

+84
-2
lines changed

‎boards/arm/fvp_corstone1000/Kconfig.fvp_corstone1000‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33

44
config BOARD_FVP_CORSTONE1000
55
select SOC_A320 if BOARD_FVP_CORSTONE1000_A320
6+
select SOC_A320 if BOARD_FVP_CORSTONE1000_A320_SMP

‎boards/arm/fvp_corstone1000/board.cmake‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@ if(CONFIG_BUILD_WITH_TFA)
106106
ENABLE_SVE_FOR_NS=1
107107
ENABLE_SVE_FOR_SWD=1
108108
ENABLE_STACK_PROTECTOR=strong
109+
# Multi-core PSCI support for secondary CPU boot
110+
ENABLE_MULTICORE=1
109111
)
110112

111113
# Output paths depend on debug/release

‎boards/arm/fvp_corstone1000/board.yml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ board:
44
vendor: arm
55
socs:
66
- name: a320
7+
variants:
8+
- name: smp

‎boards/arm/fvp_corstone1000/doc/index.rst‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ Supported Features
4242
Board Variants
4343
==============
4444

45-
The following board target is available:
45+
The following board targets are available:
4646

47-
* ``fvp_corstone1000/a320`` - ARMv9.2-A with Cortex-A320 CPU
47+
* ``fvp_corstone1000/a320`` - single-core ARMv9.2-A with Cortex-A320 CPU
48+
* ``fvp_corstone1000/a320/smp`` - quad-core SMP with all 4 Cortex-A320 CPUs
4849

4950
Memory Map
5051
==========

‎boards/arm/fvp_corstone1000/fvp_corstone1000.dtsi‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
#include <zephyr/dt-bindings/interrupt-controller/arm-gic.h>
1010

1111
/ {
12+
psci {
13+
compatible = "arm,psci-0.2";
14+
method = "smc";
15+
};
16+
1217
chosen {
1318
zephyr,sram = &dram0;
1419
zephyr,flash = &flash0;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*
2+
* Copyright (c) 2026 BayLibre SAS
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include "fvp_corstone1000_a320.dts"
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2026 BayLibre SAS
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: fvp_corstone1000/a320/smp
5+
name: Arm Corstone-1000-A320 Fixed Virtual Platform (SMP)
6+
arch: arm64
7+
type: sim
8+
simulation:
9+
- name: armfvp
10+
exec: FVP_Corstone-1000-A320
11+
toolchain:
12+
- zephyr
13+
- cross-compile
14+
ram: 128
15+
flash: 64
16+
vendor: arm
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Copyright (c) 2026 BayLibre SAS
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_XIP=n
5+
6+
# Enable Timer and Sys clock
7+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
8+
CONFIG_ARM_ARCH_TIMER=y
9+
10+
# Enable UART driver
11+
CONFIG_SERIAL=y
12+
13+
# Enable serial port
14+
CONFIG_UART_INTERRUPT_DRIVEN=y
15+
16+
# Enable console
17+
CONFIG_CONSOLE=y
18+
CONFIG_UART_CONSOLE=y
19+
20+
# Run in Non-Secure mode (EL1NS) - TF-A handles secure boot
21+
CONFIG_ARMV8_A_NS=y
22+
23+
# PSCI support for CPU power management
24+
CONFIG_PM_CPU_OPS=y
25+
26+
# 64-bit timeout for long-running operations
27+
CONFIG_TIMEOUT_64BIT=y
28+
29+
# Cache management
30+
CONFIG_CACHE_MANAGEMENT=y
31+
32+
# SMP support - 4 Cortex-A320 cores
33+
CONFIG_SMP=y
34+
CONFIG_MP_MAX_NUM_CPUS=4
35+
CONFIG_MAX_THREAD_BYTES=3
36+
37+
# TF-A warm boot does not set VMPIDR_EL2 for secondary CPUs.
38+
# Without this, EL1 reads of MPIDR_EL1 return 0 on secondary cores.
39+
CONFIG_ARM64_SET_VMPIDR_EL2=y

‎boards/arm/fvp_corstone1000/sysbuild.cmake‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ set(TFM_CMAKE_ARGS
196196
-DCORSTONE1000_DSU_120T=TRUE
197197
)
198198

199+
# Multi-core support: boot all 4 host CPUs (secondaries enter holding pen)
200+
if("${BOARD_QUALIFIERS}" MATCHES "/smp$")
201+
list(APPEND TFM_CMAKE_ARGS -DENABLE_MULTICORE=TRUE)
202+
endif()
203+
199204
# Add toolchain bin directory to CMAKE_PROGRAM_PATH so CMake can find the compiler
200205
if(ARM_GCC_M_TOOLCHAIN_DIR)
201206
list(APPEND TFM_CMAKE_ARGS "-DCMAKE_PROGRAM_PATH=${ARM_GCC_M_TOOLCHAIN_DIR}")
@@ -295,6 +300,11 @@ set(TFA_EXTRA_ARGS
295300
NR_OF_IMAGES_IN_FW_BANK=4
296301
)
297302

303+
# Multi-core PSCI support for secondary CPU boot
304+
if("${BOARD_QUALIFIERS}" MATCHES "/smp$")
305+
list(APPEND TFA_EXTRA_ARGS ENABLE_MULTICORE=1)
306+
endif()
307+
298308
# Find cross compiler for AArch64
299309
if(DEFINED ENV{CROSS_COMPILE})
300310
set(TFA_CROSS_COMPILE $ENV{CROSS_COMPILE})

0 commit comments

Comments
 (0)