blob: 1561a598a725b577def28d17c9cd7669718607f5 [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}
Govindraj Rajaf5211422023-08-17 10:41:48 -050061# Enable Memory tagging, Branch Target Identification for aarch64 only.
62ifeq ($(ARCH), aarch64)
Govindraj Raja6c1ae072024-01-11 13:56:40 -060063 mem_tag_arch_support ?= yes
Govindraj Rajaf5211422023-08-17 10:41:48 -050064endif #(ARCH=aarch64)
65
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000066endif
67
68# Enable the features which are mandatory from ARCH version 8.6 and upwards.
69ifeq "8.6" "$(word 1, $(sort 8.6 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060070armv8-6-a-feats := ENABLE_FEAT_ECV ENABLE_FEAT_FGT
71# 8.5 Compliant
72armv8-6-a-feats += ${armv8-5-a-feats}
73FEAT_LIST := ${armv8-6-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000074endif
75
76# Enable the features which are mandatory from ARCH version 8.7 and upwards.
77ifeq "8.7" "$(word 1, $(sort 8.7 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Govindraj Raja2a71f162024-01-23 14:20:52 -060078armv8-7-a-feats := ENABLE_FEAT_HCX
79# 8.6 Compliant
80armv8-7-a-feats += ${armv8-6-a-feats}
81FEAT_LIST := ${armv8-7-a-feats}
82endif
83
84# Enable the features which are mandatory from ARCH version 8.8 and upwards.
85ifeq "8.8" "$(word 1, $(sort 8.8 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Arvind Ram Prakash6b8df7b2025-01-09 17:18:30 -060086armv8-8-a-feats := ENABLE_FEAT_MOPS
Govindraj Raja2a71f162024-01-23 14:20:52 -060087# 8.7 Compliant
Manish V Badarkhe94ff1d92024-11-08 09:41:51 +000088armv8-8-a-feats += ${armv8-7-a-feats}
Govindraj Raja2a71f162024-01-23 14:20:52 -060089FEAT_LIST := ${armv8-8-a-feats}
Jayanth Dodderi Chidanand6a0da732022-01-17 18:57:17 +000090endif
Govindraj Rajaf5211422023-08-17 10:41:48 -050091
92# Enable the features which are mandatory from ARCH version 8.9 and upwards.
93ifeq "8.9" "$(word 1, $(sort 8.9 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
Jayanth Dodderi Chidanand4ec4e542024-09-06 13:49:31 +010094armv8-9-a-feats := ENABLE_FEAT_TCR2 ENABLE_FEAT_DEBUGV8P9 ENABLE_FEAT_SCTLR2
Govindraj Raja2a71f162024-01-23 14:20:52 -060095# 8.8 Compliant
96armv8-9-a-feats += ${armv8-8-a-feats}
97FEAT_LIST := ${armv8-9-a-feats}
Govindraj Rajaf5211422023-08-17 10:41:48 -050098endif
99
Govindraj Raja2a71f162024-01-23 14:20:52 -0600100# Enable the features which are mandatory from ARCH version 9.0 and upwards.
101ifeq "9.0" "$(word 1, $(sort 9.0 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
102# 8.5 Compliant
103armv9-0-a-feats += ${armv8-5-a-feats}
104FEAT_LIST := ${armv9-0-a-feats}
105endif
106
107# Enable the features which are mandatory from ARCH version 9.1 and upwards.
108ifeq "9.1" "$(word 1, $(sort 9.1 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
109# 8.6 and 9.0 Compliant
110armv9-1-a-feats += ${armv8-6-a-feats} ${armv9-0-a-feats}
111FEAT_LIST := ${armv9-1-a-feats}
112endif
113
114# Enable the features which are mandatory from ARCH version 9.2 and upwards.
115ifeq "9.2" "$(word 1, $(sort 9.2 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
116# 8.7 and 9.1 Compliant
117armv9-2-a-feats += ${armv8-7-a-feats} ${armv9-1-a-feats}
118FEAT_LIST := ${armv9-2-a-feats}
119endif
120
121# Enable the features which are mandatory from ARCH version 9.3 and upwards.
122ifeq "9.3" "$(word 1, $(sort 9.3 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
123# 8.8 and 9.2 Compliant
124armv9-3-a-feats += ${armv8-8-a-feats} ${armv9-2-a-feats}
125FEAT_LIST := ${armv9-3-a-feats}
126endif
127
128# Set all FEAT_* in FEAT_LIST to '1' if they are not yet defined or set
129# from build commandline options or platform makefile.
130$(eval $(call default_ones, ${sort ${FEAT_LIST}}))
131
Govindraj Rajaf5211422023-08-17 10:41:48 -0500132#
133################################################################################
Govindraj Raja3dafd962024-01-24 11:42:40 -0600134# Set mandatory features by default to zero, if they are not already updated.
Govindraj Rajafb730112023-10-09 13:56:06 -0500135################################################################################
136#
137
138#----
139# 8.1
140#----
141
142# Flag to enable access to Privileged Access Never bit of PSTATE.
143ENABLE_FEAT_PAN ?= 0
144
145# Flag to enable Virtualization Host Extensions.
146ENABLE_FEAT_VHE ?= 0
147
148#----
149# 8.2
150#----
151
152# Enable RAS Support.
153ENABLE_FEAT_RAS ?= 0
154
155#----
156# 8.3
157#----
158
159# Flag to enable Pointer Authentication. Internal flag not meant for
160# direct setting. Use BRANCH_PROTECTION to enable PAUTH.
161ENABLE_PAUTH ?= 0
162
John Powell025b1b82025-03-10 20:09:03 -0500163# FEAT_PAUTH_LR is an optional architectural feature, so this flag must be set
164# manually in addition to the BRANCH_PROTECTION flag which is used for other
165# branch protection and pointer authentication features.
166ENABLE_FEAT_PAUTH_LR ?= 0
167
Govindraj Rajafb730112023-10-09 13:56:06 -0500168# Include pointer authentication (ARMv8.3-PAuth) registers in cpu context. This
169# must be set to 1 if the platform wants to use this feature in the Secure
170# world. It is not necessary for use in the Non-secure world.
171CTX_INCLUDE_PAUTH_REGS ?= 0
172
173
174#----
175# 8.4
176#----
177
178# Flag to enable Secure EL-2 feature.
179ENABLE_FEAT_SEL2 ?= 0
180
181# By default, disable trace filter control register access to lower non-secure
182# exception levels, i.e. NS-EL2, or NS-EL1 if NS-EL2 is implemented, but
183# trace filter control register access is unused if FEAT_TRF is implemented.
184ENABLE_TRF_FOR_NS ?= 0
185
186# Flag to enable Data Independent Timing instructions.
187ENABLE_FEAT_DIT ?= 0
188
189#----
190# 8.5
191#----
192
193# Flag to enable Branch Target Identification.
194# Internal flag not meant for direct setting.
195# Use BRANCH_PROTECTION to enable BTI.
196ENABLE_BTI ?= 0
197
198# Flag to enable access to the Random Number Generator registers.
199ENABLE_FEAT_RNG ?= 0
200
201# Flag to enable Speculation Barrier Instruction.
202ENABLE_FEAT_SB ?= 0
203
204#----
205# 8.6
206#----
207
208# Flag to enable access to the CNTPOFF_EL2 register.
209ENABLE_FEAT_ECV ?= 0
210
211# Flag to enable access to the HDFGRTR_EL2 register.
212ENABLE_FEAT_FGT ?= 0
213
214#----
215# 8.7
216#----
217
218# Flag to enable access to the HCRX_EL2 register by setting SCR_EL3.HXEn.
219ENABLE_FEAT_HCX ?= 0
220
221#----
Arvind Ram Prakash6b8df7b2025-01-09 17:18:30 -0600222# 8.8
223#----
224
225# Flag to enable FEAT_MOPS (Standardization of Memory operations)
226# when INIT_UNUSED_NS_EL2 = 1
227ENABLE_FEAT_MOPS ?= 0
228
229#----
Govindraj Rajafb730112023-10-09 13:56:06 -0500230# 8.9
231#----
232
233# Flag to enable access to TCR2 (FEAT_TCR2).
234ENABLE_FEAT_TCR2 ?= 0
235
Jayanth Dodderi Chidanand4ec4e542024-09-06 13:49:31 +0100236# Flag to enable access to SCTLR2 (FEAT_SCTLR2).
237ENABLE_FEAT_SCTLR2 ?= 0
238
Govindraj Rajafb730112023-10-09 13:56:06 -0500239#
240################################################################################
Govindraj Rajaf5211422023-08-17 10:41:48 -0500241# Optional Features defaulted to 0 or 2, if they are not enabled from
242# build option. Can also be disabled or enabled by platform if needed.
243################################################################################
244#
245
246#----
247# 8.0
248#----
249
250# Flag to enable CSV2_2 extension.
251ENABLE_FEAT_CSV2_2 ?= 0
252
Sona Mathew30019d82023-10-25 16:48:19 -0500253# Flag to enable CSV2_3 extension. FEAT_CSV2_3 enables access to the
254# SCXTNUM_ELx register.
255ENABLE_FEAT_CSV2_3 ?= 0
256
Govindraj Rajaf5211422023-08-17 10:41:48 -0500257# By default, disable access of trace system registers from NS lower
258# ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused if
259# system register trace is implemented. This feature is available if
260# trace unit such as ETMv4.x, This feature is OPTIONAL and is only
261# permitted in Armv8 implementations.
262ENABLE_SYS_REG_TRACE_FOR_NS ?= 0
263
264#----
265# 8.2
266#----
267
268# Build option to enable/disable the Statistical Profiling Extension,
269# keep it enabled by default for AArch64.
270ifeq (${ARCH},aarch64)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500271 ENABLE_SPE_FOR_NS ?= 2
Govindraj Rajaf5211422023-08-17 10:41:48 -0500272else ifeq (${ARCH},aarch32)
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500273 ifneq ($(or $(ENABLE_SPE_FOR_NS),0),0)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500274 $(error ENABLE_SPE_FOR_NS is not supported for AArch32)
275 else
276 ENABLE_SPE_FOR_NS := 0
277 endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500278endif
279
280# Enable SVE for non-secure world by default.
281ifeq (${ARCH},aarch64)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500282 ENABLE_SVE_FOR_NS ?= 2
Govindraj Rajaf5211422023-08-17 10:41:48 -0500283# SVE is only supported on AArch64 so disable it on AArch32.
284else ifeq (${ARCH},aarch32)
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500285 ifneq ($(or $(ENABLE_SVE_FOR_NS),0),0)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500286 $(error ENABLE_SVE_FOR_NS is not supported for AArch32)
287 else
288 ENABLE_SVE_FOR_NS := 0
289 endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500290endif
291
292#----
293# 8.4
294#----
295
296# Feature flags for supporting Activity monitor extensions.
297ENABLE_FEAT_AMU ?= 0
298ENABLE_AMU_AUXILIARY_COUNTERS ?= 0
Juan Pablo Conde14c27f82024-04-03 13:18:40 -0500299AMU_RESTRICT_COUNTERS ?= 1
Govindraj Rajaf5211422023-08-17 10:41:48 -0500300
301# Build option to enable MPAM for lower ELs.
Arvind Ram Prakashedebefb2023-10-11 12:10:56 -0500302# Enabling it by default
303ifeq (${ARCH},aarch64)
Harrison Mutai72f027c2023-10-31 10:15:41 +0000304 ENABLE_FEAT_MPAM ?= 2
Arvind Ram Prakashedebefb2023-10-11 12:10:56 -0500305else ifeq (${ARCH},aarch32)
Harrison Mutai72f027c2023-10-31 10:15:41 +0000306 ifneq ($(or $(ENABLE_FEAT_MPAM),0),0)
307 $(error ENABLE_FEAT_MPAM is not supported for AArch32)
308 else
309 ENABLE_FEAT_MPAM := 0
310 endif
Arvind Ram Prakashedebefb2023-10-11 12:10:56 -0500311endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500312
Govindraj Raja8b2048c2023-09-19 08:43:16 -0500313# Include nested virtualization control (Armv8.4-NV) registers in cpu context.
314# This must be set to 1 if architecture implements Nested Virtualization
315# Extension and platform wants to use this feature in the Secure world.
316CTX_INCLUDE_NEVE_REGS ?= 0
317
Govindraj Rajaf5211422023-08-17 10:41:48 -0500318#----
319# 8.5
320#----
321
322# Flag to enable support for EL3 trapping of reads of the RNDR and RNDRRS
323# registers, by setting SCR_EL3.TRNDR.
324ENABLE_FEAT_RNG_TRAP ?= 0
325
Govindraj Rajac2823842024-03-07 14:42:20 -0600326# Enable FEAT_MTE2. This must be set to 1 if the platform wants
327# to use this feature and is enabled at ELX.
Govindraj Raja8e397882024-01-26 10:08:37 -0600328ENABLE_FEAT_MTE2 ?= 0
329
Govindraj Rajaf5211422023-08-17 10:41:48 -0500330#----
331# 8.6
332#----
333
334# Flag to enable AMUv1p1 extension.
335ENABLE_FEAT_AMUv1p1 ?= 0
336
337# Flag to enable delayed trapping of WFE instruction (FEAT_TWED).
338ENABLE_FEAT_TWED ?= 0
339
340# In v8.6+ platforms with delayed trapping of WFE being supported
341# via FEAT_TWED, this flag takes the delay value to be set in the
342# SCR_EL3.TWEDEL(4bit) field, when FEAT_TWED is implemented.
343# By default it takes 0, and need to be updated by the platforms.
344TWED_DELAY ?= 0
345
346# Disable MTPMU if FEAT_MTPMU is supported.
347DISABLE_MTPMU ?= 0
348
Arvind Ram Prakash33e6aaa2024-06-06 11:33:37 -0500349# Flag to enable FEAT_FGT2 (Fine Granular Traps 2)
350ENABLE_FEAT_FGT2 ?= 0
351
Andre Przywara19d52a82024-08-09 17:04:22 +0100352# LoadStore64Bytes extension using the ACCDATA_EL1 system register
353ENABLE_FEAT_LS64_ACCDATA ?= 0
354
Govindraj Rajaf5211422023-08-17 10:41:48 -0500355#----
Jayanth Dodderi Chidanand6d0433f2024-09-05 22:24:04 +0100356# 8.8
357#----
358
359# Flag to enable FEAT_THE (Translation Hardening Extension)
360ENABLE_FEAT_THE ?= 0
361
362#----
Govindraj Rajaf5211422023-08-17 10:41:48 -0500363# 8.9
364#----
365
Govindraj Rajaf5211422023-08-17 10:41:48 -0500366# Flag to enable access to Stage 2 Permission Indirection (FEAT_S2PIE).
367ENABLE_FEAT_S2PIE ?= 0
368
369# Flag to enable access to Stage 1 Permission Indirection (FEAT_S1PIE).
370ENABLE_FEAT_S1PIE ?= 0
371
372# Flag to enable access to Stage 2 Permission Overlay (FEAT_S2POE).
373ENABLE_FEAT_S2POE ?= 0
374
375# Flag to enable access to Stage 1 Permission Overlay (FEAT_S1POE).
376ENABLE_FEAT_S1POE ?= 0
377
Arvind Ram Prakash83271d52024-05-22 15:24:00 -0500378# Flag to enable access to Arm v8.9 Debug extension
379ENABLE_FEAT_DEBUGV8P9 ?= 0
380
Govindraj Rajaf5211422023-08-17 10:41:48 -0500381#----
382# 9.0
383#----
384
Govindraj Rajaf5211422023-08-17 10:41:48 -0500385# Scalable Matrix Extension for non-secure world.
386ENABLE_SME_FOR_NS ?= 0
387
388# Scalable Vector Extension for secure world.
389ENABLE_SVE_FOR_SWD ?= 0
390
391# By default, disable access of trace buffer control registers from NS
392# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
393# if FEAT_TRBE is implemented.
394# Note FEAT_TRBE is only supported on AArch64 - therefore do not enable in
395# AArch32.
396ifeq (${ARCH},aarch64)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500397 ENABLE_TRBE_FOR_NS ?= 0
Govindraj Rajaf5211422023-08-17 10:41:48 -0500398else ifeq (${ARCH},aarch32)
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500399 ifneq ($(or $(ENABLE_TRBE_FOR_NS),0),0)
400 $(error ENABLE_TRBE_FOR_NS is not supported for AArch32)
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500401 else
Govindraj Rajaf0c813b2023-10-17 08:13:03 -0500402 ENABLE_TRBE_FOR_NS := 0
Govindraj Raja1ca73b42023-09-20 15:31:45 -0500403 endif
Govindraj Rajaf5211422023-08-17 10:41:48 -0500404endif
405
406#----
407# 9.2
408#----
409
Govindraj Raja3dafd962024-01-24 11:42:40 -0600410# Flag to enable Realm Management Extension (FEAT_RME).
411ENABLE_RME ?= 0
412
Govindraj Rajaf5211422023-08-17 10:41:48 -0500413# Scalable Matrix Extension version 2 for non-secure world.
414ENABLE_SME2_FOR_NS ?= 0
415
416# Scalable Matrix Extension for secure world.
417ENABLE_SME_FOR_SWD ?= 0
418
419# By default, disable access to branch record buffer control registers from NS
420# lower ELs i.e. NS-EL2, or NS-EL1 if NS-EL2 implemented but unused
421# if FEAT_BRBE is implemented.
422ENABLE_BRBE_FOR_NS ?= 0
423
Arvind Ram Prakasha57e18e2024-11-11 14:32:37 -0600424# Flag to enable Floating point exception Mode Register Feature (FEAT_FPMR)
425ENABLE_FEAT_FPMR ?= 0
426
Tushar Khandelwal7e84f3c2024-03-15 15:00:29 +0000427# Flag to enable Memory Encryption Contexts (FEAT_MEC).
428ENABLE_FEAT_MEC ?= 0
429
Govindraj Rajaf5211422023-08-17 10:41:48 -0500430#----
Govindraj Raja30655132024-09-06 15:43:43 +0100431# 9.3
432#----
433# Flag to enable access to Arm v9.3 FEAT_D128 extension
434ENABLE_FEAT_D128 ?= 0
435
436#----
Govindraj Rajaf5211422023-08-17 10:41:48 -0500437#9.4
438#----
439
440# Flag to enable access to Guarded Control Stack (FEAT_GCS).
441ENABLE_FEAT_GCS ?= 0