Skip to content

Commit c80aba8

Browse files
Suzuki K Poulosewildea01
authored andcommitted
arm64: Add helpers for detecting AArch32 support at EL0
Adds a helper to extract the support for AArch32 at EL0 Tested-by: Yury Norov <ynorov@caviumnetworks.com> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
1 parent 7528350 commit c80aba8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

arch/arm64/include/asm/cpufeature.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ static inline bool id_aa64mmfr0_mixed_endian_el0(u64 mmfr0)
170170
cpuid_feature_extract_unsigned_field(mmfr0, ID_AA64MMFR0_BIGENDEL0_SHIFT) == 0x1;
171171
}
172172

173+
static inline bool id_aa64pfr0_32bit_el0(u64 pfr0)
174+
{
175+
u32 val = cpuid_feature_extract_unsigned_field(pfr0, ID_AA64PFR0_EL0_SHIFT);
176+
177+
return val == ID_AA64PFR0_EL0_32BIT_64BIT;
178+
}
179+
173180
void __init setup_cpu_features(void);
174181

175182
void update_cpu_capabilities(const struct arm64_cpu_capabilities *caps,

arch/arm64/include/asm/sysreg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@
115115
#define ID_AA64PFR0_ASIMD_SUPPORTED 0x0
116116
#define ID_AA64PFR0_EL1_64BIT_ONLY 0x1
117117
#define ID_AA64PFR0_EL0_64BIT_ONLY 0x1
118+
#define ID_AA64PFR0_EL0_32BIT_64BIT 0x2
118119

119120
/* id_aa64mmfr0 */
120121
#define ID_AA64MMFR0_TGRAN4_SHIFT 28

0 commit comments

Comments
 (0)