blob: bb4e224ac67470d69a7d820ff6ce0a6b722bd4ab [file] [log] [blame]
Jayanth Dodderi Chidanand9461a892022-01-17 18:57:17 +00001#
Govindraj Raja24d3a4e2023-12-21 13:57:49 -06002# Copyright (c) 2022-2024, Arm Limited. All rights reserved.
Jayanth Dodderi Chidanand9461a892022-01-17 18:57:17 +00003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Govindraj Raja0386e312023-08-17 10:41:48 -05007# This file lists all of the architectural features, and initializes
8# and enables them based on the configured architecture version.
9
10# This file follows the following format:
Govindraj Raja16b11372023-10-09 13:56:06 -050011# - Enable mandatory feature if applicable to an Arch Version.
12# - By default disable any mandatory features if they have not been defined yet.
Govindraj Raja0386e312023-08-17 10:41:48 -050013# - Disable or enable any optional feature this would be enabled/disabled if needed by platform.
14
15#
16################################################################################
Govindraj Raja16b11372023-10-09 13:56:06 -050017# Enable Mandatory features based on Arch versions.
18################################################################################
19#
20
21# Enable the features which are mandatory from ARCH version 8.1 and upwards.
22ifeq "8.1" "$(word 1, $(sort 8.1 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
23ENABLE_FEAT_PAN := 1
24ENABLE_FEAT_VHE := 1
25endif
26
27# Enable the features which are mandatory from ARCH version 8.2 and upwards.
28ifeq "8.2" "$(word 1, $(sort 8.2 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
29ENABLE_FEAT_RAS := 1
30endif
31
32# Enable the features which are mandatory from ARCH version 8.4 and upwards.
33ifeq "8.4" "$(word 1, $(sort 8.4 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
34ENABLE_FEAT_SEL2 := 1
35ENABLE_TRF_FOR_NS := 1
36ENABLE_FEAT_DIT := 1
37endif
38
39# Enable the features which are mandatory from ARCH version 8.5 and upwards.
40ifeq "8.5" "$(word 1, $(sort 8.5 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
41ENABLE_FEAT_RNG := 1
42ENABLE_FEAT_SB := 1
43
44# Enable Memory tagging, Branch Target Identification for aarch64 only.
45ifeq ($(ARCH), aarch64)
46 mem_tag_arch_support := yes
47endif #(ARCH=aarch64)
48
49endif
50
51# Enable the features which are mandatory from ARCH version 8.6 and upwards.
52ifeq "8.6" "$(word 1, $(sort 8.6 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
53ENABLE_FEAT_ECV := 1
54ENABLE_FEAT_FGT := 1
55endif
56
57# Enable the features which are mandatory from ARCH version 8.7 and upwards.
58ifeq "8.7" "$(word 1, $(sort 8.7 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
59ENABLE_FEAT_HCX := 1
60endif
61
62# Enable the features which are mandatory from ARCH version 8.9 and upwards.
63ifeq "8.9" "$(word 1, $(sort 8.9 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
64ENABLE_FEAT_TCR2 := 1
65endif
66
67#
68################################################################################
Govindraj Raja0386e312023-08-17 10:41:48 -050069# Set mandatory features by default to zero.
70################################################################################
71#
72
73#----
74# 8.1
75#----
76
77# Flag to enable access to Privileged Access Never bit of PSTATE.
Govindraj Raja16b11372023-10-09 13:56:06 -050078ENABLE_FEAT_PAN ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -050079
80# Flag to enable Virtualization Host Extensions.
Govindraj Raja16b11372023-10-09 13:56:06 -050081ENABLE_FEAT_VHE ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -050082
83#----
84# 8.2
85#----
86
87# Enable RAS Support.
Govindraj Raja16b11372023-10-09 13:56:06 -050088ENABLE_FEAT_RAS ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -050089
90#----
Govindraj Raja16b11372023-10-09 13:56:06 -050091# 8.3
92#----
93
94# Flag to enable Pointer Authentication. Internal flag not meant for
95# direct setting. Use BRANCH_PROTECTION to enable PAUTH.
96ENABLE_PAUTH ?= 0
97
98# Include pointer authentication (ARMv8.3-PAuth) registers in cpu context. This
99# must be set to 1 if the platform wants to use this feature in the Secure
100# world. It is not necessary for use in the Non-secure world.
101CTX_INCLUDE_PAUTH_REGS ?= 0
102
103
104#----
Govindraj Raja0386e312023-08-17 10:41:48 -0500105# 8.4
106#----
107
108# Flag to enable Secure EL-2 feature.
Govindraj Raja16b11372023-10-09 13:56:06 -0500109ENABLE_FEAT_SEL2 ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500110
Govindraj Raja0386e312023-08-17 10:41:48 -0500111# By default, disable trace filter control register access to lower non-secure
112# exception levels, i.e. NS-EL2, or NS-EL1 if NS-EL2 is implemented, but
113# trace filter control register access is unused if FEAT_TRF is implemented.
Govindraj Raja16b11372023-10-09 13:56:06 -0500114ENABLE_TRF_FOR_NS ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500115
116# Flag to enable Data Independent Timing instructions.
Govindraj Raja16b11372023-10-09 13:56:06 -0500117ENABLE_FEAT_DIT ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500118
119#----
120# 8.5
121#----
122
Govindraj Raja16b11372023-10-09 13:56:06 -0500123# Flag to enable Branch Target Identification.
124# Internal flag not meant for direct setting.
125# Use BRANCH_PROTECTION to enable BTI.
126ENABLE_BTI ?= 0
127
Govindraj Raja0386e312023-08-17 10:41:48 -0500128# Flag to enable access to the Random Number Generator registers.
Govindraj Raja16b11372023-10-09 13:56:06 -0500129ENABLE_FEAT_RNG ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500130
131# Flag to enable Speculation Barrier Instruction.
Govindraj Raja16b11372023-10-09 13:56:06 -0500132ENABLE_FEAT_SB ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500133
Govindraj Raja0386e312023-08-17 10:41:48 -0500134#----
135# 8.6
136#----
137
138# Flag to enable access to the CNTPOFF_EL2 register.
Govindraj Raja16b11372023-10-09 13:56:06 -0500139ENABLE_FEAT_ECV ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500140
141# Flag to enable access to the HDFGRTR_EL2 register.
Govindraj Raja16b11372023-10-09 13:56:06 -0500142ENABLE_FEAT_FGT ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500143
144#----
145# 8.7
146#----
147
148# Flag to enable access to the HCRX_EL2 register by setting SCR_EL3.HXEn.
Govindraj Raja16b11372023-10-09 13:56:06 -0500149ENABLE_FEAT_HCX ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500150
151#----
152# 8.9
153#----
154
155# Flag to enable access to TCR2 (FEAT_TCR2).
Govindraj Raja16b11372023-10-09 13:56:06 -0500156ENABLE_FEAT_TCR2 ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500157
158#
159################################################################################
Govindraj Raja0386e312023-08-17 10:41:48 -0500160# Optional Features defaulted to 0 or 2, if they are not enabled from
161# build option. Can also be disabled or enabled by platform if needed.
162################################################################################
163#
164
165#----
166# 8.0
167#----
168
169# Flag to enable CSV2_2 extension.
170ENABLE_FEAT_CSV2_2 ?= 0
171
Sona Mathew3b84c962023-10-25 16:48:19 -0500172# Flag to enable CSV2_3 extension. FEAT_CSV2_3 enables access to the
173# SCXTNUM_ELx register.
174ENABLE_FEAT_CSV2_3 ?= 0
175
Govindraj Raja0386e312023-08-17 10:41:48 -0500176# By default, disable access of trace system registers from NS lower
177# ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused if
178# system register trace is implemented. This feature is available if
179# trace unit such as ETMv4.x, This feature is OPTIONAL and is only
180# permitted in Armv8 implementations.
181ENABLE_SYS_REG_TRACE_FOR_NS ?= 0
182
183#----
184# 8.2
185#----
186
187# Build option to enable/disable the Statistical Profiling Extension,
188# keep it enabled by default for AArch64.
189ifeq (${ARCH},aarch64)
Govindraj Raja28b525c2023-09-20 15:31:45 -0500190 ENABLE_SPE_FOR_NS ?= 2
Govindraj Raja0386e312023-08-17 10:41:48 -0500191else ifeq (${ARCH},aarch32)
Govindraj Raja399541a2023-10-17 08:13:03 -0500192 ifneq ($(or $(ENABLE_SPE_FOR_NS),0),0)
Govindraj Raja28b525c2023-09-20 15:31:45 -0500193 $(error ENABLE_SPE_FOR_NS is not supported for AArch32)
194 else
195 ENABLE_SPE_FOR_NS := 0
196 endif
Govindraj Raja0386e312023-08-17 10:41:48 -0500197endif
198
199# Enable SVE for non-secure world by default.
200ifeq (${ARCH},aarch64)
Govindraj Raja28b525c2023-09-20 15:31:45 -0500201 ENABLE_SVE_FOR_NS ?= 2
Govindraj Raja0386e312023-08-17 10:41:48 -0500202# SVE is only supported on AArch64 so disable it on AArch32.
203else ifeq (${ARCH},aarch32)
Govindraj Raja399541a2023-10-17 08:13:03 -0500204 ifneq ($(or $(ENABLE_SVE_FOR_NS),0),0)
Govindraj Raja28b525c2023-09-20 15:31:45 -0500205 $(error ENABLE_SVE_FOR_NS is not supported for AArch32)
206 else
207 ENABLE_SVE_FOR_NS := 0
208 endif
Govindraj Raja0386e312023-08-17 10:41:48 -0500209endif
210
211#----
212# 8.4
213#----
214
215# Feature flags for supporting Activity monitor extensions.
216ENABLE_FEAT_AMU ?= 0
217ENABLE_AMU_AUXILIARY_COUNTERS ?= 0
218ENABLE_AMU_FCONF ?= 0
219AMU_RESTRICT_COUNTERS ?= 0
220
221# Build option to enable MPAM for lower ELs.
Arvind Ram Prakashab28d4b2023-10-11 12:10:56 -0500222# Enabling it by default
223ifeq (${ARCH},aarch64)
Harrison Mutaibb75e4f2023-10-31 10:15:41 +0000224 ENABLE_FEAT_MPAM ?= 2
Arvind Ram Prakashab28d4b2023-10-11 12:10:56 -0500225else ifeq (${ARCH},aarch32)
Harrison Mutaibb75e4f2023-10-31 10:15:41 +0000226 ifneq ($(or $(ENABLE_FEAT_MPAM),0),0)
227 $(error ENABLE_FEAT_MPAM is not supported for AArch32)
228 else
229 ENABLE_FEAT_MPAM := 0
230 endif
Arvind Ram Prakashab28d4b2023-10-11 12:10:56 -0500231endif
Govindraj Raja0386e312023-08-17 10:41:48 -0500232
Govindraj Raja3748d902023-09-19 08:43:16 -0500233# Include nested virtualization control (Armv8.4-NV) registers in cpu context.
234# This must be set to 1 if architecture implements Nested Virtualization
235# Extension and platform wants to use this feature in the Secure world.
236CTX_INCLUDE_NEVE_REGS ?= 0
237
Govindraj Raja0386e312023-08-17 10:41:48 -0500238#----
239# 8.5
240#----
241
242# Flag to enable support for EL3 trapping of reads of the RNDR and RNDRRS
243# registers, by setting SCR_EL3.TRNDR.
244ENABLE_FEAT_RNG_TRAP ?= 0
245
Govindraj Raja24d3a4e2023-12-21 13:57:49 -0600246# Enable Memory Tagging Extension. This must be set to 1 if the platform wants
247# to use this feature in the Secure world and MTE is enabled at ELX.
248ifeq ($(CTX_INCLUDE_MTE_REGS),1)
249 $(warning CTX_INCLUDE_MTE_REGS option is deprecated use ENABLE_FEAT_MTE, Enabling ENABLE_FEAT_MTE)
250 ENABLE_FEAT_MTE ?= 1
251endif
252ifeq (${ARCH},aarch32)
253 ifneq ($(or $(ENABLE_FEAT_MTE),0),0)
254 $(error ENABLE_FEAT_MTE is not supported for AArch32)
255 endif
256endif
257ENABLE_FEAT_MTE ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500258
259#----
260# 8.6
261#----
262
263# Flag to enable AMUv1p1 extension.
264ENABLE_FEAT_AMUv1p1 ?= 0
265
266# Flag to enable delayed trapping of WFE instruction (FEAT_TWED).
267ENABLE_FEAT_TWED ?= 0
268
269# In v8.6+ platforms with delayed trapping of WFE being supported
270# via FEAT_TWED, this flag takes the delay value to be set in the
271# SCR_EL3.TWEDEL(4bit) field, when FEAT_TWED is implemented.
272# By default it takes 0, and need to be updated by the platforms.
273TWED_DELAY ?= 0
274
275# Disable MTPMU if FEAT_MTPMU is supported.
276DISABLE_MTPMU ?= 0
277
278#----
279# 8.9
280#----
281
282# Flag to enable NoTagAccess memory region attribute for stage 2 of translation.
283ENABLE_FEAT_MTE_PERM ?= 0
284
285# Flag to enable access to Stage 2 Permission Indirection (FEAT_S2PIE).
286ENABLE_FEAT_S2PIE ?= 0
287
288# Flag to enable access to Stage 1 Permission Indirection (FEAT_S1PIE).
289ENABLE_FEAT_S1PIE ?= 0
290
291# Flag to enable access to Stage 2 Permission Overlay (FEAT_S2POE).
292ENABLE_FEAT_S2POE ?= 0
293
294# Flag to enable access to Stage 1 Permission Overlay (FEAT_S1POE).
295ENABLE_FEAT_S1POE ?= 0
296
297#----
298# 9.0
299#----
300
301# Flag to enable Realm Management Extension (FEAT_RME).
302ENABLE_RME ?= 0
303
304# Scalable Matrix Extension for non-secure world.
305ENABLE_SME_FOR_NS ?= 0
306
307# Scalable Vector Extension for secure world.
308ENABLE_SVE_FOR_SWD ?= 0
309
310# By default, disable access of trace buffer control registers from NS
311# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
312# if FEAT_TRBE is implemented.
313# Note FEAT_TRBE is only supported on AArch64 - therefore do not enable in
314# AArch32.
315ifeq (${ARCH},aarch64)
Govindraj Raja28b525c2023-09-20 15:31:45 -0500316 ENABLE_TRBE_FOR_NS ?= 0
Govindraj Raja0386e312023-08-17 10:41:48 -0500317else ifeq (${ARCH},aarch32)
Govindraj Raja399541a2023-10-17 08:13:03 -0500318 ifneq ($(or $(ENABLE_TRBE_FOR_NS),0),0)
319 $(error ENABLE_TRBE_FOR_NS is not supported for AArch32)
Govindraj Raja28b525c2023-09-20 15:31:45 -0500320 else
Govindraj Raja399541a2023-10-17 08:13:03 -0500321 ENABLE_TRBE_FOR_NS := 0
Govindraj Raja28b525c2023-09-20 15:31:45 -0500322 endif
Govindraj Raja0386e312023-08-17 10:41:48 -0500323endif
324
325#----
326# 9.2
327#----
328
329# Scalable Matrix Extension version 2 for non-secure world.
330ENABLE_SME2_FOR_NS ?= 0
331
332# Scalable Matrix Extension for secure world.
333ENABLE_SME_FOR_SWD ?= 0
334
335# By default, disable access to branch record buffer control registers from NS
336# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
337# if FEAT_BRBE is implemented.
338ENABLE_BRBE_FOR_NS ?= 0
339
340#----
341#9.4
342#----
343
344# Flag to enable access to Guarded Control Stack (FEAT_GCS).
345ENABLE_FEAT_GCS ?= 0