plat_pm.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /*
  2. * Copyright (c) 2020, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef PLAT_PM_H
  7. #define PLAT_PM_H
  8. #include <lib/utils_def.h>
  9. #define MT_PLAT_PWR_STATE_CPU U(1)
  10. #define MT_PLAT_PWR_STATE_CLUSTER U(2)
  11. #define MT_PLAT_PWR_STATE_MCUSYS U(3)
  12. #define MT_PLAT_PWR_STATE_SUSPEND2IDLE U(8)
  13. #define MT_PLAT_PWR_STATE_SYSTEM_SUSPEND U(9)
  14. #define MTK_LOCAL_STATE_RUN U(0)
  15. #define MTK_LOCAL_STATE_RET U(1)
  16. #define MTK_LOCAL_STATE_OFF U(2)
  17. #define MTK_AFFLVL_CPU U(0)
  18. #define MTK_AFFLVL_CLUSTER U(1)
  19. #define MTK_AFFLVL_MCUSYS U(2)
  20. #define MTK_AFFLVL_SYSTEM U(3)
  21. #define IS_CLUSTER_OFF_STATE(s) \
  22. is_local_state_off(s->pwr_domain_state[MTK_AFFLVL_CLUSTER])
  23. #define IS_MCUSYS_OFF_STATE(s) \
  24. is_local_state_off(s->pwr_domain_state[MTK_AFFLVL_MCUSYS])
  25. #define IS_SYSTEM_SUSPEND_STATE(s) \
  26. is_local_state_off(s->pwr_domain_state[MTK_AFFLVL_SYSTEM])
  27. #define IS_PLAT_SUSPEND_ID(stateid)\
  28. ((stateid == MT_PLAT_PWR_STATE_SUSPEND2IDLE) \
  29. || (stateid == MT_PLAT_PWR_STATE_SYSTEM_SUSPEND))
  30. #endif /* PLAT_PM_H */