xref: /rk3399_ARM-atf/make_helpers/arch_features.mk (revision e7e231d39c68083e870cdaaa89ecc4e5045fdd64)
1#
2# Copyright (c) 2022-2026, Arm Limited. All rights reserved.
3#
4# SPDX-License-Identifier: BSD-3-Clause
5#
6
7# 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:
11#   - Enable mandatory feature if not updated, as applicable to an Arch Version.
12#   - By default disable any mandatory features if they have not been defined yet.
13#   - Disable or enable any optional feature this would be enabled/disabled if needed by platform.
14
15#
16################################################################################
17# Enable Mandatory features if not updated yet, 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)))"
23armv8-1-a-feats         := ENABLE_FEAT_PAN ENABLE_FEAT_VHE
24
25FEAT_LIST               := ${armv8-1-a-feats}
26endif
27
28# 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)))"
30armv8-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}
43endif
44
45# 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)))"
47armv8-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}
52endif
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)))"
56armv8-5-a-feats         := ENABLE_FEAT_SB
57# 8.4 Compliant
58armv8-5-a-feats         += ${armv8-4-a-feats}
59
60FEAT_LIST               := ${armv8-5-a-feats}
61endif
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)))"
65armv8-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}
69endif
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)))"
73armv8-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)))"
81armv8-8-a-feats		:= ENABLE_FEAT_MOPS
82# 8.7 Compliant
83armv8-8-a-feats         += ${armv8-7-a-feats}
84FEAT_LIST               := ${armv8-8-a-feats}
85endif
86
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)))"
89armv8-9-a-feats         := ENABLE_FEAT_TCR2 ENABLE_FEAT_DEBUGV8P9	\
90			   ENABLE_FEAT_SCTLR2 ENABLE_FEAT_CLRBHB
91# 8.8 Compliant
92armv8-9-a-feats         += ${armv8-8-a-feats}
93FEAT_LIST               := ${armv8-9-a-feats}
94endif
95
96# Enable the features which are mandatory from ARCH version 9.0 and upwards.
97ifeq "9.0" "$(word 1, $(sort 9.0 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
98# 8.5 Compliant
99armv9-0-a-feats         += ${armv8-5-a-feats}
100FEAT_LIST               := ${armv9-0-a-feats}
101endif
102
103# Enable the features which are mandatory from ARCH version 9.1 and upwards.
104ifeq "9.1" "$(word 1, $(sort 9.1 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
105# 8.6 and 9.0 Compliant
106armv9-1-a-feats         += ${armv8-6-a-feats} ${armv9-0-a-feats}
107FEAT_LIST               := ${armv9-1-a-feats}
108endif
109
110# Enable the features which are mandatory from ARCH version 9.2 and upwards.
111ifeq "9.2" "$(word 1, $(sort 9.2 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
112# 8.7 and 9.1 Compliant
113armv9-2-a-feats         += ${armv8-7-a-feats} ${armv9-1-a-feats}
114FEAT_LIST               := ${armv9-2-a-feats}
115endif
116
117# Enable the features which are mandatory from ARCH version 9.3 and upwards.
118ifeq "9.3" "$(word 1, $(sort 9.3 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
119# 8.8 and 9.2 Compliant
120armv9-3-a-feats         += ${armv8-8-a-feats} ${armv9-2-a-feats}
121FEAT_LIST               := ${armv9-3-a-feats}
122endif
123
124# Enable the features which are mandatory from ARCH version 9.4 and upwards.
125ifeq "9.4" "$(word 1, $(sort 9.4 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
126# 8.9 and 9.3 Compliant
127armv9-4-a-feats         += ${armv8-9-a-feats} ${armv9-3-a-feats}
128FEAT_LIST               := ${armv9-4-a-feats}
129endif
130
131# Enable the features which are mandatory from ARCH version 9.5 and upwards.
132ifeq "9.5" "$(word 1, $(sort 9.5 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
133# 9.4 Compliant
134armv9-5-a-feats         := ENABLE_FEAT_STEP2
135armv9-5-a-feats         += ${armv9-4-a-feats}
136FEAT_LIST               := ${armv9-5-a-feats}
137endif
138
139# Enable the features which are mandatory from ARCH version 9.6 and upwards.
140ifeq "9.6" "$(word 1, $(sort 9.6 $(ARM_ARCH_MAJOR).$(ARM_ARCH_MINOR)))"
141# 9.5 Compliant
142armv9-6-a-feats         := ENABLE_FEAT_UINJ
143armv9-6-a-feats         += ${armv9-5-a-feats}
144FEAT_LIST               := ${armv9-6-a-feats}
145endif
146
147# Set all FEAT_* in FEAT_LIST to '1' if they are not yet defined or set
148# from build commandline options or platform makefile.
149$(eval $(call set_ones, ${sort ${FEAT_LIST}}))
150