MCUXpresso SDK API Reference Manual  Rev 2.12.1
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SMSCM: Secure Miscellaneous System Control Module

Overview

The MCUXpresso SDK provides a peripheral driver for the Secure Miscellaneous System Control (SMSMC) module of MCUXpresso SDK devices.

Function groups

Enable debug

The function SMSCM_EnableDebug() enable the debug feature.

Disable debug

The function SMSCM_DisableDebug() disable the debug feature.

Lock the debug

The function SMSCM_DebugLock() lock the debug register and it can not be modified until reset.

The value in security counter register can be setted and changed by APIs provided. Several APIs are provided to control the On-Chip Memory Registers (OCMRn), users can lock the OCMRn, enable and set flash cache mode, select ECC control functions, and some of other APIs are provided to get the ECC fault address and OCMR attribute.

Typical use case

Example use of SMSCM security counter. Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/smscm

Files

file  fsl_smscm.h
 

Data Structures

struct  smscm_ecc_fault_attr_t
 SMSCM attribute. More...
 

Enumerations

enum  _smscm_debug
 SMSCM debug enable type.
 
enum  smscm_mem_t
 SMSCM On-Chip Memory Descriptor Register.
 
enum  smscm_ecc_ctrl_t
 SMSCM ECC control type of On-Chip Memory.
 

Functions

static void SMSCM_EnableDebug (SMSCM_Type *base, uint32_t debugToEnable)
 Enable the Debug function. More...
 
static void SMSCM_DisableDebug (SMSCM_Type *base, uint32_t debugToDisable)
 Disables the Debug function. More...
 
static void SMSCM_DebugLock (SMSCM_Type *base)
 Lock the debug function. More...
 
static uint32_t SMSCM_GetSecurityCount (SMSCM_Type *base)
 Get value in Security Counter Register (SCTR). More...
 
static void SMSCM_SetSecurityCount (SMSCM_Type *base, uint32_t val)
 Set value in Security Counter Register (SCTR). More...
 
static void SMSCM_IncreaseSecurityCount (SMSCM_Type *base, uint32_t val)
 Write value to be plused in Security Counter Register (SCTR). More...
 
static void SMSCM_DecreaseSecurityCount (SMSCM_Type *base, uint32_t val)
 Write value to be minused in Security Counter Register (SCTR). More...
 
static void SMSCM_IncreaseSecurityCountBy1 (SMSCM_Type *base)
 Increase security counter rigister by 1. More...
 
static void SMSCM_DecreaseSecurityCountBy1 (SMSCM_Type *base)
 Decrease security counter rigister by 1. More...
 
static void SMSCM_LockMemControlReg (SMSCM_Type *base, smscm_mem_t mem)
 Lock the on-chip memory descriptor. More...
 
static void SMSCM_EnableFlashCache (SMSCM_Type *base, bool enable)
 Enable or disable the on-chip memory flash cache. More...
 
static void SMSCM_EnableFlashInstructionCache (SMSCM_Type *base, bool enable)
 Enable flash instruction cache. More...
 
static void SMSCM_EnableFlashDataCache (SMSCM_Type *base, bool enable)
 Enable flash data cache. More...
 
static void SMSCM_ClearFlashCache (SMSCM_Type *base)
 Clear the on-chip memory flash cache. More...
 
static void SMSCM_LockFlashIFR1 (SMSCM_Type *base)
 Lock IFR1 by flash controller. More...
 
static void SMSCM_EnableFlashSpeculate (SMSCM_Type *base, bool enable)
 SMSCM Flash Speculate enable. More...
 
static void SMSCM_EnableDataPrefetch (SMSCM_Type *base, bool enable)
 SMSCM Data Prefetch enable. More...
 
static void SMSCM_EnableFlashDataNonCorrectableBusError (SMSCM_Type *base, bool enable)
 Disable non-correctable bus errors on flash data fetches. More...
 
static void SMSCM_EnableFlashInstructionNonCorrectableBusError (SMSCM_Type *base, bool enable)
 Disable non-correctable bus errors on flash instruction fetches. More...
 
static void SMSCM_SetMemEccControl (SMSCM_Type *base, smscm_mem_t mem, smscm_ecc_ctrl_t eccCtrl)
 Select ecc control type in OCMDRn. More...
 
static void SMSCM_EnableEccReport (SMSCM_Type *base)
 Enable RAM ECC 1 bit and non-correctable reporting. More...
 
static bool SMSCM_GetEccValid (SMSCM_Type *base)
 Get the ECC location valid states. More...
 
static uint8_t SMSCM_GetEccLocation (SMSCM_Type *base)
 Get the ECC location. More...
 
void SMSCM_ClearEccError (SMSCM_Type *base, uint8_t errLocation)
 Clear each 1-bit correctable or non-correctable error. More...
 
static uint32_t SMSCM_GetEccAddress (SMSCM_Type *base)
 Get the ECC fault address. More...
 
void SMSCM_GetEccAttribute (SMSCM_Type *base, smscm_ecc_fault_attr_t *eccAttribute)
 Get ECC attribute. More...
 
static uint32_t SMSCM_GetEccFaultDataHigh (SMSCM_Type *base)
 Get ECC Fault Data High. More...
 
static uint32_t SMSCM_GetEccFaultDataLow (SMSCM_Type *base)
 Get ECC Fault Data Low. More...
 

Driver version

#define FSL_MSCM_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 SMSCM driver version 2.0.0. More...
 

Data Structure Documentation

struct smscm_ecc_fault_attr_t

Macro Definition Documentation

#define FSL_MSCM_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Function Documentation

static void SMSCM_EnableDebug ( SMSCM_Type *  base,
uint32_t  debugToEnable 
)
inlinestatic

DebugToEnable could be bitwise OR of _smscm_debug_enable.

Parameters
baseSMSCM peripheral address.
debugToEnabledebug enable type.
static void SMSCM_DisableDebug ( SMSCM_Type *  base,
uint32_t  debugToDisable 
)
inlinestatic

DebugToDisable could be bitwise OR of _smscm_debug_disable.

Parameters
baseSMSCM peripheral address.
debugToDisabledebug disable type.
static void SMSCM_DebugLock ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
static uint32_t SMSCM_GetSecurityCount ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
Returns
SMSCM SCTR value.
static void SMSCM_SetSecurityCount ( SMSCM_Type *  base,
uint32_t  val 
)
inlinestatic
Parameters
baseSMSCM peripheral base address.
valSCTR value to set.
static void SMSCM_IncreaseSecurityCount ( SMSCM_Type *  base,
uint32_t  val 
)
inlinestatic

The entire contents of the write data word are added to the security counter, and next-state SCTR =current-state SCTR + DATA32.

Parameters
baseSMSCM peripheral base address.
valSCTR value to plus.
static void SMSCM_DecreaseSecurityCount ( SMSCM_Type *  base,
uint32_t  val 
)
inlinestatic

The entire contents of the write data word are added to the security counter, and next-state SCTR =current-state SCTR - DATA32.

Parameters
baseSMSCM peripheral base address.
valSCTR value to be minused.
static void SMSCM_IncreaseSecurityCountBy1 ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
static void SMSCM_DecreaseSecurityCountBy1 ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
static void SMSCM_LockMemControlReg ( SMSCM_Type *  base,
smscm_mem_t  mem 
)
inlinestatic

This register bit provides a mechanism to “lock” the configuration state defined by OCMDRn[11:0]. Once asserted, attempted writes to the OCMDRn[11:0] register are ignored until the next reset clears the flag.

Parameters
baseSMSCM peripheral address.
memSelect OCMDRn to enable read-only mode.
static void SMSCM_EnableFlashCache ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_EnableFlashInstructionCache ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_EnableFlashDataCache ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_ClearFlashCache ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_LockFlashIFR1 ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_EnableFlashSpeculate ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_EnableDataPrefetch ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_EnableFlashDataNonCorrectableBusError ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_EnableFlashInstructionNonCorrectableBusError ( SMSCM_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
static void SMSCM_SetMemEccControl ( SMSCM_Type *  base,
smscm_mem_t  mem,
smscm_ecc_ctrl_t  eccCtrl 
)
inlinestatic
Parameters
baseSMSCM peripheral address.
memSelect OCMDRn.
eccCtrlSelect ecc control type.
static void SMSCM_EnableEccReport ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
static bool SMSCM_GetEccValid ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
Returns
State of ECC Error Location field.
static uint8_t SMSCM_GetEccLocation ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
Returns
ECC fault location.
void SMSCM_ClearEccError ( SMSCM_Type *  base,
uint8_t  errLocation 
)
Parameters
baseSMSCM peripheral address.
errLocationECC Error Location
static uint32_t SMSCM_GetEccAddress ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
Returns
ECC fault address.
void SMSCM_GetEccAttribute ( SMSCM_Type *  base,
smscm_ecc_fault_attr_t eccAttribute 
)
Parameters
baseSMSCM peripheral address.
eccAttributeEcc attribute.
static uint32_t SMSCM_GetEccFaultDataHigh ( SMSCM_Type *  base)
inlinestatic

This read-only field specifies the upper 32-bit read data word (data[63:32]) from the last captured ECCevent. For ECC events that occur in 32-bit RAMs, this 32-bit field will return 32'h0.

Parameters
baseSMSCM peripheral base address.
Returns
The higher 32-bit read data word.
static uint32_t SMSCM_GetEccFaultDataLow ( SMSCM_Type *  base)
inlinestatic
Parameters
baseSMSCM peripheral base address.
Returns
The lower 32-bit read data word.