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

Overview

The MCUXpresso SDK provides a driver for the RDC module of MCUXpresso SDK devices.

The Resource Domain Controller (RDC) provides robust support for the isolation of destination memory mapped locations such as peripherals and memory to a single core, a bus master, or set of cores and bus masters.
The RDC driver should be used together with the RDC_SEMA42 driver.

Data Structures

struct  _rdc_hardware_config
 RDC hardware configuration. More...
 
struct  _rdc_domain_assignment
 Master domain assignment. More...
 
struct  _rdc_periph_access_config
 Peripheral domain access permission configuration. More...
 
struct  _rdc_mem_access_config
 Memory region domain access control configuration. More...
 
struct  _rdc_mem_status
 Memory region access violation status. More...
 

Typedefs

typedef struct _rdc_hardware_config rdc_hardware_config_t
 RDC hardware configuration.
 
typedef struct
_rdc_domain_assignment 
rdc_domain_assignment_t
 Master domain assignment.
 
typedef struct
_rdc_periph_access_config 
rdc_periph_access_config_t
 Peripheral domain access permission configuration.
 
typedef struct
_rdc_mem_access_config 
rdc_mem_access_config_t
 Memory region domain access control configuration. More...
 
typedef struct _rdc_mem_status rdc_mem_status_t
 Memory region access violation status.
 

Enumerations

enum  _rdc_interrupts { kRDC_RestoreCompleteInterrupt = RDC_INTCTRL_RCI_EN_MASK }
 RDC interrupts. More...
 
enum  _rdc_flags { kRDC_PowerDownDomainOn = RDC_STAT_PDS_MASK }
 RDC status. More...
 
enum  _rdc_access_policy {
  kRDC_NoAccess = 0,
  kRDC_WriteOnly = 1,
  kRDC_ReadOnly = 2,
  kRDC_ReadWrite = 3
}
 Access permission policy. More...
 

Functions

void RDC_Init (RDC_Type *base)
 Initializes the RDC module. More...
 
void RDC_Deinit (RDC_Type *base)
 De-initializes the RDC module. More...
 
void RDC_GetHardwareConfig (RDC_Type *base, rdc_hardware_config_t *config)
 Gets the RDC hardware configuration. More...
 
static void RDC_EnableInterrupts (RDC_Type *base, uint32_t mask)
 Enable interrupts. More...
 
static void RDC_DisableInterrupts (RDC_Type *base, uint32_t mask)
 Disable interrupts. More...
 
static uint32_t RDC_GetInterruptStatus (RDC_Type *base)
 Get the interrupt pending status. More...
 
static void RDC_ClearInterruptStatus (RDC_Type *base, uint32_t mask)
 Clear interrupt pending status. More...
 
static uint32_t RDC_GetStatus (RDC_Type *base)
 Get RDC status. More...
 
static void RDC_ClearStatus (RDC_Type *base, uint32_t mask)
 Clear RDC status. More...
 
void RDC_SetMasterDomainAssignment (RDC_Type *base, rdc_master_t master, const rdc_domain_assignment_t *domainAssignment)
 Set master domain assignment. More...
 
void RDC_GetDefaultMasterDomainAssignment (rdc_domain_assignment_t *domainAssignment)
 Get default master domain assignment. More...
 
static void RDC_LockMasterDomainAssignment (RDC_Type *base, rdc_master_t master)
 Lock master domain assignment. More...
 
void RDC_SetPeriphAccessConfig (RDC_Type *base, const rdc_periph_access_config_t *config)
 Set peripheral access policy. More...
 
void RDC_GetDefaultPeriphAccessConfig (rdc_periph_access_config_t *config)
 Get default peripheral access policy. More...
 
static void RDC_LockPeriphAccessConfig (RDC_Type *base, rdc_periph_t periph)
 Lock peripheral access policy configuration. More...
 
static uint8_t RDC_GetPeriphAccessPolicy (RDC_Type *base, rdc_periph_t periph, uint8_t domainId)
 Get the peripheral access policy for specific domain. More...
 
void RDC_SetMemAccessConfig (RDC_Type *base, const rdc_mem_access_config_t *config)
 Set memory region access policy. More...
 
void RDC_GetDefaultMemAccessConfig (rdc_mem_access_config_t *config)
 Get default memory region access policy. More...
 
static void RDC_LockMemAccessConfig (RDC_Type *base, rdc_mem_t mem)
 Lock memory access policy configuration. More...
 
static void RDC_SetMemAccessValid (RDC_Type *base, rdc_mem_t mem, bool valid)
 Enable or disable memory access policy configuration. More...
 
void RDC_GetMemViolationStatus (RDC_Type *base, rdc_mem_t mem, rdc_mem_status_t *status)
 Get the memory region violation status. More...
 
static void RDC_ClearMemViolationFlag (RDC_Type *base, rdc_mem_t mem)
 Clear the memory region violation flag. More...
 
static uint8_t RDC_GetMemAccessPolicy (RDC_Type *base, rdc_mem_t mem, uint8_t domainId)
 Get the memory region access policy for specific domain. More...
 
static uint8_t RDC_GetCurrentMasterDomainId (RDC_Type *base)
 Gets the domain ID of the current bus master. More...
 

Data Structure Documentation

struct _rdc_hardware_config

Data Fields

uint32_t domainNumber: 4
 Number of domains. More...
 
uint32_t masterNumber: 8
 Number of bus masters. More...
 
uint32_t periphNumber: 8
 Number of peripherals. More...
 
uint32_t memNumber: 8
 Number of memory regions. More...
 

Field Documentation

uint32_t _rdc_hardware_config::domainNumber
uint32_t _rdc_hardware_config::masterNumber
uint32_t _rdc_hardware_config::periphNumber
uint32_t _rdc_hardware_config::memNumber
struct _rdc_domain_assignment

Data Fields

uint32_t domainId: 2U
 Domain ID. More...
 
uint32_t __pad0__: 29U
 Reserved. More...
 
uint32_t lock: 1U
 Lock the domain assignment. More...
 

Field Documentation

uint32_t _rdc_domain_assignment::domainId
uint32_t _rdc_domain_assignment::__pad0__
uint32_t _rdc_domain_assignment::lock
struct _rdc_periph_access_config

Data Fields

rdc_periph_t periph
 Peripheral name. More...
 
bool lock
 Lock the permission until reset. More...
 
bool enableSema
 Enable semaphore or not, when enabled, master should call RDC_SEMA42_Lock to lock the semaphore gate accordingly before access the peripheral. More...
 
uint16_t policy
 Access policy. More...
 

Field Documentation

rdc_periph_t _rdc_periph_access_config::periph
bool _rdc_periph_access_config::lock
bool _rdc_periph_access_config::enableSema
uint16_t _rdc_periph_access_config::policy
struct _rdc_mem_access_config

Note that when setting the rdc_mem_access_config_t::baseAddress and rdc_mem_access_config_t::endAddress, should be aligned to the region resolution, see rdc_mem_t definitions.

Data Fields

rdc_mem_t mem
 Memory region descriptor name. More...
 
bool lock
 Lock the configuration. More...
 
uint64_t baseAddress
 Start address of the memory region. More...
 
uint64_t endAddress
 End address of the memory region. More...
 
uint16_t policy
 Access policy. More...
 

Field Documentation

rdc_mem_t _rdc_mem_access_config::mem
bool _rdc_mem_access_config::lock
uint64_t _rdc_mem_access_config::baseAddress
uint64_t _rdc_mem_access_config::endAddress
uint16_t _rdc_mem_access_config::policy
struct _rdc_mem_status

Data Fields

bool hasViolation
 Violating happens or not. More...
 
uint8_t domainID
 Violating Domain ID. More...
 
uint64_t address
 Violating Address. More...
 

Field Documentation

bool _rdc_mem_status::hasViolation
uint8_t _rdc_mem_status::domainID
uint64_t _rdc_mem_status::address

Typedef Documentation

Note that when setting the rdc_mem_access_config_t::baseAddress and rdc_mem_access_config_t::endAddress, should be aligned to the region resolution, see rdc_mem_t definitions.

Enumeration Type Documentation

Enumerator
kRDC_RestoreCompleteInterrupt 

Interrupt generated when the RDC has completed restoring state to a recently re-powered memory regions.

enum _rdc_flags
Enumerator
kRDC_PowerDownDomainOn 

Power down domain is ON.

Enumerator
kRDC_NoAccess 

Could not read or write.

kRDC_WriteOnly 

Write only.

kRDC_ReadOnly 

Read only.

kRDC_ReadWrite 

Read and write.

Function Documentation

void RDC_Init ( RDC_Type *  base)

This function enables the RDC clock.

Parameters
baseRDC peripheral base address.
void RDC_Deinit ( RDC_Type *  base)

This function disables the RDC clock.

Parameters
baseRDC peripheral base address.
void RDC_GetHardwareConfig ( RDC_Type *  base,
rdc_hardware_config_t config 
)

This function gets the RDC hardware configurations, including number of bus masters, number of domains, number of memory regions and number of peripherals.

Parameters
baseRDC peripheral base address.
configPointer to the structure to get the configuration.
static void RDC_EnableInterrupts ( RDC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRDC peripheral base address.
maskInterrupts to enable, it is OR'ed value of enum _rdc_interrupts.
static void RDC_DisableInterrupts ( RDC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRDC peripheral base address.
maskInterrupts to disable, it is OR'ed value of enum _rdc_interrupts.
static uint32_t RDC_GetInterruptStatus ( RDC_Type *  base)
inlinestatic
Parameters
baseRDC peripheral base address.
Returns
Interrupts pending status, it is OR'ed value of enum _rdc_interrupts.
static void RDC_ClearInterruptStatus ( RDC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRDC peripheral base address.
maskStatus to clear, it is OR'ed value of enum _rdc_interrupts.
static uint32_t RDC_GetStatus ( RDC_Type *  base)
inlinestatic
Parameters
baseRDC peripheral base address.
Returns
mask RDC status, it is OR'ed value of enum _rdc_flags.
static void RDC_ClearStatus ( RDC_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseRDC peripheral base address.
maskRDC status to clear, it is OR'ed value of enum _rdc_flags.
void RDC_SetMasterDomainAssignment ( RDC_Type *  base,
rdc_master_t  master,
const rdc_domain_assignment_t domainAssignment 
)
Parameters
baseRDC peripheral base address.
masterWhich master to set.
domainAssignmentPointer to the assignment.
void RDC_GetDefaultMasterDomainAssignment ( rdc_domain_assignment_t domainAssignment)

The default configuration is:

assignment->domainId = 0U;
assignment->lock = 0U;
Parameters
domainAssignmentPointer to the assignment.
static void RDC_LockMasterDomainAssignment ( RDC_Type *  base,
rdc_master_t  master 
)
inlinestatic

Once locked, it could not be unlocked until next reset.

Parameters
baseRDC peripheral base address.
masterWhich master to lock.
void RDC_SetPeriphAccessConfig ( RDC_Type *  base,
const rdc_periph_access_config_t config 
)
Parameters
baseRDC peripheral base address.
configPointer to the policy configuration.
void RDC_GetDefaultPeriphAccessConfig ( rdc_periph_access_config_t config)

The default configuration is:

config->lock = false;
config->enableSema = false;
config->policy = RDC_ACCESS_POLICY(0, kRDC_ReadWrite) |
RDC_ACCESS_POLICY(1, kRDC_ReadWrite) |
RDC_ACCESS_POLICY(2, kRDC_ReadWrite) |
RDC_ACCESS_POLICY(3, kRDC_ReadWrite);
Parameters
configPointer to the policy configuration.
static void RDC_LockPeriphAccessConfig ( RDC_Type *  base,
rdc_periph_t  periph 
)
inlinestatic

Once locked, it could not be unlocked until reset.

Parameters
baseRDC peripheral base address.
periphWhich peripheral to lock.
static uint8_t RDC_GetPeriphAccessPolicy ( RDC_Type *  base,
rdc_periph_t  periph,
uint8_t  domainId 
)
inlinestatic
Parameters
baseRDC peripheral base address.
periphWhich peripheral to get.
domainIdGet policy for which domain.
Returns
Access policy, see _rdc_access_policy.
void RDC_SetMemAccessConfig ( RDC_Type *  base,
const rdc_mem_access_config_t config 
)

Note that when setting the baseAddress and endAddress in config, should be aligned to the region resolution, see rdc_mem_t definitions.

Parameters
baseRDC peripheral base address.
configPointer to the policy configuration.
void RDC_GetDefaultMemAccessConfig ( rdc_mem_access_config_t config)

The default configuration is:

config->lock = false;
config->baseAddress = 0;
config->endAddress = 0;
config->policy = RDC_ACCESS_POLICY(0, kRDC_ReadWrite) |
RDC_ACCESS_POLICY(1, kRDC_ReadWrite) |
RDC_ACCESS_POLICY(2, kRDC_ReadWrite) |
RDC_ACCESS_POLICY(3, kRDC_ReadWrite);
Parameters
configPointer to the policy configuration.
static void RDC_LockMemAccessConfig ( RDC_Type *  base,
rdc_mem_t  mem 
)
inlinestatic

Once locked, it could not be unlocked until reset. After locked, you can only call RDC_SetMemAccessValid to enable the configuration, but can not disable it or change other settings.

Parameters
baseRDC peripheral base address.
memWhich memory region to lock.
static void RDC_SetMemAccessValid ( RDC_Type *  base,
rdc_mem_t  mem,
bool  valid 
)
inlinestatic
Parameters
baseRDC peripheral base address.
memWhich memory region to operate.
validPass in true to valid, false to invalid.
void RDC_GetMemViolationStatus ( RDC_Type *  base,
rdc_mem_t  mem,
rdc_mem_status_t status 
)

The first access violation is captured. Subsequent violations are ignored until the status register is cleared. Contents are cleared upon reading the register. Clearing of contents occurs only when the status is read by the memory region's associated domain ID(s).

Parameters
baseRDC peripheral base address.
memWhich memory region to get.
statusThe returned status.
static void RDC_ClearMemViolationFlag ( RDC_Type *  base,
rdc_mem_t  mem 
)
inlinestatic
Parameters
baseRDC peripheral base address.
memWhich memory region to clear.
static uint8_t RDC_GetMemAccessPolicy ( RDC_Type *  base,
rdc_mem_t  mem,
uint8_t  domainId 
)
inlinestatic
Parameters
baseRDC peripheral base address.
memWhich memory region to get.
domainIdGet policy for which domain.
Returns
Access policy, see _rdc_access_policy.
static uint8_t RDC_GetCurrentMasterDomainId ( RDC_Type *  base)
inlinestatic

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

Parameters
baseRDC peripheral base address.
Returns
Domain ID of current bus master.