pm_common.h 1.7 KB

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