diff options
author | Mark Rutland <mark.rutland@arm.com> | 2015-07-31 10:46:16 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2015-08-03 07:33:39 -0400 |
commit | bff60792f994a87324ab57e89e945b4572b1ef77 (patch) | |
tree | 6621042fdbf61a747dd7f7c094db8e8bfe17087a /include/linux/psci.h | |
parent | bc0195aad0daa2ad5b0d76cce22b167bc3435590 (diff) |
arm64: psci: factor invocation code to drivers
To enable sharing with arm, move the core PSCI framework code to
drivers/firmware. This results in a minor gain in lines of code, but
this will quickly be amortised by the removal of code currently
duplicated in arch/arm.
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'include/linux/psci.h')
-rw-r--r-- | include/linux/psci.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/include/linux/psci.h b/include/linux/psci.h new file mode 100644 index 000000000000..a682fcc91c33 --- /dev/null +++ b/include/linux/psci.h | |||
@@ -0,0 +1,52 @@ | |||
1 | /* | ||
2 | * This program is free software; you can redistribute it and/or modify | ||
3 | * it under the terms of the GNU General Public License version 2 as | ||
4 | * published by the Free Software Foundation. | ||
5 | * | ||
6 | * This program is distributed in the hope that it will be useful, | ||
7 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
8 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
9 | * GNU General Public License for more details. | ||
10 | * | ||
11 | * Copyright (C) 2015 ARM Limited | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_PSCI_H | ||
15 | #define __LINUX_PSCI_H | ||
16 | |||
17 | #include <linux/init.h> | ||
18 | #include <linux/types.h> | ||
19 | |||
20 | #define PSCI_POWER_STATE_TYPE_STANDBY 0 | ||
21 | #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 | ||
22 | |||
23 | bool psci_tos_resident_on(int cpu); | ||
24 | |||
25 | struct psci_operations { | ||
26 | int (*cpu_suspend)(u32 state, unsigned long entry_point); | ||
27 | int (*cpu_off)(u32 state); | ||
28 | int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); | ||
29 | int (*migrate)(unsigned long cpuid); | ||
30 | int (*affinity_info)(unsigned long target_affinity, | ||
31 | unsigned long lowest_affinity_level); | ||
32 | int (*migrate_info_type)(void); | ||
33 | }; | ||
34 | |||
35 | extern struct psci_operations psci_ops; | ||
36 | |||
37 | #if defined(CONFIG_ARM_PSCI_FW) | ||
38 | int __init psci_dt_init(void); | ||
39 | #else | ||
40 | static inline int psci_dt_init(void) { return 0; } | ||
41 | #endif | ||
42 | |||
43 | #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI) | ||
44 | int __init psci_acpi_init(void); | ||
45 | bool __init acpi_psci_present(void); | ||
46 | bool __init acpi_psci_use_hvc(void); | ||
47 | #else | ||
48 | static inline int psci_acpi_init(void) { return 0; } | ||
49 | static inline bool acpi_psci_present(void) { return false; } | ||
50 | #endif | ||
51 | |||
52 | #endif /* __LINUX_PSCI_H */ | ||