Like done previously for poweroff, also register a runtime handler for
restarting the board.

Signed-off-by: Ahmad Fatoum <[email protected]>
---
 arch/arm/cpu/psci-client.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/arch/arm/cpu/psci-client.c b/arch/arm/cpu/psci-client.c
index 17b021898884..f53181d18473 100644
--- a/arch/arm/cpu/psci-client.c
+++ b/arch/arm/cpu/psci-client.c
@@ -47,6 +47,12 @@ static void __noreturn __efi_runtime 
rt_psci_poweroff(unsigned long flags)
        __hang();
 }
 
+static void __noreturn __efi_runtime rt_psci_restart(unsigned long flags)
+{
+       psci_invoke_fn(ARM_PSCI_0_2_FN_SYSTEM_RESET, 0, 0, 0);
+       __hang();
+}
+
 static u32 version;
 int psci_get_version(void)
 {
@@ -184,6 +190,7 @@ static int __init psci_probe(struct device *dev)
 
        restart.name = "psci";
        restart.restart = psci_restart;
+       restart.rt_restart = rt_psci_restart;
        restart.priority = 400;
 
        ret = restart_handler_register(&restart);
-- 
2.47.3


Reply via email to