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

Overview

The MCUXpresso SDK provides a driver for the Trusted Resource Domain Controller (TRDC) block of MCUXpresso SDK devices.

TRDC functions

The TRDC module includes four submodules, as follows:

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

Data Structures

struct  trdc_hardware_config_t
 TRDC hardware configuration. More...
 
struct  trdc_slave_memory_hardware_config_t
 Hardware configuration of the two slave memories within each MBC(memory block checker). More...
 
struct  trdc_processor_domain_assignment_t
 Domain assignment for the processor bus master. More...
 
struct  trdc_non_processor_domain_assignment_t
 Domain assignment for the non-processor bus master. More...
 
struct  trdc_idau_config_t
 IDAU(Implementation-Defined Attribution Unit) configuration for TZ-M function control. More...
 
struct  trdc_flw_config_t
 FLW(Flash Logical Window) configuration. More...
 
struct  trdc_domain_error_t
 TRDC domain error definition. More...
 
struct  trdc_memory_access_control_config_t
 Memory access control configuration for MBC/MRC. More...
 
struct  trdc_mrc_region_descriptor_config_t
 The configuration of each region descriptor per domain per MRC instance. More...
 
struct  trdc_mbc_nse_update_config_t
 The configuration of MBC NSE update. More...
 
struct  trdc_mbc_memory_block_config_t
 The configuration of each memory block per domain per MBC instance. More...
 

Enumerations

enum  trdc_did_sel_t {
  kTRDC_DidMda,
  kTRDC_DidInput,
  kTRDC_DidMdaAndInput,
  kTRDC_DidReserved
}
 TRDC domain ID select method, the register bit TRDC_MDA_W0_0_DFMT0[DIDS], used for domain hit evaluation. More...
 
enum  trdc_secure_attr_t {
  kTRDC_ForceSecure,
  kTRDC_ForceNonSecure,
  kTRDC_MasterSecure,
  kTRDC_MasterSecure1
}
 TRDC secure attribute, the register bit TRDC_MDA_W0_0_DFMT0[SA], used for bus master domain assignment. More...
 
enum  trdc_privilege_attr_t {
  kTRDC_ForceUser,
  kTRDC_ForcePrivilege,
  kTRDC_MasterPrivilege,
  kTRDC_MasterPrivilege1
}
 TRDC privileged attribute, the register bit TRDC_MDA_W0_x_DFMT1[PA], used for non-processor bus master domain assignment. More...
 
enum  trdc_controller_t {
  kTRDC_MemBlockController0 = 0U,
  kTRDC_MemBlockController1 = 1U,
  kTRDC_MemBlockController2 = 2U,
  kTRDC_MemBlockController3 = 3U,
  kTRDC_MemRegionChecker0 = 4U,
  kTRDC_MemRegionChecker1 = 5U
}
 TRDC controller definition for domain error check. More...
 
enum  trdc_error_state_t {
  kTRDC_ErrorStateNone = 0x00U,
  kTRDC_ErrorStateNone1 = 0x01U,
  kTRDC_ErrorStateSingle = 0x02U,
  kTRDC_ErrorStateMulti = 0x03U
}
 TRDC domain error state definition TRDC_MBCn_DERR_W1[EST] or TRDC_MRCn_DERR_W1[EST]. More...
 
enum  trdc_error_attr_t {
  kTRDC_ErrorSecureUserInst = 0x00U,
  kTRDC_ErrorSecureUserData = 0x01U,
  kTRDC_ErrorSecurePrivilegeInst = 0x02U,
  kTRDC_ErrorSecurePrivilegeData = 0x03U,
  kTRDC_ErrorNonSecureUserInst = 0x04U,
  kTRDC_ErrorNonSecureUserData = 0x05U,
  kTRDC_ErrorNonSecurePrivilegeInst = 0x06U,
  kTRDC_ErrorNonSecurePrivilegeData = 0x07U
}
 TRDC domain error attribute definition TRDC_MBCn_DERR_W1[EATR] or TRDC_MRCn_DERR_W1[EATR]. More...
 
enum  trdc_error_type_t {
  kTRDC_ErrorTypeRead = 0x00U,
  kTRDC_ErrorTypeWrite = 0x01U
}
 TRDC domain error access type definition TRDC_DERR_W1_n[ERW]. More...
 
enum  _trdc_region_descriptor {
  kTRDC_RegionDescriptor0 = (1U << 0U),
  kTRDC_RegionDescriptor1 = (1U << 1U),
  kTRDC_RegionDescriptor2 = (1U << 2U),
  kTRDC_RegionDescriptor3 = (1U << 3U),
  kTRDC_RegionDescriptor4 = (1U << 4U),
  kTRDC_RegionDescriptor5 = (1U << 5U),
  kTRDC_RegionDescriptor6 = (1U << 6U),
  kTRDC_RegionDescriptor7 = (1U << 7U),
  kTRDC_RegionDescriptor8 = (1U << 8U),
  kTRDC_RegionDescriptor9 = (1U << 9U),
  kTRDC_RegionDescriptor10 = (1U << 10U),
  kTRDC_RegionDescriptor11 = (1U << 11U),
  kTRDC_RegionDescriptor12 = (1U << 12U),
  kTRDC_RegionDescriptor13 = (1U << 13U),
  kTRDC_RegionDescriptor14 = (1U << 14U),
  kTRDC_RegionDescriptor15 = (1U << 15U)
}
 The region descriptor enumeration, used to form a mask to set/clear the NSE bits for one or several regions. More...
 
enum  _trdc_MRC_domain {
  kTRDC_MrcDomain0 = (1U << 0U),
  kTRDC_MrcDomain1 = (1U << 1U),
  kTRDC_MrcDomain2 = (1U << 2U),
  kTRDC_MrcDomain3 = (1U << 3U),
  kTRDC_MrcDomain4 = (1U << 4U),
  kTRDC_MrcDomain5 = (1U << 5U),
  kTRDC_MrcDomain6 = (1U << 6U),
  kTRDC_MrcDomain7 = (1U << 7U),
  kTRDC_MrcDomain8 = (1U << 8U),
  kTRDC_MrcDomain9 = (1U << 9U),
  kTRDC_MrcDomain10 = (1U << 10U),
  kTRDC_MrcDomain11 = (1U << 11U),
  kTRDC_MrcDomain12 = (1U << 12U),
  kTRDC_MrcDomain13 = (1U << 13U),
  kTRDC_MrcDomain14 = (1U << 14U),
  kTRDC_MrcDomain15 = (1U << 15U)
}
 The MRC domain enumeration, used to form a mask to enable/disable the update or clear all NSE bits of one or several domains. More...
 
enum  _trdc_MBC_domain {
  kTRDC_MbcDomain0 = (1U << 0U),
  kTRDC_MbcDomain1 = (1U << 1U),
  kTRDC_MbcDomain2 = (1U << 2U),
  kTRDC_MbcDomain3 = (1U << 3U),
  kTRDC_MbcDomain4 = (1U << 4U),
  kTRDC_MbcDomain5 = (1U << 5U),
  kTRDC_MbcDomain6 = (1U << 6U),
  kTRDC_MbcDomain7 = (1U << 7U)
}
 The MBC domain enumeration, used to form a mask to enable/disable the update or clear NSE bits of one or several domains. More...
 
enum  _trdc_MBC_memory {
  kTRDC_MbcSlaveMemory0 = (1U << 0U),
  kTRDC_MbcSlaveMemory1 = (1U << 1U),
  kTRDC_MbcSlaveMemory2 = (1U << 2U),
  kTRDC_MbcSlaveMemory3 = (1U << 3U)
}
 The MBC slave memory enumeration, used to form a mask to enable/disable the update or clear NSE bits of one or several memory block. More...
 
enum  _trdc_MBC_bit {
  kTRDC_MbcBit0 = (1U << 0U),
  kTRDC_MbcBit1 = (1U << 1U),
  kTRDC_MbcBit2 = (1U << 2U),
  kTRDC_MbcBit3 = (1U << 3U),
  kTRDC_MbcBit4 = (1U << 4U),
  kTRDC_MbcBit5 = (1U << 5U),
  kTRDC_MbcBit6 = (1U << 6U),
  kTRDC_MbcBit7 = (1U << 7U),
  kTRDC_MbcBit8 = (1U << 8U),
  kTRDC_MbcBit9 = (1U << 9U),
  kTRDC_MbcBit10 = (1U << 10U),
  kTRDC_MbcBit11 = (1U << 11U),
  kTRDC_MbcBit12 = (1U << 12U),
  kTRDC_MbcBit13 = (1U << 13U),
  kTRDC_MbcBit14 = (1U << 14U),
  kTRDC_MbcBit15 = (1U << 15U),
  kTRDC_MbcBit16 = (1U << 16U),
  kTRDC_MbcBit17 = (1U << 17U),
  kTRDC_MbcBit18 = (1U << 18U),
  kTRDC_MbcBit19 = (1U << 19U),
  kTRDC_MbcBit20 = (1U << 20U),
  kTRDC_MbcBit21 = (1U << 21U),
  kTRDC_MbcBit22 = (1U << 22U),
  kTRDC_MbcBit23 = (1U << 23U),
  kTRDC_MbcBit24 = (1U << 24U),
  kTRDC_MbcBit25 = (1U << 25U),
  kTRDC_MbcBit26 = (1U << 26U),
  kTRDC_MbcBit27 = (1U << 27U),
  kTRDC_MbcBit28 = (1U << 28U),
  kTRDC_MbcBit29 = (1U << 29U),
  kTRDC_MbcBit30 = (1U << 30U),
  kTRDC_MbcBit31 = (1U << 31U)
}
 The MBC bit enumeration, used to form a mask to set/clear configured words' NSE. More...
 

Initialization and deinitialization

void TRDC_Init (TRDC_Type *base)
 Initializes the TRDC module. More...
 
void TRDC_Deinit (TRDC_Type *base)
 De-initializes the TRDC module. More...
 

Hardware configuration

static uint8_t TRDC_GetCurrentMasterDomainId (TRDC_Type *base)
 Gets the domain ID of the current bus master. More...
 
void TRDC_GetHardwareConfig (TRDC_Type *base, trdc_hardware_config_t *config)
 Gets the TRDC hardware configuration. More...
 

Master domain assignment

static void TRDC_SetDacGlobalValid (TRDC_Type *base)
 Sets the TRDC DAC(Domain Assignment Controllers) global valid. More...
 
static void TRDC_LockMasterDomainAssignment (TRDC_Type *base, uint8_t master)
 Locks the bus master domain assignment register. More...
 
static void TRDC_SetMasterDomainAssignmentValid (TRDC_Type *base, uint8_t master, bool valid)
 Sets the master domain assignment as valid or invalid. More...
 
void TRDC_GetDefaultProcessorDomainAssignment (trdc_processor_domain_assignment_t *domainAssignment)
 Gets the default master domain assignment for the processor bus master. More...
 
void TRDC_GetDefaultNonProcessorDomainAssignment (trdc_non_processor_domain_assignment_t *domainAssignment)
 Gets the default master domain assignment for non-processor bus master. More...
 
void TRDC_SetProcessorDomainAssignment (TRDC_Type *base, const trdc_processor_domain_assignment_t *domainAssignment)
 Sets the processor bus master domain assignment. More...
 
void TRDC_SetNonProcessorDomainAssignment (TRDC_Type *base, uint8_t master, const trdc_non_processor_domain_assignment_t *domainAssignment)
 Sets the non-processor bus master domain assignment. More...
 

TZ-M congiguration

void TRDC_GetDefaultIDAUConfig (trdc_idau_config_t *idauConfiguration)
 Gets the default IDAU(Implementation-Defined Attribution Unit) configuration. More...
 
void TRDC_SetIDAU (TRDC_Type *base, const trdc_idau_config_t *idauConfiguration)
 Sets the IDAU(Implementation-Defined Attribution Unit) control configuration. More...
 

FLW(Flash Logical Window) configuration

static void TRDC_EnableFlashLogicalWindow (TRDC_Type *base, bool enable)
 Enables/disables the FLW(flash logical window) function. More...
 
static void TRDC_LockFlashLogicalWindow (TRDC_Type *base)
 Locks FLW registers. More...
 
static uint32_t TRDC_GetFlashLogicalWindowPbase (TRDC_Type *base)
 Gets the FLW physical base address. More...
 
static void TRDC_GetSetFlashLogicalWindowSize (TRDC_Type *base, uint16_t size)
 Sets the FLW size. More...
 
void TRDC_GetDefaultFlashLogicalWindowConfig (trdc_flw_config_t *flwConfiguration)
 Gets the default FLW(Flsh Logical Window) configuration. More...
 
void TRDC_SetFlashLogicalWindow (TRDC_Type *base, const trdc_flw_config_t *flwConfiguration)
 Sets the FLW function's configuration. More...
 

Domain error check and clear

status_t TRDC_GetAndClearFirstDomainError (TRDC_Type *base, trdc_domain_error_t *error)
 Gets and clears the first domain error of the current domain. More...
 
status_t TRDC_GetAndClearFirstSpecificDomainError (TRDC_Type *base, trdc_domain_error_t *error, uint8_t domainId)
 Gets and clears the first domain error of the specific domain. More...
 

MRC configuration

static void TRDC_SetMrcGlobalValid (TRDC_Type *base)
 Sets the TRDC MRC(Memory Region Checkers) global valid. More...
 
static uint8_t TRDC_GetMrcRegionNumber (TRDC_Type *base, uint8_t mrcIdx)
 Gets the TRDC MRC(Memory Region Checkers) region number valid. More...
 
void TRDC_MrcSetMemoryAccessConfig (TRDC_Type *base, const trdc_memory_access_control_config_t *config, uint8_t mrcIdx, uint8_t regIdx)
 Sets the memory access configuration for one of the access control register of one MRC. More...
 
void TRDC_MrcEnableDomainNseUpdate (TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask, bool enable)
 Enables the update of the selected domians. More...
 
void TRDC_MrcRegionNseSet (TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask)
 Sets the NSE bits of the selected regions for domains. More...
 
void TRDC_MrcRegionNseClear (TRDC_Type *base, uint8_t mrcIdx, uint16_t regionMask)
 Clears the NSE bits of the selected regions for domains. More...
 
void TRDC_MrcDomainNseClear (TRDC_Type *base, uint8_t mrcIdx, uint16_t domianMask)
 Clears the NSE bits for all the regions of the selected domains. More...
 
void TRDC_MrcSetRegionDescriptorConfig (TRDC_Type *base, const trdc_mrc_region_descriptor_config_t *config)
 Sets the configuration for one of the region descriptor per domain per MRC instnce. More...
 

MBC configuration

static void TRDC_SetMbcGlobalValid (TRDC_Type *base)
 Sets the TRDC MBC(Memory Block Checkers) global valid. More...
 
void TRDC_GetMbcHardwareConfig (TRDC_Type *base, trdc_slave_memory_hardware_config_t *config, uint8_t mbcIdx, uint8_t slvIdx)
 Gets the hardware configuration of the one of two slave memories within each MBC(memory block checker). More...
 
void TRDC_MbcSetNseUpdateConfig (TRDC_Type *base, const trdc_mbc_nse_update_config_t *config, uint8_t mbcIdx)
 Sets the NSR update configuration for one of the MBC instance. More...
 
void TRDC_MbcWordNseSet (TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask)
 Sets the NSE bits of the selected configuration words according to NSE update configuration. More...
 
void TRDC_MbcWordNseClear (TRDC_Type *base, uint8_t mbcIdx, uint32_t bitMask)
 Clears the NSE bits of the selected configuration words according to NSE update configuration. More...
 
void TRDC_MbcNseClearAll (TRDC_Type *base, uint8_t mbcIdx, uint8_t domainMask, uint8_t memoryMask)
 Clears all configuration words' NSE bits of the selected domain and memory. More...
 
void TRDC_MbcSetMemoryAccessConfig (TRDC_Type *base, const trdc_memory_access_control_config_t *config, uint8_t mbcIdx, uint8_t rgdIdx)
 Sets the memory access configuration for one of the region descriptor of one MBC. More...
 
void TRDC_MbcSetMemoryBlockConfig (TRDC_Type *base, const trdc_mbc_memory_block_config_t *config)
 Sets the configuration for one of the memory block per domain per MBC instnce. More...
 

Data Structure Documentation

struct trdc_hardware_config_t

Data Fields

uint8_t masterNumber
 Number of bus masters. More...
 
uint8_t domainNumber
 Number of domains. More...
 
uint8_t mbcNumber
 Number of MBCs. More...
 
uint8_t mrcNumber
 Number of MRCs. More...
 

Field Documentation

uint8_t trdc_hardware_config_t::masterNumber
uint8_t trdc_hardware_config_t::domainNumber
uint8_t trdc_hardware_config_t::mbcNumber
uint8_t trdc_hardware_config_t::mrcNumber
struct trdc_slave_memory_hardware_config_t

Data Fields

uint32_t blockNum
 Number of blocks. More...
 
uint32_t blockSize
 Block size. More...
 

Field Documentation

uint32_t trdc_slave_memory_hardware_config_t::blockNum
uint32_t trdc_slave_memory_hardware_config_t::blockSize
struct trdc_processor_domain_assignment_t

Data Fields

uint32_t domainId: 3U
 Domain ID. More...
 
uint32_t __pad0__: 1U
 Reserved. More...
 
uint32_t domainIdSelect: 2U
 Domain ID select method, see trdc_did_sel_t. More...
 
uint32_t __pad1__: 8U
 Reserved. More...
 
uint32_t secureAttr: 2U
 Secure attribute, see trdc_secure_attr_t. More...
 
uint32_t __pad2__: 14U
 Reserved. More...
 
uint32_t lock: 1U
 Lock the register. More...
 
uint32_t __pad3__: 1U
 Reserved. More...
 

Field Documentation

uint32_t trdc_processor_domain_assignment_t::domainId
uint32_t trdc_processor_domain_assignment_t::__pad0__
uint32_t trdc_processor_domain_assignment_t::domainIdSelect
uint32_t trdc_processor_domain_assignment_t::__pad1__
uint32_t trdc_processor_domain_assignment_t::secureAttr
uint32_t trdc_processor_domain_assignment_t::__pad2__
uint32_t trdc_processor_domain_assignment_t::lock
uint32_t trdc_processor_domain_assignment_t::__pad3__
struct trdc_non_processor_domain_assignment_t

Data Fields

uint32_t domainId: 3U
 Domain ID. More...
 
uint32_t __pad0__: 1U
 Reserved. More...
 
uint32_t privilegeAttr: 2U
 Privileged attribute, see trdc_privilege_attr_t. More...
 
uint32_t secureAttr: 2U
 Secure attribute, see trdc_secure_attr_t. More...
 
uint32_t bypassDomainId: 1U
 Bypass domain ID. More...
 
uint32_t __pad1__: 21U
 Reserved. More...
 
uint32_t lock: 1U
 Lock the register. More...
 
uint32_t __pad2__: 1U
 Reserved. More...
 

Field Documentation

uint32_t trdc_non_processor_domain_assignment_t::domainId
uint32_t trdc_non_processor_domain_assignment_t::__pad0__
uint32_t trdc_non_processor_domain_assignment_t::privilegeAttr
uint32_t trdc_non_processor_domain_assignment_t::secureAttr
uint32_t trdc_non_processor_domain_assignment_t::bypassDomainId
uint32_t trdc_non_processor_domain_assignment_t::__pad1__
uint32_t trdc_non_processor_domain_assignment_t::lock
uint32_t trdc_non_processor_domain_assignment_t::__pad2__
struct trdc_idau_config_t

Data Fields

uint32_t __pad0__: 8U
 Reserved. More...
 
uint32_t lockSecureVTOR: 1U
 Disable writes to secure VTOR(Vector Table Offset Register). More...
 
uint32_t lockNonsecureVTOR: 1U
 Disable writes to non-secure VTOR, Application interrupt and Reset Control Registers. More...
 
uint32_t lockSecureMPU: 1U
 Disable writes to secure MPU(Memory Protection Unit) from software or from a debug agent connected to the processor in Secure state. More...
 
uint32_t lockNonsecureMPU: 1U
 Disable writes to non-secure MPU(Memory Protection Unit) from software or from a debug agent connected to the processor. More...
 
uint32_t lockSAU: 1U
 Disable writes to SAU(Security Attribution Unit) registers. More...
 
uint32_t __pad1__: 19U
 Reserved. More...
 

Field Documentation

uint32_t trdc_idau_config_t::__pad0__
uint32_t trdc_idau_config_t::lockSecureVTOR
uint32_t trdc_idau_config_t::lockNonsecureVTOR
uint32_t trdc_idau_config_t::lockSecureMPU
uint32_t trdc_idau_config_t::lockNonsecureMPU
uint32_t trdc_idau_config_t::lockSAU
uint32_t trdc_idau_config_t::__pad1__
struct trdc_flw_config_t

Data Fields

uint16_t blockCount
 Block count of the Flash Logic Window in 32KByte blocks. More...
 
uint32_t arrayBaseAddr
 Flash array base address of the Flash Logical Window. More...
 
bool lock
 Disable writes to FLW registers. More...
 
bool enable
 Enable FLW function. More...
 

Field Documentation

uint16_t trdc_flw_config_t::blockCount
uint32_t trdc_flw_config_t::arrayBaseAddr
bool trdc_flw_config_t::lock
bool trdc_flw_config_t::enable
struct trdc_domain_error_t

Data Fields

trdc_controller_t controller
 Which controller captured access violation. More...
 
uint32_t address
 Access address that generated access violation. More...
 
trdc_error_state_t errorState
 Error state. More...
 
trdc_error_attr_t errorAttr
 Error attribute. More...
 
trdc_error_type_t errorType
 Error type. More...
 
uint8_t errorPort
 Error port. More...
 
uint8_t domainId
 Domain ID. More...
 
uint8_t slaveMemoryIdx
 The slave memory index. More...
 

Field Documentation

trdc_controller_t trdc_domain_error_t::controller
uint32_t trdc_domain_error_t::address
trdc_error_state_t trdc_domain_error_t::errorState
trdc_error_attr_t trdc_domain_error_t::errorAttr
trdc_error_type_t trdc_domain_error_t::errorType
uint8_t trdc_domain_error_t::errorPort
uint8_t trdc_domain_error_t::domainId
uint8_t trdc_domain_error_t::slaveMemoryIdx

Only apply when violation in MBC.

struct trdc_memory_access_control_config_t

Data Fields

uint32_t nonsecureUsrX: 1U
 Allow nonsecure user execute access. More...
 
uint32_t nonsecureUsrW: 1U
 Allow nonsecure user write access. More...
 
uint32_t nonsecureUsrR: 1U
 Allow nonsecure user read access. More...
 
uint32_t __pad0__: 1U
 Reserved. More...
 
uint32_t nonsecurePrivX: 1U
 Allow nonsecure privilege execute access. More...
 
uint32_t nonsecurePrivW: 1U
 Allow nonsecure privilege write access. More...
 
uint32_t nonsecurePrivR: 1U
 Allow nonsecure privilege read access. More...
 
uint32_t __pad1__: 1U
 Reserved. More...
 
uint32_t secureUsrX: 1U
 Allow secure user execute access. More...
 
uint32_t secureUsrW: 1U
 Allow secure user write access. More...
 
uint32_t secureUsrR: 1U
 Allow secure user read access. More...
 
uint32_t __pad2__: 1U
 Reserved. More...
 
uint32_t securePrivX: 1U
 Allownsecure privilege execute access. More...
 
uint32_t securePrivW: 1U
 Allownsecure privilege write access. More...
 
uint32_t securePrivR: 1U
 Allownsecure privilege read access. More...
 
uint32_t __pad3__: 16U
 Reserved. More...
 
uint32_t lock: 1U
 Lock the configuration until next reset, only apply to access control register 0. More...
 

Field Documentation

uint32_t trdc_memory_access_control_config_t::nonsecureUsrX
uint32_t trdc_memory_access_control_config_t::nonsecureUsrW
uint32_t trdc_memory_access_control_config_t::nonsecureUsrR
uint32_t trdc_memory_access_control_config_t::__pad0__
uint32_t trdc_memory_access_control_config_t::nonsecurePrivX
uint32_t trdc_memory_access_control_config_t::nonsecurePrivW
uint32_t trdc_memory_access_control_config_t::nonsecurePrivR
uint32_t trdc_memory_access_control_config_t::__pad1__
uint32_t trdc_memory_access_control_config_t::secureUsrX
uint32_t trdc_memory_access_control_config_t::secureUsrW
uint32_t trdc_memory_access_control_config_t::secureUsrR
uint32_t trdc_memory_access_control_config_t::__pad2__
uint32_t trdc_memory_access_control_config_t::securePrivX
uint32_t trdc_memory_access_control_config_t::securePrivW
uint32_t trdc_memory_access_control_config_t::securePrivR
uint32_t trdc_memory_access_control_config_t::__pad3__
uint32_t trdc_memory_access_control_config_t::lock
struct trdc_mrc_region_descriptor_config_t

Data Fields

uint8_t memoryAccessControlSelect
 Select one of the 8 access control policies for this region, for access cotrol policies see trdc_memory_access_control_config_t. More...
 
uint32_t startAddr
 Physical start address. More...
 
bool valid
 Lock the register. More...
 
bool nseEnable
 Enable non-secure accesses and disable secure accesses. More...
 
uint32_t endAddr
 Physical start address. More...
 
uint8_t mrcIdx
 The index of the MRC for this configuration to take effect. More...
 
uint8_t domainIdx
 The index of the domain for this configuration to take effect. More...
 
uint8_t regionIdx
 The index of the region for this configuration to take effect. More...
 

Field Documentation

uint8_t trdc_mrc_region_descriptor_config_t::memoryAccessControlSelect
uint32_t trdc_mrc_region_descriptor_config_t::startAddr
bool trdc_mrc_region_descriptor_config_t::valid
bool trdc_mrc_region_descriptor_config_t::nseEnable
uint32_t trdc_mrc_region_descriptor_config_t::endAddr
uint8_t trdc_mrc_region_descriptor_config_t::mrcIdx
uint8_t trdc_mrc_region_descriptor_config_t::domainIdx
uint8_t trdc_mrc_region_descriptor_config_t::regionIdx
struct trdc_mbc_nse_update_config_t

Data Fields

uint32_t __pad0__: 2U
 Reserved. More...
 
uint32_t wordIdx: 4U
 MBC configuration word index to be updated. More...
 
uint32_t __pad1__: 2U
 Reserved. More...
 
uint32_t memorySelect: 4U
 Bit mask of the selected memory to be updated. More...
 
uint32_t __pad2__: 4U
 Reserved. More...
 
uint32_t domianSelect: 8U
 Bit mask of the selected domain to be updated. More...
 
uint32_t __pad3__: 7U
 Reserved. More...
 
uint32_t autoIncrement: 1U
 Whether to increment the word index after current word is updated using this configuration. More...
 

Field Documentation

uint32_t trdc_mbc_nse_update_config_t::__pad0__
uint32_t trdc_mbc_nse_update_config_t::wordIdx
uint32_t trdc_mbc_nse_update_config_t::__pad1__
uint32_t trdc_mbc_nse_update_config_t::memorySelect
uint32_t trdc_mbc_nse_update_config_t::__pad2__
uint32_t trdc_mbc_nse_update_config_t::domianSelect
uint32_t trdc_mbc_nse_update_config_t::__pad3__
uint32_t trdc_mbc_nse_update_config_t::autoIncrement
struct trdc_mbc_memory_block_config_t

Data Fields

uint32_t memoryAccessControlSelect: 3U
 Select one of the 8 access control policies for this memory block, for access cotrol policies see trdc_memory_access_control_config_t. More...
 
uint32_t nseEnable: 1U
 Enable non-secure accesses and disable secure accesses. More...
 
uint32_t mbcIdx: 4U
 The index of the MBC for this configuration to take effect. More...
 
uint32_t domainIdx: 8U
 The index of the domain for this configuration to take effect. More...
 
uint32_t slaveMemoryIdx: 8U
 The index of the slave memory for this configuration to take effect. More...
 
uint32_t memoryBlockIdx: 8U
 The index of the memory block for this configuration to take effect. More...
 

Field Documentation

uint32_t trdc_mbc_memory_block_config_t::memoryAccessControlSelect
uint32_t trdc_mbc_memory_block_config_t::nseEnable
uint32_t trdc_mbc_memory_block_config_t::mbcIdx
uint32_t trdc_mbc_memory_block_config_t::domainIdx
uint32_t trdc_mbc_memory_block_config_t::slaveMemoryIdx
uint32_t trdc_mbc_memory_block_config_t::memoryBlockIdx

Enumeration Type Documentation

Enumerator
kTRDC_DidMda 

Use MDAn[2:0] as DID.

kTRDC_DidInput 

Use the input DID (DID_in) as DID.

kTRDC_DidMdaAndInput 

Use MDAn[2] concatenated with DID_in[1:0] as DID.

kTRDC_DidReserved 

Reserved.

Enumerator
kTRDC_ForceSecure 

Force the bus attribute for this master to secure.

kTRDC_ForceNonSecure 

Force the bus attribute for this master to non-secure.

kTRDC_MasterSecure 

Use the bus master's secure/nonsecure attribute directly.

kTRDC_MasterSecure1 

Use the bus master's secure/nonsecure attribute directly.

Enumerator
kTRDC_ForceUser 

Force the bus attribute for this master to user.

kTRDC_ForcePrivilege 

Force the bus attribute for this master to privileged.

kTRDC_MasterPrivilege 

Use the bus master's attribute directly.

kTRDC_MasterPrivilege1 

Use the bus master's attribute directly.

Enumerator
kTRDC_MemBlockController0 

Memory block checker 0.

kTRDC_MemBlockController1 

Memory block checker 1.

kTRDC_MemBlockController2 

Memory block checker 2.

kTRDC_MemBlockController3 

Memory block checker 3.

kTRDC_MemRegionChecker0 

Memory region checker 0.

kTRDC_MemRegionChecker1 

Memory region checker 1.

Enumerator
kTRDC_ErrorStateNone 

No access violation detected.

kTRDC_ErrorStateNone1 

No access violation detected.

kTRDC_ErrorStateSingle 

Single access violation detected.

kTRDC_ErrorStateMulti 

Multiple access violation detected.

Enumerator
kTRDC_ErrorSecureUserInst 

Secure user mode, instruction fetch access.

kTRDC_ErrorSecureUserData 

Secure user mode, data access.

kTRDC_ErrorSecurePrivilegeInst 

Secure privileged mode, instruction fetch access.

kTRDC_ErrorSecurePrivilegeData 

Secure privileged mode, data access.

kTRDC_ErrorNonSecureUserInst 

NonSecure user mode, instruction fetch access.

kTRDC_ErrorNonSecureUserData 

NonSecure user mode, data access.

kTRDC_ErrorNonSecurePrivilegeInst 

NonSecure privileged mode, instruction fetch access.

kTRDC_ErrorNonSecurePrivilegeData 

NonSecure privileged mode, data access.

Enumerator
kTRDC_ErrorTypeRead 

Error occurs on read reference.

kTRDC_ErrorTypeWrite 

Error occurs on write reference.

Enumerator
kTRDC_RegionDescriptor0 

Region descriptor 0.

kTRDC_RegionDescriptor1 

Region descriptor 1.

kTRDC_RegionDescriptor2 

Region descriptor 2.

kTRDC_RegionDescriptor3 

Region descriptor 3.

kTRDC_RegionDescriptor4 

Region descriptor 4.

kTRDC_RegionDescriptor5 

Region descriptor 5.

kTRDC_RegionDescriptor6 

Region descriptor 6.

kTRDC_RegionDescriptor7 

Region descriptor 7.

kTRDC_RegionDescriptor8 

Region descriptor 8.

kTRDC_RegionDescriptor9 

Region descriptor 9.

kTRDC_RegionDescriptor10 

Region descriptor 10.

kTRDC_RegionDescriptor11 

Region descriptor 11.

kTRDC_RegionDescriptor12 

Region descriptor 12.

kTRDC_RegionDescriptor13 

Region descriptor 13.

kTRDC_RegionDescriptor14 

Region descriptor 14.

kTRDC_RegionDescriptor15 

Region descriptor 15.

Enumerator
kTRDC_MrcDomain0 

Domain 0.

kTRDC_MrcDomain1 

Domain 1.

kTRDC_MrcDomain2 

Domain 2.

kTRDC_MrcDomain3 

Domain 3.

kTRDC_MrcDomain4 

Domain 4.

kTRDC_MrcDomain5 

Domain 5.

kTRDC_MrcDomain6 

Domain 6.

kTRDC_MrcDomain7 

Domain 7.

kTRDC_MrcDomain8 

Domain 8.

kTRDC_MrcDomain9 

Domain 9.

kTRDC_MrcDomain10 

Domain 10.

kTRDC_MrcDomain11 

Domain 11.

kTRDC_MrcDomain12 

Domain 12.

kTRDC_MrcDomain13 

Domain 13.

kTRDC_MrcDomain14 

Domain 14.

kTRDC_MrcDomain15 

Domain 15.

Enumerator
kTRDC_MbcDomain0 

Domain 0.

kTRDC_MbcDomain1 

Domain 1.

kTRDC_MbcDomain2 

Domain 2.

kTRDC_MbcDomain3 

Domain 3.

kTRDC_MbcDomain4 

Domain 4.

kTRDC_MbcDomain5 

Domain 5.

kTRDC_MbcDomain6 

Domain 6.

kTRDC_MbcDomain7 

Domain 7.

Enumerator
kTRDC_MbcSlaveMemory0 

Memory 0.

kTRDC_MbcSlaveMemory1 

Memory 1.

kTRDC_MbcSlaveMemory2 

Memory 2.

kTRDC_MbcSlaveMemory3 

Memory 3.

Enumerator
kTRDC_MbcBit0 

Bit 0.

kTRDC_MbcBit1 

Bit 1.

kTRDC_MbcBit2 

Bit 2.

kTRDC_MbcBit3 

Bit 3.

kTRDC_MbcBit4 

Bit 4.

kTRDC_MbcBit5 

Bit 5.

kTRDC_MbcBit6 

Bit 6.

kTRDC_MbcBit7 

Bit 7.

kTRDC_MbcBit8 

Bit 8.

kTRDC_MbcBit9 

Bit 9.

kTRDC_MbcBit10 

Bit 10.

kTRDC_MbcBit11 

Bit 11.

kTRDC_MbcBit12 

Bit 12.

kTRDC_MbcBit13 

Bit 13.

kTRDC_MbcBit14 

Bit 14.

kTRDC_MbcBit15 

Bit 15.

kTRDC_MbcBit16 

Bit 16.

kTRDC_MbcBit17 

Bit 17.

kTRDC_MbcBit18 

Bit 18.

kTRDC_MbcBit19 

Bit 19.

kTRDC_MbcBit20 

Bit 20.

kTRDC_MbcBit21 

Bit 21.

kTRDC_MbcBit22 

Bit 22.

kTRDC_MbcBit23 

Bit 23.

kTRDC_MbcBit24 

Bit 24.

kTRDC_MbcBit25 

Bit 25.

kTRDC_MbcBit26 

Bit 26.

kTRDC_MbcBit27 

Bit 27.

kTRDC_MbcBit28 

Bit 28.

kTRDC_MbcBit29 

Bit 29.

kTRDC_MbcBit30 

Bit 30.

kTRDC_MbcBit31 

Bit 31.

Function Documentation

void TRDC_Init ( TRDC_Type *  base)

This function enables the TRDC clock.

Parameters
baseTRDC peripheral base address.
void TRDC_Deinit ( TRDC_Type *  base)

This function disables the TRDC clock.

Parameters
baseTRDC peripheral base address.
static uint8_t TRDC_GetCurrentMasterDomainId ( TRDC_Type *  base)
inlinestatic
Parameters
baseTRDC peripheral base address.
Returns
Domain ID of current bus master.
void TRDC_GetHardwareConfig ( TRDC_Type *  base,
trdc_hardware_config_t config 
)

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

Parameters
baseTRDC peripheral base address.
configPointer to the structure to get the configuration.
static void TRDC_SetDacGlobalValid ( TRDC_Type *  base)
inlinestatic

Once enabled, it will remain enabled until next reset.

Parameters
baseTRDC peripheral base address.
static void TRDC_LockMasterDomainAssignment ( TRDC_Type *  base,
uint8_t  master 
)
inlinestatic

This function locks the master domain assignment. After it is locked, the register can't be changed until next reset.

Parameters
baseTRDC peripheral base address.
masterWhich master to configure.
assignIndexWhich assignment register to lock.
static void TRDC_SetMasterDomainAssignmentValid ( TRDC_Type *  base,
uint8_t  master,
bool  valid 
)
inlinestatic

This function sets the master domain assignment as valid or invalid.

Parameters
baseTRDC peripheral base address.
masterWhich master to configure.
assignIndexIndex for the domain assignment register.
validTrue to set valid, false to set invalid.
void TRDC_GetDefaultProcessorDomainAssignment ( trdc_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 = kTRDC_DidMda;
* assignment->lock = 0U;
*
Parameters
domainAssignmentPointer to the assignment structure.
void TRDC_GetDefaultNonProcessorDomainAssignment ( trdc_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 = kTRDC_ForceUser;
* assignment->secureAttr = kTRDC_ForceSecure;
* assignment->bypassDomainId = 0U;
* assignment->lock = 0U;
*
Parameters
domainAssignmentPointer to the assignment structure.
void TRDC_SetProcessorDomainAssignment ( TRDC_Type *  base,
const trdc_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.

* trdc_processor_domain_assignment_t processorAssignment;
*
*
* processorAssignment.domainId = 0;
* processorAssignment.xxx = xxx;
* TRDC_SetMasterDomainAssignment(TRDC, &processorAssignment);
*
Parameters
baseTRDC peripheral base address.
domainAssignmentPointer to the assignment structure.
void TRDC_SetNonProcessorDomainAssignment ( TRDC_Type *  base,
uint8_t  master,
const trdc_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.

* trdc_non_processor_domain_assignment_t nonProcessorAssignment;
*
* nonProcessorAssignment.domainId = 1;
* nonProcessorAssignment.xxx = xxx;
*
* TRDC_SetMasterDomainAssignment(TRDC, kXrdcMasterDma0, 0U, &nonProcessorAssignment);
*
Parameters
baseTRDC peripheral base address.
masterWhich master to configure.
assignIndexWhich assignment register to set.
domainAssignmentPointer to the assignment structure.
void TRDC_GetDefaultIDAUConfig ( trdc_idau_config_t idauConfiguration)
* config->lockSecureVTOR = false;
* config->lockNonsecureVTOR = false;
* config->lockSecureMPU = false;
* config->lockNonsecureMPU = false;
* config->lockSAU = false;
*
Parameters
domainAssignmentPointer to the configuration structure.
void TRDC_SetIDAU ( TRDC_Type *  base,
const trdc_idau_config_t idauConfiguration 
)

Example: Lock the secure and non-secure MPU registers.

* trdc_idau_config_t idauConfiguration;
*
* TRDC_GetDefaultIDAUConfig(&idauConfiguration);
*
* idauConfiguration.lockSecureMPU = true;
* idauConfiguration.lockNonsecureMPU = true;
* TRDC_SetIDAU(TRDC, &idauConfiguration);
*
Parameters
baseTRDC peripheral base address.
domainAssignmentPointer to the configuration structure.
static void TRDC_EnableFlashLogicalWindow ( TRDC_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseTRDC peripheral base address.
enableTrue to enable, false to disable.
static void TRDC_LockFlashLogicalWindow ( TRDC_Type *  base)
inlinestatic

Once locked the registers can noy be updated until next reset.

Parameters
baseTRDC peripheral base address.
static uint32_t TRDC_GetFlashLogicalWindowPbase ( TRDC_Type *  base)
inlinestatic
Parameters
baseTRDC peripheral base address.
Returns
Physical address of the FLW function.
static void TRDC_GetSetFlashLogicalWindowSize ( TRDC_Type *  base,
uint16_t  size 
)
inlinestatic
Parameters
baseTRDC peripheral base address.
sizeSize of the FLW in unit of 32k bytes.
void TRDC_GetDefaultFlashLogicalWindowConfig ( trdc_flw_config_t flwConfiguration)
* config->blockCount = false;
* config->arrayBaseAddr = false;
* config->lock = false;
* config->enable = false;
*
Parameters
flwConfigurationPointer to the configuration structure.
void TRDC_SetFlashLogicalWindow ( TRDC_Type *  base,
const trdc_flw_config_t flwConfiguration 
)
* trdc_flw_config_t flwConfiguration;
*
* TRDC_GetDefaultIDAUConfig(&flwConfiguration);
*
* flwConfiguration.blockCount = 32U;
* flwConfiguration.arrayBaseAddr = 0xXXXXXXXX;
* TRDC_SetIDAU(TRDC, &flwConfiguration);
*
Parameters
baseTRDC peripheral base address.
flwConfigurationPointer to the configuration structure.
status_t TRDC_GetAndClearFirstDomainError ( TRDC_Type *  base,
trdc_domain_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
baseTRDC peripheral base address.
errorPointer to the error information. return 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_NoData.
status_t TRDC_GetAndClearFirstSpecificDomainError ( TRDC_Type *  base,
trdc_domain_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
baseTRDC peripheral base address.
errorPointer to the error information.
domainIdThe error of which domain to get and clear. return 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_NoData.
static void TRDC_SetMrcGlobalValid ( TRDC_Type *  base)
inlinestatic

Once enabled, it will remain enabled until next reset.

Parameters
baseTRDC peripheral base address.
static uint8_t TRDC_GetMrcRegionNumber ( TRDC_Type *  base,
uint8_t  mrcIdx 
)
inlinestatic
Parameters
baseTRDC peripheral base address.
void TRDC_MrcSetMemoryAccessConfig ( TRDC_Type *  base,
const trdc_memory_access_control_config_t config,
uint8_t  mrcIdx,
uint8_t  regIdx 
)

Example: Enable the secure operations and lock the configuration for MRC0 region 1.

*
* config.securePrivX = true;
* config.securePrivW = true;
* config.securePrivR = true;
* config.lock = true;
* TRDC_SetMrcMemoryAccess(TRDC, &config, 0, 1);
*
Parameters
baseTRDC peripheral base address.
configPointer to the configuration structure.
mrcIdxMRC index.
regIdxRegister number.
void TRDC_MrcEnableDomainNseUpdate ( TRDC_Type *  base,
uint8_t  mrcIdx,
uint16_t  domianMask,
bool  enable 
)

After the domians' update are enabled, their regions' NSE bits can be set or clear.

Parameters
baseTRDC peripheral base address.
mrcIdxMRC index.
domianMaskBit mask of the domains to be enabled.
enableTrue to enable, false to disable.
void TRDC_MrcRegionNseSet ( TRDC_Type *  base,
uint8_t  mrcIdx,
uint16_t  regionMask 
)

This function sets the NSE bits for the selected regions for the domains whose update are enabled.

Parameters
baseTRDC peripheral base address.
mrcIdxMRC index.
regionMaskBit mask of the regions whose NSE bits to set.
void TRDC_MrcRegionNseClear ( TRDC_Type *  base,
uint8_t  mrcIdx,
uint16_t  regionMask 
)

This function clears the NSE bits for the selected regions for the domains whose update are enabled.

Parameters
baseTRDC peripheral base address.
mrcIdxMRC index.
regionMaskBit mask of the regions whose NSE bits to clear.
void TRDC_MrcDomainNseClear ( TRDC_Type *  base,
uint8_t  mrcIdx,
uint16_t  domianMask 
)

This function clears the NSE bits for all regions of selected domains whose update are enabled.

Parameters
baseTRDC peripheral base address.
mrcIdxMRC index.
domianMaskBit mask of the domians whose NSE bits to clear.
void TRDC_MrcSetRegionDescriptorConfig ( TRDC_Type *  base,
const trdc_mrc_region_descriptor_config_t config 
)

This function sets the configuration for one of the region descriptor, including the start and end address of the region, memory access control policy and valid.

Parameters
baseTRDC peripheral base address.
configPointer to region descriptor configuration structure.
static void TRDC_SetMbcGlobalValid ( TRDC_Type *  base)
inlinestatic

Once enabled, it will remain enabled until next reset.

Parameters
baseTRDC peripheral base address.
void TRDC_GetMbcHardwareConfig ( TRDC_Type *  base,
trdc_slave_memory_hardware_config_t config,
uint8_t  mbcIdx,
uint8_t  slvIdx 
)
Parameters
baseTRDC peripheral base address.
configPointer to the structure to get the configuration.
mbcIdxMBC number.
slvIdxSlave number.
void TRDC_MbcSetNseUpdateConfig ( TRDC_Type *  base,
const trdc_mbc_nse_update_config_t config,
uint8_t  mbcIdx 
)

After set the NSE configuration, the configured memory area can be updateby NSE set/clear.

Parameters
baseTRDC peripheral base address.
configPointer to NSE update configuration structure.
mbcIdxMBC index.
void TRDC_MbcWordNseSet ( TRDC_Type *  base,
uint8_t  mbcIdx,
uint32_t  bitMask 
)

This function sets the NSE bits of the word for the configured regio, memory.

Parameters
baseTRDC peripheral base address.
mbcIdxMBC index.
bitMaskMask of the bits whose NSE bits to set.
void TRDC_MbcWordNseClear ( TRDC_Type *  base,
uint8_t  mbcIdx,
uint32_t  bitMask 
)

This function sets the NSE bits of the word for the configured regio, memory.

Parameters
baseTRDC peripheral base address.
mbcIdxMBC index.
bitMaskMask of the bits whose NSE bits to clear.
void TRDC_MbcNseClearAll ( TRDC_Type *  base,
uint8_t  mbcIdx,
uint8_t  domainMask,
uint8_t  memoryMask 
)
Parameters
baseTRDC peripheral base address.
mbcIdxMBC index.
bitMaskMask of the bits whose NSE bits to clear.
void TRDC_MbcSetMemoryAccessConfig ( TRDC_Type *  base,
const trdc_memory_access_control_config_t config,
uint8_t  mbcIdx,
uint8_t  rgdIdx 
)

Example: Enable the secure operations and lock the configuration for MRC0 region 1.

*
* config.securePrivX = true;
* config.securePrivW = true;
* config.securePrivR = true;
* config.lock = true;
* TRDC_SetMbcMemoryAccess(TRDC, &config, 0, 1);
*
Parameters
baseTRDC peripheral base address.
configPointer to the configuration structure.
mbcIdxMBC index.
rgdIdxRegion descriptor number.
void TRDC_MbcSetMemoryBlockConfig ( TRDC_Type *  base,
const trdc_mbc_memory_block_config_t config 
)

This function sets the configuration for one of the memory block, including the memory access control policy and nse enable.

Parameters
baseTRDC peripheral base address.
configPointer to memory block configuration structure.