psci.h 867 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright 2020 Carlo Caione <ccaione@baylibre.com>
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. */
  6. #ifndef ZEPHYR_INCLUDE_DRIVERS_PM_CPU_OPS_PSCI_H_
  7. #define ZEPHYR_INCLUDE_DRIVERS_PM_CPU_OPS_PSCI_H_
  8. #include <zephyr/types.h>
  9. #include <arch/arm64/arm-smccc.h>
  10. #include <stddef.h>
  11. #include <device.h>
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. /* PSCI version decoding (independent of PSCI version) */
  16. #define PSCI_VERSION_MAJOR_SHIFT 16
  17. #define PSCI_VERSION_MINOR_MASK \
  18. ((1U << PSCI_VERSION_MAJOR_SHIFT) - 1)
  19. #define PSCI_VERSION_MAJOR_MASK ~PSCI_VERSION_MINOR_MASK
  20. #define PSCI_VERSION_MAJOR(ver) \
  21. (((ver) & PSCI_VERSION_MAJOR_MASK) >> PSCI_VERSION_MAJOR_SHIFT)
  22. #define PSCI_VERSION_MINOR(ver) \
  23. ((ver) & PSCI_VERSION_MINOR_MASK)
  24. uint32_t psci_version(void);
  25. #ifdef __cplusplus
  26. }
  27. #endif
  28. #endif /* ZEPHYR_INCLUDE_DRIVERS_PM_CPU_OPS_PSCI_H_ */