summaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2016-08-16 21:08:46 +0200
committerAlexander Graf <agraf@suse.de>2016-10-18 09:08:08 +0200
commit51bfb5b6f522b1fbe453c18df03648d72b08131f (patch)
treec5be0a47dee5c0719f1370960f73614ce06802da /arch/arm/cpu
parent80a4800ee1526a4a46cd02b3ea2fd37eebb77504 (diff)
arm: Disable HVC PSCI calls by default
All systems that are running on armv8 are running bare metal with firmware that implements PSCI running in EL3. That means we don't really need to expose the hypercall variants of them. This patch leaves the code in, but makes the code explicit enough to have the compiler optimize it out. With this we don't need to worry about hvc vs smc calling convention when calling psci helper functions. Signed-off-by: Alexander Graf <agraf@suse.de> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv8/fwcall.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv8/fwcall.c b/arch/arm/cpu/armv8/fwcall.c
index 079e250cbe..6bb68f2ed3 100644
--- a/arch/arm/cpu/armv8/fwcall.c
+++ b/arch/arm/cpu/armv8/fwcall.c
@@ -17,7 +17,7 @@
* x0~x7: input arguments
* x0~x3: output arguments
*/
-void hvc_call(struct pt_regs *args)
+static void hvc_call(struct pt_regs *args)
{
asm volatile(
"ldr x0, %0\n"
@@ -75,13 +75,21 @@ void smc_call(struct pt_regs *args)
"x16", "x17");
}
-void __noreturn psci_system_reset(bool conduit_smc)
+/*
+ * For now, all systems we support run at least in EL2 and thus
+ * trigger PSCI calls to EL3 using SMC. If anyone ever wants to
+ * use PSCI on U-Boot running below a hypervisor, please detect
+ * this and set the flag accordingly.
+ */
+static const bool use_smc_for_psci = true;
+
+void __noreturn psci_system_reset(void)
{
struct pt_regs regs;
regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_RESET;
- if (conduit_smc)
+ if (use_smc_for_psci)
smc_call(&regs);
else
hvc_call(&regs);