at v5.7 1.5 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * 4 * Copyright (C) 2015 ARM Limited 5 */ 6 7#ifndef __LINUX_PSCI_H 8#define __LINUX_PSCI_H 9 10#include <linux/arm-smccc.h> 11#include <linux/init.h> 12#include <linux/types.h> 13 14#define PSCI_POWER_STATE_TYPE_STANDBY 0 15#define PSCI_POWER_STATE_TYPE_POWER_DOWN 1 16 17bool psci_tos_resident_on(int cpu); 18 19int psci_cpu_suspend_enter(u32 state); 20bool psci_power_state_is_valid(u32 state); 21int psci_set_osi_mode(void); 22bool psci_has_osi_support(void); 23 24enum smccc_version { 25 SMCCC_VERSION_1_0, 26 SMCCC_VERSION_1_1, 27}; 28 29struct psci_operations { 30 u32 (*get_version)(void); 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 enum arm_smccc_conduit conduit; 39 enum smccc_version smccc_version; 40}; 41 42extern struct psci_operations psci_ops; 43 44#if defined(CONFIG_ARM_PSCI_FW) 45int __init psci_dt_init(void); 46#else 47static inline int psci_dt_init(void) { return 0; } 48#endif 49 50#if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI) 51int __init psci_acpi_init(void); 52bool __init acpi_psci_present(void); 53bool acpi_psci_use_hvc(void); 54#else 55static inline int psci_acpi_init(void) { return 0; } 56static inline bool acpi_psci_present(void) { return false; } 57static inline bool acpi_psci_use_hvc(void) {return false; } 58#endif 59 60#endif /* __LINUX_PSCI_H */