]>
Commit | Line | Data |
---|---|---|
1802d0be | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
bff60792 | 2 | /* |
bff60792 MR |
3 | * |
4 | * Copyright (C) 2015 ARM Limited | |
5 | */ | |
6 | ||
7 | #ifndef __LINUX_PSCI_H | |
8 | #define __LINUX_PSCI_H | |
9 | ||
10 | #include <linux/init.h> | |
11 | #include <linux/types.h> | |
12 | ||
13 | #define PSCI_POWER_STATE_TYPE_STANDBY 0 | |
14 | #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 | |
15 | ||
16 | bool psci_tos_resident_on(int cpu); | |
17 | ||
9ffeb6d0 LP |
18 | int psci_cpu_suspend_enter(u32 state); |
19 | bool psci_power_state_is_valid(u32 state); | |
8b6f2499 | 20 | |
09a8d6d4 MZ |
21 | enum psci_conduit { |
22 | PSCI_CONDUIT_NONE, | |
23 | PSCI_CONDUIT_SMC, | |
24 | PSCI_CONDUIT_HVC, | |
25 | }; | |
26 | ||
e78eef55 MZ |
27 | enum smccc_version { |
28 | SMCCC_VERSION_1_0, | |
29 | SMCCC_VERSION_1_1, | |
30 | }; | |
31 | ||
bff60792 | 32 | struct psci_operations { |
d68e3ba5 | 33 | u32 (*get_version)(void); |
bff60792 MR |
34 | int (*cpu_suspend)(u32 state, unsigned long entry_point); |
35 | int (*cpu_off)(u32 state); | |
36 | int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); | |
37 | int (*migrate)(unsigned long cpuid); | |
38 | int (*affinity_info)(unsigned long target_affinity, | |
39 | unsigned long lowest_affinity_level); | |
40 | int (*migrate_info_type)(void); | |
09a8d6d4 | 41 | enum psci_conduit conduit; |
e78eef55 | 42 | enum smccc_version smccc_version; |
bff60792 MR |
43 | }; |
44 | ||
45 | extern struct psci_operations psci_ops; | |
46 | ||
47 | #if defined(CONFIG_ARM_PSCI_FW) | |
48 | int __init psci_dt_init(void); | |
49 | #else | |
50 | static inline int psci_dt_init(void) { return 0; } | |
51 | #endif | |
52 | ||
53 | #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI) | |
54 | int __init psci_acpi_init(void); | |
55 | bool __init acpi_psci_present(void); | |
fa31ab77 | 56 | bool acpi_psci_use_hvc(void); |
bff60792 MR |
57 | #else |
58 | static inline int psci_acpi_init(void) { return 0; } | |
59 | static inline bool acpi_psci_present(void) { return false; } | |
fa31ab77 | 60 | static inline bool acpi_psci_use_hvc(void) {return false; } |
bff60792 MR |
61 | #endif |
62 | ||
63 | #endif /* __LINUX_PSCI_H */ |