MCUXpresso SDK API Reference Manual  Rev 2.15.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
XRDC: Extended Resource Domain Controller

Overview

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:

Accordingly, the XRDC driver functions could be grouped as follows:

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

Data Structures

struct  _xrdc_hardware_config
 XRDC hardware configuration. More...
 
struct  _xrdc_processor_domain_assignment
 Domain assignment for the processor bus master. More...
 
struct  _xrdc_non_processor_domain_assignment
 Domain assignment for the non-processor bus master. More...
 
struct  _xrdc_pid_config
 XRDC process identifier (PID) configuration. More...
 
struct  _xrdc_periph_access_config
 XRDC peripheral domain access control configuration. More...
 
struct  _xrdc_mem_access_config
 XRDC memory region domain access control configuration. More...
 
struct  _xrdc_error
 XRDC domain error definition. More...
 

Typedefs

typedef struct
_xrdc_hardware_config 
xrdc_hardware_config_t
 XRDC hardware configuration.
 
typedef enum _xrdc_pid_enable xrdc_pid_enable_t
 XRDC PID enable mode, the register bit XRDC_MDA_Wx[PE], used for domain hit evaluation.
 
typedef enum _xrdc_did_sel xrdc_did_sel_t
 XRDC domain ID select method, the register bit XRDC_MDA_Wx[DIDS], used for domain hit evaluation.
 
typedef enum _xrdc_secure_attr xrdc_secure_attr_t
 XRDC secure attribute, the register bit XRDC_MDA_Wx[SA], used for non-processor bus master domain assignment.
 
typedef enum _xrdc_privilege_attr xrdc_privilege_attr_t
 XRDC privileged attribute, the register bit XRDC_MDA_Wx[PA], used for non-processor bus master domain assignment.
 
typedef struct
_xrdc_processor_domain_assignment 
xrdc_processor_domain_assignment_t
 Domain assignment for the processor bus master.
 
typedef struct
_xrdc_non_processor_domain_assignment 
xrdc_non_processor_domain_assignment_t
 Domain assignment for the non-processor bus master.
 
typedef enum _xrdc_pid_lock xrdc_pid_lock_t
 XRDC PID LK2 definition XRDC_PIDn[LK2].
 
typedef struct _xrdc_pid_config xrdc_pid_config_t
 XRDC process identifier (PID) configuration.
 
typedef enum _xrdc_access_policy xrdc_access_policy_t
 XRDC domain access control policy.
 
typedef enum
_xrdc_access_config_lock 
xrdc_access_config_lock_t
 Access configuration lock mode, the register field PDAC and MRGD LK2.
 
typedef enum
_xrdc_excl_access_lock_config 
xrdc_excl_access_lock_config_t
 Exclusive access lock mode configuration, the register field PDAC and MRGD EAL.
 
typedef struct
_xrdc_periph_access_config 
xrdc_periph_access_config_t
 XRDC peripheral domain access control configuration.
 
typedef enum _xrdc_mem_accset xrdc_mem_accset_t
 XRDC memory ACCSET (SET of programmable access flags).
 
typedef enum _xrdc_mem_code_region xrdc_mem_code_region_t
 XRDC memory code region indicator.
 
typedef enum
_xrdc_access_flags_select 
xrdc_access_flags_select_t
 XRDC domain access flags/policy select. More...
 
typedef struct
_xrdc_mem_access_config 
xrdc_mem_access_config_t
 XRDC memory region domain access control configuration.
 
typedef enum _xrdc_controller xrdc_controller_t
 XRDC controller definition for domain error check.
 
typedef enum _xrdc_error_state xrdc_error_state_t
 XRDC domain error state definition XRDC_DERR_W1_n[EST].
 
typedef enum _xrdc_error_attr xrdc_error_attr_t
 XRDC domain error attribute definition XRDC_DERR_W1_n[EATR].
 
typedef enum _xrdc_error_type xrdc_error_type_t
 XRDC domain error access type definition XRDC_DERR_W1_n[ERW].
 
typedef struct _xrdc_error xrdc_error_t
 XRDC domain error definition.
 

Enumerations

enum  { kStatus_XRDC_NoError = MAKE_STATUS(kStatusGroup_XRDC, 0) }
 XRDC status _xrdc_status. More...
 
enum  _xrdc_pid_enable {
  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 {
  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 {
  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 {
  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 {
  kXRDC_PidLockSecurePrivilegeWritable = 0U,
  kXRDC_PidLockSecurePrivilegeWritable1 = 1U,
  kXRDC_PidLockMasterXOnly = 2U,
  kXRDC_PidLockLocked = 3U
}
 XRDC PID LK2 definition XRDC_PIDn[LK2]. More...
 
enum  _xrdc_access_policy
 XRDC domain access control policy.
 
enum  _xrdc_access_config_lock {
  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_excl_access_lock_config {
  kXRDC_ExclAccessLockDisabled = 0U,
  kXRDC_ExclAccessLockDisabledUntilNextRst = 1U,
  kXRDC_ExclAccessLockEnabledStateAvail = 2U,
  kXRDC_ExclAccessLockEnabledStateNotAvail = 3U
}
 Exclusive access lock mode configuration, the register field PDAC and MRGD EAL. More...
 
enum  _xrdc_mem_accset {
  kXRDC_MemAccset1 = 0U,
  kXRDC_MemAccset2 = 1U
}
 XRDC memory ACCSET (SET of programmable access flags). More...
 
enum  _xrdc_mem_code_region {
  kXRDC_MemCodeRegion0 = 0U,
  kXRDC_MemCodeRegion1 = 1U
}
 XRDC memory code region indicator. More...
 
enum  _xrdc_access_flags_select
 XRDC domain access flags/policy select. More...
 
enum  _xrdc_controller {
  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 {
  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 {
  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 {
  kXRDC_ErrorTypeRead = 0x00U,
  kXRDC_ErrorTypeWrite = 0x01U
}
 XRDC domain error access type definition XRDC_DERR_W1_n[ERW]. More...
 

Functions

void XRDC_Init (XRDC_Type *base)
 Initializes the XRDC module. More...
 
void XRDC_Deinit (XRDC_Type *base)
 De-initializes the XRDC module. More...
 

XRDC manager (XRDC_MGR)

void XRDC_GetHardwareConfig (XRDC_Type *base, xrdc_hardware_config_t *config)
 Gets the XRDC hardware configuration. More...
 
static void XRDC_LockGlobalControl (XRDC_Type *base)
 Locks the XRDC global control register XRDC_CR. More...
 
static void XRDC_SetGlobalValid (XRDC_Type *base, bool valid)
 Sets the XRDC global valid. More...
 
static uint8_t XRDC_GetCurrentMasterDomainId (XRDC_Type *base)
 Gets the domain ID of the current bus master. More...
 
status_t XRDC_GetAndClearFirstDomainError (XRDC_Type *base, xrdc_error_t *error)
 Gets and clears the first domain error of the current domain. More...
 
status_t XRDC_GetAndClearFirstSpecificDomainError (XRDC_Type *base, xrdc_error_t *error, uint8_t domainId)
 Gets and clears the first domain error of the specific domain. More...
 

XRDC Master Domain Assignment Controller (XRDC_MDAC).

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...
 

XRDC Memory Region Controller (XRDC_MRC)

void XRDC_GetMemAccessDefaultConfig (xrdc_mem_access_config_t *config)
 Gets the default memory region access policy. More...
 
void XRDC_SetMemAccessConfig (XRDC_Type *base, const xrdc_mem_access_config_t *config)
 Sets the memory region access policy. More...
 
static void XRDC_SetMemAccessLockMode (XRDC_Type *base, xrdc_mem_t mem, xrdc_access_config_lock_t lockMode)
 Sets the memory region descriptor register lock mode. More...
 
static void XRDC_SetMemAccessValid (XRDC_Type *base, xrdc_mem_t mem, bool valid)
 Sets the memory region descriptor as valid or invalid. More...
 
void XRDC_SetMemExclAccessLockMode (XRDC_Type *base, xrdc_mem_t mem, xrdc_excl_access_lock_config_t lockMode)
 Sets the memory region exclusive access lock mode configuration. More...
 
void XRDC_ForceMemExclAccessLockRelease (XRDC_Type *base, xrdc_mem_t mem)
 Forces the release of the memory region exclusive access lock. More...
 
static uint8_t XRDC_GetMemExclAccessLockDomainOwner (XRDC_Type *base, xrdc_mem_t mem)
 Gets the exclusive access lock domain owner of the memory region. More...
 
void XRDC_SetMemAccsetLock (XRDC_Type *base, xrdc_mem_t mem, xrdc_mem_accset_t accset, bool lock)
 Sets the memory region ACCSET (programmable access flags) lock. More...
 

XRDC Peripheral Access Controller (XRDC_PAC)

void XRDC_GetPeriphAccessDefaultConfig (xrdc_periph_access_config_t *config)
 Gets the default peripheral access configuration. More...
 
void XRDC_SetPeriphAccessConfig (XRDC_Type *base, const xrdc_periph_access_config_t *config)
 Sets the peripheral access configuration. More...
 
static void XRDC_SetPeriphAccessLockMode (XRDC_Type *base, xrdc_periph_t periph, xrdc_access_config_lock_t lockMode)
 Sets the peripheral access configuration register lock mode. More...
 
static void XRDC_SetPeriphAccessValid (XRDC_Type *base, xrdc_periph_t periph, bool valid)
 Sets the peripheral access as valid or invalid. More...
 
static void XRDC_SetPeriphExclAccessLockMode (XRDC_Type *base, xrdc_periph_t periph, xrdc_excl_access_lock_config_t lockMode)
 Sets the peripheral exclusive access lock mode configuration. More...
 
void XRDC_ForcePeriphExclAccessLockRelease (XRDC_Type *base, xrdc_periph_t periph)
 Forces the release of the peripheral exclusive access lock. More...
 
static uint8_t XRDC_GetPeriphExclAccessLockDomainOwner (XRDC_Type *base, xrdc_periph_t periph)
 Gets the exclusive access lock domain owner of the peripheral. More...
 

Data Structure Documentation

struct _xrdc_hardware_config

Data Fields

uint8_t masterNumber
 Number of bus masters. More...
 
uint8_t domainNumber
 Number of domains. More...
 
uint8_t pacNumber
 Number of PACs. More...
 
uint8_t mrcNumber
 Number of MRCs. More...
 

Field Documentation

uint8_t _xrdc_hardware_config::masterNumber
uint8_t _xrdc_hardware_config::domainNumber
uint8_t _xrdc_hardware_config::pacNumber
uint8_t _xrdc_hardware_config::mrcNumber
struct _xrdc_processor_domain_assignment

Data Fields

uint32_t domainId: 4U
 Domain ID. More...
 
uint32_t domainIdSelect: 2U
 Domain ID select method, see xrdc_did_sel_t. More...
 
uint32_t pidEnable: 2U
 PId enable method, see xrdc_pid_enable_t. More...
 
uint32_t pidMask: 6U
 PId mask. More...
 
uint32_t __pad0__: 2U
 Reserved. More...
 
uint32_t pid: 6U
 PId value. More...
 
uint32_t __pad1__: 2U
 Reserved. More...
 
uint32_t __pad2__: 4U
 Reserved. More...
 
uint32_t __pad3__: 1U
 Reserved. More...
 
uint32_t __pad4__: 1U
 Reserved. More...
 
uint32_t lock: 1U
 Lock the register. More...
 
uint32_t __pad5__: 1U
 Reserved. More...
 

Field Documentation

uint32_t _xrdc_processor_domain_assignment::domainId
uint32_t _xrdc_processor_domain_assignment::domainIdSelect
uint32_t _xrdc_processor_domain_assignment::pidEnable
uint32_t _xrdc_processor_domain_assignment::pidMask
uint32_t _xrdc_processor_domain_assignment::__pad0__
uint32_t _xrdc_processor_domain_assignment::pid
uint32_t _xrdc_processor_domain_assignment::__pad1__
uint32_t _xrdc_processor_domain_assignment::__pad2__
uint32_t _xrdc_processor_domain_assignment::__pad3__
uint32_t _xrdc_processor_domain_assignment::__pad4__
uint32_t _xrdc_processor_domain_assignment::lock
uint32_t _xrdc_processor_domain_assignment::__pad5__
struct _xrdc_non_processor_domain_assignment

Data Fields

uint32_t domainId: 4U
 Domain ID. More...
 
uint32_t privilegeAttr: 2U
 Privileged attribute, see xrdc_privilege_attr_t. More...
 
uint32_t secureAttr: 2U
 Secure attribute, see xrdc_secure_attr_t. More...
 
uint32_t bypassDomainId: 1U
 Bypass domain ID. More...
 
uint32_t __pad0__: 15U
 Reserved. More...
 
uint32_t __pad1__: 4U
 Reserved. More...
 
uint32_t __pad2__: 1U
 Reserved. More...
 
uint32_t __pad3__: 1U
 Reserved. More...
 
uint32_t lock: 1U
 Lock the register. More...
 
uint32_t __pad4__: 1U
 Reserved. More...
 

Field Documentation

uint32_t _xrdc_non_processor_domain_assignment::domainId
uint32_t _xrdc_non_processor_domain_assignment::privilegeAttr
uint32_t _xrdc_non_processor_domain_assignment::secureAttr
uint32_t _xrdc_non_processor_domain_assignment::bypassDomainId
uint32_t _xrdc_non_processor_domain_assignment::__pad0__
uint32_t _xrdc_non_processor_domain_assignment::__pad1__
uint32_t _xrdc_non_processor_domain_assignment::__pad2__
uint32_t _xrdc_non_processor_domain_assignment::__pad3__
uint32_t _xrdc_non_processor_domain_assignment::lock
uint32_t _xrdc_non_processor_domain_assignment::__pad4__
struct _xrdc_pid_config

Data Fields

uint32_t pid: 6U
 PID value, PIDn[PID]. More...
 
uint32_t __pad0__: 22U
 Reserved. More...
 
uint32_t tsmEnable: 1U
 Enable three-state model. More...
 
uint32_t lockMode: 2U
 PIDn configuration lock mode, see xrdc_pid_lock_t. More...
 
uint32_t __pad1__: 1U
 Reserved. More...
 

Field Documentation

uint32_t _xrdc_pid_config::pid
uint32_t _xrdc_pid_config::__pad0__
uint32_t _xrdc_pid_config::tsmEnable
uint32_t _xrdc_pid_config::lockMode
uint32_t _xrdc_pid_config::__pad1__
struct _xrdc_periph_access_config

Data Fields

xrdc_periph_t periph
 Peripheral name. More...
 
xrdc_access_config_lock_t lockMode
 PDACn lock configuration. More...
 
xrdc_excl_access_lock_config_t exclAccessLockMode
 Exclusive access lock configuration. More...
 
xrdc_access_policy_t policy [FSL_FEATURE_XRDC_DOMAIN_COUNT]
 Access policy for each domain. More...
 

Field Documentation

xrdc_periph_t _xrdc_periph_access_config::periph
xrdc_access_config_lock_t _xrdc_periph_access_config::lockMode
xrdc_excl_access_lock_config_t _xrdc_periph_access_config::exclAccessLockMode
xrdc_access_policy_t _xrdc_periph_access_config::policy[FSL_FEATURE_XRDC_DOMAIN_COUNT]
struct _xrdc_mem_access_config

Data Fields

xrdc_mem_t mem
 Memory region descriptor name. More...
 
bool enableAccset1Lock
 Enable ACCSET1 access lock or not. More...
 
bool enableAccset2Lock
 Enable ACCSET2 access lock or not. More...
 
uint16_t accset1
 SET 1 of Programmable access flags. More...
 
uint16_t accset2
 SET 2 of Programmable access flags. More...
 
xrdc_access_config_lock_t lockMode
 MRGDn lock configuration. More...
 
xrdc_access_flags_select_t policy [FSL_FEATURE_XRDC_DOMAIN_COUNT]
 Access policy/flags select for each domain. More...
 
xrdc_mem_code_region_t codeRegion
 Code region select. More...
 
uint32_t baseAddress
 Memory region base/start address. More...
 
uint32_t endAddress
 Memory region end address. More...
 
xrdc_excl_access_lock_config_t exclAccessLockMode
 Exclusive access lock configuration. More...
 

Field Documentation

xrdc_mem_t _xrdc_mem_access_config::mem
bool _xrdc_mem_access_config::enableAccset1Lock
bool _xrdc_mem_access_config::enableAccset2Lock
uint16_t _xrdc_mem_access_config::accset1

xxx_xxx_xxx_xxx => PS{R,W,X}_PN{R,W,X}_US{R,W,X}_UN{R,W,X}. flag = 0 : inhibits access, flag = 1 : allows access.

uint16_t _xrdc_mem_access_config::accset2

xxx_xxx_xxx_xxx => PS{R,W,X}_PN{R,W,X}_US{R,W,X}_UN{R,W,X}. flag = 0 : inhibits access, flag = 1 : allows access.

xrdc_access_config_lock_t _xrdc_mem_access_config::lockMode
xrdc_access_flags_select_t _xrdc_mem_access_config::policy[FSL_FEATURE_XRDC_DOMAIN_COUNT]
xrdc_mem_code_region_t _xrdc_mem_access_config::codeRegion
uint32_t _xrdc_mem_access_config::baseAddress
uint32_t _xrdc_mem_access_config::endAddress

The 5 LSB of end address is ignored and forced to 0x1F by hardware.

xrdc_excl_access_lock_config_t _xrdc_mem_access_config::exclAccessLockMode
struct _xrdc_error

Data Fields

xrdc_controller_t controller
 Which controller captured access violation. More...
 
uint32_t address
 Access address that generated access violation. More...
 
xrdc_error_state_t errorState
 Error state. More...
 
xrdc_error_attr_t errorAttr
 Error attribute. More...
 
xrdc_error_type_t errorType
 Error type. More...
 
uint8_t errorPort
 Error port. More...
 
uint8_t domainId
 Domain ID. More...
 

Field Documentation

xrdc_controller_t _xrdc_error::controller
uint32_t _xrdc_error::address
xrdc_error_state_t _xrdc_error::errorState
xrdc_error_attr_t _xrdc_error::errorAttr
xrdc_error_type_t _xrdc_error::errorType
uint8_t _xrdc_error::errorPort
uint8_t _xrdc_error::domainId

Typedef Documentation

Policy: {R,W,X} Read, write, execute flags. flag = 0 : inhibits access, flag = 1 : allows access. policy => SecurePriv_NonSecurePriv_SecureUser_NonSecureUsr xxx_xxx_xxx_xxx => PS{R,W,X}_PN{R,W,X}_US{R,W,X}_UN{R,W,X}

      PS > PN > US > UN          PS > PN > US > UN

DxSEL CodeRegion = 0 CodeRegion = 1 000 000_000_000_000 = 0x000 000_000_000_000 = 0x000 001 ACCSET1 010 ACCSET2 011 110_000_000_000 = 0xC00 001_001_001_001 = 0x249 100 110_110_000_000 = 0xD80 111_000_000_000 = 0xE00 101 110_110_100_100 = 0xDA4 110_111_000_000 = 0xDC0 110 110_110_110_000 = 0xDB0 110_110_111_000 = 0xDB8 111 110_110_110_110 = 0xDB6 110_110_111_111 = 0xDBF

Enumeration Type Documentation

anonymous enum
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_ExclAccessLockDisabled 

Lock disabled.

kXRDC_ExclAccessLockDisabledUntilNextRst 

Lock disabled until next reset.

kXRDC_ExclAccessLockEnabledStateAvail 

Lock enabled, lock state = available.

kXRDC_ExclAccessLockEnabledStateNotAvail 

Lock enabled, lock state = not available.

Enumerator
kXRDC_MemAccset1 

Memory region SET 1 of programmable access flags.

kXRDC_MemAccset2 

Memory region SET 2 of programmable access flags.

Enumerator
kXRDC_MemCodeRegion0 

Code region indicator 0=data.

kXRDC_MemCodeRegion1 

Code region indicator 1=code.

Policy: {R,W,X} Read, write, execute flags. flag = 0 : inhibits access, flag = 1 : allows access. policy => SecurePriv_NonSecurePriv_SecureUser_NonSecureUsr xxx_xxx_xxx_xxx => PS{R,W,X}_PN{R,W,X}_US{R,W,X}_UN{R,W,X}

      PS > PN > US > UN          PS > PN > US > UN

DxSEL CodeRegion = 0 CodeRegion = 1 000 000_000_000_000 = 0x000 000_000_000_000 = 0x000 001 ACCSET1 010 ACCSET2 011 110_000_000_000 = 0xC00 001_001_001_001 = 0x249 100 110_110_000_000 = 0xD80 111_000_000_000 = 0xE00 101 110_110_100_100 = 0xDA4 110_111_000_000 = 0xDC0 110 110_110_110_000 = 0xDB0 110_110_111_000 = 0xDB8 111 110_110_110_110 = 0xDB6 110_110_111_111 = 0xDBF

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.

Function Documentation

void XRDC_Init ( XRDC_Type *  base)

This function enables the XRDC clock.

Parameters
baseXRDC peripheral base address.
void XRDC_Deinit ( XRDC_Type *  base)

This function disables the XRDC clock.

Parameters
baseXRDC peripheral base address.
void XRDC_GetHardwareConfig ( XRDC_Type *  base,
xrdc_hardware_config_t config 
)

This function gets the XRDC hardware configurations, including number of bus masters, number of domains, number of MRCs and number of PACs.

Parameters
baseXRDC peripheral base address.
configPointer 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
baseXRDC 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
baseXRDC peripheral base address.
validTrue to valid XRDC.
static uint8_t XRDC_GetCurrentMasterDomainId ( XRDC_Type *  base)
inlinestatic

This function returns the domain ID of the current bus master.

Parameters
baseXRDC 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
baseXRDC peripheral base address.
errorPointer 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
baseXRDC peripheral base address.
errorPointer to the error information.
domainIdThe 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.
void XRDC_GetPidDefaultConfig ( xrdc_pid_config_t config)

This function initializes the configuration structure to default values. The default values are:

* config->pid = 0U;
* config->tsmEnable = 0U;
* config->sp4smEnable = 0U;
*
Parameters
configPointer 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
baseXRDC peripheral base address.
masterWhich bus master to configure.
configPointer 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
baseXRDC peripheral base address.
masterWhich master's PID to lock.
lockModeLock mode to set.
void XRDC_GetDefaultNonProcessorDomainAssignment ( xrdc_non_processor_domain_assignment_t domainAssignment)

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->privilegeAttr = kXRDC_ForceUser;
* assignment->privilegeAttr = kXRDC_ForceSecure;
* assignment->bypassDomainId = 0U;
* assignment->blogicPartId = 0U;
* assignment->benableLogicPartId = 0U;
* assignment->lock = 0U;
*
Parameters
domainAssignmentPointer to the assignment structure.
void XRDC_GetDefaultProcessorDomainAssignment ( xrdc_processor_domain_assignment_t domainAssignment)

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->domainIdSelect = kXRDC_DidMda;
* assignment->dpidEnable = kXRDC_PidDisable;
* assignment->pidMask = 0U;
* assignment->pid = 0U;
* assignment->logicPartId = 0U;
* assignment->enableLogicPartId = 0U;
* assignment->lock = 0U;
*
Parameters
domainAssignmentPointer to the assignment structure.
void XRDC_SetNonProcessorDomainAssignment ( XRDC_Type *  base,
xrdc_master_t  master,
uint8_t  assignIndex,
const xrdc_non_processor_domain_assignment_t domainAssignment 
)

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.

* xrdc_non_processor_domain_assignment_t nonProcessorAssignment;
*
* nonProcessorAssignment.domainId = 1;
* nonProcessorAssignment.xxx = xxx;
*
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterDma0, 0U, &nonProcessorAssignment);
*
Parameters
baseXRDC peripheral base address.
masterWhich master to configure.
assignIndexWhich assignment register to set.
domainAssignmentPointer to the assignment structure.
void XRDC_SetProcessorDomainAssignment ( XRDC_Type *  base,
xrdc_master_t  master,
uint8_t  assignIndex,
const xrdc_processor_domain_assignment_t domainAssignment 
)

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.

* xrdc_processor_domain_assignment_t processorAssignment;
*
*
* processorAssignment.domainId = 1;
* processorAssignment.xxx = xxx;
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterCpu0, 0U, &processorAssignment);
*
* processorAssignment.domainId = 2;
* processorAssignment.xxx = xxx;
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterCpu0, 1U, &processorAssignment);
*
* processorAssignment.domainId = 0;
* processorAssignment.xxx = xxx;
* XRDC_SetMasterDomainAssignment(XRDC, kXrdcMasterCpu0, 2U, &processorAssignment);
*
Parameters
baseXRDC peripheral base address.
masterWhich master to configure.
assignIndexWhich assignment register to set.
domainAssignmentPointer 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
baseXRDC peripheral base address.
masterWhich master to configure.
assignIndexWhich 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
baseXRDC peripheral base address.
masterWhich master to configure.
assignIndexIndex for the domain assignment register.
validTrue to set valid, false to set invalid.
void XRDC_GetMemAccessDefaultConfig ( xrdc_mem_access_config_t config)

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->lockMode = kXRDC_AccessConfigLockWritable;
* config->baseAddress = 0U;
* config->policy[0] = kXRDC_AccessPolicyNone;
* config->policy[1] = kXRDC_AccessPolicyNone;
* ...
* config->policy[15] = kXRDC_AccessPolicyNone;
*
Parameters
configPointer to the configuration structure.
void XRDC_SetMemAccessConfig ( XRDC_Type *  base,
const xrdc_mem_access_config_t config 
)

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,
* .size = kXRDC_MemSize1K,
* .policy[0] = kXRDC_AccessPolicyAll
* };
* XRDC_SetMemAccessConfig(XRDC, &config);
*

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,
* .size = kXRDC_MemSize1K,
* .policy[0] = kXRDC_AccessPolicyAll
* },
* {
* .mem = kXRDC_MemMrc0_2,
* .baseAddress = 0x1FFF0000U,
* .size = kXRDC_MemSize2K,
* .policy[0] = kXRDC_AccessPolicyAll
* }
* };
*
* for (i=0U; i<((sizeof(configs)/sizeof(configs[0]))); i++)
* {
* XRDC_SetMemAccessConfig(XRDC, &configs[i]);
* }
*
Parameters
baseXRDC peripheral base address.
configPointer to the access policy configuration structure.
static void XRDC_SetMemAccessLockMode ( XRDC_Type *  base,
xrdc_mem_t  mem,
xrdc_access_config_lock_t  lockMode 
)
inlinestatic
Parameters
baseXRDC peripheral base address.
memWhich memory region descriptor to lock.
lockModeThe 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,
* .size = kXRDC_MemSize1K,
* .policy[0] = kXRDC_AccessPolicyAll
* };
* XRDC_SetMemAccessConfig(XRDC, &config);
*
* XRDC_SetMemAccessValid(kXRDC_MemMrc0_1, false);
*
* XRDC_SetMemAccessValid(kXRDC_MemMrc0_1, true);
*
Parameters
baseXRDC peripheral base address.
memWhich memory region descriptor to set.
validTrue to set valid, false to set invalid.
void XRDC_SetMemExclAccessLockMode ( XRDC_Type *  base,
xrdc_mem_t  mem,
xrdc_excl_access_lock_config_t  lockMode 
)

Note: Any write to MRGD_W[0-3]_n clears the MRGD_W4_n[VLD] indicator so a coherent register state can be supported. It is indispensable to re-assert the valid bit when dynamically changing the EAL in the MRGD, which is done in this API.

Parameters
baseXRDC peripheral base address.
memWhich memory region's exclusive access lock mode to configure.
lockModeThe exclusive access lock mode to set.
void XRDC_ForceMemExclAccessLockRelease ( XRDC_Type *  base,
xrdc_mem_t  mem 
)

A lock can be forced to the available state (EAL=10) by a domain that does not own the lock through the forced lock release procedure: The procedure to force a exclusive access lock release is as follows:

  1. Write 0x02000046 to W1 register (PAC/MSC) or W3 register (MRC)
  2. Write 0x02000052 to W1 register (PAC/MSC) or W3 register (MRC)

Note: The two writes must be consecutive, any intervening write to the register resets the sequence.

Parameters
baseXRDC peripheral base address.
memWhich memory region's exclusive access lock to force release.
static uint8_t XRDC_GetMemExclAccessLockDomainOwner ( XRDC_Type *  base,
xrdc_mem_t  mem 
)
inlinestatic

This function returns the domain ID of the exclusive access lock owner of the memory region.

Parameters
baseXRDC peripheral base address.
memWhich memory region's exclusive access lock domain owner to get.
Returns
Domain ID of the memory region exclusive access lock owner.
void XRDC_SetMemAccsetLock ( XRDC_Type *  base,
xrdc_mem_t  mem,
xrdc_mem_accset_t  accset,
bool  lock 
)
Parameters
baseXRDC peripheral base address.
memWhich memory region descriptor to lock.
accsetWhich set/index of ACCSET to lock.
lockTrue to set lock, false to set unlock.
void XRDC_GetPeriphAccessDefaultConfig ( xrdc_periph_access_config_t config)

The default configuration is set as follows:

* config->enableSema = false;
* config->semaNum = 0U;
* config->policy[0] = kXRDC_AccessPolicyNone;
* config->policy[1] = kXRDC_AccessPolicyNone;
* ...
* config->policy[15] = kXRDC_AccessPolicyNone;
*
Parameters
configPointer to the configuration structure.
void XRDC_SetPeriphAccessConfig ( XRDC_Type *  base,
const xrdc_periph_access_config_t config 
)

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;
* XRDC_SetPeriphAccessConfig(XRDC, &config);
*

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++)
* {
* XRDC_SetPeriphAccessConfig(XRDC, &config[i]);
* }
*
Parameters
baseXRDC peripheral base address.
configPointer to the configuration structure.
static void XRDC_SetPeriphAccessLockMode ( XRDC_Type *  base,
xrdc_periph_t  periph,
xrdc_access_config_lock_t  lockMode 
)
inlinestatic
Parameters
baseXRDC peripheral base address.
periphWhich peripheral access configuration register to lock.
lockModeThe 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;
* };
* XRDC_SetPeriphAccessConfig(XRDC, &config);
*
* XRDC_SetPeriphAccessValid(kXrdcPeriLptmr0, false);
*
* XRDC_SetPeriphAccessValid(kXrdcPeriLptmr0, true);
*
Parameters
baseXRDC peripheral base address.
periphWhich peripheral access configuration to set.
validTrue to set valid, false to set invalid.
static void XRDC_SetPeriphExclAccessLockMode ( XRDC_Type *  base,
xrdc_periph_t  periph,
xrdc_excl_access_lock_config_t  lockMode 
)
inlinestatic
Parameters
baseXRDC peripheral base address.
periphWhich peripheral's exclusive access lock mode to configure.
lockModeThe exclusive access lock mode to set.
void XRDC_ForcePeriphExclAccessLockRelease ( XRDC_Type *  base,
xrdc_periph_t  periph 
)

A lock can be forced to the available state (EAL=10) by a domain that does not own the lock through the forced lock release procedure: The procedure to force a exclusive access lock release is as follows:

  1. Write 0x02000046 to W1 register (PAC/MSC) or W3 register (MRC)
  2. Write 0x02000052 to W1 register (PAC/MSC) or W3 register (MRC)

Note: The two writes must be consecutive, any intervening write to the register resets the sequence.

Parameters
baseXRDC peripheral base address.
periphWhich peripheral's exclusive access lock to force release.
static uint8_t XRDC_GetPeriphExclAccessLockDomainOwner ( XRDC_Type *  base,
xrdc_periph_t  periph 
)
inlinestatic

This function returns the domain ID of the exclusive access lock owner of the peripheral.

Parameters
baseXRDC peripheral base address.
periphWhich peripheral's exclusive access lock domain owner to get.
Returns
Domain ID of the peripheral exclusive access lock owner.