Skip to content

Commit a61fcce

Browse files
author
Nicolas Pitre
committed
boards: arm: fvp: Add Cortex-A320 board variant support
Add Cortex-A320 support to the unified FVP board structure with ARMv9.2-A specific configuration parameters. Signed-off-by: Nicolas Pitre <[email protected]>
1 parent 231963f commit a61fcce

File tree

13 files changed

+207
-0
lines changed

13 files changed

+207
-0
lines changed

arch/arm64/core/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,16 @@ config CPU_CORTEX_A510
8989
power-efficient processing optimized for embedded applications with
9090
ARMv9-A features.
9191

92+
config CPU_CORTEX_A320
93+
bool
94+
select CPU_CORTEX_A
95+
select ARMV9_A
96+
help
97+
This option signifies the use of a Cortex-A320 CPU, which implements
98+
the ARMv9.2-A architecture. It provides advanced features including
99+
enhanced SVE2, improved security extensions, and specialized performance
100+
optimizations.
101+
92102
config CPU_CORTEX_R82
93103
bool
94104
select CPU_AARCH64_CORTEX_R

boards/arm/fvp_base_revc_2xaem/Kconfig.fvp_base_revc_2xaem

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ config BOARD_FVP_BASE_REVC_2XAEM_V9A_SMP
2626
bool
2727
default y if BOARD_QUALIFIERS = "v9a/smp" || BOARD_QUALIFIERS = "v9a/smp/ns"
2828
select BOARD_FVP_BASE_REVC_2XAEM_V9A
29+
30+
config BOARD_FVP_BASE_REVC_2XAEM_A320
31+
bool
32+
default y if BOARD_QUALIFIERS = "a320"
33+
select SOC_FVP_A320

boards/arm/fvp_base_revc_2xaem/board.cmake

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,87 @@ if(CONFIG_ARMV9_A)
5050
set(ARMFVP_MIN_VERSION 11.29.27)
5151
endif()
5252

53+
# Add Cortex-A320 specific configuration flags
54+
if(CONFIG_BOARD_FVP_BASE_REVC_2XAEM_A320)
55+
set(ARMFVP_FLAGS ${ARMFVP_FLAGS}
56+
# Cortex-A320 specific CPU identification
57+
-C cluster0.MIDR=0x410FD8F0
58+
-C cluster0.AMIIDR=0xD8F0043B
59+
-C cluster0.AMPIDR=0x4000BBD8F
60+
-C cluster0.ERRIIDR=0xD8F0043B
61+
-C cluster0.ERRPIDR=0x4000BBD8F
62+
-C cluster0.PMUPIDR=0x4000BBD80
63+
-C cluster0.CTIPIDR=0x4003BBD8F
64+
-C cluster0.DBGPIDR=0x4003BBD8F
65+
66+
# ARMv9.2-A support level
67+
-C cluster0.has_arm_v9-2=1
68+
69+
# Advanced SIMD and crypto support
70+
-C cluster0.advsimd_bf16_support_level=1
71+
-C cluster0.advsimd_i8mm_support_level=1
72+
-C cluster0.cpu0.crypto_sha3=1
73+
-C cluster0.cpu0.crypto_sha512=1
74+
-C cluster0.cpu0.crypto_sm3=1
75+
-C cluster0.cpu0.crypto_sm4=1
76+
-C cluster0.cpu0.enable_crc32=1
77+
78+
# Memory tagging support
79+
-C cluster0.memory_tagging_support_level=3
80+
81+
# Enhanced security features
82+
-C cluster0.has_qarma3_pac=1
83+
-C cluster0.has_const_pac=2
84+
85+
# SVE configuration for Cortex-A320
86+
-C cluster0.sve.veclen=2
87+
88+
# Performance monitoring
89+
-C cluster0.pmu-num_counters=6
90+
-C cluster0.configure_pmu_events_with_json='{"pmu_events":["SVE_INST_RETIRED","BR_INDNR_TAKEN_RETIRED","BR_IND_RETIRED","EXC_IRQ","EXC_FIQ","EXC_RETURN","EXC_TAKEN","L1D_CACHE_RD","L2D_CACHE_RD","BUS_ACCESS_RD","BUS_ACCESS_WR","MEM_ACCESS_RD","MEM_ACCESS_WR","BR_PRED_RETIRED","BR_IMMED_MIS_PRED_RETIRED","BR_IND_MIS_PRED_RETIRED","BR_RETURN_PRED_RETIRED","BR_RETURN_MIS_PRED_RETIRED","BR_INDNR_PRED_RETIRED","BR_INDNR_MIS_PRED_RETIRED","BR_IMMED_PRED_RETIRED"]}'
91+
92+
# Cache configuration
93+
-C cluster0.dcache-ways=4
94+
-C cluster0.icache-ways=4
95+
-C cluster0.l2cache-ways=8
96+
-C cluster0.icache-log2linelen=6
97+
-C cluster0.l2cache-read_bus_width_in_bytes=16
98+
-C cluster0.l2cache-write_bus_width_in_bytes=32
99+
100+
# Debug and trace configuration
101+
-C cluster0.has_ets=1
102+
-C cluster0.has_trbe=1
103+
-C cluster0.has_self_hosted_trace_extension=2
104+
105+
# Advanced architectural features
106+
-C cluster0.has_ccidx=1
107+
-C cluster0.has_16k_granule=1
108+
-C cluster0.ecv_support_level=2
109+
-C cluster0.has_cvadp_support=1
110+
-C cluster0.has_lrcpc=1
111+
-C cluster0.has_dot_product=2
112+
-C cluster0.has_wfet_and_wfit=2
113+
-C cluster0.has_xs=2
114+
-C cluster0.has_v8_5_debug_over_power_down=2
115+
-C cluster0.has_v8_7_fp_enhancements=2
116+
-C cluster0.has_amu=1
117+
-C cluster0.has_mpmm=1
118+
-C cluster0.has_mpam=2
119+
-C cluster0.has_ras=2
120+
121+
# Memory system configuration
122+
-C cluster0.stage12_tlb_size=1024
123+
-C cluster0.restriction_on_speculative_execution=2
124+
-C cluster0.restriction_on_speculative_execution_aarch32=2
125+
126+
# Error handling
127+
-C cluster0.number_of_error_records=3
128+
-C cluster0.ERXMISC0_mask=0xC003FFC3
129+
)
130+
# Set minimum FVP version for Cortex-A320 features
131+
set(ARMFVP_MIN_VERSION 11.29.27)
132+
endif()
133+
53134
if(CONFIG_BUILD_WITH_TFA)
54135
set(TFA_PLAT "fvp")
55136

boards/arm/fvp_base_revc_2xaem/board.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ board:
1313
- name: smp
1414
variants:
1515
- name: ns
16+
- name: a320

boards/arm/fvp_base_revc_2xaem/doc/index.rst

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ This board configuration supports multiple architecture variants:
4949
* ``fvp_base_revc_2xaem/v9a`` - ARMv9-A (64-bit) with Cortex-A510 cores
5050
* ``fvp_base_revc_2xaem/v9a/smp`` - ARMv9-A SMP (4 cores)
5151
* ``fvp_base_revc_2xaem/v9a/smp/ns`` - ARMv9-A SMP Non-Secure
52+
* ``fvp_base_revc_2xaem/a320`` - ARMv9.2-A with Cortex-A320 configuration
53+
54+
**Cortex-A320 Configuration:**
55+
56+
The ``a320`` variant provides Cortex-A320 specific FVP configuration with:
57+
58+
* ARMv9.2-A architecture compliance
59+
* Enhanced cryptographic extensions (SHA3, SHA512, SM3, SM4)
60+
* Advanced memory tagging (MTE Level 3)
61+
* QARMA3 Pointer Authentication
62+
* Optimized cache configuration for Cortex-A320
63+
* Performance monitoring unit with SVE-specific events
5264

5365
Devices
5466
========
@@ -103,6 +115,14 @@ For ARMv9-A variants:
103115
:board: fvp_base_revc_2xaem/v9a
104116
:goals: build
105117

118+
For Cortex-A320 specific configuration:
119+
120+
.. zephyr-app-commands::
121+
:zephyr-app: samples/hello_world
122+
:host-os: unix
123+
:board: fvp_base_revc_2xaem/a320
124+
:goals: build
125+
106126
For SMP variants:
107127

108128
.. zephyr-app-commands::
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) 2025 BayLibre SAS
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
/dts-v1/;
7+
8+
#include <arm64/armv9-a.dtsi>
9+
#include "fvp_base_revc_2xaem.dtsi"
10+
11+
/ {
12+
model = "FVP Base RevC 2xAEMv9A (Cortex-A320)";
13+
};
14+
15+
&cpu0 {
16+
compatible = "arm,cortex-a320";
17+
};
18+
19+
&cpu1 {
20+
compatible = "arm,cortex-a320";
21+
};
22+
23+
&cpu2 {
24+
compatible = "arm,cortex-a320";
25+
};
26+
27+
&cpu3 {
28+
compatible = "arm,cortex-a320";
29+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2025 BayLibre SAS
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
identifier: fvp_base_revc_2xaem/a320
5+
name: FVP Emulation FVP_Base_RevC-2xAEMv9A (Cortex-A320)
6+
arch: arm64
7+
type: sim
8+
simulation:
9+
- name: armfvp
10+
exec: FVP_Base_RevC-2xAEMvA
11+
toolchain:
12+
- zephyr
13+
- cross-compile
14+
ram: 2048
15+
flash: 64
16+
vendor: arm
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2025 BayLibre SAS
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
CONFIG_XIP=n
5+
6+
CONFIG_THREAD_STACK_INFO=y
7+
8+
# Enable Timer and Sys clock
9+
CONFIG_SYS_CLOCK_TICKS_PER_SEC=1000
10+
CONFIG_ARM_ARCH_TIMER=y
11+
12+
# Enable UART driver
13+
CONFIG_SERIAL=y
14+
15+
# Enable serial port
16+
CONFIG_UART_INTERRUPT_DRIVEN=y
17+
18+
# Enable console
19+
CONFIG_CONSOLE=y
20+
CONFIG_UART_CONSOLE=y

cmake/gcc-m-cpu.cmake

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ elseif("${ARCH}" STREQUAL "arm64")
117117
set(GCC_M_CPU cortex-a78)
118118
elseif(CONFIG_CPU_CORTEX_A510)
119119
set(GCC_M_CPU cortex-a510)
120+
elseif(CONFIG_CPU_CORTEX_A320)
121+
# Cortex-A320 was announced in February 2025 and is not yet supported in any GCC version
122+
# Use cortex-a710 as fallback since both are high-performance ARMv9-A cores with similar features
123+
# TODO: Update to use cortex-a320 when GCC support is added (likely in GCC 15 or 16)
124+
set(GCC_M_CPU cortex-a710)
125+
message(STATUS "Using cortex-a710 as fallback for cortex-a320 (not yet supported in GCC)")
120126
elseif(CONFIG_CPU_CORTEX_R82)
121127
set(GCC_M_CPU cortex-r82)
122128
endif()
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Copyright (c) 2025 BayLibre SAS
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: ARM Cortex-A320 CPU
5+
6+
compatible: "arm,cortex-a320"
7+
8+
include: cpu.yaml

0 commit comments

Comments
 (0)