diff mbox

[03/11] ARM64: use the common machine reset handling

Message ID 20131031062958.848317356@linux.com (mailing list archive)
State New, archived
Headers show

Commit Message

Domenico Andreoli Oct. 31, 2013, 6:27 a.m. UTC
From: Domenico Andreoli <domenico.andreoli@linux.com>

Proof of concept: ARM64 as a consumer of the machine reset hooks.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Cc: linux-arch@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Signed-off-by: Domenico Andreoli <domenico.andreoli@linux.com>
---
 arch/arm64/kernel/process.c |    5 +++++
 kernel/power/Kconfig        |    2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
diff mbox

Patch

Index: b/kernel/power/Kconfig
===================================================================
--- a/kernel/power/Kconfig
+++ b/kernel/power/Kconfig
@@ -297,4 +297,4 @@  config CPU_PM
 config MACHINE_RESET
 	bool
 	default n
-	depends on ARM
+	depends on ARM || ARM64
Index: b/arch/arm64/kernel/process.c
===================================================================
--- a/arch/arm64/kernel/process.c
+++ b/arch/arm64/kernel/process.c
@@ -29,6 +29,7 @@ 
 #include <linux/user.h>
 #include <linux/delay.h>
 #include <linux/reboot.h>
+#include <linux/machine_reset.h>
 #include <linux/interrupt.h>
 #include <linux/kallsyms.h>
 #include <linux/init.h>
@@ -120,6 +121,8 @@  void machine_power_off(void)
 	machine_shutdown();
 	if (pm_power_off)
 		pm_power_off();
+	else
+		default_power_off();
 }
 
 void machine_restart(char *cmd)
@@ -133,6 +136,8 @@  void machine_restart(char *cmd)
 	/* Now call the architecture specific reboot code. */
 	if (arm_pm_restart)
 		arm_pm_restart(reboot_mode, cmd);
+	else
+		default_restart(reboot_mode, cmd);
 
 	/*
 	 * Whoops - the architecture was unable to reboot.