@@ -71,7 +71,7 @@ ARCH_OBJ += psci.o
COMMON_OBJ += psci.o
PSCI_NODE := psci { \
compatible = \"arm,psci\"; \
- method = \"smc\"; \
+ method = \"$(PSCI_METHOD)\"; \
cpu_on = <$(PSCI_CPU_ON)>; \
cpu_off = <$(PSCI_CPU_OFF)>; \
};
@@ -224,13 +224,20 @@ extern char psci_vectors[];
static void cpu_init_psci_arch(unsigned int cpu)
{
- if (mrs(CurrentEL) != CURRENTEL_EL3) {
- print_cpu_warn(cpu, "PSCI could not be initialized (not booted at EL3).\r\n");
+ if (!bootwrapper_is_r_class() && mrs(CurrentEL) == CURRENTEL_EL3) {
+ msr(VBAR_EL3, (unsigned long)psci_vectors);
+ isb();
return;
}
- msr(VBAR_EL3, (unsigned long)psci_vectors);
- isb();
+ if (bootwrapper_is_r_class() && mrs(CurrentEL) == CURRENTEL_EL2) {
+ msr(VBAR_EL2, (unsigned long)psci_vectors);
+ isb();
+ return;
+ }
+
+ print_cpu_warn(cpu, "PSCI could not be initialized (not booted at EL3).\r\n");
+
}
#else
static void cpu_init_psci_arch(unsigned int cpu) { }
@@ -107,6 +107,9 @@ AC_ARG_ENABLE([psci],
[USE_PSCI=$enableval], [USE_PSCI="yes"])
AM_CONDITIONAL([PSCI], [test "x$USE_PSCI" = "xyes"])
AS_IF([test "x$USE_PSCI" = "xyes"], [], [USE_PSCI=no])
+AS_IF([test "x$USE_ARCH" = "xaarch64-r"],
+ AC_SUBST([PSCI_METHOD], [hvc]), AC_SUBST([PSCI_METHOD], [smc])
+)
AS_IF([test "x$USE_PSCI" != "xyes" -a "x$KERNEL_ES" = "x32"],
[AC_MSG_ERROR([With an AArch32 kernel, boot method must be PSCI.])]
Armv8-R doesn't have EL3, so the PSCI vector needs to be installed in VBAR_EL2 and the conduit needs to be 'hcv' instead of 'smc'. Implement the modifications needed when --with-bw-arch is 'aarch64-r'. Signed-off-by: Luca Fancellu <luca.fancellu@arm.com> --- v4 changes: - rework cpu_init_psci_arch code to don't have #ifdef --- Makefile.am | 2 +- arch/aarch64/init.c | 15 +++++++++++---- configure.ac | 3 +++ 3 files changed, 15 insertions(+), 5 deletions(-)