mt_spm_rc_api.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*
  2. * Copyright (c) 2023, MediaTek Inc. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef MT_SPM_RC_API_H
  7. #define MT_SPM_RC_API_H
  8. #include <mt_spm.h>
  9. #include <mt_spm_cond.h>
  10. #include <mt_spm_constraint.h>
  11. #include <mt_spm_internal.h>
  12. #define SPM_RC_BITS_SET(dest, src) ({ (dest) |= (src); })
  13. #define SPM_RC_BITS_CLR(dest, src) ({ (dest) &= (~src); })
  14. int spm_rc_condition_modifier(unsigned int id, unsigned int act,
  15. const void *val,
  16. enum mt_spm_rm_rc_type dest_rc_id,
  17. struct mt_spm_cond_tables * const tlb);
  18. int spm_rc_constraint_status_get(unsigned int id, unsigned int type,
  19. unsigned int act,
  20. enum mt_spm_rm_rc_type dest_rc_id,
  21. struct constraint_status * const src,
  22. struct constraint_status * const dest);
  23. int spm_rc_constraint_status_set(unsigned int id, unsigned int type,
  24. unsigned int act,
  25. enum mt_spm_rm_rc_type dest_rc_id,
  26. struct constraint_status * const src,
  27. struct constraint_status * const dest);
  28. int spm_rc_constraint_valid_set(enum mt_spm_rm_rc_type id,
  29. enum mt_spm_rm_rc_type dest_rc_id,
  30. unsigned int valid,
  31. struct constraint_status * const dest);
  32. int spm_rc_constraint_valid_clr(enum mt_spm_rm_rc_type id,
  33. enum mt_spm_rm_rc_type dest_rc_id,
  34. unsigned int valid,
  35. struct constraint_status * const dest);
  36. #endif