mt_spm_rc_internal.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2021, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_SPM_RC_INTERNAL_H
  7. #define MT_SPM_RC_INTERNAL_H
  8. #include <stdbool.h>
  9. #define SPM_FLAG_SRAM_SLEEP_CTRL \
  10. (SPM_FLAG_DISABLE_SSPM_SRAM_SLEEP | \
  11. SPM_FLAG_DISABLE_DRAMC_MCU_SRAM_SLEEP | \
  12. SPM_FLAG_DISABLE_SYSRAM_SLEEP)
  13. /* cpu buck/ldo constraint function */
  14. bool spm_is_valid_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
  15. unsigned int spm_allow_rc_cpu_buck_ldo(int state_id);
  16. int spm_run_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
  17. int spm_reset_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
  18. /* spm resource dram constraint function */
  19. bool spm_is_valid_rc_dram(unsigned int cpu, int state_id);
  20. int spm_update_rc_dram(int state_id, int type, const void *val);
  21. unsigned int spm_allow_rc_dram(int state_id);
  22. int spm_run_rc_dram(unsigned int cpu, int state_id);
  23. int spm_reset_rc_dram(unsigned int cpu, int state_id);
  24. /* spm resource syspll constraint function */
  25. bool spm_is_valid_rc_syspll(unsigned int cpu, int state_id);
  26. int spm_update_rc_syspll(int state_id, int type, const void *val);
  27. unsigned int spm_allow_rc_syspll(int state_id);
  28. int spm_run_rc_syspll(unsigned int cpu, int state_id);
  29. int spm_reset_rc_syspll(unsigned int cpu, int state_id);
  30. /* spm resource bus26m constraint function */
  31. bool spm_is_valid_rc_bus26m(unsigned int cpu, int state_id);
  32. int spm_update_rc_bus26m(int state_id, int type, const void *val);
  33. unsigned int spm_allow_rc_bus26m(int state_id);
  34. int spm_run_rc_bus26m(unsigned int cpu, int state_id);
  35. int spm_reset_rc_bus26m(unsigned int cpu, int state_id);
  36. #endif /* MT_SPM_RC_INTERNAL_H */