2 * (C) Copyright 2014, Cavium Inc.
4 * SPDX-License-Identifier: GPL-2.0+
7 #include <asm-offsets.h>
10 #include <asm/macro.h>
12 #include <asm/system.h>
15 * Issue the hypervisor call
17 * x0~x7: input arguments
18 * x0~x3: output arguments
20 static void hvc_call(struct pt_regs *args)
36 : "+m" (args->regs[0]), "+m" (args->regs[1]),
37 "+m" (args->regs[2]), "+m" (args->regs[3])
38 : "m" (args->regs[4]), "m" (args->regs[5]),
39 "m" (args->regs[6]), "m" (args->regs[7])
40 : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
41 "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15",
46 * void smc_call(arg0, arg1...arg7)
48 * issue the secure monitor call
50 * x0~x7: input arguments
51 * x0~x3: output arguments
54 void smc_call(struct pt_regs *args)
69 : "+m" (args->regs[0]), "+m" (args->regs[1]),
70 "+m" (args->regs[2]), "+m" (args->regs[3])
71 : "m" (args->regs[4]), "m" (args->regs[5]),
73 : "x0", "x1", "x2", "x3", "x4", "x5", "x6", "x7",
74 "x8", "x9", "x10", "x11", "x12", "x13", "x14", "x15",
79 * For now, all systems we support run at least in EL2 and thus
80 * trigger PSCI calls to EL3 using SMC. If anyone ever wants to
81 * use PSCI on U-Boot running below a hypervisor, please detect
82 * this and set the flag accordingly.
84 static const bool use_smc_for_psci = true;
86 void __noreturn psci_system_reset(void)
90 regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_RESET;
101 void __noreturn psci_system_off(void)
105 regs.regs[0] = ARM_PSCI_0_2_FN_SYSTEM_OFF;
107 if (use_smc_for_psci)
116 #ifdef CONFIG_PSCI_RESET
117 void reset_misc(void)
121 #endif /* CONFIG_PSCI_RESET */