blob: e2bacc6fd2f2d93710cd65d9751a2d1db0b04b37 [file] [log] [blame]
David Brazdil0f672f62019-12-10 10:32:29 +00001/* SPDX-License-Identifier: GPL-2.0-only */
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00002/*
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00003 *
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
16bool psci_tos_resident_on(int cpu);
17
David Brazdil0f672f62019-12-10 10:32:29 +000018int psci_cpu_suspend_enter(u32 state);
19bool psci_power_state_is_valid(u32 state);
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000020
21enum psci_conduit {
22 PSCI_CONDUIT_NONE,
23 PSCI_CONDUIT_SMC,
24 PSCI_CONDUIT_HVC,
25};
26
27enum smccc_version {
28 SMCCC_VERSION_1_0,
29 SMCCC_VERSION_1_1,
30};
31
32struct psci_operations {
33 u32 (*get_version)(void);
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);
41 enum psci_conduit conduit;
42 enum smccc_version smccc_version;
43};
44
45extern struct psci_operations psci_ops;
46
47#if defined(CONFIG_ARM_PSCI_FW)
48int __init psci_dt_init(void);
49#else
50static inline int psci_dt_init(void) { return 0; }
51#endif
52
53#if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI)
54int __init psci_acpi_init(void);
55bool __init acpi_psci_present(void);
56bool acpi_psci_use_hvc(void);
57#else
58static inline int psci_acpi_init(void) { return 0; }
59static inline bool acpi_psci_present(void) { return false; }
60static inline bool acpi_psci_use_hvc(void) {return false; }
61#endif
62
63#endif /* __LINUX_PSCI_H */