SDL API Guide for J721E
MCRC Functions

Introduction

Functions

int32_t SDL_MCRC_init (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t watchdogPreload, uint32_t blockPreload)
 Initialize MCRC channel and will configure watchdog and block preload value for given channel. More...
 
int32_t SDL_MCRC_verifyInit (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t watchdogPreload, uint32_t blockPreload)
 Verify the MCRC watchdog and block preload value initialized for given channel. More...
 
int32_t SDL_MCRC_config (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t patternCount, uint32_t sectorCount, SDL_MCRC_ModeType mode)
 This API will configure MCRC mode, pattern and sector count for given channel. More...
 
int32_t SDL_MCRC_verifyConfig (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t patternCount, uint32_t sectorCount, SDL_MCRC_ModeType mode)
 This API will verify the configure of MCRC mode, pattern and sector count for given channel. More...
 
int32_t SDL_MCRC_channelReset (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel)
 This API is used to reset the MCRC channel. More...
 
int32_t SDL_MCRC_setPSASeedSig (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, const SDL_MCRC_Signature_t *pSeedSign)
 This API is used to set the PSA seed value without compression for given Channel. More...
 
int32_t SDL_MCRC_getPSASectorSig (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, SDL_MCRC_Signature_t *pSecSign)
 This API is used to get sector signature Value/ MCRC value for given channel. More...
 
int32_t SDL_MCRC_intrStatus (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t *pIntrStatus)
 This API is used to get the pending interrupts for given Channel. More...
 
int32_t SDL_MCRC_enableIntr (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t intrMask)
 This API is used to enable interrupts for given Channel. More...
 
int32_t SDL_MCRC_disableIntr (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t intrMask)
 This API is used to disable interrupts for given Channel. More...
 
int32_t SDL_MCRC_clearIntr (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t intrMask)
 This API is used to clear interrupts for given Channel. More...
 
int32_t SDL_MCRC_isBusy (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t *pBusyFlag)
 This API is used to check if MCRC is busy for given Channel. More...
 
int32_t SDL_MCRC_getCurSecNum (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, uint32_t *pCurSecNum)
 This API is used to get the current sector number of which the signature verification fails in AUTO mode for given channel. More...
 
int32_t SDL_MCRC_getPSASig (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, SDL_MCRC_Signature_t *pPSAsig)
 This API is used to get current known good signature value/ MCRC value for given channel. More...
 
int32_t SDL_MCRC_readStaticReg (SDL_MCRC_InstType instance, SDL_MCRC_StaticRegs_t *pStaticRegs)
 This API is used to read static registers of MCRC module. This API needs to be called after the initial configuration is done and hence mutliple read between static registers do not change the values. More...
 
int32_t SDL_MCRC_getCurPSASig (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, SDL_MCRC_Signature_t *pCurPSASig)
 This API is used to get current known good signature value/ MCRC value for given channel. More...
 
int32_t SDL_MCRC_getPSASigRegAddr (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, SDL_MCRC_SignatureRegAddr_t *pMCRCregAddr)
 This API is used to get the PSA register address for given Channel. More...
 
int32_t SDL_MCRC_computeSignCPUmode (SDL_MCRC_InstType instance, SDL_MCRC_channel_t channel, const SDL_MCRC_dataConfig_t *pDataConfig, SDL_MCRC_Signature_t *sectSignVal)
 This API is used to compute the signature for CPU-only mode and it check if the generated MCRC signature value matches with the reference signature value. More...
 

Function Documentation

◆ SDL_MCRC_init()

int32_t SDL_MCRC_init ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  watchdogPreload,
uint32_t  blockPreload 
)

Initialize MCRC channel and will configure watchdog and block preload value for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number to be initializaed. Values given by SDL_MCRC_channel_t.
watchdogPreloadIt is used to check if DMA does supply a block of data responding to a request in a given time frame.
blockPreloadIt is used to check if MCRC for an entire block is completed in a given time frame.
Returns
status MCRC channel initialization status. SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_verifyInit()

int32_t SDL_MCRC_verifyInit ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  watchdogPreload,
uint32_t  blockPreload 
)

Verify the MCRC watchdog and block preload value initialized for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number to be verified initialization. Values given by SDL_MCRC_channel_t.
watchdogPreloadIt is used to check if DMA does supply a block of data responding to a request in a given time frame.
blockPreloadIt is used to check if MCRC for an entire block is completed in a given time frame.
Returns
status MCRC channel verfiy initialization status. SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments SDL_EFAIL: failure, indicate verify initialization failed

◆ SDL_MCRC_config()

int32_t SDL_MCRC_config ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  patternCount,
uint32_t  sectorCount,
SDL_MCRC_ModeType  mode 
)

This API will configure MCRC mode, pattern and sector count for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number to be configured. Values given by SDL_MCRC_channel_t.
patternCountNumber of data patterns in one sector to be compressed.
sectorCountNumber of sectors in a block of memory.
modeMCRC operational mode. Refer SDL_MCRC_ModeType.
Returns
status MCRC channel configuration status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_verifyConfig()

int32_t SDL_MCRC_verifyConfig ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  patternCount,
uint32_t  sectorCount,
SDL_MCRC_ModeType  mode 
)

This API will verify the configure of MCRC mode, pattern and sector count for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number to be verified configuration. Values given by SDL_MCRC_channel_t.
patternCountNumber of data patterns in one sector to be compressed.
sectorCountNumber of sectors in a block of memory.
modeMCRC operational mode. Refer SDL_MCRC_ModeType.
Returns
status MCRC channel configuration status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments SDL_EFAIL: failure, indicate verify configure failed

◆ SDL_MCRC_channelReset()

int32_t SDL_MCRC_channelReset ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel 
)

This API is used to reset the MCRC channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which reset is to be done. Values given by SDL_MCRC_channel_t.
Returns
status MCRC channel reset status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_setPSASeedSig()

int32_t SDL_MCRC_setPSASeedSig ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
const SDL_MCRC_Signature_t pSeedSign 
)

This API is used to set the PSA seed value without compression for given Channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which PSA seed value to be set. Values given by SDL_MCRC_channel_t.
pSeedSignPointer to MCRC PSA seed signature values. Refer struct SDL_MCRC_Signature_t for details.
Returns
status MCRC channel set PSA seed value status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_getPSASectorSig()

int32_t SDL_MCRC_getPSASectorSig ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
SDL_MCRC_Signature_t pSecSign 
)

This API is used to get sector signature Value/ MCRC value for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number which was configured for MCRC calculation. Values given by SDL_MCRC_channel_t.
pSecSignPointer to MCRC PSA sector signature values Refer struct SDL_MCRC_Signature_t.
Returns
status MCRC channel get PSA sector signaure value status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_intrStatus()

int32_t SDL_MCRC_intrStatus ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t *  pIntrStatus 
)

This API is used to get the pending interrupts for given Channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which pending interrupt is to get. Values given by SDL_MCRC_channel_t.
pIntrStatusPointer to pending interrupt status/occurred.
Returns
status MCRC get pending interrupts status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_enableIntr()

int32_t SDL_MCRC_enableIntr ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  intrMask 
)

This API is used to enable interrupts for given Channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which interrupt is to enable. Values given by SDL_MCRC_channel_t.
intrMaskInterrupts to enable.
Returns
status MCRC enable interrupts status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_disableIntr()

int32_t SDL_MCRC_disableIntr ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  intrMask 
)

This API is used to disable interrupts for given Channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which interrupt is to disable. Values given by SDL_MCRC_channel_t.
intrMaskInterrupts to disable.
Returns
status MCRC disable interrupts status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_clearIntr()

int32_t SDL_MCRC_clearIntr ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t  intrMask 
)

This API is used to clear interrupts for given Channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which interrupt is to clear. Values given by SDL_MCRC_channel_t.
intrMaskInterrupts to clear status.
Returns
status MCRC clear interrupts status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_isBusy()

int32_t SDL_MCRC_isBusy ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t *  pBusyFlag 
)

This API is used to check if MCRC is busy for given Channel.


During Auto or Semi-CPU mode, the busy flag is set when the first data pattern of the block is compressed and remains set until the the last data pattern of the block is compressed. The flag is cleared when the last data pattern of the block is compressed.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which busy status is to get. Values given by SDL_MCRC_channel_t.
pBusyFlagPointer to busy flag. SDL_TRUE: MCRC channel is busy. SDL_EFALSE: MCRC channel is free.
Returns
status MCRC channel check busy status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_getCurSecNum()

int32_t SDL_MCRC_getCurSecNum ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
uint32_t *  pCurSecNum 
)

This API is used to get the current sector number of which the signature verification fails in AUTO mode for given channel.


When a sector fails, the erroneous sector number is logged and the MCRC fail interrupt is generated.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which the curent sector number is to get. Values given by SDL_MCRC_channel_t.
pCurSecNumPointer to current sector number.
Returns
status MCRC channel get current sector number status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_getPSASig()

int32_t SDL_MCRC_getPSASig ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
SDL_MCRC_Signature_t pPSAsig 
)

This API is used to get current known good signature value/ MCRC value for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which current MCRC value is to get. Values given by SDL_MCRC_channel_t.
pPSAsigPointer to current MCRC PSA signature values Refer struct SDL_MCRC_Signature_t.
Returns
status MCRC channel get current PSA signaure value status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_readStaticReg()

int32_t SDL_MCRC_readStaticReg ( SDL_MCRC_InstType  instance,
SDL_MCRC_StaticRegs_t pStaticRegs 
)

This API is used to read static registers of MCRC module. This API needs to be called after the initial configuration is done and hence mutliple read between static registers do not change the values.

Parameters
instanceMCRC instance either MCU or Main.
pStaticRegspointer to static registers to be read
Returns
SDL_PASS - success
SDL_EBADARGS - API fails due to bad input arguments

◆ SDL_MCRC_getCurPSASig()

int32_t SDL_MCRC_getCurPSASig ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
SDL_MCRC_Signature_t pCurPSASig 
)

This API is used to get current known good signature value/ MCRC value for given channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which current MCRC value is to get. Values given by SDL_MCRC_channel_t.
pCurPSASigPointer to current MCRC PSA signature values Refer struct SDL_MCRC_Signature_t.
Returns
status MCRC channel get current PSA signaure value status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_getPSASigRegAddr()

int32_t SDL_MCRC_getPSASigRegAddr ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
SDL_MCRC_SignatureRegAddr_t pMCRCregAddr 
)

This API is used to get the PSA register address for given Channel.

Parameters
instanceMCRC instance either MCU or Main.
channelChannel number for which PSA register address is to get. Values given by SDL_MCRC_channel_t.
pMCRCregAddrPointer to MCRC PSA register address structure. Refer structure SDL_MCRC_SignatureRegAddr_t.
Returns
status MCRC channel get PSA signature register address status SDL_PASS: success SDL_EBADARGS: failure, indicate the bad input arguments

◆ SDL_MCRC_computeSignCPUmode()

int32_t SDL_MCRC_computeSignCPUmode ( SDL_MCRC_InstType  instance,
SDL_MCRC_channel_t  channel,
const SDL_MCRC_dataConfig_t pDataConfig,
SDL_MCRC_Signature_t sectSignVal 
)

This API is used to compute the signature for CPU-only mode and it check if the generated MCRC signature value matches with the reference signature value.

Parameters
instanceMCRC instance either MCU or Main.
channelMCRC channel number to be used
pDataConfigPointer to data configuration
sectSignValGenerated sector signature value.
Returns
SDL_PASS: Success; SDL_FAIL: Failure; SDL_EBADARGS: Bad arguments error