plat_mtk_lpm.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2021, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PLAT_MTK_LPM_H
  7. #define PLAT_MTK_LPM_H
  8. #include <lib/psci/psci.h>
  9. #include <lib/utils_def.h>
  10. #define MT_IRQ_REMAIN_MAX U(32)
  11. #define MT_IRQ_REMAIN_CAT_LOG BIT(31)
  12. struct mt_irqremain {
  13. unsigned int count;
  14. unsigned int irqs[MT_IRQ_REMAIN_MAX];
  15. unsigned int wakeupsrc_cat[MT_IRQ_REMAIN_MAX];
  16. unsigned int wakeupsrc[MT_IRQ_REMAIN_MAX];
  17. };
  18. #define PLAT_RC_STATUS_READY BIT(0)
  19. #define PLAT_RC_STATUS_FEATURE_EN BIT(1)
  20. #define PLAT_RC_STATUS_UART_NONSLEEP BIT(31)
  21. struct mt_lpm_tz {
  22. int (*pwr_prompt)(unsigned int cpu, const psci_power_state_t *state);
  23. int (*pwr_reflect)(unsigned int cpu, const psci_power_state_t *state);
  24. int (*pwr_cpu_on)(unsigned int cpu, const psci_power_state_t *state);
  25. int (*pwr_cpu_dwn)(unsigned int cpu, const psci_power_state_t *state);
  26. int (*pwr_cluster_on)(unsigned int cpu,
  27. const psci_power_state_t *state);
  28. int (*pwr_cluster_dwn)(unsigned int cpu,
  29. const psci_power_state_t *state);
  30. int (*pwr_mcusys_on)(unsigned int cpu, const psci_power_state_t *state);
  31. int (*pwr_mcusys_on_finished)(unsigned int cpu,
  32. const psci_power_state_t *state);
  33. int (*pwr_mcusys_dwn)(unsigned int cpu,
  34. const psci_power_state_t *state);
  35. };
  36. const struct mt_lpm_tz *mt_plat_cpu_pm_init(void);
  37. #endif /* PLAT_MTK_LPM_H */