psci.h 1.5 KB

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