Loading Documentation/devicetree/bindings/arm/psci.txt 0 → 100644 +55 −0 Original line number Diff line number Diff line * Power State Coordination Interface (PSCI) Firmware implementing the PSCI functions described in ARM document number ARM DEN 0022A ("Power State Coordination Interface System Software on ARM processors") can be used by Linux to initiate various CPU-centric power operations. Issue A of the specification describes functions for CPU suspend, hotplug and migration of secure software. Functions are invoked by trapping to the privilege level of the PSCI firmware (specified as part of the binding below) and passing arguments in a manner similar to that specified by AAPCS: r0 => 32-bit Function ID / return value {r1 - r3} => Parameters Note that the immediate field of the trapping instruction must be set to #0. Main node required properties: - compatible : Must be "arm,psci" - method : The method of calling the PSCI firmware. Permitted values are: "smc" : SMC #0, with the register assignments specified in this binding. "hvc" : HVC #0, with the register assignments specified in this binding. Main node optional properties: - cpu_suspend : Function ID for CPU_SUSPEND operation - cpu_off : Function ID for CPU_OFF operation - cpu_on : Function ID for CPU_ON operation - migrate : Function ID for MIGRATE operation Example: psci { compatible = "arm,psci"; method = "smc"; cpu_suspend = <0x95c10000>; cpu_off = <0x95c10001>; cpu_on = <0x95c10002>; migrate = <0x95c10003>; }; arch/arm/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -1622,6 +1622,16 @@ config HOTPLUG_CPU Say Y here to experiment with turning CPUs off and on. CPUs can be controlled through /sys/devices/system/cpu. config ARM_PSCI bool "Support for the ARM Power State Coordination Interface (PSCI)" depends on CPU_V7 help Say Y here if you want Linux to communicate with system firmware implementing the PSCI specification for CPU-centric power management operations described in ARM document number ARM DEN 0022A ("Power State Coordination Interface System Software on ARM processors"). config LOCAL_TIMERS bool "Use local timer interrupts" depends on SMP Loading arch/arm/include/asm/opcodes-sec.h 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2012 ARM Limited */ #ifndef __ASM_ARM_OPCODES_SEC_H #define __ASM_ARM_OPCODES_SEC_H #include <asm/opcodes.h> #define __SMC(imm4) __inst_arm_thumb32( \ 0xE1600070 | (((imm4) & 0xF) << 0), \ 0xF7F08000 | (((imm4) & 0xF) << 16) \ ) #endif /* __ASM_ARM_OPCODES_SEC_H */ arch/arm/include/asm/opcodes.h +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #define __ASM_ARM_OPCODES_H #ifndef __ASSEMBLY__ #include <linux/linkage.h> extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr); #endif Loading arch/arm/include/asm/psci.h 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2012 ARM Limited */ #ifndef __ASM_ARM_PSCI_H #define __ASM_ARM_PSCI_H #define PSCI_POWER_STATE_TYPE_STANDBY 0 #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 struct psci_power_state { u16 id; u8 type; u8 affinity_level; }; struct psci_operations { int (*cpu_suspend)(struct psci_power_state state, unsigned long entry_point); int (*cpu_off)(struct psci_power_state state); int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); int (*migrate)(unsigned long cpuid); }; extern struct psci_operations psci_ops; #endif /* __ASM_ARM_PSCI_H */ Loading
Documentation/devicetree/bindings/arm/psci.txt 0 → 100644 +55 −0 Original line number Diff line number Diff line * Power State Coordination Interface (PSCI) Firmware implementing the PSCI functions described in ARM document number ARM DEN 0022A ("Power State Coordination Interface System Software on ARM processors") can be used by Linux to initiate various CPU-centric power operations. Issue A of the specification describes functions for CPU suspend, hotplug and migration of secure software. Functions are invoked by trapping to the privilege level of the PSCI firmware (specified as part of the binding below) and passing arguments in a manner similar to that specified by AAPCS: r0 => 32-bit Function ID / return value {r1 - r3} => Parameters Note that the immediate field of the trapping instruction must be set to #0. Main node required properties: - compatible : Must be "arm,psci" - method : The method of calling the PSCI firmware. Permitted values are: "smc" : SMC #0, with the register assignments specified in this binding. "hvc" : HVC #0, with the register assignments specified in this binding. Main node optional properties: - cpu_suspend : Function ID for CPU_SUSPEND operation - cpu_off : Function ID for CPU_OFF operation - cpu_on : Function ID for CPU_ON operation - migrate : Function ID for MIGRATE operation Example: psci { compatible = "arm,psci"; method = "smc"; cpu_suspend = <0x95c10000>; cpu_off = <0x95c10001>; cpu_on = <0x95c10002>; migrate = <0x95c10003>; };
arch/arm/Kconfig +10 −0 Original line number Diff line number Diff line Loading @@ -1622,6 +1622,16 @@ config HOTPLUG_CPU Say Y here to experiment with turning CPUs off and on. CPUs can be controlled through /sys/devices/system/cpu. config ARM_PSCI bool "Support for the ARM Power State Coordination Interface (PSCI)" depends on CPU_V7 help Say Y here if you want Linux to communicate with system firmware implementing the PSCI specification for CPU-centric power management operations described in ARM document number ARM DEN 0022A ("Power State Coordination Interface System Software on ARM processors"). config LOCAL_TIMERS bool "Use local timer interrupts" depends on SMP Loading
arch/arm/include/asm/opcodes-sec.h 0 → 100644 +24 −0 Original line number Diff line number Diff line /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2012 ARM Limited */ #ifndef __ASM_ARM_OPCODES_SEC_H #define __ASM_ARM_OPCODES_SEC_H #include <asm/opcodes.h> #define __SMC(imm4) __inst_arm_thumb32( \ 0xE1600070 | (((imm4) & 0xF) << 0), \ 0xF7F08000 | (((imm4) & 0xF) << 16) \ ) #endif /* __ASM_ARM_OPCODES_SEC_H */
arch/arm/include/asm/opcodes.h +1 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,7 @@ #define __ASM_ARM_OPCODES_H #ifndef __ASSEMBLY__ #include <linux/linkage.h> extern asmlinkage unsigned int arm_check_condition(u32 opcode, u32 psr); #endif Loading
arch/arm/include/asm/psci.h 0 → 100644 +36 −0 Original line number Diff line number Diff line /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * Copyright (C) 2012 ARM Limited */ #ifndef __ASM_ARM_PSCI_H #define __ASM_ARM_PSCI_H #define PSCI_POWER_STATE_TYPE_STANDBY 0 #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 struct psci_power_state { u16 id; u8 type; u8 affinity_level; }; struct psci_operations { int (*cpu_suspend)(struct psci_power_state state, unsigned long entry_point); int (*cpu_off)(struct psci_power_state state); int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); int (*migrate)(unsigned long cpuid); }; extern struct psci_operations psci_ops; #endif /* __ASM_ARM_PSCI_H */