summaryrefslogtreecommitdiff
path: root/lib/cpus/aarch64
diff options
context:
space:
mode:
authorJuan Pablo Conde <juanpablo.conde@arm.com>2023-08-14 16:20:52 -0500
committerJuan Pablo Conde <juanpablo.conde@arm.com>2023-08-24 14:23:28 -0500
commit0bbd4329bf73b0da1ed69578c385dd36358e261e (patch)
tree4c52adcf4289c04a38d74ac58af634173b607308 /lib/cpus/aarch64
parentf56da5d36d0d0c7a9f7ad6cf3df76d34d16f9822 (diff)
fix(cpus): check for SME presence in Gelas
The original powerdown function for Gelas included SME disabling instructions but did not check for the presence of SME before disabling. This could lead to unexpected beaviors. This patch adds that check so the feature is disabled only if it is present. Change-Id: I582db53a6669317620e4f72a3eac87525897d3d0 Signed-off-by: Juan Pablo Conde <juanpablo.conde@arm.com>
Diffstat (limited to 'lib/cpus/aarch64')
-rw-r--r--lib/cpus/aarch64/cortex_gelas.S11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/cpus/aarch64/cortex_gelas.S b/lib/cpus/aarch64/cortex_gelas.S
index e0d20a9e7..dc704f204 100644
--- a/lib/cpus/aarch64/cortex_gelas.S
+++ b/lib/cpus/aarch64/cortex_gelas.S
@@ -34,13 +34,20 @@ cpu_reset_func_end cortex_gelas
* ----------------------------------------------------
*/
func cortex_gelas_core_pwr_dwn
+#if ENABLE_SME_FOR_NS
/* ---------------------------------------------------
- * Disable SME
+ * Disable SME if enabled and supported
* ---------------------------------------------------
*/
+ mrs x0, ID_AA64PFR1_EL1
+ ubfx x0, x0, #ID_AA64PFR1_EL1_SME_SHIFT, \
+ #ID_AA64PFR1_EL1_SME_WIDTH
+ cmp x0, #ID_AA64PFR1_EL1_SME_NOT_SUPPORTED
+ b.eq 1f
msr CORTEX_GELAS_SVCRSM, xzr
msr CORTEX_GELAS_SVCRZA, xzr
-
+1:
+#endif
/* ---------------------------------------------------
* Enable CPU power down bit in power control register
* ---------------------------------------------------