mt_spm_resource_req.h 947 B

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (c) 2022, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_SPM_RESOURCE_REQ_H
  7. #define MT_SPM_RESOURCE_REQ_H
  8. /* SPM resource request internal bit */
  9. #define MT_SPM_BIT_XO_FPM (0U)
  10. #define MT_SPM_BIT_26M (1U)
  11. #define MT_SPM_BIT_INFRA (2U)
  12. #define MT_SPM_BIT_SYSPLL (3U)
  13. #define MT_SPM_BIT_DRAM_S0 (4U)
  14. #define MT_SPM_BIT_DRAM_S1 (5U)
  15. /* SPM resource request internal bit_mask */
  16. #define MT_SPM_XO_FPM BIT(MT_SPM_BIT_XO_FPM)
  17. #define MT_SPM_26M BIT(MT_SPM_BIT_26M)
  18. #define MT_SPM_INFRA BIT(MT_SPM_BIT_INFRA)
  19. #define MT_SPM_SYSPLL BIT(MT_SPM_BIT_SYSPLL)
  20. #define MT_SPM_DRAM_S0 BIT(MT_SPM_BIT_DRAM_S0)
  21. #define MT_SPM_DRAM_S1 BIT(MT_SPM_BIT_DRAM_S1)
  22. char spm_resource_req(unsigned int user, unsigned int req_mask);
  23. #define IS_PLAT_SUSPEND_ID(stateid)\
  24. ((stateid == MT_PLAT_PWR_STATE_SUSPEND2IDLE)\
  25. || (stateid == MT_PLAT_PWR_STATE_SYSTEM_SUSPEND))
  26. #endif /* MT_SPM_RESOURCE_REQ_H */