From b2552c46b60e55bfa2db5a19937d09d3b0e66623 Mon Sep 17 00:00:00 2001 From: Wojciech Macek Date: Tue, 1 Mar 2016 08:15:00 +0000 Subject: [PATCH] Enable SRE_EL2 on ARM64 Enable system register access for EL2. Alpine-V2 is the first device requiring this to be enabled. It is also in-sync with Linux initialization code, and compatible with Alpine-V2 uboot requirements. Obtained from: Semihalf Submitted by: Michal Stanek Sponsored by: Annapurna Labs Approved by: cognet (mentor) Reviewed by: wma Differential revision: https://reviews.freebsd.org/D5394 --- sys/arm64/arm64/locore.S | 1 + sys/arm64/include/armreg.h | 1 + 2 files changed, 2 insertions(+) diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S index 87abee18e48..b1fd3ae75a6 100644 --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -265,6 +265,7 @@ drop_to_el1: mrs x2, icc_sre_el2 orr x2, x2, #ICC_SRE_EL2_EN /* Enable access from insecure EL1 */ + orr x2, x2, #ICC_SRE_EL2_SRE /* Enable system registers */ msr icc_sre_el2, x2 2: diff --git a/sys/arm64/include/armreg.h b/sys/arm64/include/armreg.h index 405f3bb8d0b..8b2bc92436c 100644 --- a/sys/arm64/include/armreg.h +++ b/sys/arm64/include/armreg.h @@ -131,6 +131,7 @@ #define ICC_SRE_EL1_SRE (1U << 0) /* ICC_SRE_EL2 */ +#define ICC_SRE_EL2_SRE (1U << 0) #define ICC_SRE_EL2_EN (1U << 3) /* ID_AA64DFR0_EL1 */