11#include "fsl_common.h"
22#define FSL_XRDC2_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
25#define XRDC2_EAL_FORCE_RELEASE_MAGIC_0 0x02000046UL
26#define XRDC2_EAL_FORCE_RELEASE_MAGIC_1 0x02000052UL
28#define XRDC2_EAL_DISABLE (0UL << XRDC2_MSC_MSAC_W1_EAL_SHIFT)
29#define XRDC2_EAL_DISABLE_UNTIL_RESET (1UL << XRDC2_MSC_MSAC_W1_EAL_SHIFT)
30#define XRDC2_EAL_UNLOCKED (2UL << XRDC2_MSC_MSAC_W1_EAL_SHIFT)
31#define XRDC2_EAL_LOCKED (3UL << XRDC2_MSC_MSAC_W1_EAL_SHIFT)
33#define XRDC2_EAL_MASK XRDC2_MSC_MSAC_W1_EAL_MASK
91 kXRDC2_AccessPolicyNone = 0U,
92 kXRDC2_AccessPolicyAlt1 = 1U,
93 kXRDC2_AccessPolicyAlt2 = 2U,
94 kXRDC2_AccessPolicyAlt3 = 3U,
95 kXRDC2_AccessPolicyAlt4 = 4U,
96 kXRDC2_AccessPolicyAlt5 = 5U,
97 kXRDC2_AccessPolicyAlt6 = 6U,
98 kXRDC2_AccessPolicyAll = 7U
145#if defined(__cplusplus)
187static inline uint8_t XRDC2_GetCurrentMasterDomainId(
XRDC2_Type *base)
189#if defined(XRDC2_SR_DIN_MASK)
190 return (uint8_t)((base->SR & XRDC2_SR_DIN_MASK) >> XRDC2_SR_DIN_SHIFT);
192 return (uint8_t)((base->SR & XRDC2_SR_DID_MASK) >> XRDC2_SR_DID_SHIFT);
206 base->MCR = (base->MCR & ~XRDC2_MCR_GCL_MASK) |
XRDC2_MCR_GCL(mode);
215static inline uint8_t XRDC2_GetCurrentGlobalConfigLockOwnerDomainId(
XRDC2_Type *base)
217 return (uint8_t)((base->SR & XRDC2_SR_GCLO_MASK) >> XRDC2_SR_GCLO_SHIFT);
272 base->MDACI_MDAJ[master][assignIndex].MDAC_MDA_W1 |= XRDC2_MDAC_MDA_W1_DL_MASK;
287static inline void XRDC2_SetMasterDomainAssignmentValid(
XRDC2_Type *base,
294 base->MDACI_MDAJ[master][assignIndex].MDAC_MDA_W1 |= XRDC2_MDAC_MDA_W1_VLD_MASK;
298 base->MDACI_MDAJ[master][assignIndex].MDAC_MDA_W1 &= ~XRDC2_MDAC_MDA_W1_VLD_MASK;
333 xrdc2_mem_slot_t memSlot,
363 xrdc2_mem_slot_t memSlot,
416static inline void XRDC2_UnlockMemSlotExclAccess(
XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
418 base->MSCI_MSAC_WK[(uint32_t)memSlot].MSC_MSAC_W1 = XRDC2_EAL_UNLOCKED;
429static inline void XRDC2_ForceMemSlotExclAccessLockRelease(
XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
431 base->MSCI_MSAC_WK[(uint32_t)memSlot].MSC_MSAC_W1 = XRDC2_EAL_FORCE_RELEASE_MAGIC_0;
432 base->MSCI_MSAC_WK[(uint32_t)memSlot].MSC_MSAC_W1 = XRDC2_EAL_FORCE_RELEASE_MAGIC_1;
616 xrdc2_periph_t periph,
682#if defined(__cplusplus)
#define XRDC2_MCR_GCL(x)
Definition: MIMXRT1166_cm4.h:93253
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:225
enum _xrdc2_master xrdc2_master_t
Structure for the XRDC2 mapping.
void XRDC2_LockMemSlotExclAccess(XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
Lock the memory slot exclusive access using blocking method.
Definition: fsl_xrdc2.c:377
void XRDC2_SetPeriphAccessConfig(XRDC2_Type *base, xrdc2_periph_t periph, const xrdc2_periph_access_config_t *config)
Sets the peripheral access policy.
Definition: fsl_xrdc2.c:699
bool lock
Definition: fsl_xrdc2.h:77
struct _xrdc2_mem_access_config xrdc2_mem_access_config_t
XRDC2 memory region domain access control configuration.
xrdc2_privilege_attr_t privilegeAttr
Definition: fsl_xrdc2.h:78
enum _xrdc2_privilege_attr xrdc2_privilege_attr_t
XRDC2 privileged attribute, the register bit MDACi_MDAj_W0[PA], defines the privileged/user attribute...
uint8_t XRDC2_GetMemExclAccessLockDomainOwner(XRDC2_Type *base, xrdc2_mem_t mem)
Get current memory region exclusive access lock owner.
Definition: fsl_xrdc2.c:560
xrdc2_access_config_lock_t lockMode
Definition: fsl_xrdc2.h:137
void XRDC2_GetMemAccessDefaultConfig(xrdc2_mem_access_config_t *config)
Gets the default memory access configuration.
Definition: fsl_xrdc2.c:414
void XRDC2_SetMemDomainAccessPolicy(XRDC2_Type *base, xrdc2_mem_t mem, uint8_t domainId, xrdc2_access_policy_t policy)
Sets the memory region access policy for specific domain.
Definition: fsl_xrdc2.c:509
void XRDC2_GetPeriphAccessDefaultConfig(xrdc2_periph_access_config_t *config)
Gets the default peripheral access configuration.
Definition: fsl_xrdc2.c:679
struct _xrdc2_mem_slot_access_config xrdc2_mem_slot_access_config_t
XRDC2 memory slot domain access control configuration.
uint8_t XRDC2_GetMemSlotExclAccessLockDomainOwner(XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
Get current memory slot exclusive access lock owner.
Definition: fsl_xrdc2.c:333
uint8_t XRDC2_GetPeriphExclAccessLockDomainOwner(XRDC2_Type *base, xrdc2_periph_t periph)
Get current peripheral exclusive access lock owner.
Definition: fsl_xrdc2.c:796
uint32_t endAddr
Definition: fsl_xrdc2.h:127
void XRDC2_SetMasterDomainAssignment(XRDC2_Type *base, xrdc2_master_t master, uint8_t assignIndex, const xrdc2_master_domain_assignment_t *assignment)
Sets the processor bus master domain assignment.
Definition: fsl_xrdc2.c:162
enum _xrdc2_access_config_lock xrdc2_access_config_lock_t
Access configuration lock mode, the register field PDAC and MRGD LK2.
status_t XRDC2_TryLockMemExclAccess(XRDC2_Type *base, xrdc2_mem_t mem)
Try to lock the memory region exclusive access.
Definition: fsl_xrdc2.c:577
void XRDC2_Deinit(XRDC2_Type *base)
De-initializes the XRDC2 module.
Definition: fsl_xrdc2.c:91
void XRDC2_EnableMemExclAccessLock(XRDC2_Type *base, xrdc2_mem_t mem, bool enable)
Enable or disable the memory region exclusive access lock.
Definition: fsl_xrdc2.c:538
void XRDC2_ForceMemExclAccessLockRelease(XRDC2_Type *base, xrdc2_mem_t mem)
Force the memory region exclusive access lock release.
Definition: fsl_xrdc2.c:656
xrdc2_access_policy_t policy[FSL_FEATURE_XRDC2_DOMAIN_COUNT]
Definition: fsl_xrdc2.h:138
uint16_t match
Definition: fsl_xrdc2.h:82
void XRDC2_EnableMemSlotExclAccessLock(XRDC2_Type *base, xrdc2_mem_slot_t memSlot, bool enable)
Enable or disable the memory slot exclusive access lock.
Definition: fsl_xrdc2.c:314
void XRDC2_LockMemExclAccess(XRDC2_Type *base, xrdc2_mem_t mem)
Lock the memory region exclusive access using blocking method.
Definition: fsl_xrdc2.c:609
void XRDC2_SetMemAccessConfig(XRDC2_Type *base, xrdc2_mem_t mem, const xrdc2_mem_access_config_t *config)
Sets the memory region access policy.
Definition: fsl_xrdc2.c:436
uint8_t domainId
Definition: fsl_xrdc2.h:80
void XRDC2_SetMemAccessValid(XRDC2_Type *base, xrdc2_mem_t mem, bool valid)
Sets the memory region descriptor as valid or invalid.
Definition: fsl_xrdc2.c:469
uint32_t startAddr
Definition: fsl_xrdc2.h:126
_xrdc2_privilege_attr
XRDC2 privileged attribute, the register bit MDACi_MDAj_W0[PA], defines the privileged/user attribute...
Definition: fsl_xrdc2.h:62
void XRDC2_LockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
Lock the peripheral exclusive access using blocking method.
Definition: fsl_xrdc2.c:870
void XRDC2_ForcePeriphExclAccessLockRelease(XRDC2_Type *base, xrdc2_periph_t periph)
Force the peripheral exclusive access lock release.
Definition: fsl_xrdc2.c:918
void XRDC2_SetMemSlotAccessLockMode(XRDC2_Type *base, xrdc2_mem_slot_t memSlot, xrdc2_access_config_lock_t lockMode)
Sets the memory slot descriptor lock mode.
Definition: fsl_xrdc2.c:267
void XRDC2_SetMemSlotAccessConfig(XRDC2_Type *base, xrdc2_mem_slot_t memSlot, const xrdc2_mem_slot_access_config_t *config)
Sets the memory slot access policy.
Definition: fsl_xrdc2.c:221
_xrdc2_global_config_lock
Global configuration lock.
Definition: fsl_xrdc2.h:39
uint16_t mask
Definition: fsl_xrdc2.h:81
status_t XRDC2_TryLockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
Try to lock the peripheral exclusive access.
Definition: fsl_xrdc2.c:837
void XRDC2_UnlockMemExclAccess(XRDC2_Type *base, xrdc2_mem_t mem)
Unlock the memory region exclusive access.
Definition: fsl_xrdc2.c:640
_xrdc2_access_config_lock
Access configuration lock mode, the register field PDAC and MRGD LK2.
Definition: fsl_xrdc2.h:105
status_t XRDC2_TryLockMemSlotExclAccess(XRDC2_Type *base, xrdc2_mem_slot_t memSlot)
Try to lock the memory slot exclusive access.
Definition: fsl_xrdc2.c:347
xrdc2_secure_attr_t secureAttr
Definition: fsl_xrdc2.h:79
enum _xrdc2_global_config_lock xrdc2_global_config_lock_t
Global configuration lock.
enum _xrdc2_access_policy xrdc2_access_policy_t
XRDC2 domain access control policy.
void XRDC2_SetMemAccessLockMode(XRDC2_Type *base, xrdc2_mem_t mem, xrdc2_access_config_lock_t lockMode)
Sets the memory descriptor lock mode.
Definition: fsl_xrdc2.c:492
void XRDC2_UnlockPeriphExclAccess(XRDC2_Type *base, xrdc2_periph_t periph)
Unlock the peripheral exclusive access.
Definition: fsl_xrdc2.c:902
struct _xrdc2_periph_access_config xrdc2_periph_access_config_t
XRDC2 peripheral domain access control configuration.
void XRDC2_SetGlobalValid(XRDC2_Type *base, bool valid)
Sets the XRDC2 global valid.
Definition: fsl_xrdc2.c:104
void XRDC2_GetMemSlotAccessDefaultConfig(xrdc2_mem_slot_access_config_t *config)
Gets the default memory slot access configuration.
Definition: fsl_xrdc2.c:201
xrdc2_access_config_lock_t lockMode
Definition: fsl_xrdc2.h:128
void XRDC2_SetPeriphAccessLockMode(XRDC2_Type *base, xrdc2_periph_t periph, xrdc2_access_config_lock_t lockMode)
Sets the peripheral descriptor lock mode.
Definition: fsl_xrdc2.c:748
struct _xrdc2_master_domain_assignment xrdc2_master_domain_assignment_t
Domain assignment for the bus master.
void XRDC2_SetPeriphAccessValid(XRDC2_Type *base, xrdc2_periph_t periph, bool valid)
Sets the peripheral descriptor as valid or invalid.
Definition: fsl_xrdc2.c:725
void XRDC2_EnablePeriphExclAccessLock(XRDC2_Type *base, xrdc2_periph_t periph, bool enable)
Disable the peripheral exclusive access lock.
Definition: fsl_xrdc2.c:814
xrdc2_access_policy_t policy[FSL_FEATURE_XRDC2_DOMAIN_COUNT]
Definition: fsl_xrdc2.h:129
_xrdc2_access_policy
XRDC2 domain access control policy.
Definition: fsl_xrdc2.h:89
void XRDC2_GetDefaultMasterDomainAssignment(xrdc2_master_domain_assignment_t *assignment)
Gets the default master domain assignment.
Definition: fsl_xrdc2.c:142
xrdc2_access_policy_t policy[FSL_FEATURE_XRDC2_DOMAIN_COUNT]
Definition: fsl_xrdc2.h:118
xrdc2_access_config_lock_t lockMode
Definition: fsl_xrdc2.h:117
void XRDC2_Init(XRDC2_Type *base)
Initializes the XRDC2 module.
Definition: fsl_xrdc2.c:80
_xrdc2_secure_attr
XRDC2 secure attribute, the register bit MDACi_MDAj_W0[SA], secure/nonsecure attribute output on a hi...
Definition: fsl_xrdc2.h:51
void XRDC2_SetPeriphDomainAccessPolicy(XRDC2_Type *base, xrdc2_periph_t periph, uint8_t domainId, xrdc2_access_policy_t policy)
Sets the peripheral access policy for specific domain.
Definition: fsl_xrdc2.c:765
void XRDC2_SetMemSlotAccessValid(XRDC2_Type *base, xrdc2_mem_slot_t memSlot, bool valid)
Sets the memory slot descriptor as valid or invalid.
Definition: fsl_xrdc2.c:246
void XRDC2_SetMemSlotDomainAccessPolicy(XRDC2_Type *base, xrdc2_mem_slot_t memSlot, uint8_t domainId, xrdc2_access_policy_t policy)
Sets the memory slot access policy for specific domain.
Definition: fsl_xrdc2.c:282
enum _xrdc2_secure_attr xrdc2_secure_attr_t
XRDC2 secure attribute, the register bit MDACi_MDAj_W0[SA], secure/nonsecure attribute output on a hi...
@ kXRDC2_ForcePrivilege
Definition: fsl_xrdc2.h:65
@ kXRDC2_ForceUser
Definition: fsl_xrdc2.h:64
@ kXRDC2_MasterPrivilege
Definition: fsl_xrdc2.h:63
@ kXRDC2_GlobalConfigLockDisabledUntilReset
Definition: fsl_xrdc2.h:41
@ kXRDC2_GlobalConfigLockOwnerOnly
Definition: fsl_xrdc2.h:42
@ kXRDC2_GlobalConfigLockEnabledUntilReset
Definition: fsl_xrdc2.h:43
@ kXRDC2_GlobalConfigLockDisabled
Definition: fsl_xrdc2.h:40
@ kXRDC2_AccessConfigLockDisabled
Definition: fsl_xrdc2.h:106
@ kXRDC2_AccessConfigLockDisabledUntilReset
Definition: fsl_xrdc2.h:107
@ kXRDC2_AccessConfigLockDomainXOnly
Definition: fsl_xrdc2.h:108
@ kXRDC2_AccessConfigLockEnabledUntilReset
Definition: fsl_xrdc2.h:109
@ kXRDC2_ForceSecure
Definition: fsl_xrdc2.h:53
@ kXRDC2_MasterSecure
Definition: fsl_xrdc2.h:52
@ kXRDC2_ForceNonSecure
Definition: fsl_xrdc2.h:54
Definition: MIMXRT1166_cm4.h:93188
Domain assignment for the bus master.
Definition: fsl_xrdc2.h:76
XRDC2 memory region domain access control configuration.
Definition: fsl_xrdc2.h:125
XRDC2 memory slot domain access control configuration.
Definition: fsl_xrdc2.h:136
XRDC2 peripheral domain access control configuration.
Definition: fsl_xrdc2.h:116
Definition: deflate.c:114