psci.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  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. #ifndef __LINUX_PSCI_H
  14. #define __LINUX_PSCI_H
  15. #include <linux/init.h>
  16. #include <linux/types.h>
  17. #define PSCI_POWER_STATE_TYPE_STANDBY 0
  18. #define PSCI_POWER_STATE_TYPE_POWER_DOWN 1
  19. bool psci_tos_resident_on(int cpu);
  20. int psci_cpu_init_idle(unsigned int cpu);
  21. int psci_cpu_suspend_enter(unsigned long index);
  22. struct psci_operations {
  23. u32 (*get_version)(void);
  24. int (*cpu_suspend)(u32 state, unsigned long entry_point);
  25. int (*cpu_off)(u32 state);
  26. int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);
  27. int (*migrate)(unsigned long cpuid);
  28. int (*affinity_info)(unsigned long target_affinity,
  29. unsigned long lowest_affinity_level);
  30. int (*migrate_info_type)(void);
  31. };
  32. extern struct psci_operations psci_ops;
  33. #if defined(CONFIG_ARM_PSCI_FW)
  34. int __init psci_dt_init(void);
  35. #else
  36. static inline int psci_dt_init(void) { return 0; }
  37. #endif
  38. #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI)
  39. int __init psci_acpi_init(void);
  40. bool __init acpi_psci_present(void);
  41. bool acpi_psci_use_hvc(void);
  42. #else
  43. static inline int psci_acpi_init(void) { return 0; }
  44. static inline bool acpi_psci_present(void) { return false; }
  45. static inline bool acpi_psci_use_hvc(void) {return false; }
  46. #endif
  47. #endif /* __LINUX_PSCI_H */