AM64x MCU+ SDK  08.01.00

Introduction

CRC Driver API/interface file.

   CRC programming sequence:
   1. CRCChannelReset()
   2. CRCInitialize()
   3. CRCConfigure()
   4. CRCEnableIntr() - if needed
   5. Transfer data to PSA signature for generation of signature value
       - DMA is utilized in Semi-CPU mode
       - CPU need to pump data into PSA register in Full CPU mode.
   6. CRCGetPSASectorSig()
       - After complete transfer read CRC signature.

   CRC signature generated depends on amount of data copied into
   PSA register at a time/in single write. Though data pattern can be
   8, 16, 32, or 64 bit, data copied into PSA register is always 64 bit
   wide. If data pattern is less than 64 bit, then it is padded with
   zeros to make it 64 bit write.

Go to the source code of this file.

CRC Operation Mode

#define CRC_OPERATION_MODE_DATA   (CRC_CTRL2_CH1_MODE_DATA)
 
#define CRC_OPERATION_MODE_AUTO   (CRC_CTRL2_CH1_MODE_AUTO)
 
#define CRC_OPERATION_MODE_SEMICPU   (CRC_CTRL2_CH1_MODE_SEMICPU)
 
#define CRC_OPERATION_MODE_FULLCPU   (CRC_CTRL2_CH1_MODE_FULLCPU)
 
typedef uint32_t crcOperationMode_t
 CRC operation mode supported. CRC can either operate in Semi-CPU, Full-CPU or Auto mode. More...
 

CRC channel

#define CRC_CHANNEL_1   (0x1U)
 
#define CRC_CHANNEL_2   (0x2U)
 
#define CRC_CHANNEL_3   (0x3U)
 
#define CRC_CHANNEL_4   (0x4U)
 
typedef uint32_t crcChannel_t
 CRC channel supported. More...
 

CRC Interrupt Priority

The offset for the highest pending priority interrupt. These interrupt offset returned in CRCGetHighestPriorityIntrStatus function

#define CRC_INTR_PRIORITY_CH1_FAIL   (0x1U)
 
#define CRC_INTR_PRIORITY_CH2_FAIL   (0x2U)
 
#define CRC_INTR_PRIORITY_CH3_FAIL   (0x3U)
 
#define CRC_INTR_PRIORITY_CH4_FAIL   (0x4U)
 
#define CRC_INTR_PRIORITY_CH1_COMPRESSION_DONE   (0x9U)
 
#define CRC_INTR_PRIORITY_CH2_COMPRESSION_DONE   (0xaU)
 
#define CRC_INTR_PRIORITY_CH3_COMPRESSION_DONE   (0xbU)
 
#define CRC_INTR_PRIORITY_CH4_COMPRESSION_DONE   (0xcU)
 
#define CRC_INTR_PRIORITY_CH1_OVERRUN   (0x11U)
 
#define CRC_INTR_PRIORITY_CH2_OVERRUN   (0x12U)
 
#define CRC_INTR_PRIORITY_CH3_OVERRUN   (0x13U)
 
#define CRC_INTR_PRIORITY_CH4_OVERRUN   (0x14U)
 
#define CRC_INTR_PRIORITY_CH1_UNDERRUN   (0x19U)
 
#define CRC_INTR_PRIORITY_CH2_UNDERRUN   (0x1aU)
 
#define CRC_INTR_PRIORITY_CH3_UNDERRUN   (0x1bU)
 
#define CRC_INTR_PRIORITY_CH4_UNDERRUN   (0x1cU)
 
#define CRC_INTR_PRIORITY_CH1_TIMEOUT   (0x21U)
 
#define CRC_INTR_PRIORITY_CH2_TIMEOUT   (0x22U)
 
#define CRC_INTR_PRIORITY_CH3_TIMEOUT   (0x23U)
 
#define CRC_INTR_PRIORITY_CH4_TIMEOUT   (0x24U)
 
typedef uint32_t crcIntrPriority_t
 The offset for the highest pending priority interrupt. These interrupt offset returned in CRCGetHighestPriorityIntrStatus function. More...
 

CRC data bus type mask

#define CRC_DATA_BUS_ITCM_MASK   (CRC_MCRC_BUS_SEL_ITC_MEN_MASK)
 
#define CRC_DATA_BUS_DTCM_MASK   (CRC_MCRC_BUS_SEL_DTC_MEN_MASK)
 
#define CRC_DATA_BUS_VBUSM_MASK   (CRC_MCRC_BUS_SEL_MEN_MASK)
 
#define CRC_DATA_BUS_MASK_ALL
 
typedef uint32_t crcDataBusMask_t
 CRC data bus type mask selected for tracing control. More...
 

Data Structures

struct  crcSignature_t
 Structure for accessing CRC register data which are 64 bit wide. More...
 
struct  crcSignatureRegAddr_t
 Structure for accessing CRC registers address which are 64 bit wide. More...
 
struct  Crc_ChannelStaticRegs
 CRC channel static registers list. More...
 
struct  Crc_StaticRegs
 CRC static registers list. More...
 

Macros

#define CRC_CHANNEL_IRQSTATUS_RAW_MAIN_ALL
 Macro defines mask for all the interrupts for a channel. More...
 
#define CRC_PATTERN_COUNT_MAX   (0x000FFFFFU)
 Macro defines maximum value of CRC Pattern Count. More...
 
#define CRC_SECTOR_COUNT_MAX   (0x0000FFFFU)
 Macro defines maximum value of CRC Sector Count. More...
 
#define CRC_BCTOPLD_MAX   (0x00FFFFFFU)
 Macro defines maximum value of CRC Block Complete Timeout Counter Preload. More...
 
#define CRC_WDTOPLD_MAX   (0x00FFFFFFU)
 Macro defines maximum value of CRC Watchdog Timeout Counter Preload. More...
 
#define CRC_MAX_NUM_OF_CHANNELS   (4U)
 Max number of channels supported in CRC. More...
 

Functions

int32_t CRCInitialize (uint32_t baseAddr, crcChannel_t channel, uint32_t crcWatchdogPreload, uint32_t crcBlockPreload)
 Initialize CRC channel and will configure watchdog and block preload value for given channel. More...
 
int32_t CRCVerifyInitialize (uint32_t baseAddr, crcChannel_t channel, uint32_t crcWatchdogPreload, uint32_t crcBlockPreload)
 Verify the CRC watchdog and block preload value initialized for given channel. More...
 
int32_t CRCConfigure (uint32_t baseAddr, crcChannel_t channel, uint32_t crcPatternCount, uint32_t crcSectorCount, crcOperationMode_t crcMode)
 This API will configure CRC mode, pattern and sector count for given channel. More...
 
int32_t CRCVerifyConfigure (uint32_t baseAddr, crcChannel_t channel, uint32_t crcPatternCount, uint32_t crcSectorCount, crcOperationMode_t crcMode)
 This API will verify the configure of CRC mode, pattern and sector count for given channel. More...
 
int32_t CRCChannelReset (uint32_t baseAddr, crcChannel_t channel)
 This API is used to reset the CRC channel. More...
 
int32_t CRCGetPSASigRegAddr (uint32_t baseAddr, crcChannel_t channel, crcSignatureRegAddr_t *pCRCRegAddr)
 This API is used to get the PSA register address for given Channel. More...
 
int32_t CRCGetPSASig (uint32_t baseAddr, crcChannel_t channel, crcSignature_t *pCRCPSASign)
 This API is used to get the PSA register value for given Channel. More...
 
int32_t CRCSetPSASeedSig (uint32_t baseAddr, crcChannel_t channel, const crcSignature_t *pCRCPSASeedSign)
 This API is used to set the PSA seed value without compression for given Channel. More...
 
int32_t CRCGetPSASectorSig (uint32_t baseAddr, crcChannel_t channel, crcSignature_t *pCRCSectorSign)
 This API is used to get sector signature Value/ CRC value for given channel. More...
 
int32_t CRCGetHighestPriorityIntrStatus (uint32_t baseAddr, uint32_t *pIntVecAddr)
 This API is used to get the pending interrupt with highest priority. More...
 
int32_t CRCGetIntrStatus (uint32_t baseAddr, crcChannel_t channel, uint32_t *pIntrStatus)
 This API is used to get the pending interrupts for given Channel. More...
 
int32_t CRCEnableIntr (uint32_t baseAddr, crcChannel_t channel, uint32_t intrMask)
 This API is used to enable interrupts for given Channel. More...
 
int32_t CRCDisableIntr (uint32_t baseAddr, crcChannel_t channel, uint32_t intrMask)
 This API is used to disable interrupts for given Channel. More...
 
int32_t CRCClearIntr (uint32_t baseAddr, crcChannel_t channel, uint32_t intrMask)
 This API is used to clear interrupts for given Channel. More...
 
int32_t CRCPowerDownCtrl (uint32_t baseAddr, uint32_t ctrlFlag)
 This API is used to control the power down of the CRC module. More...
 
int32_t CRCIsBusy (uint32_t baseAddr, crcChannel_t channel, uint32_t *pBusyFlag)
 This API is used to check if CRC is busy for given Channel. More...
 
int32_t CRCGetCurSecNum (uint32_t baseAddr, crcChannel_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 CRCGetCurPSASig (uint32_t baseAddr, crcChannel_t channel, crcSignature_t *pCurPSASig)
 This API is used to get current known good signature value/ CRC value for given channel. More...
 
int32_t CRCGetRawData (uint32_t baseAddr, crcChannel_t channel, crcSignature_t *pRawData)
 This API is used to get the uncompressed raw data value for given channel. More...
 
int32_t CRCDataBusTracingCtrl (uint32_t baseAddr, uint32_t ctrlFlag, crcDataBusMask_t dataBusMask, crcDataBusMask_t busEnableMask)
 This API is used to control the CRC data bus tracing. More...
 
int32_t CRCVerifyBusTracingCtrl (uint32_t baseAddr, uint32_t ctrlFlag, crcDataBusMask_t dataBusMask, crcDataBusMask_t busEnableMask)
 This API is used to verify the control the CRC data bus tracing. More...
 
int32_t CRCReadStaticRegs (uint32_t baseAddr, Crc_StaticRegs *pStaticRegs)
 This API is used to read static registers of CRC 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...