summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2018-11-01 10:18:41 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-11-05 17:03:29 +0100
commit245550bce79a6af34e767ebb0ed844a7e7eb582e (patch)
tree273c0713d5a724919ae3cd56a9e0e6d84870fade
parent296fa431f9725334f2057039e015f6fc537c0aa0 (diff)
downloadbarebox-245550bce79a6af34e767ebb0ed844a7e7eb582e.tar.gz
barebox-245550bce79a6af34e767ebb0ed844a7e7eb582e.tar.xz
ARM: don't try to install secure monitor when entered in HYP mode
When Barebox has been entered in HYP mode, the CPU is already switched to the non-secure world and it's not possible for Barebox to install it's own secure monitor. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Roland Hieber <r.hieber@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--arch/arm/cpu/sm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/arm/cpu/sm.c b/arch/arm/cpu/sm.c
index cb0bac106b..1246d8e3a4 100644
--- a/arch/arm/cpu/sm.c
+++ b/arch/arm/cpu/sm.c
@@ -184,6 +184,9 @@ int armv7_secure_monitor_install(void)
return -EINVAL;
}
+ if (__boot_cpu_mode == HYP_MODE)
+ return 0;
+
mmuon = get_cr() & CR_M;
vbar = get_vbar();