blob: 393efe2edf9afb9d8a38d1a16201e78c64881026 [file] [log] [blame]
Mark Rutlandbff60792015-07-31 15:46:16 +01001/*
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
23bool psci_tos_resident_on(int cpu);
Lorenzo Pieralisi068654c2015-05-26 16:49:01 +010024bool psci_power_state_loses_context(u32 state);
25bool psci_power_state_is_valid(u32 state);
Mark Rutlandbff60792015-07-31 15:46:16 +010026
Lorenzo Pieralisi8b6f2492016-02-01 18:01:30 +010027int psci_cpu_init_idle(unsigned int cpu);
28int psci_cpu_suspend_enter(unsigned long index);
29
Mark Rutlandbff60792015-07-31 15:46:16 +010030struct psci_operations {
31 int (*cpu_suspend)(u32 state, unsigned long entry_point);
32 int (*cpu_off)(u32 state);
33 int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);
34 int (*migrate)(unsigned long cpuid);
35 int (*affinity_info)(unsigned long target_affinity,
36 unsigned long lowest_affinity_level);
37 int (*migrate_info_type)(void);
38};
39
40extern struct psci_operations psci_ops;
41
42#if defined(CONFIG_ARM_PSCI_FW)
43int __init psci_dt_init(void);
44#else
45static inline int psci_dt_init(void) { return 0; }
46#endif
47
48#if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI)
49int __init psci_acpi_init(void);
50bool __init acpi_psci_present(void);
51bool __init acpi_psci_use_hvc(void);
52#else
53static inline int psci_acpi_init(void) { return 0; }
54static inline bool acpi_psci_present(void) { return false; }
55#endif
56
57#endif /* __LINUX_PSCI_H */