blob: a6fd6bef6e6250525ab5b1e07b7622f292b926aa [file] [log] [blame]
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +00001#
John Powell025b1b82025-03-10 20:09:03 -05002# Copyright (c) 2022-2025, Arm Limited. All rights reserved.
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +00003#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
Govindraj Rajaf5211422023-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 Raja3dafd962024-01-24 11:42:40 -060011# - Enable mandatory feature if not updated, as applicable to an Arch Version.
Govindraj Rajafb730112023-10-09 13:56:06 -050012# - By default disable any mandatory features if they have not been defined yet.
Govindraj Rajaf5211422023-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 Raja3dafd962024-01-24 11:42:40 -060017# Enable Mandatory features if not updated yet, based on Arch versions.
Govindraj Rajaf5211422023-08-17 10:41:48 -050018################################################################################
19#
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000020
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)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060023armv8-1-a-feats := ENABLE_FEAT_PAN ENABLE_FEAT_VHE
24
25FEAT_LIST := ${armv8-1-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000026endif
27
Manish Pandey9202d512023-02-13 12:39:17 +000028# Enable the features which are mandatory from ARCH version 8.2 and upwards.
29ifeq "8.2" "$(word 1, $(sort 8.2 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060030armv8-2-a-feats := ENABLE_FEAT_RAS
31# 8.1 Compliant
32armv8-2-a-feats += ${armv8-1-a-feats}
33
34FEAT_LIST := ${armv8-2-a-feats}
35endif
36
37# Enable the features which are mandatory from ARCH version 8.3 and upwards.
38ifeq "8.3" "$(word 1, $(sort 8.3 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
39# 8.2 Compliant
40armv8-3-a-feats += ${armv8-2-a-feats}
41
42FEAT_LIST := ${armv8-3-a-feats}
Manish Pandey9202d512023-02-13 12:39:17 +000043endif
44
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000045# Enable the features which are mandatory from ARCH version 8.4 and upwards.
46ifeq "8.4" "$(word 1, $(sort 8.4 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060047armv8-4-a-feats := ENABLE_FEAT_SEL2 ENABLE_TRF_FOR_NS ENABLE_FEAT_DIT
48# 8.3 Compliant
49armv8-4-a-feats += ${armv8-3-a-feats}
50
51FEAT_LIST := ${armv8-4-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000052endif
53
54# Enable the features which are mandatory from ARCH version 8.5 and upwards.
55ifeq "8.5" "$(word 1, $(sort 8.5 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060056armv8-5-a-feats := ENABLE_FEAT_RNG ENABLE_FEAT_SB
57# 8.4 Compliant
58armv8-5-a-feats += ${armv8-4-a-feats}
Govindraj Rajaf5211422023-08-17 10:41:48 -050059
Govindraj Raja2a71f162024-01-23 14:20:52 -060060FEAT_LIST := ${armv8-5-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000061endif
62
63# Enable the features which are mandatory from ARCH version 8.6 and upwards.
64ifeq "8.6" "$(word 1, $(sort 8.6 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060065armv8-6-a-feats := ENABLE_FEAT_ECV ENABLE_FEAT_FGT
66# 8.5 Compliant
67armv8-6-a-feats += ${armv8-5-a-feats}
68FEAT_LIST := ${armv8-6-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000069endif
70
71# Enable the features which are mandatory from ARCH version 8.7 and upwards.
72ifeq "8.7" "$(word 1, $(sort 8.7 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060073armv8-7-a-feats := ENABLE_FEAT_HCX
74# 8.6 Compliant
75armv8-7-a-feats += ${armv8-6-a-feats}
76FEAT_LIST := ${armv8-7-a-feats}
77endif
78
79# Enable the features which are mandatory from ARCH version 8.8 and upwards.
80ifeq "8.8" "$(word 1, $(sort 8.8 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Arvind Ram Prakash6b8df7b2025-01-09 17:18:30 -060081armv8-8-a-feats := ENABLE_FEAT_MOPS
Govindraj Raja2a71f162024-01-23 14:20:52 -060082# 8.7 Compliant
Manish V Badarkhe94ff1d92024-11-08 09:41:51 +000083armv8-8-a-feats += ${armv8-7-a-feats}
Govindraj Raja2a71f162024-01-23 14:20:52 -060084FEAT_LIST := ${armv8-8-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000085endif
Govindraj Rajaf5211422023-08-17 10:41:48 -050086
87# Enable the features which are mandatory from ARCH version 8.9 and upwards.
88ifeq "8.9" "$(word 1, $(sort 8.9 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Jayanth Dodderi Chidanand4ec4e542024-09-06 13:49:31 +010089armv8-9-a-feats := ENABLE_FEAT_TCR2 ENABLE_FEAT_DEBUGV8P9 ENABLE_FEAT_SCTLR2
Govindraj Raja2a71f162024-01-23 14:20:52 -060090# 8.8 Compliant
91armv8-9-a-feats += ${armv8-8-a-feats}
92FEAT_LIST := ${armv8-9-a-feats}
Govindraj Rajaf5211422023-08-17 10:41:48 -050093endif
94
Govindraj Raja2a71f162024-01-23 14:20:52 -060095# Enable the features which are mandatory from ARCH version 9.0 and upwards.
96ifeq "9.0" "$(word 1, $(sort 9.0 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
97# 8.5 Compliant
98armv9-0-a-feats += ${armv8-5-a-feats}
99FEAT_LIST := ${armv9-0-a-feats}
100endif
101
102# Enable the features which are mandatory from ARCH version 9.1 and upwards.
103ifeq "9.1" "$(word 1, $(sort 9.1 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
104# 8.6 and 9.0 Compliant
105armv9-1-a-feats += ${armv8-6-a-feats} ${armv9-0-a-feats}
106FEAT_LIST := ${armv9-1-a-feats}
107endif
108
109# Enable the features which are mandatory from ARCH version 9.2 and upwards.
110ifeq "9.2" "$(word 1, $(sort 9.2 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
111# 8.7 and 9.1 Compliant
112armv9-2-a-feats += ${armv8-7-a-feats} ${armv9-1-a-feats}
113FEAT_LIST := ${armv9-2-a-feats}
114endif
115
116# Enable the features which are mandatory from ARCH version 9.3 and upwards.
117ifeq "9.3" "$(word 1, $(sort 9.3 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
118# 8.8 and 9.2 Compliant
119armv9-3-a-feats += ${armv8-8-a-feats} ${armv9-2-a-feats}
120FEAT_LIST := ${armv9-3-a-feats}
121endif
122
123# Set all FEAT_* in FEAT_LIST to '1' if they are not yet defined or set
124# from build commandline options or platform makefile.
125$(eval $(call default_ones, ${sort ${FEAT_LIST}}))
126
Govindraj Rajaf5211422023-08-17 10:41:48 -0500127#
128################################################################################
Govindraj Raja3dafd962024-01-24 11:42:40 -0600129# Set mandatory features by default to zero, if they are not already updated.
Govindraj Rajafb730112023-10-09 13:56:06 -0500130################################################################################
131#
132
133#----
134# 8.1
135#----
136
137# Flag to enable access to Privileged Access Never bit of PSTATE.
138ENABLE_FEAT_PAN ?= 0
139
140# Flag to enable Virtualization Host Extensions.
141ENABLE_FEAT_VHE ?= 0
142
143#----
144# 8.2
145#----
146
147# Enable RAS Support.
148ENABLE_FEAT_RAS ?= 0
149
150#----
151# 8.3
152#----
153
154# Flag to enable Pointer Authentication. Internal flag not meant for
155# direct setting. Use BRANCH_PROTECTION to enable PAUTH.
156ENABLE_PAUTH ?= 0
157
John Powell025b1b82025-03-10 20:09:03 -0500158# FEAT_PAUTH_LR is an optional architectural feature, so this flag must be set
159# manually in addition to the BRANCH_PROTECTION flag which is used for other
160# branch protection and pointer authentication features.
161ENABLE_FEAT_PAUTH_LR ?= 0
162
Govindraj Rajafb730112023-10-09 13:56:06 -0500163# Include pointer authentication (ARMv8.3-PAuth) registers in cpu context. This
164# must be set to 1 if the platform wants to use this feature in the Secure
165# world. It is not necessary for use in the Non-secure world.
166CTX_INCLUDE_PAUTH_REGS ?= 0
167
168
169#----
170# 8.4
171#----
172
173# Flag to enable Secure EL-2 feature.
174ENABLE_FEAT_SEL2 ?= 0
175
176# By default, disable trace filter control register access to lower non-secure
177# exception levels, i.e. NS-EL2, or NS-EL1 if NS-EL2 is implemented, but
178# trace filter control register access is unused if FEAT_TRF is implemented.
179ENABLE_TRF_FOR_NS ?= 0
180
181# Flag to enable Data Independent Timing instructions.
182ENABLE_FEAT_DIT ?= 0
183
184#----
185# 8.5
186#----
187
188# Flag to enable Branch Target Identification.
189# Internal flag not meant for direct setting.
190# Use BRANCH_PROTECTION to enable BTI.
191ENABLE_BTI ?= 0
192
193# Flag to enable access to the Random Number Generator registers.
194ENABLE_FEAT_RNG ?= 0
195
196# Flag to enable Speculation Barrier Instruction.
197ENABLE_FEAT_SB ?= 0
198
199#----
200# 8.6
201#----
202
203# Flag to enable access to the CNTPOFF_EL2 register.
204ENABLE_FEAT_ECV ?= 0
205
206# Flag to enable access to the HDFGRTR_EL2 register.
207ENABLE_FEAT_FGT ?= 0
208
209#----
210# 8.7
211#----
212
213# Flag to enable access to the HCRX_EL2 register by setting SCR_EL3.HXEn.
214ENABLE_FEAT_HCX ?= 0
215
216#----
Arvind Ram Prakash6b8df7b2025-01-09 17:18:30 -0600217# 8.8
218#----
219
220# Flag to enable FEAT_MOPS (Standardization of Memory operations)
221# when INIT_UNUSED_NS_EL2 = 1
222ENABLE_FEAT_MOPS ?= 0
223
224#----
Govindraj Rajafb730112023-10-09 13:56:06 -0500225# 8.9
226#----
227
228# Flag to enable access to TCR2 (FEAT_TCR2).
229ENABLE_FEAT_TCR2 ?= 0
230
Jayanth Dodderi Chidanand4ec4e542024-09-06 13:49:31 +0100231# Flag to enable access to SCTLR2 (FEAT_SCTLR2).
232ENABLE_FEAT_SCTLR2 ?= 0
233
Govindraj Rajafb730112023-10-09 13:56:06 -0500234#
235################################################################################
Govindraj Rajaf5211422023-08-17 10:41:48 -0500236# Optional Features defaulted to 0 or 2, if they are not enabled from
237# build option. Can also be disabled or enabled by platform if needed.
238################################################################################
239#
240
241#----
242# 8.0
243#----
244
245# Flag to enable CSV2_2 extension.
246ENABLE_FEAT_CSV2_2 ?= 0
247
Sona Mathew30019d82023-10-25 16:48:19 -0500248# Flag to enable CSV2_3 extension. FEAT_CSV2_3 enables access to the
249# SCXTNUM_ELx register.
250ENABLE_FEAT_CSV2_3 ?= 0
251
Govindraj Rajaf5211422023-08-17 10:41:48 -0500252# By default, disable access of trace system registers from NS lower
253# ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused if
254# system register trace is implemented. This feature is available if
255# trace unit such as ETMv4.x, This feature is OPTIONAL and is only
256# permitted in Armv8 implementations.
257ENABLE_SYS_REG_TRACE_FOR_NS ?= 0
258
259#----
260# 8.2
261#----
262
263# Build option to enable/disable the Statistical Profiling Extension,
264# keep it enabled by default for AArch64.
265ifeq (${ARCH},aarch64)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500266 ENABLE_SPE_FOR_NS ?= 2
Govindraj Rajaf5211422023-08-17 10:41:48 -0500267else ifeq (${ARCH},aarch32)
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500268 ifneq ($(or $(ENABLE_SPE_FOR_NS),0),0)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500269 $(error ENABLE_SPE_FOR_NS is not supported for AArch32)
270 else
271 ENABLE_SPE_FOR_NS := 0
272 endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500273endif
274
275# Enable SVE for non-secure world by default.
276ifeq (${ARCH},aarch64)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500277 ENABLE_SVE_FOR_NS ?= 2
Govindraj Rajaf5211422023-08-17 10:41:48 -0500278# SVE is only supported on AArch64 so disable it on AArch32.
279else ifeq (${ARCH},aarch32)
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500280 ifneq ($(or $(ENABLE_SVE_FOR_NS),0),0)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500281 $(error ENABLE_SVE_FOR_NS is not supported for AArch32)
282 else
283 ENABLE_SVE_FOR_NS := 0
284 endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500285endif
286
287#----
288# 8.4
289#----
290
291# Feature flags for supporting Activity monitor extensions.
292ENABLE_FEAT_AMU ?= 0
293ENABLE_AMU_AUXILIARY_COUNTERS ?= 0
Juan Pablo Conde14c27f82024-04-03 13:18:40 -0500294AMU_RESTRICT_COUNTERS ?= 1
Govindraj Rajaf5211422023-08-17 10:41:48 -0500295
296# Build option to enable MPAM for lower ELs.
Arvind Ram Prakashedebefb2023-10-11 12:10:56 -0500297# Enabling it by default
298ifeq (${ARCH},aarch64)
Harrison Mutai72f027c2023-10-31 10:15:41 +0000299 ENABLE_FEAT_MPAM ?= 2
Arvind Ram Prakashedebefb2023-10-11 12:10:56 -0500300else ifeq (${ARCH},aarch32)
Harrison Mutai72f027c2023-10-31 10:15:41 +0000301 ifneq ($(or $(ENABLE_FEAT_MPAM),0),0)
302 $(error ENABLE_FEAT_MPAM is not supported for AArch32)
303 else
304 ENABLE_FEAT_MPAM := 0
305 endif
Arvind Ram Prakashedebefb2023-10-11 12:10:56 -0500306endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500307
Govindraj Raja8b2048c2023-09-19 08:43:16 -0500308# Include nested virtualization control (Armv8.4-NV) registers in cpu context.
309# This must be set to 1 if architecture implements Nested Virtualization
310# Extension and platform wants to use this feature in the Secure world.
311CTX_INCLUDE_NEVE_REGS ?= 0
312
Govindraj Rajaf5211422023-08-17 10:41:48 -0500313#----
314# 8.5
315#----
316
317# Flag to enable support for EL3 trapping of reads of the RNDR and RNDRRS
318# registers, by setting SCR_EL3.TRNDR.
319ENABLE_FEAT_RNG_TRAP ?= 0
320
Govindraj Rajac2823842024-03-07 14:42:20 -0600321# Enable FEAT_MTE2. This must be set to 1 if the platform wants
322# to use this feature and is enabled at ELX.
Govindraj Raja8e397882024-01-26 10:08:37 -0600323ENABLE_FEAT_MTE2 ?= 0
324
Govindraj Rajaf5211422023-08-17 10:41:48 -0500325#----
326# 8.6
327#----
328
329# Flag to enable AMUv1p1 extension.
330ENABLE_FEAT_AMUv1p1 ?= 0
331
332# Flag to enable delayed trapping of WFE instruction (FEAT_TWED).
333ENABLE_FEAT_TWED ?= 0
334
335# In v8.6+ platforms with delayed trapping of WFE being supported
336# via FEAT_TWED, this flag takes the delay value to be set in the
337# SCR_EL3.TWEDEL(4bit) field, when FEAT_TWED is implemented.
338# By default it takes 0, and need to be updated by the platforms.
339TWED_DELAY ?= 0
340
341# Disable MTPMU if FEAT_MTPMU is supported.
342DISABLE_MTPMU ?= 0
343
Arvind Ram Prakash33e6aaa2024-06-06 11:33:37 -0500344# Flag to enable FEAT_FGT2 (Fine Granular Traps 2)
345ENABLE_FEAT_FGT2 ?= 0
346
Andre Przywara19d52a82024-08-09 17:04:22 +0100347# LoadStore64Bytes extension using the ACCDATA_EL1 system register
348ENABLE_FEAT_LS64_ACCDATA ?= 0
349
Govindraj Rajaf5211422023-08-17 10:41:48 -0500350#----
Jayanth Dodderi Chidanand6d0433f2024-09-05 22:24:04 +0100351# 8.8
352#----
353
354# Flag to enable FEAT_THE (Translation Hardening Extension)
355ENABLE_FEAT_THE ?= 0
356
357#----
Govindraj Rajaf5211422023-08-17 10:41:48 -0500358# 8.9
359#----
360
Govindraj Rajaf5211422023-08-17 10:41:48 -0500361# Flag to enable access to Stage 2 Permission Indirection (FEAT_S2PIE).
362ENABLE_FEAT_S2PIE ?= 0
363
364# Flag to enable access to Stage 1 Permission Indirection (FEAT_S1PIE).
365ENABLE_FEAT_S1PIE ?= 0
366
367# Flag to enable access to Stage 2 Permission Overlay (FEAT_S2POE).
368ENABLE_FEAT_S2POE ?= 0
369
370# Flag to enable access to Stage 1 Permission Overlay (FEAT_S1POE).
371ENABLE_FEAT_S1POE ?= 0
372
Arvind Ram Prakash83271d52024-05-22 15:24:00 -0500373# Flag to enable access to Arm v8.9 Debug extension
374ENABLE_FEAT_DEBUGV8P9 ?= 0
375
Govindraj Rajaf5211422023-08-17 10:41:48 -0500376#----
377# 9.0
378#----
379
Govindraj Rajaf5211422023-08-17 10:41:48 -0500380# Scalable Matrix Extension for non-secure world.
381ENABLE_SME_FOR_NS ?= 0
382
383# Scalable Vector Extension for secure world.
384ENABLE_SVE_FOR_SWD ?= 0
385
386# By default, disable access of trace buffer control registers from NS
387# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
388# if FEAT_TRBE is implemented.
389# Note FEAT_TRBE is only supported on AArch64 - therefore do not enable in
390# AArch32.
391ifeq (${ARCH},aarch64)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500392 ENABLE_TRBE_FOR_NS ?= 0
Govindraj Rajaf5211422023-08-17 10:41:48 -0500393else ifeq (${ARCH},aarch32)
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500394 ifneq ($(or $(ENABLE_TRBE_FOR_NS),0),0)
395 $(error ENABLE_TRBE_FOR_NS is not supported for AArch32)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500396 else
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500397 ENABLE_TRBE_FOR_NS := 0
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500398 endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500399endif
400
401#----
402# 9.2
403#----
404
Govindraj Raja3dafd962024-01-24 11:42:40 -0600405# Flag to enable Realm Management Extension (FEAT_RME).
406ENABLE_RME ?= 0
407
Govindraj Rajaf5211422023-08-17 10:41:48 -0500408# Scalable Matrix Extension version 2 for non-secure world.
409ENABLE_SME2_FOR_NS ?= 0
410
411# Scalable Matrix Extension for secure world.
412ENABLE_SME_FOR_SWD ?= 0
413
414# By default, disable access to branch record buffer control registers from NS
415# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
416# if FEAT_BRBE is implemented.
417ENABLE_BRBE_FOR_NS ?= 0
418
Arvind Ram Prakasha57e18e2024-11-11 14:32:37 -0600419# Flag to enable Floating point exception Mode Register Feature (FEAT_FPMR)
420ENABLE_FEAT_FPMR ?= 0
421
Tushar Khandelwal7e84f3c2024-03-15 15:00:29 +0000422# Flag to enable Memory Encryption Contexts (FEAT_MEC).
423ENABLE_FEAT_MEC ?= 0
424
Govindraj Rajaf5211422023-08-17 10:41:48 -0500425#----
Govindraj Raja30655132024-09-06 15:43:43 +0100426# 9.3
427#----
428# Flag to enable access to Arm v9.3 FEAT_D128 extension
429ENABLE_FEAT_D128 ?= 0
430
Boyan Karatotev8cef63d2025-01-07 11:26:56 +0000431# Flag to enable access to GICv5 CPU interface extension (FEAT_GCIE)
432ENABLE_FEAT_GCIE ?= 0
433
Govindraj Raja30655132024-09-06 15:43:43 +0100434#----
Govindraj Rajaf5211422023-08-17 10:41:48 -0500435#9.4
436#----
437
438# Flag to enable access to Guarded Control Stack (FEAT_GCS).
439ENABLE_FEAT_GCS ?= 0