developer | 451d49d | 2022-11-16 21:52:21 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2023, MediaTek Inc. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #ifndef MT_SPM_RC_API_H |
| 8 | #define MT_SPM_RC_API_H |
| 9 | |
| 10 | #include <mt_spm.h> |
| 11 | #include <mt_spm_cond.h> |
| 12 | #include <mt_spm_constraint.h> |
| 13 | #include <mt_spm_internal.h> |
| 14 | |
| 15 | #define SPM_RC_BITS_SET(dest, src) ({ (dest) |= (src); }) |
| 16 | #define SPM_RC_BITS_CLR(dest, src) ({ (dest) &= (~src); }) |
| 17 | |
| 18 | int spm_rc_condition_modifier(unsigned int id, unsigned int act, |
| 19 | const void *val, |
| 20 | enum mt_spm_rm_rc_type dest_rc_id, |
| 21 | struct mt_spm_cond_tables * const tlb); |
| 22 | |
| 23 | int spm_rc_constraint_status_get(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 | |
| 29 | int spm_rc_constraint_status_set(unsigned int id, unsigned int type, |
| 30 | unsigned int act, |
| 31 | enum mt_spm_rm_rc_type dest_rc_id, |
| 32 | struct constraint_status * const src, |
| 33 | struct constraint_status * const dest); |
| 34 | |
| 35 | int spm_rc_constraint_valid_set(enum mt_spm_rm_rc_type id, |
| 36 | enum mt_spm_rm_rc_type dest_rc_id, |
| 37 | unsigned int valid, |
| 38 | struct constraint_status * const dest); |
| 39 | |
| 40 | int spm_rc_constraint_valid_clr(enum mt_spm_rm_rc_type id, |
| 41 | enum mt_spm_rm_rc_type dest_rc_id, |
| 42 | unsigned int valid, |
| 43 | struct constraint_status * const dest); |
| 44 | |
| 45 | #endif |