pm_common.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright (c) 2013-2018, ARM Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. /*
  7. * Contains definitions of commonly used macros and data types needed
  8. * for PU Power Management. This file should be common for all PU's.
  9. */
  10. #ifndef PM_COMMON_H
  11. #define PM_COMMON_H
  12. #include <stdint.h>
  13. #include <plat_pm_common.h>
  14. #if IPI_CRC_CHECK
  15. #define PAYLOAD_ARG_CNT 8U
  16. #define IPI_W0_TO_W6_SIZE 28U
  17. #define PAYLOAD_CRC_POS 7U
  18. #define CRC_INIT_VALUE 0x4F4EU
  19. #define CRC_ORDER 16U
  20. #define CRC_POLYNOM 0x8005U
  21. #else
  22. #define PAYLOAD_ARG_CNT 6U
  23. #endif
  24. #define PAYLOAD_ARG_SIZE 4U /* size in bytes */
  25. #define TZ_VERSION_MAJOR 1
  26. #define TZ_VERSION_MINOR 0
  27. #define TZ_VERSION ((TZ_VERSION_MAJOR << 16) | \
  28. TZ_VERSION_MINOR)
  29. /**
  30. * pm_ipi - struct for capturing IPI-channel specific info
  31. * @local_ipi_id Local IPI agent ID
  32. * @remote_ipi_id Remote IPI Agent ID
  33. * @buffer_base base address for payload buffer
  34. */
  35. struct pm_ipi {
  36. const uint32_t local_ipi_id;
  37. const uint32_t remote_ipi_id;
  38. const uintptr_t buffer_base;
  39. };
  40. /**
  41. * pm_proc - struct for capturing processor related info
  42. * @node_id node-ID of the processor
  43. * @pwrdn_mask cpu-specific mask to be used for power control register
  44. * @ipi pointer to IPI channel structure
  45. * (in APU all processors share one IPI channel)
  46. */
  47. struct pm_proc {
  48. const uint32_t node_id;
  49. const uint32_t pwrdn_mask;
  50. const struct pm_ipi *ipi;
  51. };
  52. const struct pm_proc *pm_get_proc(uint32_t cpuid);
  53. #endif /* PM_COMMON_H */