psci.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. struct psci_operations {
  21. int (*cpu_suspend)(u32 state, unsigned long entry_point);
  22. int (*cpu_off)(u32 state);
  23. int (*cpu_on)(unsigned long cpuid, unsigned long entry_point);
  24. int (*migrate)(unsigned long cpuid);
  25. int (*affinity_info)(unsigned long target_affinity,
  26. unsigned long lowest_affinity_level);
  27. int (*migrate_info_type)(void);
  28. };
  29. extern struct psci_operations psci_ops;
  30. #if defined(CONFIG_ARM_PSCI_FW)
  31. int __init psci_dt_init(void);
  32. #else
  33. static inline int psci_dt_init(void) { return 0; }
  34. #endif
  35. #if defined(CONFIG_ARM_PSCI_FW) && defined(CONFIG_ACPI)
  36. int __init psci_acpi_init(void);
  37. bool __init acpi_psci_present(void);
  38. bool __init acpi_psci_use_hvc(void);
  39. #else
  40. static inline int psci_acpi_init(void) { return 0; }
  41. static inline bool acpi_psci_present(void) { return false; }
  42. #endif
  43. #endif /* __LINUX_PSCI_H */