diff options
author | Jon Medhurst <tixy@linaro.org> | 2014-08-14 16:11:45 +0100 |
---|---|---|
committer | Jon Medhurst <tixy@linaro.org> | 2014-08-14 16:11:45 +0100 |
commit | 95383ee1e1f5b03a1f363910e19b47fa09327548 (patch) | |
tree | 924c28a242f5021573e03842f80b2e4145b8a8ac | |
parent | 21e7cba11c1f464652b0bd0645d919a97a35d38a (diff) | |
parent | 0d617ea0c4cdfa4d9e578c337bb3d9fcf034fa4f (diff) |
Merge branch 'lsk-3.10-armlt-juno-misc' into integration-lsk-3.10-juno-androidlsk-3.10-armlt-juno-20140814
-rw-r--r-- | arch/arm64/boot/dts/juno.dts | 2 | ||||
-rw-r--r-- | arch/arm64/kernel/psci.c | 24 |
2 files changed, 26 insertions, 0 deletions
diff --git a/arch/arm64/boot/dts/juno.dts b/arch/arm64/boot/dts/juno.dts index 319a7b5658d9..b41f121b572b 100644 --- a/arch/arm64/boot/dts/juno.dts +++ b/arch/arm64/boot/dts/juno.dts @@ -200,6 +200,8 @@ cpu_off = <0x84000002>; cpu_on = <0xC4000003>; migrate = <0xC4000005>; + sys_poweroff = <0x84000008>; + sys_reset = <0x84000009>; }; pci0: pci@30000000 { diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index 0e32ab453e5b..7fd33f0a9740 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -18,6 +18,7 @@ #include <linux/cpuidle.h> #include <linux/init.h> #include <linux/of.h> +#include <linux/pm.h> #include <linux/smp.h> #include <linux/slab.h> @@ -27,6 +28,7 @@ #include <asm/psci.h> #include <asm/smp_plat.h> #include <asm/suspend.h> +#include <asm/system_misc.h> #define PSCI_POWER_STATE_TYPE_STANDBY 0 #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 @@ -54,6 +56,8 @@ enum psci_function { PSCI_FN_CPU_ON, PSCI_FN_CPU_OFF, PSCI_FN_MIGRATE, + PSCI_FN_SYSTEM_RESET, + PSCI_FN_SYSTEM_OFF, PSCI_FN_MAX, }; @@ -187,6 +191,16 @@ static int psci_migrate(unsigned long cpuid) return psci_to_linux_errno(err); } +static void psci_sys_reset(char str, const char *cmd) +{ + invoke_psci_fn(psci_function_id[PSCI_FN_SYSTEM_RESET], 0, 0, 0); +} + +static void psci_sys_poweroff(void) +{ + invoke_psci_fn(psci_function_id[PSCI_FN_SYSTEM_OFF], 0, 0, 0); +} + static const struct of_device_id psci_of_match[] __initconst = { { .compatible = "arm,psci", }, {}, @@ -309,6 +323,16 @@ void __init psci_init(void) psci_ops.migrate = psci_migrate; } + if (!of_property_read_u32(np, "sys_reset", &id)) { + psci_function_id[PSCI_FN_SYSTEM_RESET] = id; + arm_pm_restart = psci_sys_reset; + } + + if (!of_property_read_u32(np, "sys_poweroff", &id)) { + psci_function_id[PSCI_FN_SYSTEM_OFF] = id; + pm_power_off = psci_sys_poweroff; + } + out_put_node: of_node_put(np); return; |