mt_spm_rc_internal.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2022, 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_SRAM_SLEEP_DEFAULT_FLAG (SPM_FLAG_DISABLE_DRAMC_MCU_SRAM_SLEEP)
  10. #define SPM_FLAG_SRAM_SLEEP_CTRL \
  11. (SPM_FLAG_DISABLE_SSPM_SRAM_SLEEP | \
  12. SPM_FLAG_DISABLE_DRAMC_MCU_SRAM_SLEEP | \
  13. SPM_FLAG_DISABLE_SYSRAM_SLEEP | \
  14. SPM_FLAG_DISABLE_MCUPM_SRAM_SLEEP | \
  15. SPM_FLAG_DISABLE_SRAM_EVENT)
  16. /* cpu buck/ldo constraint function */
  17. bool spm_is_valid_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
  18. unsigned int spm_allow_rc_cpu_buck_ldo(int state_id);
  19. int spm_run_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
  20. int spm_reset_rc_cpu_buck_ldo(unsigned int cpu, int state_id);
  21. /* spm resource dram constraint function */
  22. bool spm_is_valid_rc_dram(unsigned int cpu, int state_id);
  23. int spm_update_rc_dram(int state_id, int type, const void *val);
  24. unsigned int spm_allow_rc_dram(int state_id);
  25. int spm_run_rc_dram(unsigned int cpu, int state_id);
  26. int spm_reset_rc_dram(unsigned int cpu, int state_id);
  27. /* spm resource syspll constraint function */
  28. bool spm_is_valid_rc_syspll(unsigned int cpu, int state_id);
  29. int spm_update_rc_syspll(int state_id, int type, const void *val);
  30. unsigned int spm_allow_rc_syspll(int state_id);
  31. int spm_run_rc_syspll(unsigned int cpu, int state_id);
  32. int spm_reset_rc_syspll(unsigned int cpu, int state_id);
  33. /* spm resource bus26m constraint function */
  34. bool spm_is_valid_rc_bus26m(unsigned int cpu, int state_id);
  35. int spm_update_rc_bus26m(int state_id, int type, const void *val);
  36. unsigned int spm_allow_rc_bus26m(int state_id);
  37. int spm_run_rc_bus26m(unsigned int cpu, int state_id);
  38. int spm_reset_rc_bus26m(unsigned int cpu, int state_id);
  39. #endif /* MT_SPM_RC_INTERNAL_H */