11802d0beSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 2bff60792SMark Rutland /* 3bff60792SMark Rutland * 4bff60792SMark Rutland * Copyright (C) 2015 ARM Limited 5bff60792SMark Rutland */ 6bff60792SMark Rutland 7bff60792SMark Rutland #ifndef __LINUX_PSCI_H 8bff60792SMark Rutland #define __LINUX_PSCI_H 9bff60792SMark Rutland 10a5520eacSMark Rutland #include <linux/arm-smccc.h> 11bff60792SMark Rutland #include <linux/init.h> 12bff60792SMark Rutland #include <linux/types.h> 13bff60792SMark Rutland 14bff60792SMark Rutland #define PSCI_POWER_STATE_TYPE_STANDBY 0 15bff60792SMark Rutland #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 16bff60792SMark Rutland 17bff60792SMark Rutland bool psci_tos_resident_on(int cpu); 18bff60792SMark Rutland 199ffeb6d0SLorenzo Pieralisi int psci_cpu_suspend_enter(u32 state); 209ffeb6d0SLorenzo Pieralisi bool psci_power_state_is_valid(u32 state); 21*10942019SUlf Hansson int psci_set_osi_mode(bool enable); 2249fdcd75SUlf Hansson bool psci_has_osi_support(void); 238b6f2499SLorenzo Pieralisi 24bff60792SMark Rutland struct psci_operations { 25d68e3ba5SWill Deacon u32 (*get_version)(void); 26bff60792SMark Rutland int (*cpu_suspend)(u32 state, unsigned long entry_point); 27bff60792SMark Rutland int (*cpu_off)(u32 state); 28bff60792SMark Rutland int (*cpu_on)(unsigned long cpuid, unsigned long entry_point); 29bff60792SMark Rutland int (*migrate)(unsigned long cpuid); 30bff60792SMark Rutland int (*affinity_info)(unsigned long target_affinity, 31bff60792SMark Rutland unsigned long lowest_affinity_level); 32bff60792SMark Rutland int (*migrate_info_type)(void); 33bff60792SMark Rutland }; 34bff60792SMark Rutland 35bff60792SMark Rutland extern struct psci_operations psci_ops; 36bff60792SMark Rutland 37bff60792SMark Rutland #if defined(CONFIG_ARM_PSCI_FW) 38bff60792SMark Rutland int __init psci_dt_init(void); 39bff60792SMark Rutland #else 40bff60792SMark Rutland static inline int psci_dt_init(void) { return 0; } 41bff60792SMark Rutland #endif 42bff60792SMark Rutland 43bff60792SMark Rutland #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI) 44bff60792SMark Rutland int __init psci_acpi_init(void); 45bff60792SMark Rutland bool __init acpi_psci_present(void); 46fa31ab77SJames Morse bool acpi_psci_use_hvc(void); 47bff60792SMark Rutland #else 48bff60792SMark Rutland static inline int psci_acpi_init(void) { return 0; } 49bff60792SMark Rutland static inline bool acpi_psci_present(void) { return false; } 50fa31ab77SJames Morse static inline bool acpi_psci_use_hvc(void) {return false; } 51bff60792SMark Rutland #endif 52bff60792SMark Rutland 53bff60792SMark Rutland #endif /* __LINUX_PSCI_H */ 54