summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv8
diff options
context:
space:
mode:
authorMichal Simek <michal.simek@xilinx.com>2017-05-29 07:11:32 (GMT)
committerTom Rini <trini@konsulko.com>2017-06-05 18:13:12 (GMT)
commit3c85417f45e8ffeb57ab04ed5512e3a1a813f0e0 (patch)
treeb86d40bdded9ab25c9214491bfb7cbeee4eede29 /arch/arm/cpu/armv8
parent18b29165854ba180ce3348e404f11a3e988fc726 (diff)
downloadu-boot-3c85417f45e8ffeb57ab04ed5512e3a1a813f0e0.tar.xz
ARMv8: Add support for poweroff via PSCI
Add support for calling poweroff in case of psci is wired. Based on the same solution as is used for reset. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Move all logic in to fwcall.c as other ARMs implement poweroff via PMIC] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'arch/arm/cpu/armv8')
-rw-r--r--arch/arm/cpu/armv8/fwcall.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/arm/cpu/armv8/fwcall.c b/arch/arm/cpu/armv8/fwcall.c
index 7dfd270..c220267 100644
--- a/arch/arm/cpu/armv8/fwcall.c
+++ b/arch/arm/cpu/armv8/fwcall.c
@@ -1,5 +1,6 @@
/**
* (C) Copyright 2014, Cavium Inc.
+ * (C) Copyright 2017, Xilinx Inc.
*
* SPDX-License-Identifier: GPL-2.0+
**/
@@ -114,6 +115,22 @@ void __noreturn __efi_runtime psci_system_off(void)
;
}
+#ifdef CONFIG_CMD_POWEROFF
+int do_poweroff(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+{
+ puts("poweroff ...\n");
+
+ udelay(50000); /* wait 50 ms */
+
+ disable_interrupts();
+
+ psci_system_off();
+
+ /*NOTREACHED*/
+ return 0;
+}
+#endif
+
#ifdef CONFIG_PSCI_RESET
void reset_misc(void)
{