Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *
0004  * Copyright (C) 2015 ARM Limited
0005  */
0006 
0007 #ifndef __LINUX_PSCI_H
0008 #define __LINUX_PSCI_H
0009 
0010 #include <linux/arm-smccc.h>
0011 #include <linux/init.h>
0012 #include <linux/types.h>
0013 
0014 #define PSCI_POWER_STATE_TYPE_STANDBY       0
0015 #define PSCI_POWER_STATE_TYPE_POWER_DOWN    1
0016 
0017 bool psci_tos_resident_on(int cpu);
0018 
0019 int psci_cpu_suspend_enter(u32 state);
0020 bool psci_power_state_is_valid(u32 state);
0021 int psci_set_osi_mode(bool enable);
0022 bool psci_has_osi_support(void);
0023 
0024 struct psci_operations {
0025     u32 (*get_version)(void);
0026     int (*cpu_suspend)(u32 state, unsigned long entry_point);
0027     int (*cpu_off)(u32 state);
0028     int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);
0029     int (*migrate)(unsigned long cpuid);
0030     int (*affinity_info)(unsigned long target_affinity,
0031             unsigned long lowest_affinity_level);
0032     int (*migrate_info_type)(void);
0033 };
0034 
0035 extern struct psci_operations psci_ops;
0036 
0037 struct psci_0_1_function_ids {
0038     u32 cpu_suspend;
0039     u32 cpu_on;
0040     u32 cpu_off;
0041     u32 migrate;
0042 };
0043 
0044 struct psci_0_1_function_ids get_psci_0_1_function_ids(void);
0045 
0046 #if defined(CONFIG_ARM_PSCI_FW)
0047 int __init psci_dt_init(void);
0048 #else
0049 static inline int psci_dt_init(void) { return 0; }
0050 #endif
0051 
0052 #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI)
0053 int __init psci_acpi_init(void);
0054 bool __init acpi_psci_present(void);
0055 bool acpi_psci_use_hvc(void);
0056 #else
0057 static inline int psci_acpi_init(void) { return 0; }
0058 static inline bool acpi_psci_present(void) { return false; }
0059 static inline bool acpi_psci_use_hvc(void) {return false; }
0060 #endif
0061 
0062 #endif /* __LINUX_PSCI_H */