The MCUXpresso SDK provides a driver for the Extended Resource Domain Controller (XRDC) block of MCUXpresso SDK devices.
XRDC functions
The XRDC module includes four submodules, as follows:
- XRDC_MGR The Manager submodule coordinates all programming model reads and writes.
- XRDC_MDAC The Master Domain Assignment Controller handles resource assignments and generation of the domain identifiers (domain ID).
- XRDC_MRC The Memory Region Controller implements the access controls for slave memories based on the pre-programmed region descriptor registers.
- XRDC_PAC The Peripheral Access Controller implements the access controls for slave peripherals based on the preprogrammed domain access control registers.
Accordingly, the XRDC driver functions could be grouped as follows:
- XRDC_MGR functions.
- XRDC_MDAC functions.
- XRDC_MRC functions.
- XRDC_PAC functions.
Typical use case
Set up configurations during system initialization
The domain assignment and access policy can be configured during the system initialization.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/xrdc
XRDC error handle
When an access violation occurs, the hard fault is triggered. The function XRDC_GetAndClearFirstDomainError() is used to get the error information. Although there might be more than one error, this function only gets the first error.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/xrdc
Access involve SEMA42
See the SoC reference manual to check which SEMA42 instance is used. For example, for KL28, the memory region defined by the MRC0 uses the SEMA42-0, while the memory region defined by MRC1 uses the SEMA42-1. The peripherals controlled by the PAC0 and PAC2 use the SEMA42-0, while the peripherals controlled by PAC1 use the SEMA42-1.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/xrdc
|
enum | { kStatus_XRDC_NoError = MAKE_STATUS(kStatusGroup_XRDC, 0)
} |
| XRDC status _xrdc_status. More...
|
|
enum | xrdc_pid_enable_t {
kXRDC_PidDisable,
kXRDC_PidDisable1,
kXRDC_PidExp0,
kXRDC_PidExp1
} |
| XRDC PID enable mode, the register bit XRDC_MDA_Wx[PE], used for domain hit evaluation. More...
|
|
enum | xrdc_did_sel_t {
kXRDC_DidMda,
kXRDC_DidInput,
kXRDC_DidMdaAndInput,
kXRDC_DidReserved
} |
| XRDC domain ID select method, the register bit XRDC_MDA_Wx[DIDS], used for domain hit evaluation. More...
|
|
enum | xrdc_secure_attr_t {
kXRDC_ForceSecure,
kXRDC_ForceNonSecure,
kXRDC_MasterSecure,
kXRDC_MasterSecure1
} |
| XRDC secure attribute, the register bit XRDC_MDA_Wx[SA], used for non-processor bus master domain assignment. More...
|
|
enum | xrdc_privilege_attr_t {
kXRDC_ForceUser,
kXRDC_ForcePrivilege,
kXRDC_MasterPrivilege,
kXRDC_MasterPrivilege1
} |
| XRDC privileged attribute, the register bit XRDC_MDA_Wx[PA], used for non-processor bus master domain assignment. More...
|
|
enum | xrdc_pid_lock_t {
kXRDC_PidLockSecurePrivilegeWritable = 0U,
kXRDC_PidLockSecurePrivilegeWritable1 = 1U,
kXRDC_PidLockMasterXOnly = 2U,
kXRDC_PidLockLocked = 3U
} |
| XRDC PID LK2 definition XRDC_PIDn[LK2]. More...
|
|
enum | xrdc_access_policy_t |
| XRDC domain access control policy.
|
|
enum | xrdc_access_config_lock_t {
kXRDC_AccessConfigLockWritable = 0U,
kXRDC_AccessConfigLockWritable1 = 1U,
kXRDC_AccessConfigLockDomainXOnly = 2U,
kXRDC_AccessConfigLockLocked = 3U
} |
| Access configuration lock mode, the register field PDAC and MRGD LK2. More...
|
|
enum | xrdc_mem_size_t {
kXRDC_MemSizeNone = 0U,
kXRDC_MemSize32B = 4U,
kXRDC_MemSize64B = 5U,
kXRDC_MemSize128B = 6U,
kXRDC_MemSize256B = 7U,
kXRDC_MemSize512B = 8U,
kXRDC_MemSize1K = 9U,
kXRDC_MemSize2K = 10U,
kXRDC_MemSize4K = 11U,
kXRDC_MemSize8K = 12U,
kXRDC_MemSize16K = 13U,
kXRDC_MemSize32K = 14U,
kXRDC_MemSize64K = 15U,
kXRDC_MemSize128K = 16U,
kXRDC_MemSize256K = 17U,
kXRDC_MemSize512K = 18U,
kXRDC_MemSize1M = 19U,
kXRDC_MemSize2M = 20U,
kXRDC_MemSize4M = 21U,
kXRDC_MemSize8M = 22U,
kXRDC_MemSize16M = 23U,
kXRDC_MemSize32M = 24U,
kXRDC_MemSize64M = 25U,
kXRDC_MemSize128M = 26U,
kXRDC_MemSize256M = 27U,
kXRDC_MemSize512M = 28U,
kXRDC_MemSize1G = 29U,
kXRDC_MemSize2G = 30U,
kXRDC_MemSize4G = 31U
} |
| XRDC memory size definition. More...
|
|
enum | xrdc_controller_t {
kXRDC_MemController0 = 0U,
kXRDC_MemController1 = 1U,
kXRDC_MemController2 = 2U,
kXRDC_MemController3 = 3U,
kXRDC_MemController4 = 4U,
kXRDC_MemController5 = 5U,
kXRDC_MemController6 = 6U,
kXRDC_MemController7 = 7U,
kXRDC_MemController8 = 8U,
kXRDC_MemController9 = 9U,
kXRDC_MemController10 = 10U,
kXRDC_MemController11 = 11U,
kXRDC_MemController12 = 12U,
kXRDC_MemController13 = 13U,
kXRDC_MemController14 = 14U,
kXRDC_MemController15 = 15U,
kXRDC_PeriphController0 = 16U,
kXRDC_PeriphController1 = 17U,
kXRDC_PeriphController2 = 18U,
kXRDC_PeriphController3 = 19U
} |
| XRDC controller definition for domain error check. More...
|
|
enum | xrdc_error_state_t {
kXRDC_ErrorStateNone = 0x00U,
kXRDC_ErrorStateNone1 = 0x01U,
kXRDC_ErrorStateSingle = 0x02U,
kXRDC_ErrorStateMulti = 0x03U
} |
| XRDC domain error state definition XRDC_DERR_W1_n[EST]. More...
|
|
enum | xrdc_error_attr_t {
kXRDC_ErrorSecureUserInst = 0x00U,
kXRDC_ErrorSecureUserData = 0x01U,
kXRDC_ErrorSecurePrivilegeInst = 0x02U,
kXRDC_ErrorSecurePrivilegeData = 0x03U,
kXRDC_ErrorNonSecureUserInst = 0x04U,
kXRDC_ErrorNonSecureUserData = 0x05U,
kXRDC_ErrorNonSecurePrivilegeInst = 0x06U,
kXRDC_ErrorNonSecurePrivilegeData = 0x07U
} |
| XRDC domain error attribute definition XRDC_DERR_W1_n[EATR]. More...
|
|
enum | xrdc_error_type_t {
kXRDC_ErrorTypeRead = 0x00U,
kXRDC_ErrorTypeWrite = 0x01U
} |
| XRDC domain error access type definition XRDC_DERR_W1_n[ERW]. More...
|
|
|
void | XRDC_GetPidDefaultConfig (xrdc_pid_config_t *config) |
| Gets the default PID configuration structure. More...
|
|
void | XRDC_SetPidConfig (XRDC_Type *base, xrdc_master_t master, const xrdc_pid_config_t *config) |
| Configures the PID for a specific bus master. More...
|
|
static void | XRDC_SetPidLockMode (XRDC_Type *base, xrdc_master_t master, xrdc_pid_lock_t lockMode) |
| Sets the PID configuration register lock mode. More...
|
|
void | XRDC_GetDefaultNonProcessorDomainAssignment (xrdc_non_processor_domain_assignment_t *domainAssignment) |
| Gets the default master domain assignment for non-processor bus master. More...
|
|
void | XRDC_GetDefaultProcessorDomainAssignment (xrdc_processor_domain_assignment_t *domainAssignment) |
| Gets the default master domain assignment for the processor bus master. More...
|
|
void | XRDC_SetNonProcessorDomainAssignment (XRDC_Type *base, xrdc_master_t master, uint8_t assignIndex, const xrdc_non_processor_domain_assignment_t *domainAssignment) |
| Sets the non-processor bus master domain assignment. More...
|
|
void | XRDC_SetProcessorDomainAssignment (XRDC_Type *base, xrdc_master_t master, uint8_t assignIndex, const xrdc_processor_domain_assignment_t *domainAssignment) |
| Sets the processor bus master domain assignment. More...
|
|
static void | XRDC_LockMasterDomainAssignment (XRDC_Type *base, xrdc_master_t master, uint8_t assignIndex) |
| Locks the bus master domain assignment register. More...
|
|
static void | XRDC_SetMasterDomainAssignmentValid (XRDC_Type *base, xrdc_master_t master, uint8_t assignIndex, bool valid) |
| Sets the master domain assignment as valid or invalid. More...
|
|
struct xrdc_hardware_config_t |
uint8_t xrdc_hardware_config_t::masterNumber |
uint8_t xrdc_hardware_config_t::domainNumber |
uint8_t xrdc_hardware_config_t::pacNumber |
uint8_t xrdc_hardware_config_t::mrcNumber |
struct xrdc_processor_domain_assignment_t |
uint32_t xrdc_processor_domain_assignment_t::domainId |
uint32_t xrdc_processor_domain_assignment_t::domainIdSelect |
uint32_t xrdc_processor_domain_assignment_t::pidEnable |
uint32_t xrdc_processor_domain_assignment_t::pidMask |
uint32_t xrdc_processor_domain_assignment_t::__pad0__ |
uint32_t xrdc_processor_domain_assignment_t::pid |
uint32_t xrdc_processor_domain_assignment_t::__pad1__ |
uint32_t xrdc_processor_domain_assignment_t::__pad2__ |
uint32_t xrdc_processor_domain_assignment_t::__pad3__ |
uint32_t xrdc_processor_domain_assignment_t::__pad4__ |
uint32_t xrdc_processor_domain_assignment_t::lock |
uint32_t xrdc_processor_domain_assignment_t::__pad5__ |
struct xrdc_non_processor_domain_assignment_t |
uint32_t xrdc_non_processor_domain_assignment_t::domainId |
uint32_t xrdc_non_processor_domain_assignment_t::privilegeAttr |
uint32_t xrdc_non_processor_domain_assignment_t::secureAttr |
uint32_t xrdc_non_processor_domain_assignment_t::bypassDomainId |
uint32_t xrdc_non_processor_domain_assignment_t::__pad0__ |
uint32_t xrdc_non_processor_domain_assignment_t::__pad1__ |
uint32_t xrdc_non_processor_domain_assignment_t::__pad2__ |
uint32_t xrdc_non_processor_domain_assignment_t::__pad3__ |
uint32_t xrdc_non_processor_domain_assignment_t::lock |
uint32_t xrdc_non_processor_domain_assignment_t::__pad4__ |
uint32_t xrdc_pid_config_t::pid |
uint32_t xrdc_pid_config_t::__pad0__ |
uint32_t xrdc_pid_config_t::tsmEnable |
uint32_t xrdc_pid_config_t::lockMode |
uint32_t xrdc_pid_config_t::__pad1__ |
struct xrdc_periph_access_config_t |
xrdc_periph_t xrdc_periph_access_config_t::periph |
bool xrdc_periph_access_config_t::enableSema |
uint32_t xrdc_periph_access_config_t::semaNum |
struct xrdc_mem_access_config_t |
xrdc_mem_t xrdc_mem_access_config_t::mem |
bool xrdc_mem_access_config_t::enableSema |
uint8_t xrdc_mem_access_config_t::semaNum |
uint8_t xrdc_mem_access_config_t::subRegionDisableMask |
uint32_t xrdc_mem_access_config_t::baseAddress |
uint32_t xrdc_error_t::address |
uint8_t xrdc_error_t::errorPort |
uint8_t xrdc_error_t::domainId |
Enumerator |
---|
kStatus_XRDC_NoError |
No error captured.
|
Enumerator |
---|
kXRDC_PidDisable |
PID is not used in domain hit evalution.
|
kXRDC_PidDisable1 |
PID is not used in domain hit evalution.
|
kXRDC_PidExp0 |
((XRDC_MDA_W[PID] & ~XRDC_MDA_W[PIDM]) == (XRDC_PID[PID] & ~XRDC_MDA_W[PIDM])).
|
kXRDC_PidExp1 |
~((XRDC_MDA_W[PID] & ~XRDC_MDA_W[PIDM]) == (XRDC_PID[PID] & ~XRDC_MDA_W[PIDM])).
|
Enumerator |
---|
kXRDC_DidMda |
Use MDAn[3:0] as DID.
|
kXRDC_DidInput |
Use the input DID (DID_in) as DID.
|
kXRDC_DidMdaAndInput |
Use MDAn[3:2] concatenated with DID_in[1:0] as DID.
|
kXRDC_DidReserved |
Reserved.
|
Enumerator |
---|
kXRDC_ForceSecure |
Force the bus attribute for this master to secure.
|
kXRDC_ForceNonSecure |
Force the bus attribute for this master to non-secure.
|
kXRDC_MasterSecure |
Use the bus master's secure/nonsecure attribute directly.
|
kXRDC_MasterSecure1 |
Use the bus master's secure/nonsecure attribute directly.
|
Enumerator |
---|
kXRDC_ForceUser |
Force the bus attribute for this master to user.
|
kXRDC_ForcePrivilege |
Force the bus attribute for this master to privileged.
|
kXRDC_MasterPrivilege |
Use the bus master's attribute directly.
|
kXRDC_MasterPrivilege1 |
Use the bus master's attribute directly.
|
Enumerator |
---|
kXRDC_PidLockSecurePrivilegeWritable |
Writable by any secure privileged write.
|
kXRDC_PidLockSecurePrivilegeWritable1 |
Writable by any secure privileged write.
|
kXRDC_PidLockMasterXOnly |
PIDx is only writable by master x.
|
kXRDC_PidLockLocked |
Read-only until the next reset.
|
Enumerator |
---|
kXRDC_AccessConfigLockWritable |
Entire PDACn/MRGDn can be written.
|
kXRDC_AccessConfigLockWritable1 |
Entire PDACn/MRGDn can be written.
|
kXRDC_AccessConfigLockDomainXOnly |
Domain x only write the DxACP field.
|
kXRDC_AccessConfigLockLocked |
PDACn is read-only until the next reset.
|
Enumerator |
---|
kXRDC_MemSizeNone |
None size.
|
kXRDC_MemSize32B |
2^(4+1) = 32
|
kXRDC_MemSize64B |
2^(5+1) = 64
|
kXRDC_MemSize128B |
2^(6+1) = 128
|
kXRDC_MemSize256B |
2^(7+1) = 256
|
kXRDC_MemSize512B |
2^(8+1) = 512
|
kXRDC_MemSize1K |
2^(9+1) = 1kB
|
kXRDC_MemSize2K |
2^(10+1) = 2kB
|
kXRDC_MemSize4K |
2^(11+1) = 4kB
|
kXRDC_MemSize8K |
2^(12+1) = 8kB
|
kXRDC_MemSize16K |
2^(13+1) = 16kB
|
kXRDC_MemSize32K |
2^(14+1) = 32kB
|
kXRDC_MemSize64K |
2^(15+1) = 64kB
|
kXRDC_MemSize128K |
2^(16+1) = 128kB
|
kXRDC_MemSize256K |
2^(17+1) = 256kB
|
kXRDC_MemSize512K |
2^(18+1) = 512kB
|
kXRDC_MemSize1M |
2^(19+1) = 1MB
|
kXRDC_MemSize2M |
2^(20+1) = 2MB
|
kXRDC_MemSize4M |
2^(21+1) = 4MB
|
kXRDC_MemSize8M |
2^(22+1) = 8MB
|
kXRDC_MemSize16M |
2^(23+1) = 16MB
|
kXRDC_MemSize32M |
2^(24+1) = 32MB
|
kXRDC_MemSize64M |
2^(25+1) = 64MB
|
kXRDC_MemSize128M |
2^(26+1) = 128MB
|
kXRDC_MemSize256M |
2^(27+1) = 256MB
|
kXRDC_MemSize512M |
2^(28+1) = 512MB
|
kXRDC_MemSize1G |
2^(29+1) = 1GB
|
kXRDC_MemSize2G |
2^(30+1) = 2GB
|
kXRDC_MemSize4G |
2^(31+1) = 4GB
|
Enumerator |
---|
kXRDC_MemController0 |
Memory region controller 0.
|
kXRDC_MemController1 |
Memory region controller 1.
|
kXRDC_MemController2 |
Memory region controller 2.
|
kXRDC_MemController3 |
Memory region controller 3.
|
kXRDC_MemController4 |
Memory region controller 4.
|
kXRDC_MemController5 |
Memory region controller 5.
|
kXRDC_MemController6 |
Memory region controller 6.
|
kXRDC_MemController7 |
Memory region controller 7.
|
kXRDC_MemController8 |
Memory region controller 8.
|
kXRDC_MemController9 |
Memory region controller 9.
|
kXRDC_MemController10 |
Memory region controller 10.
|
kXRDC_MemController11 |
Memory region controller 11.
|
kXRDC_MemController12 |
Memory region controller 12.
|
kXRDC_MemController13 |
Memory region controller 13.
|
kXRDC_MemController14 |
Memory region controller 14.
|
kXRDC_MemController15 |
Memory region controller 15.
|
kXRDC_PeriphController0 |
Peripheral access controller 0.
|
kXRDC_PeriphController1 |
Peripheral access controller 1.
|
kXRDC_PeriphController2 |
Peripheral access controller 2.
|
kXRDC_PeriphController3 |
Peripheral access controller 3.
|
Enumerator |
---|
kXRDC_ErrorStateNone |
No access violation detected.
|
kXRDC_ErrorStateNone1 |
No access violation detected.
|
kXRDC_ErrorStateSingle |
Single access violation detected.
|
kXRDC_ErrorStateMulti |
Multiple access violation detected.
|
Enumerator |
---|
kXRDC_ErrorSecureUserInst |
Secure user mode, instruction fetch access.
|
kXRDC_ErrorSecureUserData |
Secure user mode, data access.
|
kXRDC_ErrorSecurePrivilegeInst |
Secure privileged mode, instruction fetch access.
|
kXRDC_ErrorSecurePrivilegeData |
Secure privileged mode, data access.
|
kXRDC_ErrorNonSecureUserInst |
NonSecure user mode, instruction fetch access.
|
kXRDC_ErrorNonSecureUserData |
NonSecure user mode, data access.
|
kXRDC_ErrorNonSecurePrivilegeInst |
NonSecure privileged mode, instruction fetch access.
|
kXRDC_ErrorNonSecurePrivilegeData |
NonSecure privileged mode, data access.
|
Enumerator |
---|
kXRDC_ErrorTypeRead |
Error occurs on read reference.
|
kXRDC_ErrorTypeWrite |
Error occurs on write reference.
|
void XRDC_Init |
( |
XRDC_Type * |
base | ) |
|
This function enables the XRDC clock.
- Parameters
-
base | XRDC peripheral base address. |
void XRDC_Deinit |
( |
XRDC_Type * |
base | ) |
|
This function disables the XRDC clock.
- Parameters
-
base | XRDC peripheral base address. |
This function gets the XRDC hardware configurations, including number of bus masters, number of domains, number of MRCs and number of PACs.
- Parameters
-
base | XRDC peripheral base address. |
config | Pointer to the structure to get the configuration. |
static void XRDC_LockGlobalControl |
( |
XRDC_Type * |
base | ) |
|
|
inlinestatic |
This function locks the XRDC_CR register. After it is locked, the register is read-only until the next reset.
- Parameters
-
base | XRDC peripheral base address. |
static void XRDC_SetGlobalValid |
( |
XRDC_Type * |
base, |
|
|
bool |
valid |
|
) |
| |
|
inlinestatic |
This function sets the XRDC global valid or invalid. When the XRDC is global invalid, all accesses from all bus masters to all slaves are allowed.
- Parameters
-
base | XRDC peripheral base address. |
valid | True to valid XRDC. |
static uint8_t XRDC_GetCurrentMasterDomainId |
( |
XRDC_Type * |
base | ) |
|
|
inlinestatic |
This function returns the domain ID of the current bus master.
- Parameters
-
base | XRDC peripheral base address. |
- Returns
- Domain ID of current bus master.
status_t XRDC_GetAndClearFirstDomainError |
( |
XRDC_Type * |
base, |
|
|
xrdc_error_t * |
error |
|
) |
| |
This function gets the first access violation information for the current domain and clears the pending flag. There might be multiple access violations pending for the current domain. This function only processes the first error.
- Parameters
-
base | XRDC peripheral base address. |
error | Pointer to the error information. |
- Returns
- If the access violation is captured, this function returns the kStatus_Success. The error information can be obtained from the parameter error. If no access violation is captured, this function returns the kStatus_XRDC_NoError.
status_t XRDC_GetAndClearFirstSpecificDomainError |
( |
XRDC_Type * |
base, |
|
|
xrdc_error_t * |
error, |
|
|
uint8_t |
domainId |
|
) |
| |
This function gets the first access violation information for the specific domain and clears the pending flag. There might be multiple access violations pending for the current domain. This function only processes the first error.
- Parameters
-
base | XRDC peripheral base address. |
error | Pointer to the error information. |
domainId | The error of which domain to get and clear. |
- Returns
- If the access violation is captured, this function returns the kStatus_Success. The error information can be obtained from the parameter error. If no access violation is captured, this function returns the kStatus_XRDC_NoError.
This function initializes the configuration structure to default values. The default values are:
* config->pid = 0U;
* config->tsmEnable = 0U;
* config->sp4smEnable = 0U;
*
- Parameters
-
config | Pointer to the configuration structure. |
void XRDC_SetPidConfig |
( |
XRDC_Type * |
base, |
|
|
xrdc_master_t |
master, |
|
|
const xrdc_pid_config_t * |
config |
|
) |
| |
This function configures the PID for a specific bus master. Do not use this function for non-processor bus masters.
- Parameters
-
base | XRDC peripheral base address. |
master | Which bus master to configure. |
config | Pointer to the configuration structure. |
static void XRDC_SetPidLockMode |
( |
XRDC_Type * |
base, |
|
|
xrdc_master_t |
master, |
|
|
xrdc_pid_lock_t |
lockMode |
|
) |
| |
|
inlinestatic |
This function sets the PID configuration register lock XRDC_PIDn[LK2].
- Parameters
-
base | XRDC peripheral base address. |
master | Which master's PID to lock. |
lockMode | Lock mode to set. |
This function gets the default master domain assignment for non-processor bus master. It should only be used for the non-processor bus masters, such as DMA. This function sets the assignment as follows:
* assignment->domainId = 0U;
* assignment->bypassDomainId = 0U;
* assignment->blogicPartId = 0U;
* assignment->benableLogicPartId = 0U;
* assignment->lock = 0U;
*
- Parameters
-
domainAssignment | Pointer to the assignment structure. |
This function gets the default master domain assignment for the processor bus master. It should only be used for the processor bus masters, such as CORE0. This function sets the assignment as follows:
* assignment->domainId = 0U;
* assignment->pidMask = 0U;
* assignment->pid = 0U;
* assignment->logicPartId = 0U;
* assignment->enableLogicPartId = 0U;
* assignment->lock = 0U;
*
- Parameters
-
domainAssignment | Pointer to the assignment structure. |
This function sets the non-processor master domain assignment as valid. One bus master might have multiple domain assignment registers. The parameter assignIndex
specifies which assignment register to set.
Example: Set domain assignment for DMA0.
*
* nonProcessorAssignment.xxx = xxx;
*
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterDma0, 0U, &nonProcessorAssignment);
*
- Parameters
-
base | XRDC peripheral base address. |
master | Which master to configure. |
assignIndex | Which assignment register to set. |
domainAssignment | Pointer to the assignment structure. |
This function sets the processor master domain assignment as valid. One bus master might have multiple domain assignment registers. The parameter assignIndex
specifies which assignment register to set.
Example: Set domain assignment for core 0. In this example, there are 3 assignment registers for core 0.
*
*
* processorAssignment.xxx = xxx;
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterCpu0, 0U, &processorAssignment);
*
* processorAssignment.xxx = xxx;
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterCpu0, 1U, &processorAssignment);
*
* processorAssignment.xxx = xxx;
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterCpu0, 2U, &processorAssignment);
*
- Parameters
-
base | XRDC peripheral base address. |
master | Which master to configure. |
assignIndex | Which assignment register to set. |
domainAssignment | Pointer to the assignment structure. |
static void XRDC_LockMasterDomainAssignment |
( |
XRDC_Type * |
base, |
|
|
xrdc_master_t |
master, |
|
|
uint8_t |
assignIndex |
|
) |
| |
|
inlinestatic |
This function locks the master domain assignment. One bus master might have multiple domain assignment registers. The parameter assignIndex
specifies which assignment register to lock. After it is locked, the register can't be changed until next reset.
- Parameters
-
base | XRDC peripheral base address. |
master | Which master to configure. |
assignIndex | Which assignment register to lock. |
static void XRDC_SetMasterDomainAssignmentValid |
( |
XRDC_Type * |
base, |
|
|
xrdc_master_t |
master, |
|
|
uint8_t |
assignIndex, |
|
|
bool |
valid |
|
) |
| |
|
inlinestatic |
This function sets the master domain assignment as valid or invalid. One bus master might have multiple domain assignment registers. The parameter assignIndex
specifies which assignment register to configure.
- Parameters
-
base | XRDC peripheral base address. |
master | Which master to configure. |
assignIndex | Index for the domain assignment register. |
valid | True to set valid, false to set invalid. |
This function gets the default memory region access policy. It sets the policy as follows:
* config->enableSema = false;
* config->semaNum = 0U;
* config->subRegionDisableMask = 0U;
* config->size = kXrdcMemSizeNone;
* config->baseAddress = 0U;
* config->policy[0] = kXRDC_AccessPolicyNone;
* config->policy[1] = kXRDC_AccessPolicyNone;
* ...
* config->policy[15] = kXRDC_AccessPolicyNone;
*
- Parameters
-
config | Pointer to the configuration structure. |
This function sets the memory region access configuration as valid. There are two methods to use it:
Example 1: Set one configuration run time. Set memory region 0x20000000 ~ 0x20000400 accessible by domain 0, use MRC0_1.
* {
* .mem = kXRDC_MemMrc0_1,
* .baseAddress = 0x20000000U,
* .policy[0] = kXRDC_AccessPolicyAll
* };
*
Example 2: Set multiple configurations during startup. Set memory region 0x20000000 ~ 0x20000400 accessible by domain 0, use MRC0_1. Set memory region 0x1FFF0000 ~ 0x1FFF0800 accessible by domain 0, use MRC0_2.
* {
* {
* .
mem = kXRDC_MemMrc0_1,
* .baseAddress = 0x20000000U,
* .policy[0] = kXRDC_AccessPolicyAll
* },
* {
* .mem = kXRDC_MemMrc0_2,
* .baseAddress = 0x1FFF0000U,
* .policy[0] = kXRDC_AccessPolicyAll
* }
* };
*
* for (i=0U; i<((sizeof(configs)/sizeof(configs[0]))); i++)
* {
* }
*
- Parameters
-
base | XRDC peripheral base address. |
config | Pointer to the access policy configuration structure. |
- Parameters
-
base | XRDC peripheral base address. |
mem | Which memory region descriptor to lock. |
lockMode | The lock mode to set. |
static void XRDC_SetMemAccessValid |
( |
XRDC_Type * |
base, |
|
|
xrdc_mem_t |
mem, |
|
|
bool |
valid |
|
) |
| |
|
inlinestatic |
This function sets the memory region access configuration dynamically. For example:
* {
* .
mem = kXRDC_MemMrc0_1,
* .baseAddress = 0x20000000U,
* .policy[0] = kXRDC_AccessPolicyAll
* };
*
*
*
- Parameters
-
base | XRDC peripheral base address. |
mem | Which memory region descriptor to set. |
valid | True to set valid, false to set invalid. |
The default configuration is set as follows:
* config->
policy[0] = kXRDC_AccessPolicyNone;
* config->
policy[1] = kXRDC_AccessPolicyNone;
* ...
* config->
policy[15] = kXRDC_AccessPolicyNone;
*
- Parameters
-
config | Pointer to the configuration structure. |
This function sets the peripheral access configuration as valid. Two methods to use it: Method 1: Set for one peripheral, which is used for runtime settings. Example: set LPTMR0 accessible by domain 0
*
* config.
periph = kXRDC_PeriphLptmr0;
* config.
policy[0] = kXRDC_AccessPolicyAll;
*
Method 2: Set for multiple peripherals, which is used for initialization settings.
* {
* {
* .periph = kXRDC_PeriphLptmr0,
* .
policy[0] = kXRDC_AccessPolicyAll,
* .policy[1] = kXRDC_AccessPolicyAll
* },
* {
* .periph = kXRDC_PeriphLpuart0,
* .policy[0] = kXRDC_AccessPolicyAll,
* .policy[1] = kXRDC_AccessPolicyAll
* }
* };
*
* for (i=0U; i<(sizeof(configs)/sizeof(configs[0])), i++)
* {
* }
*
- Parameters
-
base | XRDC peripheral base address. |
config | Pointer to the configuration structure. |
- Parameters
-
base | XRDC peripheral base address. |
periph | Which peripheral access configuration register to lock. |
lockMode | The lock mode to set. |
static void XRDC_SetPeriphAccessValid |
( |
XRDC_Type * |
base, |
|
|
xrdc_periph_t |
periph, |
|
|
bool |
valid |
|
) |
| |
|
inlinestatic |
This function sets the peripheral access configuration dynamically. For example:
* {
* .
periph = kXRDC_PeriphLptmr0;
* .policy[0] = kXRDC_AccessPolicyAll;
* };
*
*
*
- Parameters
-
base | XRDC peripheral base address. |
periph | Which peripheral access configuration to set. |
valid | True to set valid, false to set invalid. |