xilplmi
Vitis Drivers API Documentation
XilPlmi server APIs

Macros

#define XPLMI_MAX_RECURSIVE_CDO_PROCESS   (2U)
 < Maximum recursive CDO processing allowed More...
 
#define XPLMI_XCSUDMA_DEST_CTRL_OFFSET   (0x80CU)
 CSUDMA destination control offset. More...
 
#define XPLMI_CMD_ID_EM_FEATURES   (0U)
 Command Id of error module features. More...
 
#define XPLMI_CMD_ID_EM_SET_ACTION   (1U)
 Command Id of set action error module. More...
 
#define XPLMI_SYSMON_SAT0_PCSR_MASK_OFFSET   (0x10000U)
 SAT0 PCSR mask offset. More...
 
#define XPLMI_SYSMON_SAT1_PCSR_MASK_OFFSET   (0x20000U)
 SAT1 PCSR mask offset. More...
 
#define XPLMI_SYSMON_PCSR_CTRL_SLVERREN_MASK   (0x80000U)
 PCSR control slave error enable mask. More...
 
#define PMC_ANALOG_GD_CTRL_REG   (0xF1160000U)
 PMC_ANALOG base address. More...
 
#define PMC_ANALOG_GD0_RST_STATUS_REG_MASK   (0x200U)
 Glitch detector0 status mask. More...
 
#define PMC_ANALOG_GD1_RST_STATUS_REG_MASK   (0x2000000U)
 Glitch detector1 status mask. More...
 
#define PMC_ANALOG_GD_STATUS
 Glitch detector status mask. More...
 
#define CRP_CFU_REF_CTRL   (0xF1260108U)
 CRP CFU_REF_CTRL register address. More...
 
#define CRP_CFU_REF_CTRL_DIVISOR_MASK   (0x3FF00U)
 CRP CFU_REF_CTRL Divisor mask. More...
 
#define CFU_REF_CTRL_DIVISOR_INCREASE   (0x2U)
 CRP CFU_REF_CTRL Divisor increase. More...
 
#define XPLMI_SYSMON_CLK_SRC_IRO_VAL   (0U)
 Sysmon clock source IRO value. More...
 
#define XPLMI_PMC_ERR_SSIT_MASK   (0xE0000000U)
 PMC error SSIT mask. More...
 
#define CPM_NCR_PCIE0_LINK_DOWN_PROC_ID   (0x1U)
 PCIE0 link down proc Id. More...
 
#define CPM_NCR_PCIE1_LINK_DOWN_PROC_ID   (0x2U)
 PCIE1 link down proc Id. More...
 
#define XPLMI_DIGEST_PMC_1_0_ROM_1_0   (0x2B004AC7U)
 PMC1 ROM version 1 digest. More...
 
#define XPLMI_DIGEST_PMC_2_0_ROM_2_0   (0xB576B550U)
 PMC2 ROM version 2 digest. More...
 
#define XPLMI_ROM_VERSION_1_0   (0x10U)
 ROM version 1. More...
 
#define XPLMI_ROM_VERSION_2_0   (0x20U)
 ROM version 2. More...
 
#define XPLMI_INVALID_ROM_VERSION   (0x0U)
 Invalid ROM version. More...
 
#define XPLMI_CFU_STREAM_2_SLR_OFFSET   (CFU_STREAM_2_ADDR - XPLMI_PMC_LOCAL_BASEADDR)
 SLR offset for CFU stream 2 register. More...
 
#define XPLMI_CFU_FDRO_2_SLR_OFFSET   (CFU_FDRO_2_ADDR - XPLMI_PMC_LOCAL_BASEADDR)
 SLR offset for CFU FDRO 2 register. More...
 
#define XPLMI_SLR1_CFU_FDRO_2_ADDR   (XPLMI_PMC_ALIAS1_BASEADDR + XPLMI_CFU_FDRO_2_SLR_OFFSET)
 SLR1 CFU FDRO 2 address. More...
 
#define XPLMI_SLR2_CFU_FDRO_2_ADDR   (XPLMI_PMC_ALIAS2_BASEADDR + XPLMI_CFU_FDRO_2_SLR_OFFSET)
 SLR2 CFU FDRO 2 address. More...
 
#define XPLMI_SLR3_CFU_FDRO_2_ADDR   (XPLMI_PMC_ALIAS3_BASEADDR + XPLMI_CFU_FDRO_2_SLR_OFFSET)
 SLR3 CFU FDRO 2 address. More...
 
#define XPLMI_SLR1_CFU_STREAM_2_ADDR   (XPLMI_PMC_ALIAS1_BASEADDR + XPLMI_CFU_STREAM_2_SLR_OFFSET)
 SLR1 CFU Stream 2 address. More...
 
#define XPLMI_SLR2_CFU_STREAM_2_ADDR   (XPLMI_PMC_ALIAS2_BASEADDR + XPLMI_CFU_STREAM_2_SLR_OFFSET)
 SLR2 CFU Stream 2 address. More...
 
#define XPLMI_SLR3_CFU_STREAM_2_ADDR   (XPLMI_PMC_ALIAS3_BASEADDR + XPLMI_CFU_STREAM_2_SLR_OFFSET)
 SLR3 CFU Stream 2 address. More...
 
#define XPLMI_PMC_VOLTAGE_MULTIPLIER   (32768.0f)
 PMC voltage multiplier. More...
 
#define XPLMI_PMC_VERSION_1_0   (0x10U)
 PMC version 1.0. More...
 
#define XPLMI_CMD_ID_ASU_FEATURES   (0U)
 Command Id of ASU module features. More...
 
#define XPLMI_CMD_ID_ASU_KEY_TRANSFER   (1U)
 Command Id of ASU key transfer features. More...
 
#define XPLMI_CMD_ID_ASU_FEATURES_INDEX   (0U)
 ASU module features index. More...
 
#define XPLMI_CMD_ID_ASU_RESPONSE_INDEX   (1U)
 ASU module response index. More...
 
#define XPLMI_RESP_CMD_EXEC_STATUS_INDEX   (0U)
 Response command execution status index. More...
 
#define XPLMI_ERROR_TABLE_DS_VER   (1U)
 Error table data structure version. More...
 
#define XPLMI_ERROR_TABLE_DS_LCVER   (1U)
 Error table data structure LC version. More...
 
#define XPLMI_NUM_ERROUTS_VERSION   (1U)
 ERROUTS version. More...
 
#define XPLMI_NUM_ERROUTS_LCVERSION   (1U)
 ERROUTS LC version. More...
 
#define PCIE0_LINK_DOWN_PROC_ID   (0x1U)
 PCIE0 link down proc Id. More...
 
#define PCIE1_LINK_DOWN_PROC_ID   (0x2U)
 PCIE1 link down proc Id. More...
 
#define XPLMI_ROM_VERSION_1_0   (0x10U)
 ROM version 1. More...
 
#define XPLMI_SSSCFG_SHA0_MASK   (0x000F0000U)
 SHA0 mask. More...
 
#define XPLMI_SSSCFG_SHA1_MASK   (0x0F000000U)
 SHA1 mask. More...
 
#define XPLMI_SSSCFG_AES_MASK   (0x0000F000U)
 AES mask. More...
 
#define XPLMI_SSS_SHA0_DMA0   (0x000C0000U)
 SHA0 DMA0. More...
 
#define XPLMI_SSS_SHA0_DMA1   (0x00070000U)
 SHA0 DMA1. More...
 
#define XPLMI_SSS_SHA1_DMA0   (0x0A000000U)
 SHA1 DMA0. More...
 
#define XPLMI_SSS_SHA1_DMA1   (0x0F000000U)
 SHA1 DMA1. More...
 
#define XPLMI_SSS_AES_DMA0   (0x0000E000U)
 AES DMA0. More...
 
#define XPLMI_SSS_AES_DMA1   (0x00005000U)
 AES DMA1. More...
 
#define XPLMI_LPDINITIALIZED_VER   (1U)
 LPD initialized version. More...
 
#define XPLMI_LPDINITIALIZED_LCVER   (1U)
 LPD initialized LC version. More...
 
#define XPLMI_UART_BASEADDR_VER   (1U)
 UART base address version. More...
 
#define XPLMI_UART_BASEADDR_LCVER   (1U)
 UART base address LC version. More...
 
#define XPLMI_TRACE_LOG_VERSION   (1U)
 Trace log version. More...
 
#define XPLMI_TRACE_LOG_LCVERSION   (1U)
 Trace log LC version. More...
 
#define XPLMI_BOARD_PARAMS_VERSION   (1U)
 Board parameters version. More...
 
#define XPLMI_BOARD_PARAMS_LCVERSION   (1U)
 Board parameters LC version. More...
 
#define XPLMI_XIOMODULE_VERSION   (1U)
 IOModule version. More...
 
#define XPLMI_XIOMODULE_LCVERSION   (1U)
 IOModule LC version. More...
 
#define XPLMI_PMC_VOLTAGE_MULTIPLIER   (32768.0f)
 Voltage multiplier for Sysmon. More...
 
#define XPLMI_PMC_IRO_FREQ_233_MHZ   (233000000U)
 PMC IRO frequency 233Mhz. More...
 
#define XPLMI_PPU_BUFFER_DS_VER   (1U)
 PPU buffers Data structure version. More...
 
#define XPLMI_PPU_BUFFER_DS_LCVER   (1U)
 PPU buffers Data structure LC version. More...
 
#define XPLMI_PMC_BUFFER_DS_VER   (1U)
 PMC buffers Data structure version. More...
 
#define XPLMI_PMC_BUFFER_DS_LCVER   (1U)
 PMC buffers Data structure LC version. More...
 
#define XPLMI_PPU_BUFFER_LIST_DS_VER   (1U)
 PPU buffer list Data structure version. More...
 
#define XPLMI_PPU_BUFFER_LIST_DS_LCVER   (1U)
 PPU buffer list Data structure LC version. More...
 
#define XPLMI_PMC_BUFFER_LIST_DS_VER   (1U)
 PMC buffer list Data structure version. More...
 
#define XPLMI_PMC_BUFFER_LIST_DS_LCVER   (1U)
 PMC buffer list Data structure LC version. More...
 
#define XPLMI_ERROR_TABLE_DS_VER   (1U)
 Error table data structure version. More...
 
#define XPLMI_ERROR_TABLE_DS_LCVER   (1U)
 Error table data structure LC version. More...
 
#define XPLMI_IS_PSMCR_CHANGED_VERSION   (1U)
 PSMCR changed version status. More...
 
#define XPLMI_IS_PSMCR_CHANGED_LCVERSION   (1U)
 PSMCR changed LC version status. More...
 
#define XPLMI_NUM_ERROUTS_VERSION   (1U)
 ERROUTS version. More...
 
#define XPLMI_NUM_ERROUTS_LCVERSION   (1U)
 ERROUTS LC version. More...
 
#define CPM5N_NCR_PCIE0_LINK_UP_EVENT_PROC_ID   (0x1U)
 CPM5N_NCR_PCIE0 linkup event procedure Id. More...
 
#define CPM5N_NCR_PCIE1_LINK_UP_EVENT_PROC_ID   (0x2U)
 CPM5N_NCR_PCIE1 linkup event procedure Id. More...
 
#define CPM5N_NCR_PCIE2_LINK_UP_EVENT_PROC_ID   (0x3U)
 CPM5N_NCR_PCIE2 linkup event procedure Id. More...
 
#define CPM5N_NCR_PCIE3_LINK_UP_EVENT_PROC_ID   (0x4U)
 CPM5N_NCR_PCIE3 linkup event procedure Id. More...
 
#define XPLMI_ROM_VERSION_1_0   (0x10U)
 ROM version 1. More...
 
#define XPLMI_SSSCFG_SHA0_MASK   (0x000F0000U)
 SHA0 mask. More...
 
#define XPLMI_SSSCFG_SHA1_MASK   (0x0F000000U)
 SHA1 mask. More...
 
#define XPLMI_SSSCFG_AES_MASK   (0x0000F000U)
 AES mask. More...
 
#define XPLMI_SSS_SHA0_DMA0   (0x000C0000U)
 SHA0 DMA0. More...
 
#define XPLMI_SSS_SHA0_DMA1   (0x00070000U)
 SHA0 DMA1. More...
 
#define XPLMI_SSS_SHA1_DMA0   (0x0A000000U)
 SHA1 DMA0. More...
 
#define XPLMI_SSS_SHA1_DMA1   (0x0F000000U)
 SHA1 DMA1. More...
 
#define XPLMI_SSS_AES_DMA0   (0x0000E000U)
 AES DMA0. More...
 
#define XPLMI_SSS_AES_DMA1   (0x00005000U)
 AES DMA1. More...
 
#define XPLMI_LPDINITIALIZED_VER   (1U)
 LPD initialized version. More...
 
#define XPLMI_LPDINITIALIZED_LCVER   (1U)
 LPD initialized LC version. More...
 
#define XPLMI_UART_BASEADDR_VER   (1U)
 UART base address version. More...
 
#define XPLMI_UART_BASEADDR_LCVER   (1U)
 UART base address LC version. More...
 
#define XPLMI_TRACE_LOG_VERSION   (1U)
 Trace log version. More...
 
#define XPLMI_TRACE_LOG_LCVERSION   (1U)
 Trace log LC version. More...
 
#define XPLMI_BOARD_PARAMS_VERSION   (1U)
 Board parameters version. More...
 
#define XPLMI_BOARD_PARAMS_LCVERSION   (1U)
 Board parameters LC version. More...
 
#define XPLMI_XIOMODULE_VERSION   (1U)
 IOModule version. More...
 
#define XPLMI_XIOMODULE_LCVERSION   (1U)
 IOModule LC version. More...
 
#define XPLMI_PMC_VOLTAGE_MULTIPLIER   (32768.0f)
 Voltage multiplier for Sysmon. More...
 
#define XPLMI_PMC_IRO_FREQ_233_MHZ   (233000000U)
 PMC IRO frequency 233Mhz. More...
 
#define XPLMI_PSM_BUFFER_DS_VER   (1U)
 PSM buffers Data structure version. More...
 
#define XPLMI_PSM_BUFFER_DS_LCVER   (1U)
 PSM buffers Data structure LC version. More...
 
#define XPLMI_PMC_BUFFER_DS_VER   (1U)
 PMC buffers Data structure version. More...
 
#define XPLMI_PMC_BUFFER_DS_LCVER   (1U)
 PMC buffers Data structure LC version. More...
 
#define XPLMI_PSM_BUFFER_LIST_DS_VER   (1U)
 PSM buffer list Data structure version. More...
 
#define XPLMI_PSM_BUFFER_LIST_DS_LCVER   (1U)
 PSM buffer list Data structure LC version. More...
 
#define XPLMI_PMC_BUFFER_LIST_DS_VER   (1U)
 PMC buffer list Data structure version. More...
 
#define XPLMI_PMC_BUFFER_LIST_DS_LCVER   (1U)
 PMC buffer list Data structure LC version. More...
 
#define XPLMI_BUFFER_PSM_SEND_API_ID   (0x8U)
 API Id. More...
 
#define XPLMI_BUFFER_PSM_SEND_API_ID_IDX   (0U)
 API Id index. More...
 
#define XPLMI_BUFFER_PSM_SEND_START_ADDR_IDX   (1U)
 Start address index. More...
 
#define XPLMI_BUFFER_PSM_SEND_END_ADDR_IDX   (2U)
 End address index. More...
 
#define XPLMI_BUFFER_PAYLOAD_ARG_CNT   (7U)
 Payload argument count. More...
 
#define IPI_MAX_TIMEOUT   (0x2DB267AAU)
 IPI Max timeout ~5sec. More...
 
#define XPLMI_SCATTER_WRITE_PAYLOAD_LEN   (2U)
 Scatter write payload length. More...
 
#define XPLMI_SCATTER_WRITE2_PAYLOAD_LEN   (3U)
 Scatter write2 payload length. More...
 
#define XPLMI_FIPS_WRITE_KATMASK_PAYLOAD_LEN   (7U)
 FIPS write KAT mask payload length. More...
 
#define XPLMI_MAX_ADDR_BUFFERS   (3U)
 Maximum address buffers. More...
 
#define XPLMI_MAX_ADDR_LIST_CNT   (200U)
 Maximum address list count. More...
 
#define XPLMI_LIST_ID_MASK   (0xFF000000U)
 List Id mask. More...
 
#define XPLMI_LIST_ID_SHIFT   (24U)
 List Id shift. More...
 
#define XPLMI_ADDRESS_OFFSET_MASK   (0x00FFFFFFU)
 Address buffer offset mask. More...
 
#define XPLMI_LIST_ID_INDEX   (7U)
 List Id index. More...
 
#define XPLMI_RESET_VECTOR   (0xF0200000U)
 Reset vector. More...
 
#define XPLMI_ROM_PLM_UPDATE_REQ   (0x08U)
 ROM PLM update request. More...
 
#define PMX_PLM_UPDATE_REASON_MASK   (0x00000008U)
 PMX PLM update reason mask. More...
 
#define XPLMI_ROM_INT_REASON_CLEAR   (0x0000000FU)
 ROM initialize reason clear. More...
 
#define PLM_UPDATE_DONE_POLL_TIMEOUT   (1000U)
 PLM update done POLL timeout. More...
 
#define XPLMI_UPDATE_DB_VERSION   (1U)
 DB version update. More...
 
#define XPLMI_DS_HDR_SIZE   (sizeof(XPlmi_DsHdr))
 Data structure header size. More...
 
#define XPLMI_DS_CNT   (u32)(__data_struct_end - __data_struct_start)
 Data structure count. More...
 
#define XPLMI_UPDATE_PDIADDR_VER   (2U)
 PDI Address version update. More...
 
#define XPLMI_UPDATE_PDIADDR_LCVER   (2U)
 PDI Address LC version update. More...
 
#define XPLMI_UPDATE_TASK_ID   (0x120U)
 Task Id update. More...
 
#define XPLMI_UPDATE_FLAG_MASK   (0x1U)
 In-Place Update flag Mask. More...
 
#define XPLMI_UPDATE_PAYLOAD_LEN   (0x2U)
 In-Place Update payload len. More...
 
#define XPLMI_UPDATE_USING_IMAGE_STORE   (0U)
 In-Place Update using PDI in Image Store,1-DDR Location. More...
 
#define XPLMI_UPDATE_IN_PROGRESS   (0x1U)
 Update in progress. More...
 
#define XPLMI_UPDATE_DONE   (0x2U)
 Update done. More...
 
#define XPLMI_INVALID_UPDATE_ADDR   (0xFFFFFFFFU)
 Invalid update address. More...
 
#define XPLMI_UPDATE_TASK_DELAY   (10U)
 Update task delay. More...
 
#define XPLMI_WDT_PERIODICITY   (100U)
 WDT periodicity. More...
 
#define XPLMI_SCHEDULER_PERIOD   (10U)
 Scheduler period. More...
 
#define XPLMI_WDT_PERIODICITY_MIN   (15U)
 Minimum WDT periodicity. More...
 
#define XPLMI_WDT_PERIODICITY_MAX   (1000U)
 Maximum WDT periodicity. More...
 
#define XPLMI_SPP_WDT_PERIODICITY_MIN   (45U)
 SPP minimum WDT periodicity. More...
 
#define XPLMI_MIO_NUM_PER_BANK   (26U)
 Number of MIO per bank. More...
 
#define XPLMI_PM_STMIC_LMIO_0   (0x14104001U)
 PM STMIC LMIO_0. More...
 
#define XPLMI_PM_STMIC_LMIO_25   (0x1410401aU)
 PM STMIC LMIO_25. More...
 
#define XPLMI_PM_STMIC_PMIO_0   (0x1410801bU)
 PM STMIC PMIO_0. More...
 
#define XPLMI_PM_STMIC_PMIO_51   (0x1410804eU)
 PM STMIC PMIO_51. More...
 
#define XPLMI_PM_DEV_PMC_WDT   (0x1821C035U)
 PM DEV PMC WDT. More...
 

Functions

int XPlmi_Init (void)
 This function will initialize the PLMI module. More...
 
int XPlmi_RunTimeConfigInit (void)
 This function initializes the Runtime Configuration Area with default values. More...
 
void XPlmi_LpdInit (void)
 This function calls all the PS LPD init functions of all the different modules. More...
 
void XPlmi_PrintPlmBanner (void)
 This function prints PLM banner. More...
 
void XPlmi_ResetLpdInitialized (void)
 This function resets LpdInitialized variable to 0. More...
 
void XPlmi_SetLpdInitialized (u32 Flag)
 This function sets LpdInitialized variable with given flag. More...
 
void XPlmi_UnSetLpdInitialized (u32 Flag)
 This function clears LpdInitialized variable with given flag. More...
 
void XPlmi_UpdateKatStatus (u32 PlmKatStatus)
 This function sets XPLMI_RTCFG_PLM_KAT_ADDR with PlmKatStatus. More...
 
u32 XPlmi_GetKatStatus (void)
 This function is called to get KAT status. More...
 
void XPlmi_SetKatMask (u32 PlmKatMask)
 This function sets XPLMI_RTCFG_PLM_KAT_ADDR with PlmKatMask. More...
 
void XPlmi_ClearKatMask (u32 PlmKatMask)
 This function clears XPLMI_RTCFG_PLM_KAT_ADDR with PlmKatMask. More...
 
u32 XPlmi_IsCryptoKatEn (void)
 This function will return the crypto kat enable status from efuse cache. More...
 
int XPlmi_InitCdo (XPlmiCdo *CdoPtr)
 This function initializes the CDO pointer structure. More...
 
int XPlmi_ProcessCdo (XPlmiCdo *CdoPtr)
 This function process the CDO file. More...
 
int XPlmi_CmdExecute (XPlmi_Cmd *CmdPtr)
 This function will call the command handler registered with the command. More...
 
int XPlmi_CmdResume (XPlmi_Cmd *CmdPtr)
 This function resumes the command after being partially executed. More...
 
int XPlmi_InitUart (void)
 This function initializes the PS UART. More...
 
int XPlmi_ConfigUart (u8 UartSelect, u8 UartEnable)
 This function configures the PS UART base address. More...
 
void outbyte (char c)
 This function prints and logs the terminal prints to debug log buffer. More...
 
void XPlmi_Print (u16 DebugType, const char8 *Ctrl1,...)
 This function prints debug messages with timestamp. More...
 
int XPlmi_DmaInit (void)
 This function will initialize the DMA driver instances. More...
 
XPmcDma * XPlmi_GetDmaInstance (u32 DeviceId)
 This function returns DMA instance. More...
 
int XPlmi_WaitForNonBlkDma (u32 DmaFlags)
 This function is used to wait on non blocking DMA. More...
 
int XPlmi_WaitForNonBlkSrcDma (u32 DmaFlags)
 This function is used set wait on non blocking DMA. More...
 
int XPlmi_WaitForNonBlkDestDma (u32 DmaFlags)
 This function is used set wait on non blocking DMA. More...
 
int XPlmi_SbiDmaXfer (u64 DestAddr, u32 Len, u32 Flags)
 This function is used to transfer the data from SBI to DMA. More...
 
int XPlmi_DmaSbiXfer (u64 SrcAddr, u32 Len, u32 Flags)
 This function is used to transfer the data from DMA to SBI. More...
 
int XPlmi_DmaXfr (u64 SrcAddr, u64 DestAddr, u32 Len, u32 Flags)
 This function is used to initiate and complete the DMA to DMA transfer. More...
 
int XPlmi_EccInit (u64 Addr, u32 Len)
 This function is used to initialize the ECC memory. More...
 
int XPlmi_MemSet (u64 DestAddress, u32 Val, u32 Len)
 This function is used to Set the memory with a value. More...
 
int XPlmi_InitNVerifyMem (u64 Addr, u32 Len)
 This function initializes the memory using PZM and verifies by reading back initialized memory. More...
 
void XPlmi_SetMaxOutCmds (u8 Val)
 This function is used to set the MaxOutCmds variable. More...
 
int XPlmi_MemSetBytes (void *const DestPtr, u32 DestLen, u8 Val, u32 Length)
 This function is used to Set the memory with a value. More...
 
int XPlmi_MemCpy64 (u64 DestAddress, u64 SrcAddress, u32 Length)
 This function can copy the content of memory for both 32 and 64-bit address space. More...
 
void XPlmi_LogPlmErr (int ErrStatusVal)
 This function is called for logging PLM error into FW_ERR register. More...
 
void XPlmi_ErrMgr (int ErrStatusVal)
 This function is called in PLM error cases. More...
 
void XPlmi_UpdateErrorSubsystemId (u32 ErrorNodeId, u32 ErrorMasks, u32 SubsystemId)
 This function updates the SubystemId for the given error index. More...
 
void XPlmi_PORHandler (void)
 This function triggers Power on Reset. More...
 
u32 XPlmi_GetErrorId (u32 ErrorNodeId, u32 RegMask)
 This function returns Error Id for the given error node type and error mask. More...
 
void XPlmi_HandleSwError (u32 ErrorNodeId, u32 RegMask)
 This function handles the Software error triggered from within PLM. More...
 
void XPlmi_ErrIntrHandler (void *CallbackRef)
 This function is default interrupt handler for EAM error which will add the task to the task queue. More...
 
int XPlmi_ErrorTaskHandler (void *Data)
 This function is the interrupt handler for the EAM errors. More...
 
void XPlmi_EmClearError (XPlmi_EventType ErrorNodeType, u32 ErrorId)
 This function clears any previous errors before enabling them. More...
 
u32 EmDisableErrAction (u32 ErrMaskRegAddr, u32 RegMask)
 This function disables the error action for the given error mask. More...
 
int XPlmi_EmDisablePmcErrors (u32 RegOffset, u32 RegMask)
 This function disables the PMC error actions for the given mask. More...
 
int XPlmi_EmDisable (u32 ErrorNodeId, u32 RegMask)
 This function disables the responses for the given error. More...
 
int XPlmi_EmConfig (XPlmi_EventType NodeType, u32 ErrorId, u8 ActionId, XPlmi_ErrorHandler_t ErrorHandler, const u32 SubsystemId)
 This function configures the Action specified for a given Error ID. More...
 
int XPlmi_EmSetAction (u32 ErrorNodeId, u32 ErrorMasks, u8 ActionId, XPlmi_ErrorHandler_t ErrorHandler, const u32 SubsystemId)
 This function sets the Action specified for a given Error Masks. More...
 
int XPlmi_EmInit (XPlmi_ShutdownHandler_t SystemShutdown)
 This function initializes the error module. More...
 
void XPlmi_SoftResetHandler (void)
 This function sets clock source to IRO for ES1 silicon and resets the device. More...
 
void XPlmi_TriggerFwNcrError (void)
 This function sets clock source to IRO for ES1 silicon and triggers FW NCR error. More...
 
void XPlmi_SetEmSubsystemId (const u32 *Id)
 This function sets EmSubsystemId. More...
 
u32 XPlmi_GetEmSubsystemId (void)
 This function returns EmSubsystemId. More...
 
u32 XPlmi_UpdateNumErrOutsCount (u8 UpdateType)
 This function updates NumErrOuts and returns number of error outs count to the caller. More...
 
int XPlmi_CheckNpiErrors (void)
 This function clears NPI errors. More...
 
int XPlmi_ClearNpiErrors (void)
 This function clears NPI errors. More...
 
int XPlmi_GenericMaskPoll (XPlmi_Cmd *Cmd, u64 Addr, u32 Type)
 This function provides generic implementation for both 32-bit and 64-bit mask poll command execution. More...
 
int XPlmi_DmaTransfer (u64 Dest, u64 Src, u32 Len, u32 Flags)
 This function provides functionality for DMA write. More...
 
int XPlmi_GicRegisterHandler (u32 GicPVal, u32 GicPxVal, GicIntHandler_t Handler, void *Data)
 This will register the GIC handler. More...
 
void XPlmi_GicIntrClearStatus (u32 GicPVal, u32 GicPxVal)
 This will clear the GIC interrupt. More...
 
void XPlmi_GicIntrEnable (u32 GicPVal, u32 GicPxVal)
 This will enable the GIC interrupt. More...
 
void XPlmi_GicIntrDisable (u32 GicPVal, u32 GicPxVal)
 This will disable the GIC interrupt. More...
 
void XPlmi_GicIntrHandler (void *CallbackRef)
 This is handler for GIC interrupts. More...
 
void XPlmi_GicIntrAddTask (u32 Index)
 This function adds the GiC task handler to the TaskQueue. More...
 
int XPlmi_ValidateIpiCmd (XPlmi_Cmd *Cmd, u32 SrcIndex)
 This function checks whether the Cmd passed is supported via IPI mechanism or not. More...
 
int XPlmi_IpiPollForAck (u32 DestCpuMask, u32 TimeOutCount)
 This function polls for IPI acknowledgment from destination CPU. More...
 
int XPlmi_IpiWrite (u32 DestCpuMask, const u32 *MsgPtr, u32 MsgLen, u8 Type)
 This function writes an IPI message or a response to destination CPU. More...
 
int XPlmi_IpiTrigger (u32 DestCpuMask)
 This function triggers the IPI interrupt to destination CPU. More...
 
int XPlmi_IpiRead (u32 SrcCpuMask, u32 *MsgPtr, u32 MsgLen, u8 Type)
 This function reads an IPI message or response from source CPU. More...
 
void XPlmi_ModuleRegister (XPlmi_Module *Module)
 This function registers the module. More...
 
XPlmi_Module * XPlmi_GetModule (u32 ModuleId)
 This function returns the Module pointer if registered. More...
 
u32 * XPlmi_GetPmcIroFreq (void)
 This function provides the pointer to PmcIroFreq variable. More...
 
u64 XPlmi_GetTimerValue (void)
 This function is used to read the 64 bit timer value. More...
 
void XPlmi_MeasurePerfTime (u64 TCur, XPlmi_PerfTime *PerfTime)
 This function measures the total time taken between two points for performance measurement. More...
 
void XPlmi_PrintRomTime (void)
 This function prints the ROM time. More...
 
void XPlmi_PrintPlmTimeStamp (void)
 This function prints the PLM time stamp. More...
 
int XPlmi_StartTimer (void)
 It initializes the IO module structures and PIT timers. More...
 
int XPlmi_SetUpInterruptSystem (void)
 This function connects the interrupt handler of the IO Module to the processor. More...
 
void XPlmi_IntrHandler (void *CallbackRef)
 This function is default interrupt handler for the device. More...
 
void XPlmi_PlmIntrEnable (u32 IntrId)
 This function will enable the Iomodule interrupt. More...
 
int XPlmi_PlmIntrDisable (u32 IntrId)
 This function will disable the Iomodule interrupt. More...
 
int XPlmi_PlmIntrClear (u32 IntrId)
 This function will clear the Iomodule interrupt. More...
 
int XPlmi_RegisterHandler (u32 IntrId, GicIntHandler_t Handler, void *Data)
 This function will register the handler and enable the Iomodule interrupt. More...
 
void XPlmi_SchedulerInit (void)
 The function initializes scheduler and returns the initialization status. More...
 
void XPlmi_SchedulerHandler (void *Data)
 The function is scheduler handler and it is called at regular intervals based on configured interval. More...
 
int XPlmi_SchedulerAddTask (u32 OwnerId, XPlmi_Callback_t CallbackFn, XPlmi_ErrorFunc_t ErrorFunc, u32 MilliSeconds, TaskPriority_t Priority, void *Data, u8 TaskType)
 The function adds user periodic task to scheduler queue. More...
 
int XPlmi_SchedulerRemoveTask (u32 OwnerId, XPlmi_Callback_t CallbackFn, u32 MilliSeconds, const void *Data)
 The function removes scheduler task from scheduler queue. More...
 
XSysMonPsv * XPlmi_GetSysmonInst (void)
 This function provides address of Sysmon Instance. More...
 
int XPlmi_SysMonInit (void)
 This function initializes the SysMon. More...
 
void XPlmi_SysMonOTDetect (u32 WaitInMSecVal)
 This function detects if we are still in over-temperature condition. More...
 
u32 XPlmi_SldState (void)
 This function returns Secure Lockdown State. More...
 
void XPlmi_TriggerTamperResponse (u32 Response, u32 Flag)
 This functions Triggers Tamper Response processing immediately or as a task. More...
 
int XPlmi_RegisterTamperIntrHandler (void)
 This function registers the handler for tamper interrupt. More...
 
void XPlmi_TriggerSLDOnHaltBoot (u32 Flag)
 This function triggers secure lockdown if haltboot efuses are programmed. More...
 
XPlmi_TaskNode * XPlmi_TaskCreate (TaskPriority_t Priority, int(*Handler)(void *Arg), void *PrivData)
 This function creates the task and initializes its fields with the user parameters. More...
 
XPlmi_TaskNode * XPlmi_GetTaskInstance (int(*Handler)(void *Arg), const void *PrivData, const u32 IntrId)
 This function returns the instance of the task with matching handler and private data or with matching interrupt id. More...
 
void XPlmi_TaskTriggerNow (XPlmi_TaskNode *Task)
 This function adds the task to the task queue so that it can be triggered based on its priority. More...
 
void XPlmi_TaskInit (void)
 This function initializes the task queues list. More...
 
void XPlmi_TaskDispatchLoop (void)
 This function will be checking for tasks in the queue based on the priority. More...
 
void XPlmi_UtilRMW (u32 RegAddr, u32 Mask, u32 Value)
 This function will Read, Modify and Write to a register. More...
 
int XPlmi_UtilPoll (u32 RegAddr, u32 Mask, u32 ExpectedValue, u32 TimeOutInUs, void(*ClearHandler)(void))
 This function polls a register till the masked bits are set to expected value or till timeout occurs. More...
 
int XPlmi_UtilPoll64 (u64 RegAddr, u32 Mask, u32 ExpectedValue, u32 TimeOutInUs)
 This function polls a 64 bit address till the masked bits are set to expected value or till timeout occurs. More...
 
int XPlmi_UtilPollForMask (u32 RegAddr, u32 Mask, u32 TimeOutInUs)
 This function polls a 64 bit register till the masked bits are set to expected value or till timeout occurs. More...
 
int XPlmi_UtilPollForMask64 (u32 HighAddr, u32 LowAddr, u32 Mask, u32 TimeOutInUs)
 This function polls a 64 bit register till the masked bits are set to expected value or till timeout occurs. More...
 
void XPlmi_UtilWrite64 (u32 HighAddr, u32 LowAddr, u32 Value)
 This function writes to a 64 bit address. More...
 
void XPlmi_PrintArray (u16 DebugType, const u64 BufAddr, u32 Len, const char *Str)
 This function is used to print the entire array in bytes as specified by the debug type. More...
 
int XPlmi_UtilPollNs (u32 RegAddr, u32 Mask, u32 ExpectedValue, u64 TimeOutInNs, void(*ClearHandler)(void))
 This function polls a register till the masked bits are set to expected value or till timeout occurs. More...
 
void XPlmi_StoreMultiboot (void)
 This is a placeholder function used in case the feature is disabled. More...
 
void XPlmi_RestoreMultiboot (void)
 This is a placeholder function used in case the feature is disabled. More...
 
void XPlmi_ClearMultiboot (void)
 This is a placeholder function used in case the feature is disabled. More...
 
XPlmi_Error_t * XPlmi_GetErrorTable (void)
 This function provides error table pointer. More...
 
u32 * XPlmi_GetPsmCrState (void)
 This function provides IsPsmChanged variable. More...
 
u8 XPlmi_GetEventIndex (XPlmi_EventType ErrorNodeType)
 This function provides event index. More...
 
void XPlmi_SysmonClkSetIro (void)
 This function sets the sysmon clock to IRO for ES1 silicon. More...
 
void XPlmi_HandleLinkDownError (u32 Cpm5PcieIrStatusReg, u32 Cpm5DmaCsrIntDecReg, u32 ProcId)
 This function handles the CPM_NCR PCIE link down error. More...
 
void XPlmi_ErrPrintToLog (u32 ErrorNodeId, u32 RegMask)
 This function is the interrupt handler for Error action "Print to Log". More...
 
void XPlmi_DumpErrNGicStatus (void)
 This function dumps EAM Error status registers and Gic Status registers. More...
 
void XPlmi_ClearSsitErrors (u32 *PmcErrStatus, u32 Index)
 This function clears Ssit errors for ES1 silicon. More...
 
u32 * XPlmi_GetNumErrOuts (void)
 This function provides pointer to NumErrOuts. More...
 
int XPlmi_RestrictErrActions (XPlmi_EventType NodeType, u32 RegMask, u32 ErrorAction)
 This function restricts error actions. More...
 
void XPlmi_SetXRamAvailable (void)
 Flag to indicate XRAM is available. More...
 
XInterruptHandler * XPlmi_GetTopLevelIntrTbl (void)
 This function provides pointer to g_TopLevelInterruptTable. More...
 
u8 XPlmi_GetTopLevelIntrTblSize (void)
 This function provides size of g_TopLevelInterruptTable. More...
 
XPlmi_BoardParams * XPlmi_GetBoardParams (void)
 This function provides pointer to BoardParams. More...
 
XIOModule * XPlmi_GetIOModuleInst (void)
 This function provides pointer to IOModule structure. More...
 
u32 * XPlmi_GetUartBaseAddr (void)
 This function provides LpdInitialized variable pointer. More...
 
u32 * XPlmi_GetLpdInitialized (void)
 This function provides LpdInitialized variable pointer. More...
 
void XPlmi_RtcaPlatInit (void)
 This function performs initialization of platform specific RCTA registers. More...
 
void XPlmi_PrintRomVersion (void)
 This function prints ROM version using ROM digest value. More...
 
int XPlmi_PreInit (void)
 This function performs plmi pre-initializaton. More...
 
void XPlmi_SssMask (u32 DmaSrc)
 This function masks the secure stream switch value. More...
 
XPlmi_WaitForDmaDone_t XPlmi_GetPlmiWaitForDone (u64 DestAddr)
 This function is used to check and wait for DMA done when sending data to SSIT Slave SLRs. More...
 
XPlmi_CircularBuffer * XPlmi_GetTraceLogInst (void)
 This function provides TraceLog instance. More...
 
void XPlmi_GetReadbackSrcDest (u32 SlrType, u64 *SrcAddr, u64 *DestAddrRead)
 This function processes and provides SrcAddr and DestAddr for cfi readback. More...
 
void XPlmi_GicAddTask (u32 PlmIntrId)
 This will add the GIC interrupt task handler to the TaskQueue. More...
 
int XPlmi_RegisterNEnableIpi (void)
 This function registers and enables IPI interrupt. More...
 
void XPlmi_EnableIomoduleIntr (void)
 This function registers and enables IPI interrupt. More...
 
int XPlmi_SetPmcIroFreq (void)
 It sets the PMC IRO frequency. More...
 
int XPlmi_GetPitResetValues (u32 *Pit1ResetValue, u32 *Pit2ResetValue)
 This functions provides the PIT1 and PIT2 reset values. More...
 
int XPlmi_VerifyAddrRange (u64 StartAddr, u64 EndAddr)
 This function is used to check if the given address range is valid. More...
 
u32 XPlmi_GetGicIntrId (u32 GicPVal, u32 GicPxVal)
 This function provides Gic interrupt id. More...
 
u32 XPlmi_GetIpiIntrId (u32 BufferIndex)
 This function provides IPI interrupt id. More...
 
void XPlmi_EnableIpiIntr (void)
 This function enables IPI interrupt. More...
 
void XPlmi_ClearIpiIntr (void)
 This function clears IPI interrupt. More...
 
void XPlmi_DisableCFrameIso (void)
 This function Disables CFRAME Isolation. More...
 
void XPlmi_GetBootKatStatus (volatile u32 *PlmKatStatus)
 This function returns KAT status from RCTA area. More...
 
XPlmi_BufferList * XPlmi_GetBufferList (u32 BufferListType)
 This function defines BufferList and returns the address of the same. More...
 
u8 XPlmi_GetSlrIndex (void)
 This function is used to get the local SLR index. More...
 
u32 XPlmi_GetSlavesSlrMask (void)
 This function is used to get the combined mask of all slave SLRs. More...
 
int XPlmi_SsitRegisterEvent (u32 EventIndex, XPlmi_EventHandler_t Handler, u8 EventOrigin)
 This function is used to register any event between Master and Slave SLRs. More...
 
int XPlmi_SsitWriteEventBufferAndTriggerMsgEvent (u8 SlrIndex, u32 *ReqBuf, u32 ReqBufSize)
 This function is used to write the event buffer data and trigger the Message Event. More...
 
int XPlmi_SsitReadEventBuffer (u32 *ReqBuf, u32 ReqBufSize)
 This function is used to read the event buffer of Master SLR in Slave SLRs where the message event is received. More...
 
int XPlmi_SsitTriggerEvent (u8 SlrIndex, u32 EventIndex)
 This function is used to trigger the given event to the given SLR. More...
 
int XPlmi_SsitWaitForEvent (u8 SlrIndex, u32 EventIndex, u32 TimeOut)
 This function is used to wait for the event to be acknowledged by the given SLR after triggering. More...
 
int XPlmi_SsitReadResponse (u8 SlrIndex, u32 *RespBuf, u32 RespBufSize)
 This function is used to read the response (if applicable) in Master SLR once the event is acknowledged by Slave SLR. More...
 
int XPlmi_SsitWriteResponseAndAckMsgEvent (u32 *RespBuf, u32 RespBufSize)
 This function is used to write the response (if applicable) in Slave SLR once the event is handled and acknowledge the message event. More...
 
int XPlmi_SsitAcknowledgeEvent (u8 SlrIndex, u32 EventIndex)
 This function is used to acknowledge the event after handling. More...
 
u64 XPlmi_SsitGetSlrAddr (u32 Address, u8 SlrIndex)
 This function is used to get the global SLR address for the given local address. More...
 
int XPlmi_SsitSendMsgEventAndGetResp (u8 SlrIndex, u32 *ReqBuf, u32 ReqBufSize, u32 *RespBuf, u32 RespBufSize, u32 WaitForEventCompletion)
 This function sends a message event with given request buffer to a slave SLR, waits for event completion, reads the response from the slave SLR and returns it to the caller. More...
 
int XPlmi_SsitSyncMaster (XPlmi_Cmd *Cmd)
 This function provides SSIT Sync Master command execution. More...
 
int XPlmi_SsitSyncSlaves (XPlmi_Cmd *Cmd)
 This function provides SSIT Sync Slaves command execution. More...
 
int XPlmi_SsitWaitSlaves (XPlmi_Cmd *Cmd)
 This function provides SSIT Wait Slaves command execution. More...
 
int XPlmi_SendIpiCmdToSlaveSlr (u32 *Payload, u32 *RespBuf)
 This function handles invalid commands. More...
 
void XPlmi_NotifySldSlaveSlrs (void)
 This function notifies other SLRs about Secure Lockdown or tamper condition in SSIT devices. More...
 
void XPlmi_InterSlrSldHandshake (void)
 This function performs handshake between SLRs on SSIT ERR lines. More...
 
int XPlmi_SsitCfgSecComm (XPlmi_Cmd *Cmd)
 This function provides SSIT config secure communication command execution. More...
 
int XPlmi_GetSsitSecCommStatus (XPlmi_Cmd *Cmd)
 This function gives SSIT secure communication status Command payload parameters are. More...
 
int XPlmi_EnableWdt (u32 NodeId, u32 Periodicity)
 This function enables the WDT and sets NodeId and periodicity. More...
 
void XPlmi_DisableWdt (u32 NodeId)
 This function disables the WDT. More...
 
void XPlmi_SetPlmLiveStatus (void)
 This function Sets the PLM Status. More...
 
void XPlmi_ClearPlmLiveStatus (void)
 This function clears the PLM status. More...
 
void XPlmi_WdtHandler (void)
 This function is handler for WDT. More...
 
void XPlmi_ReconfigErrActions (void)
 This function reconfigures error actions after the update. More...
 
int EmEnableLpdSlcrErrAction (u32 ErrMaskRegAddr, u32 RegMask)
 This function enables the error action for the given error mask. More...
 
int XPlmi_EmDisableLpdSlcrErrors (u32 RegMaskAddr, u32 RegMask)
 This function disables the LPD SCLR error actions for the given mask. More...
 
int XPlmi_Versal2Ve2VmEAMHandler (void *Data)
 This function is the interrupt handler for the EAM errors. More...
 
int XPlmi_LpdSlcrEmInit (void)
 This function initializes the error actions in LPD Slcr Disables all the LPD SLCR error actions and registers default action. More...
 
int XPlmi_Versal2Ve2VmSetAction (XPlmi_Cmd *Cmd)
 This function sets the error action as prescribed by the command. More...
 
int XPlmi_GenericHandler (XPlmi_ModuleOp Op)
 This function is used for shutdown operation before In-place PLM Update. More...
 
void XPlmi_IpiIntrHandler (void *CallbackRef)
 This function is the Ipi interrupt handler for the device. More...
 
u32 XPlmi_GetRomIroFreq (void)
 This function provides the Iro Frequency used in ROM. More...
 
int XPlmi_RomISR (XPlmi_RomIntr RomServiceReq)
 This function raises an interrupt request to ROM and waits for completion. More...
 
u32 XPlmi_IsFipsModeEn (void)
 This function return FIPS mode. More...
 
u32 XPlmi_GetRomKatStatus (void)
 This function returns ROM KAT status. More...
 
void XPlmi_ClearSSSCfgErr (void)
 This function clears SSS Cfg error set during ROM PCR Extension. More...
 
XPlmi_FipsKatMask * XPlmi_GetFipsKatMaskInstance (void)
 This function returns XPlmi_FipsKatMask instance. More...
 
int XPlmi_CheckAndUpdateFipsState (void)
 This function checks and updates the FIPS state in RTCA. More...
 
void XPlmi_UpdateCryptoStatus (u32 Mask, u32 Val)
 This function sets or clears crypto bit in RTCA based on mask. More...
 
u32 XPlmi_GetCryptoStatus (u32 Mask)
 This function returns crypto status flag. More...
 
u8 XPlmi_IsKatRan (u32 PlmKatMask)
 This function will return KAT status of given mask. More...
 
void XPlmi_HandleLinkUpEvent (u32 Cpm5NPcieCdxIrStatusReg, u32 Cpm5NCdxPcieBReg, u32 ProcId)
 This function handles the CPM_NCR PCIE link up event. More...
 
void XPlmi_SetAddrBufferList (void)
 This function initializes Address Buffer List. More...
 
int XPlmi_InPlacePlmUpdate (XPlmi_Cmd *Cmd)
 This function provides In Place PLM Update support. More...
 
int XPlmi_PsmSequence (XPlmi_Cmd *Cmd)
 This function is used to transfer all psm_sequence commands to PSM RAM regions which are then processed by PSM immediately. More...
 
int XPlmi_ScatterWrite (XPlmi_Cmd *Cmd)
 This function will write single 32 bit value to multiple addresses which are specified in the payload. More...
 
int XPlmi_ScatterWrite2 (XPlmi_Cmd *Cmd)
 This function will write 2 32-bit values to multiple addresses which are specified by the payload. More...
 
int XPlmi_SetFipsKatMask (XPlmi_Cmd *Cmd)
 This function will store the KAT mask set by the user so that PLM can monitor the RTCA and compare it with KAT masks before going into FIPS operational state. More...
 
int XPlmi_RunProc (XPlmi_Cmd *Cmd)
 This function will run the already stored proc if present. More...
 
int XPlmi_ListSet (XPlmi_Cmd *Cmd)
 This function will create a list with given list of addresses. More...
 
int XPlmi_ListWrite (XPlmi_Cmd *Cmd)
 This function will execute write for the requested list of addresses. More...
 
int XPlmi_ListMaskWrite (XPlmi_Cmd *Cmd)
 This function will execute mask write for the requested list of addresses. More...
 
int XPlmi_ListMaskPoll (XPlmi_Cmd *Cmd)
 This function will execute mask poll for the requested list of addresses. More...
 
u8 XPlmi_IsPlmUpdateDone (void)
 This function checks if Inplace PLM update occurs or not. More...
 
u8 XPlmi_IsPlmUpdateDoneTmp (void)
 This function checks if Inplace PLM update occurs or not. More...
 
u8 XPlmi_IsPlmUpdateInProgress (void)
 This function checks if Inplace PLM update is in progress or not. More...
 
int XPlmi_DsOps (u32 Op, u64 Addr, void *Data)
 This function does operations like storing, restoring the Data Structure to Memory during PLM update. More...
 
XPlmi_DsEntry * XPlmi_GetDsEntry (XPlmi_DsEntry *DsList, u32 DsCnt, XPlmi_DsVer *DsVer)
 This function returns DsEntry found after searching in the provided DsList. More...
 
int XPlmi_RestoreDataBackup (void)
 This function restore all the data structures after InPlace PLM udpate. More...
 
int XPlmi_PlmUpdate (XPlmi_Cmd *Cmd)
 This function does In-Place PLM Update. More...
 
u32 XPlmi_GetUpdatePdiAddr (void)
 This function gets UpdatePdiAddr variable value. More...
 
u32 XPlmi_GetPlmUpdateIpiMask (void)
 This function gets PlmUpdateIpiMask variable value. More...
 
void XPlmi_SetPlmUpdateIpiMask (u32 value)
 This function sets PlmUpdateIpiMask variable value. More...
 
int XPlmi_DefaultSWdtConfig (void)
 This function configures the default WDT configuration if the wdt is not enabled and ROM SWDT usage bit is enabled in EFUSE. More...
 
void XPlmi_StopWdt (u32 NodeId)
 This function stops PMC WDT. More...
 
void XPlmi_KickWdt (u32 NodeId)
 This function is used to kick the WDT. More...
 
void XPlmi_RestoreWdt (void)
 This function is used to restore wdt after the In-Place PLM Update. More...
 

Variables

u8 XPlmi_Wdt::PlmLiveStatus
 PLM sets this bit to indicate it is alive. More...
 
u8 XPlmi_Wdt::IsEnabled
 Used to indicate if WDT is enabled or not. More...
 
u32 XPlmi_Wdt::Periodicity
 WDT period at which PLM should set the live status. More...
 
u32 XPlmi_Wdt::GpioAddr
 GPIO address corresponding to MIO used for WDT. More...
 
u32 XPlmi_Wdt::GpioMask
 GPIO Mask corresponding to MIO used for WDT. More...
 
u32 XPlmi_Wdt::LastResetPeriod
 Last reset period is used to check last tick time. More...
 
int XPlmi_EventLogging (XPlmi_Cmd *Cmd)
 This function provides Event Logging command execution. More...
 
u32 XPlmi_GetReadbackLen (u32 Len)
 This function processes and provides readback length. More...
 
int XPlmi_MoveBuffer (u32 BufferIndex, XPlmi_BufferList *BufferList)
 This function provides functionality to move procs when proc command is received for existing BufferId. More...
 
int XPlmi_SetBufferList (u32 Address, u16 Size)
 This function sets PSM BufferList address to given Address and Size. More...
 
int XPlmi_SearchBufferList (XPlmi_BufferList *BufferList, u32 BufferId, u64 *BufAddr, u32 *BufLen)
 This function searches Buffer list with the buffer Id to provide buffer address and buffer length. More...
 
int XPlmi_ExecuteProc (u32 ProcId)
 This function provides functionality to execute given ProcId when request to execute a particular ProcId. More...
 
int XPlmi_StoreBuffer (XPlmi_Cmd *Cmd, u32 BufferId, XPlmi_BufferList *BufferList)
 This function stores the buffer data into the buffer list provided. More...
 
int XPlmi_SetDDRMCMainRegSts (u32 DDRMCNum, u32 RegSts)
 This function sets the access status of DDR MC main registers. More...
 

Macro Definition Documentation

#define CFU_REF_CTRL_DIVISOR_INCREASE   (0x2U)

CRP CFU_REF_CTRL Divisor increase.

#define CPM5N_NCR_PCIE0_LINK_UP_EVENT_PROC_ID   (0x1U)

CPM5N_NCR_PCIE0 linkup event procedure Id.

#define CPM5N_NCR_PCIE1_LINK_UP_EVENT_PROC_ID   (0x2U)

CPM5N_NCR_PCIE1 linkup event procedure Id.

#define CPM5N_NCR_PCIE2_LINK_UP_EVENT_PROC_ID   (0x3U)

CPM5N_NCR_PCIE2 linkup event procedure Id.

#define CPM5N_NCR_PCIE3_LINK_UP_EVENT_PROC_ID   (0x4U)

CPM5N_NCR_PCIE3 linkup event procedure Id.

#define CPM_NCR_PCIE0_LINK_DOWN_PROC_ID   (0x1U)

PCIE0 link down proc Id.

#define CPM_NCR_PCIE1_LINK_DOWN_PROC_ID   (0x2U)

PCIE1 link down proc Id.

#define CRP_CFU_REF_CTRL   (0xF1260108U)

CRP CFU_REF_CTRL register address.

#define CRP_CFU_REF_CTRL_DIVISOR_MASK   (0x3FF00U)

CRP CFU_REF_CTRL Divisor mask.

#define IPI_MAX_TIMEOUT   (0x2DB267AAU)

IPI Max timeout ~5sec.

#define PCIE0_LINK_DOWN_PROC_ID   (0x1U)

PCIE0 link down proc Id.

#define PCIE1_LINK_DOWN_PROC_ID   (0x2U)

PCIE1 link down proc Id.

#define PLM_UPDATE_DONE_POLL_TIMEOUT   (1000U)

PLM update done POLL timeout.

#define PMC_ANALOG_GD0_RST_STATUS_REG_MASK   (0x200U)

Glitch detector0 status mask.

#define PMC_ANALOG_GD1_RST_STATUS_REG_MASK   (0x2000000U)

Glitch detector1 status mask.

#define PMC_ANALOG_GD_CTRL_REG   (0xF1160000U)

PMC_ANALOG base address.

#define PMC_ANALOG_GD_STATUS
Value:
#define PMC_ANALOG_GD0_RST_STATUS_REG_MASK
Glitch detector0 status mask.
Definition: xplmi_tamper.c:58
#define PMC_ANALOG_GD1_RST_STATUS_REG_MASK
Glitch detector1 status mask.
Definition: xplmi_tamper.c:60

Glitch detector status mask.

#define PMX_PLM_UPDATE_REASON_MASK   (0x00000008U)

PMX PLM update reason mask.

#define XPLMI_ADDRESS_OFFSET_MASK   (0x00FFFFFFU)

Address buffer offset mask.

Referenced by XPlmi_ListMaskPoll(), XPlmi_ListMaskWrite(), and XPlmi_ListWrite().

#define XPLMI_BOARD_PARAMS_LCVERSION   (1U)

Board parameters LC version.

#define XPLMI_BOARD_PARAMS_LCVERSION   (1U)

Board parameters LC version.

#define XPLMI_BOARD_PARAMS_VERSION   (1U)

Board parameters version.

#define XPLMI_BOARD_PARAMS_VERSION   (1U)

Board parameters version.

#define XPLMI_BUFFER_PAYLOAD_ARG_CNT   (7U)

Payload argument count.

#define XPLMI_BUFFER_PSM_SEND_API_ID   (0x8U)

API Id.

#define XPLMI_BUFFER_PSM_SEND_API_ID_IDX   (0U)

API Id index.

#define XPLMI_BUFFER_PSM_SEND_END_ADDR_IDX   (2U)

End address index.

#define XPLMI_BUFFER_PSM_SEND_START_ADDR_IDX   (1U)

Start address index.

#define XPLMI_CFU_FDRO_2_SLR_OFFSET   (CFU_FDRO_2_ADDR - XPLMI_PMC_LOCAL_BASEADDR)

SLR offset for CFU FDRO 2 register.

#define XPLMI_CFU_STREAM_2_SLR_OFFSET   (CFU_STREAM_2_ADDR - XPLMI_PMC_LOCAL_BASEADDR)

SLR offset for CFU stream 2 register.

#define XPLMI_CMD_ID_ASU_FEATURES   (0U)

Command Id of ASU module features.

#define XPLMI_CMD_ID_ASU_FEATURES_INDEX   (0U)

ASU module features index.

#define XPLMI_CMD_ID_ASU_KEY_TRANSFER   (1U)

Command Id of ASU key transfer features.

#define XPLMI_CMD_ID_ASU_RESPONSE_INDEX   (1U)

ASU module response index.

#define XPLMI_CMD_ID_EM_FEATURES   (0U)

Command Id of error module features.

#define XPLMI_CMD_ID_EM_SET_ACTION   (1U)

Command Id of set action error module.

#define XPLMI_DIGEST_PMC_1_0_ROM_1_0   (0x2B004AC7U)

PMC1 ROM version 1 digest.

#define XPLMI_DIGEST_PMC_2_0_ROM_2_0   (0xB576B550U)

PMC2 ROM version 2 digest.

#define XPLMI_DS_CNT   (u32)(__data_struct_end - __data_struct_start)

Data structure count.

Referenced by XPlmi_RestoreDataBackup().

#define XPLMI_DS_HDR_SIZE   (sizeof(XPlmi_DsHdr))

Data structure header size.

Referenced by XPlmi_DsOps(), and XPlmi_RestoreDataBackup().

#define XPLMI_ERROR_TABLE_DS_LCVER   (1U)

Error table data structure LC version.

#define XPLMI_ERROR_TABLE_DS_LCVER   (1U)

Error table data structure LC version.

#define XPLMI_ERROR_TABLE_DS_VER   (1U)

Error table data structure version.

#define XPLMI_ERROR_TABLE_DS_VER   (1U)

Error table data structure version.

#define XPLMI_FIPS_WRITE_KATMASK_PAYLOAD_LEN   (7U)

FIPS write KAT mask payload length.

Referenced by XPlmi_SetFipsKatMask().

#define XPLMI_INVALID_ROM_VERSION   (0x0U)

Invalid ROM version.

#define XPLMI_INVALID_UPDATE_ADDR   (0xFFFFFFFFU)

Invalid update address.

#define XPLMI_IS_PSMCR_CHANGED_LCVERSION   (1U)

PSMCR changed LC version status.

#define XPLMI_IS_PSMCR_CHANGED_VERSION   (1U)

PSMCR changed version status.

#define XPLMI_LIST_ID_INDEX   (7U)

List Id index.

Referenced by XPlmi_ListSet().

#define XPLMI_LIST_ID_MASK   (0xFF000000U)
#define XPLMI_LIST_ID_SHIFT   (24U)
#define XPLMI_LPDINITIALIZED_LCVER   (1U)

LPD initialized LC version.

#define XPLMI_LPDINITIALIZED_LCVER   (1U)

LPD initialized LC version.

#define XPLMI_LPDINITIALIZED_VER   (1U)

LPD initialized version.

#define XPLMI_LPDINITIALIZED_VER   (1U)

LPD initialized version.

#define XPLMI_MAX_ADDR_BUFFERS   (3U)

Maximum address buffers.

Referenced by XPlmi_SetAddrBufferList().

#define XPLMI_MAX_ADDR_LIST_CNT   (200U)

Maximum address list count.

Referenced by XPlmi_SetAddrBufferList().

#define XPLMI_MAX_RECURSIVE_CDO_PROCESS   (2U)

< Maximum recursive CDO processing allowed

Referenced by XPlmi_ProcessCdo().

#define XPLMI_MIO_NUM_PER_BANK   (26U)

Number of MIO per bank.

Referenced by XPlmi_EnableWdt().

#define XPLMI_NUM_ERROUTS_LCVERSION   (1U)

ERROUTS LC version.

#define XPLMI_NUM_ERROUTS_LCVERSION   (1U)

ERROUTS LC version.

#define XPLMI_NUM_ERROUTS_VERSION   (1U)

ERROUTS version.

#define XPLMI_NUM_ERROUTS_VERSION   (1U)

ERROUTS version.

#define XPLMI_PM_DEV_PMC_WDT   (0x1821C035U)

PM DEV PMC WDT.

Referenced by XPlmi_DefaultSWdtConfig().

#define XPLMI_PM_STMIC_LMIO_0   (0x14104001U)

PM STMIC LMIO_0.

Referenced by XPlmi_EnableWdt().

#define XPLMI_PM_STMIC_LMIO_25   (0x1410401aU)

PM STMIC LMIO_25.

Referenced by XPlmi_EnableWdt().

#define XPLMI_PM_STMIC_PMIO_0   (0x1410801bU)

PM STMIC PMIO_0.

Referenced by XPlmi_EnableWdt().

#define XPLMI_PM_STMIC_PMIO_51   (0x1410804eU)

PM STMIC PMIO_51.

Referenced by XPlmi_EnableWdt().

#define XPLMI_PMC_BUFFER_DS_LCVER   (1U)

PMC buffers Data structure LC version.

#define XPLMI_PMC_BUFFER_DS_LCVER   (1U)

PMC buffers Data structure LC version.

#define XPLMI_PMC_BUFFER_DS_VER   (1U)

PMC buffers Data structure version.

#define XPLMI_PMC_BUFFER_DS_VER   (1U)

PMC buffers Data structure version.

#define XPLMI_PMC_BUFFER_LIST_DS_LCVER   (1U)

PMC buffer list Data structure LC version.

#define XPLMI_PMC_BUFFER_LIST_DS_LCVER   (1U)

PMC buffer list Data structure LC version.

#define XPLMI_PMC_BUFFER_LIST_DS_VER   (1U)

PMC buffer list Data structure version.

#define XPLMI_PMC_BUFFER_LIST_DS_VER   (1U)

PMC buffer list Data structure version.

#define XPLMI_PMC_ERR_SSIT_MASK   (0xE0000000U)

PMC error SSIT mask.

Referenced by XPlmi_ClearSsitErrors().

#define XPLMI_PMC_IRO_FREQ_233_MHZ   (233000000U)

PMC IRO frequency 233Mhz.

#define XPLMI_PMC_IRO_FREQ_233_MHZ   (233000000U)

PMC IRO frequency 233Mhz.

#define XPLMI_PMC_VERSION_1_0   (0x10U)

PMC version 1.0.

#define XPLMI_PMC_VOLTAGE_MULTIPLIER   (32768.0f)

PMC voltage multiplier.

#define XPLMI_PMC_VOLTAGE_MULTIPLIER   (32768.0f)

Voltage multiplier for Sysmon.

#define XPLMI_PMC_VOLTAGE_MULTIPLIER   (32768.0f)

Voltage multiplier for Sysmon.

#define XPLMI_PPU_BUFFER_DS_LCVER   (1U)

PPU buffers Data structure LC version.

#define XPLMI_PPU_BUFFER_DS_VER   (1U)

PPU buffers Data structure version.

#define XPLMI_PPU_BUFFER_LIST_DS_LCVER   (1U)

PPU buffer list Data structure LC version.

#define XPLMI_PPU_BUFFER_LIST_DS_VER   (1U)

PPU buffer list Data structure version.

#define XPLMI_PSM_BUFFER_DS_LCVER   (1U)

PSM buffers Data structure LC version.

#define XPLMI_PSM_BUFFER_DS_VER   (1U)

PSM buffers Data structure version.

#define XPLMI_PSM_BUFFER_LIST_DS_LCVER   (1U)

PSM buffer list Data structure LC version.

#define XPLMI_PSM_BUFFER_LIST_DS_VER   (1U)

PSM buffer list Data structure version.

#define XPLMI_RESET_VECTOR   (0xF0200000U)

Reset vector.

#define XPLMI_RESP_CMD_EXEC_STATUS_INDEX   (0U)

Response command execution status index.

#define XPLMI_ROM_INT_REASON_CLEAR   (0x0000000FU)

ROM initialize reason clear.

#define XPLMI_ROM_PLM_UPDATE_REQ   (0x08U)

ROM PLM update request.

#define XPLMI_ROM_VERSION_1_0   (0x10U)

ROM version 1.

#define XPLMI_ROM_VERSION_1_0   (0x10U)

ROM version 1.

#define XPLMI_ROM_VERSION_1_0   (0x10U)

ROM version 1.

#define XPLMI_ROM_VERSION_2_0   (0x20U)

ROM version 2.

#define XPLMI_SCATTER_WRITE2_PAYLOAD_LEN   (3U)

Scatter write2 payload length.

Referenced by XPlmi_ScatterWrite2().

#define XPLMI_SCATTER_WRITE_PAYLOAD_LEN   (2U)

Scatter write payload length.

Referenced by XPlmi_ScatterWrite().

#define XPLMI_SCHEDULER_PERIOD   (10U)

Scheduler period.

Referenced by XPlmi_WdtHandler().

#define XPLMI_SLR1_CFU_FDRO_2_ADDR   (XPLMI_PMC_ALIAS1_BASEADDR + XPLMI_CFU_FDRO_2_SLR_OFFSET)

SLR1 CFU FDRO 2 address.

Referenced by XPlmi_GetReadbackSrcDest().

#define XPLMI_SLR1_CFU_STREAM_2_ADDR   (XPLMI_PMC_ALIAS1_BASEADDR + XPLMI_CFU_STREAM_2_SLR_OFFSET)

SLR1 CFU Stream 2 address.

Referenced by XPlmi_GetReadbackSrcDest().

#define XPLMI_SLR2_CFU_FDRO_2_ADDR   (XPLMI_PMC_ALIAS2_BASEADDR + XPLMI_CFU_FDRO_2_SLR_OFFSET)

SLR2 CFU FDRO 2 address.

Referenced by XPlmi_GetReadbackSrcDest().

#define XPLMI_SLR2_CFU_STREAM_2_ADDR   (XPLMI_PMC_ALIAS2_BASEADDR + XPLMI_CFU_STREAM_2_SLR_OFFSET)

SLR2 CFU Stream 2 address.

Referenced by XPlmi_GetReadbackSrcDest().

#define XPLMI_SLR3_CFU_FDRO_2_ADDR   (XPLMI_PMC_ALIAS3_BASEADDR + XPLMI_CFU_FDRO_2_SLR_OFFSET)

SLR3 CFU FDRO 2 address.

Referenced by XPlmi_GetReadbackSrcDest().

#define XPLMI_SLR3_CFU_STREAM_2_ADDR   (XPLMI_PMC_ALIAS3_BASEADDR + XPLMI_CFU_STREAM_2_SLR_OFFSET)

SLR3 CFU Stream 2 address.

Referenced by XPlmi_GetReadbackSrcDest().

#define XPLMI_SPP_WDT_PERIODICITY_MIN   (45U)

SPP minimum WDT periodicity.

#define XPLMI_SSS_AES_DMA0   (0x0000E000U)

AES DMA0.

#define XPLMI_SSS_AES_DMA0   (0x0000E000U)

AES DMA0.

#define XPLMI_SSS_AES_DMA1   (0x00005000U)

AES DMA1.

#define XPLMI_SSS_AES_DMA1   (0x00005000U)

AES DMA1.

#define XPLMI_SSS_SHA0_DMA0   (0x000C0000U)

SHA0 DMA0.

#define XPLMI_SSS_SHA0_DMA0   (0x000C0000U)

SHA0 DMA0.

#define XPLMI_SSS_SHA0_DMA1   (0x00070000U)

SHA0 DMA1.

#define XPLMI_SSS_SHA0_DMA1   (0x00070000U)

SHA0 DMA1.

#define XPLMI_SSS_SHA1_DMA0   (0x0A000000U)

SHA1 DMA0.

#define XPLMI_SSS_SHA1_DMA0   (0x0A000000U)

SHA1 DMA0.

#define XPLMI_SSS_SHA1_DMA1   (0x0F000000U)

SHA1 DMA1.

#define XPLMI_SSS_SHA1_DMA1   (0x0F000000U)

SHA1 DMA1.

#define XPLMI_SSSCFG_AES_MASK   (0x0000F000U)

AES mask.

#define XPLMI_SSSCFG_AES_MASK   (0x0000F000U)

AES mask.

#define XPLMI_SSSCFG_SHA0_MASK   (0x000F0000U)

SHA0 mask.

#define XPLMI_SSSCFG_SHA0_MASK   (0x000F0000U)

SHA0 mask.

#define XPLMI_SSSCFG_SHA1_MASK   (0x0F000000U)

SHA1 mask.

#define XPLMI_SSSCFG_SHA1_MASK   (0x0F000000U)

SHA1 mask.

#define XPLMI_SYSMON_CLK_SRC_IRO_VAL   (0U)

Sysmon clock source IRO value.

Referenced by XPlmi_SysmonClkSetIro().

#define XPLMI_SYSMON_PCSR_CTRL_SLVERREN_MASK   (0x80000U)

PCSR control slave error enable mask.

Referenced by XPlmi_SysMonInit().

#define XPLMI_SYSMON_SAT0_PCSR_MASK_OFFSET   (0x10000U)

SAT0 PCSR mask offset.

Referenced by XPlmi_SysMonInit().

#define XPLMI_SYSMON_SAT1_PCSR_MASK_OFFSET   (0x20000U)

SAT1 PCSR mask offset.

Referenced by XPlmi_SysMonInit().

#define XPLMI_TRACE_LOG_LCVERSION   (1U)

Trace log LC version.

#define XPLMI_TRACE_LOG_LCVERSION   (1U)

Trace log LC version.

#define XPLMI_TRACE_LOG_VERSION   (1U)

Trace log version.

#define XPLMI_TRACE_LOG_VERSION   (1U)

Trace log version.

#define XPLMI_UART_BASEADDR_LCVER   (1U)

UART base address LC version.

#define XPLMI_UART_BASEADDR_LCVER   (1U)

UART base address LC version.

#define XPLMI_UART_BASEADDR_VER   (1U)

UART base address version.

#define XPLMI_UART_BASEADDR_VER   (1U)

UART base address version.

#define XPLMI_UPDATE_DB_VERSION   (1U)

DB version update.

Referenced by XPlmi_RestoreDataBackup().

#define XPLMI_UPDATE_DONE   (0x2U)

Update done.

Referenced by XPlmi_IsPlmUpdateDone(), and XPlmi_IsPlmUpdateDoneTmp().

#define XPLMI_UPDATE_FLAG_MASK   (0x1U)

In-Place Update flag Mask.

Referenced by XPlmi_PlmUpdate().

#define XPLMI_UPDATE_IN_PROGRESS   (0x1U)

Update in progress.

Referenced by XPlmi_IsPlmUpdateInProgress(), and XPlmi_PlmUpdate().

#define XPLMI_UPDATE_PAYLOAD_LEN   (0x2U)

In-Place Update payload len.

Referenced by XPlmi_PlmUpdate().

#define XPLMI_UPDATE_PDIADDR_LCVER   (2U)

PDI Address LC version update.

#define XPLMI_UPDATE_PDIADDR_VER   (2U)

PDI Address version update.

#define XPLMI_UPDATE_TASK_DELAY   (10U)

Update task delay.

#define XPLMI_UPDATE_TASK_ID   (0x120U)

Task Id update.

Referenced by XPlmi_PlmUpdate().

#define XPLMI_UPDATE_USING_IMAGE_STORE   (0U)

In-Place Update using PDI in Image Store,1-DDR Location.

Referenced by XPlmi_PlmUpdate().

#define XPLMI_WDT_PERIODICITY   (100U)

WDT periodicity.

#define XPLMI_WDT_PERIODICITY_MAX   (1000U)

Maximum WDT periodicity.

Referenced by XPlmi_EnableWdt().

#define XPLMI_WDT_PERIODICITY_MIN   (15U)

Minimum WDT periodicity.

Referenced by XPlmi_EnableWdt(), and XPlmi_WdtHandler().

#define XPLMI_XCSUDMA_DEST_CTRL_OFFSET   (0x80CU)

CSUDMA destination control offset.

#define XPLMI_XIOMODULE_LCVERSION   (1U)

IOModule LC version.

#define XPLMI_XIOMODULE_LCVERSION   (1U)

IOModule LC version.

#define XPLMI_XIOMODULE_VERSION   (1U)

IOModule version.

#define XPLMI_XIOMODULE_VERSION   (1U)

IOModule version.

Function Documentation

u32 EmDisableErrAction ( u32  ErrMaskRegAddr,
u32  RegMask 
)

This function disables the error action for the given error mask.

Parameters
ErrMaskRegAddris the error action mask register address
RegMaskis the register mask of the error to be disabled
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERROR_ACTION_NOT_DISABLED if error action is not disabled.
  • Disable error action.
  • Check if the error action is disabled.

Referenced by XPlmi_EmDisablePmcErrors(), XPlmi_EmDisablePsmErrors(), and XPlmi_GenericHandler().

int EmEnableLpdSlcrErrAction ( u32  ErrMaskRegAddr,
u32  RegMask 
)

This function enables the error action for the given error mask.

Parameters
ErrMaskRegAddris the error action mask register address
RegMaskis the register mask of the error to be disabled
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERROR_ACTION_NOT_ENABLED if error action is not enabled.
void outbyte ( char  c)

This function prints and logs the terminal prints to debug log buffer.

Parameters
cis the character to be printed and logged
  • If UART is enabled, send the byte to UART.
  • Store the byte onto log buffer.

References XPlmi_GetUartBaseAddr().

int XPlmi_CheckAndUpdateFipsState ( void  )

This function checks and updates the FIPS state in RTCA.

Returns
  • XST_SUCCESS on success
  • XST_FAILURE on failure

References XPlmi_IsFipsModeEn().

Referenced by XPlmi_SetFipsKatMask(), and XPlmi_UpdateKatStatus().

int XPlmi_CheckNpiErrors ( void  )

This function clears NPI errors.

Returns
  • XST_SUCCESS on success and error code on failure
void XPlmi_ClearIpiIntr ( void  )

This function clears IPI interrupt.

void XPlmi_ClearKatMask ( u32  PlmKatMask)

This function clears XPLMI_RTCFG_PLM_KAT_ADDR with PlmKatMask.

Parameters
PlmKatMaskcontains the kat mask that needs to be cleared

References XPlmi_GetKatStatus(), and XPlmi_UpdateKatStatus().

void XPlmi_ClearMultiboot ( void  )

This is a placeholder function used in case the feature is disabled.

int XPlmi_ClearNpiErrors ( void  )

This function clears NPI errors.

Returns
  • XST_SUCCESS on success and error code on failure
  • Unlock NPI address space
  • Clear ISR
  • Clear error type registers
  • Lock NPI address space

References XPLMI_ERR_NPI_LOCK, and XPlmi_UtilRMW().

void XPlmi_ClearPlmLiveStatus ( void  )

This function clears the PLM status.

void XPlmi_ClearSsitErrors ( u32 *  PmcErrStatus,
u32  Index 
)

This function clears Ssit errors for ES1 silicon.

Parameters
PmcErrStatusis the pointer to the error status array
Indexis the PMC Error register Index

References XPLMI_PMC_ERR_SSIT_MASK.

Referenced by XPlmi_EmInit().

void XPlmi_ClearSSSCfgErr ( void  )

This function clears SSS Cfg error set during ROM PCR Extension.

References XPlmi_IsPlmUpdateDone().

int XPlmi_CmdExecute ( XPlmi_Cmd *  CmdPtr)

This function will call the command handler registered with the command.

Command handler shall execute the command till the payload length.

Parameters
CmdPtris pointer to command structure
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_MODULE_NOT_REGISTERED if the module is not registered.
  • XPLMI_ERR_CMD_APIID on invalid module and unregistered CMD ID.
  • XPLMI_ERR_CMD_HANDLER_NULL if command handler is not registered.
  • XPLMI_ERR_CDO_CMD on invalid CDO command handler.
  • Validate Module registration.
  • Validate if API is registered.
  • Validate the module handler.
  • Execute the API.
  • Increment the processed length and it can be used during resume
  • Assign the same handler for Resume

References XPLMI_CMD_IN_PROGRESS, XPLMI_ERR_CMD_APIID, XPLMI_ERR_CMD_HANDLER_NULL, XPLMI_ERR_MODULE_NOT_REGISTERED, XPlmi_GetModule(), and XPlmi_LogPlmErr().

int XPlmi_CmdResume ( XPlmi_Cmd *  CmdPtr)

This function resumes the command after being partially executed.

                    Resume handler shall execute the command till the payload length.
Parameters
CmdPtris pointer to command structure
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_RESUME_HANDLER if CDO CMD resume handler fails.
int XPlmi_ConfigUart ( u8  UartSelect,
u8  UartEnable 
)

This function configures the PS UART base address.

Parameters
UartSelectis the uart number to be selected
UartEnableis the flag used to enable or disable uart
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_NO_UART_PRESENT if UART is not available to configure.
  • XPLMI_ERR_CURRENT_UART_INVALID if selected UART base address is invalid.
  • XPLMI_ERR_INVALID_UART_SELECT if invalid UART SELECT argument is passed.
  • XPLMI_ERR_INVALID_UART_ENABLE if invalid UART ENABLE argument is passed.

References UART_PRINT_ENABLED, XPLMI_ERR_CURRENT_UART_INVALID, XPLMI_ERR_INVALID_UART_ENABLE, XPLMI_ERR_INVALID_UART_SELECT, XPLMI_ERR_NO_UART_PRESENT, XPlmi_GetUartBaseAddr(), XPlmi_SetLpdInitialized(), and XPlmi_UnSetLpdInitialized().

Referenced by XPlmi_EventLogging().

int XPlmi_DefaultSWdtConfig ( void  )

This function configures the default WDT configuration if the wdt is not enabled and ROM SWDT usage bit is enabled in EFUSE.

Returns
XST_SUCCESS on success and error code on failure

References XPlmi_EnableWdt(), and XPLMI_PM_DEV_PMC_WDT.

void XPlmi_DisableCFrameIso ( void  )

This function Disables CFRAME Isolation.

References XPlmi_UtilRMW().

void XPlmi_DisableWdt ( u32  NodeId)

This function disables the WDT.

This is required when LPD is powered down and if LPD MIO is used. Also required when debugging.

Parameters
NodeIdis not applicable for versal platform.

This is required when LPD is powered down and if LPD MIO is used. Also required when debugging.

Parameters
NodeIdis the Node ID of external WDT or internal PMC WDT
Returns
None

Referenced by XPlmi_ResetLpdInitialized().

int XPlmi_DmaInit ( void  )

This function will initialize the DMA driver instances.

Returns
  • XST_SUCCESS on success and error code on failure
  • Initialise PMC_DMA0 & PMC_DMA1.
int XPlmi_DmaSbiXfer ( u64  SrcAddr,
u32  Len,
u32  Flags 
)

This function is used to transfer the data from DMA to SBI.

Parameters
SrcAddrfor DMA to fetch data from
Lenof the data in words
Flagsto select PMC DMA and DMA Burst type
Returns
  • XST_SUCCESS on success and error codes on failure
  • Configure the secure stream switch
  • Transfer the data from DMA to SBI.
int XPlmi_DmaTransfer ( u64  Dest,
u64  Src,
u32  Len,
u32  Flags 
)

This function provides functionality for DMA write.

Parameters
Destis the destination address
Srcis the source address
Lenis the number of words to be transferred
Flagsis the DMA transfer related flags
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_UNALIGNED_DMA_XFER if unaligned DMA transfer fails.

References XPlmi_DmaXfr(), XPLMI_ERR_UNALIGNED_DMA_XFER, and XPLMI_WORD_LEN.

Referenced by XPlmi_MoveBuffer(), XPlmi_PsmSequence(), and XPlmi_StoreBuffer().

int XPlmi_DmaXfr ( u64  SrcAddr,
u64  DestAddr,
u32  Len,
u32  Flags 
)

This function is used to initiate and complete the DMA to DMA transfer.

Parameters
SrcAddrfor SRC channel to fetch data from
DestAddrfor DST channel to store the data
Lenof the data in words
Flagsto select PMC DMA and DMA Burst type
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_DMA_XFER_WAIT_SRC if Dma Xfer failed in Src Channel wait for done.
  • XPLMI_ERR_DMA_XFER_WAIT_DEST if Dma Xfer failed in Dest Channel wait for done.

References XPLMI_ERR_DMA_XFER_WAIT_DEST, XPLMI_ERR_DMA_XFER_WAIT_SRC, XPlmi_GetPlmiWaitForDone(), XPlmi_GetTimerValue(), and XPlmi_MeasurePerfTime().

Referenced by XPlmi_DmaTransfer(), XPlmi_MemCpy64(), and XPlmi_MemSet().

int XPlmi_DsOps ( u32  Op,
u64  Addr,
void *  Data 
)

This function does operations like storing, restoring the Data Structure to Memory during PLM update.

Parameters
Opis the type of operation to be performed on the data structure
Addris the memory address to which data structure should be stored or restored from
Datais the Data Structure Entry
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_INVALID_DS_ENTRY if invalid Data Structure entry is passed to the PLM Db Update Handler.
  • XPLMI_ERR_DS_ALIGNMENT_INCORRECT if the alignment of Data Structure used during store or restore operations is not word aligned Header.
  • XPLMI_ERR_PLM_UPDATE_DB_OVERFLOW if the given Data Structure length is exceed the Update DB buffer available.
  • XPLMI_ERR_MEMCPY_STORE_DB if memcpy failed to store database.
  • XPLMI_ERR_MEMSET_RESTORE_DB if memset failed to restore database.
  • XPLMI_ERR_MEMCPY_RESTORE_DB if memcpy failed to restore database.
  • XPLMI_ERR_PLM_UPDATE_INVALID_OP if invalid operation is passed to PLM Update DB Handler.

References XPLMI_DS_HDR_SIZE, XPLMI_ERR_DS_ALIGNMENT_INCORRECT, XPLMI_ERR_INVALID_DS_ENTRY, XPLMI_ERR_MEMCPY_RESTORE_DB, XPLMI_ERR_MEMCPY_STORE_DB, XPLMI_ERR_MEMSET_RESTORE_DB, XPLMI_ERR_PLM_UPDATE_DB_OVERFLOW, XPLMI_ERR_PLM_UPDATE_INVALID_OP, and XPLMI_WORD_LEN.

void XPlmi_DumpErrNGicStatus ( void  )

This function dumps EAM Error status registers and Gic Status registers.

Returns
None
int XPlmi_EccInit ( u64  Addr,
u32  Len 
)

This function is used to initialize the ECC memory.

Parameters
Addris memory address to be initialized
Lenis size of memory to be initialized in bytes
Returns
  • Status of the DMA transfer
  • Configure the secure stream switch
  • Configure PZM length in 128bit
  • Receive the data from destination channel

References XPLMI_WORD_LEN.

Referenced by XPlmi_InitNVerifyMem(), and XPlmi_MemSet().

void XPlmi_EmClearError ( XPlmi_EventType  ErrorNodeType,
u32  ErrorId 
)

This function clears any previous errors before enabling them.

Parameters
ErrorNodeTypeis the node type for the error event
ErrorIdis the index of the error to be cleared

References XPlmi_GetErrorTable(), and XPlmi_GetEventIndex().

Referenced by XPlmi_EmSetAction(), XPlmi_ErrorTaskHandler(), and XPlmi_Versal2Ve2VmEAMHandler().

int XPlmi_EmConfig ( XPlmi_EventType  NodeType,
u32  ErrorId,
u8  ActionId,
XPlmi_ErrorHandler_t  ErrorHandler,
const u32  SubsystemId 
)

This function configures the Action specified for a given Error ID.

Parameters
NodeTypeis the error node type
ErrorIdis the index of the error to which given action to be set
ActionIdis the action that need to be set for ErrorId. Action can be SRST/POR/ERR OUT/INT
ErrorHandlerIf INT is defined as response, handler should be defined.
SubsystemId
Returns
  • XST_SUCCESS on success and error code on failure
  • Set error action for given error Id.
  • Enable the error action.

References XPlmi_ErrPrintToLog(), and XPlmi_GetErrorTable().

Referenced by XPlmi_EmSetAction(), and XPlmi_ReconfigErrActions().

int XPlmi_EmDisable ( u32  ErrorNodeId,
u32  RegMask 
)

This function disables the responses for the given error.

Parameters
ErrorNodeIdis the node Id for the error event
RegMaskis the register mask of the error to be disabled
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERROR_ACTION_NOT_DISABLED if error action is not disabled.
  • XPLMI_INVALID_ERROR_TYPE on invalid error type.
  • For XPLMI_NODETYPE_ErrorNodeTypeEVENT_PMC_INDEX - Disable POR, SRST, Interrupt and PS Error Out.
  • For XPLMI_NODETYPE_EVENT_PSM_INDEX - Disable CR / NCR to PMC, Interrupt.
  • For XPLMI_NODETYPE_EVENT_SW_INDEX - Do nothing.
  • For invalid error return XPLMI_INVALID_ERROR_TYPE error code.

References GET_PMC_ERR_ACTION_OFFSET, XPlmi_EmDisableLpdSlcrErrors(), XPlmi_EmDisablePmcErrors(), XPlmi_EmDisablePsmErrors(), and XPlmi_GetEventIndex().

Referenced by XPlmi_EmSetAction(), XPlmi_ErrorTaskHandler(), XPlmi_HandleSwError(), and XPlmi_Versal2Ve2VmEAMHandler().

int XPlmi_EmDisableLpdSlcrErrors ( u32  RegMaskAddr,
u32  RegMask 
)

This function disables the LPD SCLR error actions for the given mask.

Parameters
RegMaskAddris the offset for the PMC ERR, POR ,IRQ mask,SRST mask
RegMaskis the register mask of the error to be disabled
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERROR_ACTION_NOT_DISABLED if error action is not disabled.
  • Disable LPD SLCR error actions.
  • Check if the error action is disabled.

Referenced by XPlmi_EmDisable(), XPlmi_GenericHandler(), and XPlmi_LpdSlcrEmInit().

int XPlmi_EmDisablePmcErrors ( u32  RegOffset,
u32  RegMask 
)

This function disables the PMC error actions for the given mask.

Parameters
RegOffsetis the offset for the PMC ERR, POR ,IRQ mask,SRST mask
RegMaskis the register mask of the error to be disabled
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERROR_ACTION_NOT_DISABLED if error action is not disabled.
  • Disable all PMC error actions.

References EmDisableErrAction(), GET_PMC_ERR_OUT_MASK, GET_PMC_IRQ_MASK, GET_PMC_POR_MASK, and GET_PMC_SRST_MASK.

Referenced by XPlmi_EmDisable(), and XPlmi_EmInit().

int XPlmi_EmInit ( XPlmi_ShutdownHandler_t  SystemShutdown)

This function initializes the error module.

Disables all the error actions and registers default action.

Parameters
SystemShutdownis the pointer to the PM system shutdown callback handler for action subtype system shutdown
Returns
  • XST_SUCCESS on success and error code on failure

Checking both Arguments for NULL, If any one of it found to be NULL Major Error Code will be returned

  • Register Error module commands
  • Detect if we are in over-temperature condition
  • Clear SSIT_ERR register to stop error propagation to other SLRs
  • Save FW_ERR register value to RTCA and clear it
  • Disable all the Error Actions
  • Ignore SSIT Errors for Versal ES1 silicon
  • Clear the error status registers
  • Register Tamper Interrupt Handler

References GET_PMC_ERR_ACTION_OFFSET, GET_RTCFG_PMC_ERR_ADDR, XPlmi_ClearSsitErrors(), XPlmi_EmDisablePmcErrors(), XPlmi_EmSetAction(), XPLMI_ERR_EMINIT_INVALID_PARAM, XPlmi_ErrorTaskHandler(), XPlmi_GetErrorTable(), XPlmi_GetTaskInstance(), XPlmi_IsPlmUpdateDone(), XPlmi_ReconfigErrActions(), XPlmi_RegisterTamperIntrHandler(), XPlmi_SysMonOTDetect(), and XPlmi_TaskCreate().

int XPlmi_EmSetAction ( u32  ErrorNodeId,
u32  ErrorMasks,
u8  ActionId,
XPlmi_ErrorHandler_t  ErrorHandler,
const u32  SubsystemId 
)

This function sets the Action specified for a given Error Masks.

Parameters
ErrorNodeIdis the node ID for the error event
ErrorMasksis the error masks to which specified action to be set
ActionIdis the action that need to be set for ErrorMasks. Action can be SRST/POR/ERR OUT/INT
ErrorHandlerIf INT is defined as response, handler should be defined.
SubsystemId
Returns
  • XST_SUCCESS on success.
  • XPLMI_INVALID_NODE_ID on invalid node ID.
  • XPLMI_INVALID_ERROR_ID on invalid error ID.
  • XPLMI_INVALID_ERROR_HANDLER on invalid error handler.
  • Check for Valid Error ID.
  • Check for Valid handler.
  • Disable the error actions for Error ID for configuring the requested error action.
  • Clear any previous errors.
  • Configure the Error Action to given Error Id.

References XPlmi_EmClearError(), XPlmi_EmConfig(), XPlmi_EmDisable(), and XPlmi_GetErrorTable().

Referenced by XPlmi_EmInit(), XPlmi_LpdSlcrEmInit(), XPlmi_PsEmInit(), XPlmi_RegisterTamperIntrHandler(), and XPlmi_Versal2Ve2VmSetAction().

void XPlmi_EnableIomoduleIntr ( void  )

This function registers and enables IPI interrupt.

Referenced by XPlmi_SetUpInterruptSystem().

void XPlmi_EnableIpiIntr ( void  )

This function enables IPI interrupt.

int XPlmi_EnableWdt ( u32  NodeId,
u32  Periodicity 
)

This function enables the WDT and sets NodeId and periodicity.

            It also verifies the parameters.
Parameters
NodeIdNodeId is the MIO node to be used by PLM for toggling.
Periodicityat which MIO value should be toggled.
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_WDT_PERIODICITY on invalid Periodicity.
  • XPLMI_ERR_WDT_LPD_NOT_INITIALIZED if LPD is not initialized.
  • XPLMI_ERR_WDT_NODE_ID on invalid node ID.
            It also verifies the parameters.
Parameters
NodeIdNodeId is the MIO node to be used by PLM for toggling.
Periodicityat which MIO value should be toggled.
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_WDT_PERIODICITY on invalid Periodicity.
  • XPLMI_ERR_PMC_WDT_NOT_ENABLED if PMC WDT is tried use and it is not enabled in design.
  • XPLMI_ERR_PMC_WDT_DRV_INIT if PMC WDT driver initialization fails.
  • XPLMI_ERR_WDT_LPD_NOT_INITIALIZED if LPD is not initialized.
  • XPLMI_ERR_WDT_NODE_ID on invalid node ID.
  • Check for Valid Node ID

Check for Valid Node ID

References LPD_WDT_INITIALIZED, XPLMI_ERR_WDT_LPD_NOT_INITIALIZED, XPLMI_ERR_WDT_NODE_ID, XPLMI_ERR_WDT_PERIODICITY, XPLMI_MIO_NUM_PER_BANK, XPLMI_PM_STMIC_LMIO_0, XPLMI_PM_STMIC_LMIO_25, XPLMI_PM_STMIC_PMIO_0, XPLMI_PM_STMIC_PMIO_51, XPlmi_SetLpdInitialized(), XPLMI_WDT_PERIODICITY_MAX, and XPLMI_WDT_PERIODICITY_MIN.

Referenced by XPlmi_DefaultSWdtConfig().

void XPlmi_ErrIntrHandler ( void *  CallbackRef)

This function is default interrupt handler for EAM error which will add the task to the task queue.

Parameters
CallbackRefis presently the interrupt number that is received
  • Detect Tamper in interrupt context and trigger the task which processes the tamper response
  • Check if the task is already created
  • Add the EAM task to the queue and disable interrupts at IOMODULE level

References XPlmi_ErrorTaskHandler(), XPlmi_GetTaskInstance(), XPlmi_PlmIntrDisable(), and XPlmi_TaskTriggerNow().

void XPlmi_ErrMgr ( int  ErrStatusVal)

This function is called in PLM error cases.

Parameters
ErrStatusValis the error code written to the FW_ERR register
  • Check if SLR Type is Master or Monolithic and take error action accordingly.
  • Fallback if boot PDI is not done else just return, so that we receive next requests

Trigger FW CR error by setting CR_Flag in FW_ERR register

  • If boot mode is jtag, donot reset. This is to keep the system state intact for further debug.
  • If Halt Boot eFuses are blown, then trigger secure lockdown. XPlmi_TriggerSLDOnHaltBoot function will run secure lockdown on domains other than PMC and triggers TAMPER_RESP_0 to ROM for running secure lockdown on PMC domain. The function will not return if eFuses are blown. If Halt Boot eFuses are not blown, update multiboot register and trigger FW NCR.
  • Update Multiboot register and perform SRST. Skip for slave boot modes.
  • If boot mode is USB or SMAP, PLM should not process remaining tasks in slave boot modes.

References XPlmi_IsPlmUpdateDone(), XPlmi_LogPlmErr(), XPlmi_PORHandler(), XPlmi_SetPlmLiveStatus(), XPLMI_SSIT_MASTER_SLR, XPLMI_SSIT_MONOLITIC, XPLMI_TRIGGER_TAMPER_IMMEDIATE, XPlmi_TriggerFwNcrError(), XPlmi_TriggerSLDOnHaltBoot(), and XPlmi_UtilRMW().

Referenced by XPlmi_HandleLinkDownError(), XPlmi_HandleLinkUpEvent(), and XPlmi_TaskDispatchLoop().

int XPlmi_ErrorTaskHandler ( void *  Data)

This function is the interrupt handler for the EAM errors.

Parameters
Datais presently passed as NULL
Returns
  • XST_SUCCESS always.
  • Interrupt is selected as response for Custom, subsystem shutdown and subsystem restart actions. For these actions, error will be disabled. Agent should clear the source and enable the error again using SetAction. In SetAction, error will be cleared and enabled. For subsystem cases, during subsystem restart, error will be enabled again.
  • Clear and enable EAM errors at IOMODULE level

References GET_PMC_ERR_ACTION_OFFSET, GET_PMC_IRQ_MASK, XPlmi_EmClearError(), XPlmi_EmDisable(), XPlmi_ErrPSMIntrHandler(), XPlmi_GetErrorTable(), XPlmi_PlmIntrClear(), XPlmi_PlmIntrEnable(), and XPlmi_Versal2Ve2VmEAMHandler().

Referenced by XPlmi_EmInit(), and XPlmi_ErrIntrHandler().

void XPlmi_ErrPrintToLog ( u32  ErrorNodeId,
u32  RegMask 
)

This function is the interrupt handler for Error action "Print to Log".

This function prints detailed information if the error is due to XMPU/XPPU protection units.

Parameters
ErrorNodeIdis the node ID for the error event
RegMaskis the register mask of the error received

This function prints detailed information if the error is due to XMPU/XPPU protection units.

Parameters
ErrorNodeIdis the node ID for the error event
RegMaskis the register mask of the error received
Returns
  • None

Print NodeId, Mask and Error ID information

Print NodeId, Mask and Error ID information

Print NodeId, Mask and Error ID information

References XPlmi_GetErrorId().

Referenced by XPlmi_EmConfig().

int XPlmi_EventLogging ( XPlmi_Cmd *  Cmd)

This function provides Event Logging command execution.

    Command payload parameters are
    Sub command
    1 - Configure print log level
            Arg1 - Log Level
    2 - Configure Debug Log buffer memory
            Arg1 - High Address
            Arg2 - Low Address
            Arg3 - Length
    3 - Retrieve Debug Log buffer
            Arg1 - High Address
            Arg2 - Low Address
    4 - Retrieve Debug Log buffer information
    5 - Configure Trace Log buffer memory
            Arg1 - High Address
            Arg2 - Low Address
            Arg3 - Length
    6 - Retrieve Trace Log buffer
            Arg1 - High Address
            Arg2 - Low Address
    7 - Retrieve Trace Log buffer information
    8 - Configure Uart
            Arg1 - Uart Select
            Arg2 - Uart Enable
Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_INVALID_LOG_LEVEL on invalid log level.
  • XST_INVALID_PARAM on invalid logging command.

References XPlmi_ConfigUart(), XPLMI_ERR_INVALID_LOG_LEVEL, XPLMI_EVENT_LOGGING_CMD_ID, and XPlmi_GetTraceLogInst().

int XPlmi_ExecuteProc ( u32  ProcId)

This function provides functionality to execute given ProcId when request to execute a particular ProcId.

Parameters
ProcIdis ProcId to be executed
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_PROC_LPD_NOT_INITIALIZED The Proc command cannot be executed because the LPD is not initialized.
  • If the ProcId has MSB set, then its in PMC RAM memory.
  • If LPD is not initialized or Proc memory is not available, do not execute the proc and return an error.
  • Fill ProcCdo structure with Proc related parameters.
  • Execute Proc.

References XPLMI_ERR_PROC_LPD_NOT_INITIALIZED, XPlmi_GetBufferList(), XPlmi_MemSetBytes(), XPlmi_ProcessCdo(), and XPlmi_SearchBufferList().

Referenced by XPlmi_HandleLinkDownError(), XPlmi_HandleLinkUpEvent(), and XPlmi_RunProc().

int XPlmi_GenericMaskPoll ( XPlmi_Cmd *  Cmd,
u64  Addr,
u32  Type 
)

This function provides generic implementation for both 32-bit and 64-bit mask poll command execution.

    Command payload parameters are
    - Address
    - Mask
    - Expected Value
    - Timeout in us
    - Deferred Error flag - Optional
            0 - Return error in case of failure,
            1 - Ignore error, return success always
            2 - Defer error till the end of partition load
            3 - Break to end offset in case of failure
    - Error Code
Parameters
Cmdis pointer to the command structure
Addris address of mask poll
Typeis flag indicating if the address is 64-bit
Returns
  • XST_SUCCESS on success.
  • XST_FAILURE if timedout.

References XPlmi_GetTimerValue(), XPlmi_MeasurePerfTime(), XPlmi_UtilPoll(), and XPlmi_UtilPoll64().

Referenced by XPlmi_ListMaskPoll().

XPlmi_BoardParams * XPlmi_GetBoardParams ( void  )

This function provides pointer to BoardParams.

Returns
Pointer to BoardParams
void XPlmi_GetBootKatStatus ( volatile u32 *  PlmKatStatus)

This function returns KAT status from RCTA area.

This function sets KAT status from RTC area.

Parameters
PlmKatStatusis the pointer to the variable which holds kat status
XPlmi_BufferList * XPlmi_GetBufferList ( u32  BufferListType)

This function defines BufferList and returns the address of the same.

Parameters
BufferListTypeis the proc list type if it is stored in PMC or PSM RAM
Returns
BufferList is the address of BufferList structure
Parameters
BufferListTypeis the proc list type if it is stored in PMC or PPU RAM
Returns
BufferList is the address of BufferList structure
  • Create static BufferList structure and initialize with zero during initial call.
  • Initialize first Data address of the PmcBufferList to the PMC RAM reserved address and BufferMemSize with the Max Size allocated
  • Create static BufferList structure and initialize with zero during initial call.
  • Initialize first Data address of the PmcBufferList to the PMC RAM reserved address and BufferMemSize with the Max Size allocated
  • Create static BufferList structure and initialize with zero during initial call.
  • Initialize first Data address of the PmcBufferList to the PMC RAM reserved address and BufferMemSize with the Max Size allocated

Referenced by XPlmi_ExecuteProc(), XPlmi_PsmSequence(), and XPlmi_SetBufferList().

u32 XPlmi_GetCryptoStatus ( u32  Mask)

This function returns crypto status flag.

Parameters
MaskMask to read crypto status
Returns
Crypto status value

References XPLMI_RTCFG_PLM_CRYPTO_STATUS_ADDR.

XPmcDma* XPlmi_GetDmaInstance ( u32  DeviceId)

This function returns DMA instance.

Parameters
DeviceIdis PMC DMA's device ID
Returns
  • PMC DMA instance pointer.
  • Return the PMC_DMA0 or PMC_DMA1 instance pointer based on the device ID only if they are ready. Otherwise, return NULL.
XPlmi_DsEntry* XPlmi_GetDsEntry ( XPlmi_DsEntry *  DsList,
u32  DsCnt,
XPlmi_DsVer *  DsVer 
)

This function returns DsEntry found after searching in the provided DsList.

Parameters
DsListis the Data Structure List in which the DS is searched
DsCntis the number of Data Structures present in the List
DsVeris the version information of the data structure
Returns
XST_SUCCESS on success and error code on failure

Referenced by XPlmi_RestoreDataBackup().

u32 XPlmi_GetEmSubsystemId ( void  )

This function returns EmSubsystemId.

Returns
  • EmSubsystemId

Referenced by XPlmi_Versal2Ve2VmSetAction().

u32 XPlmi_GetErrorId ( u32  ErrorNodeId,
u32  RegMask 
)

This function returns Error Id for the given error node type and error mask.

Parameters
ErrorNodeIdis the error node Id.
RegMaskis register mask of the error.
Returns
ErrorId value.

Referenced by XPlmi_ErrPrintToLog(), and XPlmi_HandleSwError().

u8 XPlmi_GetEventIndex ( XPlmi_EventType  ErrorNodeType)

This function provides event index.

Parameters
ErrorNodeTypeis the Node Type of the EAM register
Returns
Event Index

Referenced by XPlmi_EmClearError(), XPlmi_EmDisable(), and XPlmi_Versal2Ve2VmSetAction().

XPlmi_FipsKatMask * XPlmi_GetFipsKatMaskInstance ( void  )

This function returns XPlmi_FipsKatMask instance.

Returns
pointer to the XPlmi_FipsKatMask instance

Referenced by XPlmi_SetFipsKatMask().

u32 XPlmi_GetGicIntrId ( u32  GicPVal,
u32  GicPxVal 
)

This function provides Gic interrupt id.

Parameters
GicPValindicates GICP source
GicPxValindicates GICPx source
Returns
Gic Interrupt Id
Parameters
GicPValindicates GICP source
GicPxValindicates GICPx source
Returns
Readback length

Referenced by XPlmi_GicRegisterHandler().

XIOModule * XPlmi_GetIOModuleInst ( void  )

This function provides pointer to IOModule structure.

Returns
Pointer to XIOModule

Referenced by XPlmi_GetTimerValue(), XPlmi_PlmIntrClear(), XPlmi_PlmIntrDisable(), XPlmi_PlmIntrEnable(), XPlmi_RegisterHandler(), XPlmi_SetUpInterruptSystem(), and XPlmi_StartTimer().

u32 XPlmi_GetIpiIntrId ( u32  BufferIndex)

This function provides IPI interrupt id.

Parameters
BufferIndexis the Ipi target buffer index
Returns
IPI interrupt id

Referenced by XPlmi_GicAddTask(), and XPlmi_IpiIntrHandler().

u32 XPlmi_GetKatStatus ( void  )

This function is called to get KAT status.

References XPLMI_KAT_MASK.

Referenced by XPlmi_ClearKatMask(), and XPlmi_SetKatMask().

u32 * XPlmi_GetLpdInitialized ( void  )

This function provides LpdInitialized variable pointer.

Returns
Pointer to LpdInitialized variable

Referenced by XPlmi_ResetLpdInitialized(), XPlmi_SetLpdInitialized(), and XPlmi_UnSetLpdInitialized().

XPlmi_Module* XPlmi_GetModule ( u32  ModuleId)

This function returns the Module pointer if registered.

Parameters
ModuleIdRegistered ID of the module.
Returns
  • Module ptr if module is registered else NULL.

Referenced by XPlmi_CmdExecute().

u32 * XPlmi_GetNumErrOuts ( void  )

This function provides pointer to NumErrOuts.

Returns
Pointer to NumErrOuts

Referenced by XPlmi_UpdateNumErrOutsCount().

int XPlmi_GetPitResetValues ( u32 *  Pit1ResetValue,
u32 *  Pit2ResetValue 
)

This functions provides the PIT1 and PIT2 reset values.

Parameters
Pit1ResetValueis the pointer to store the PIT1 reset value.
Pit2ResetValueis the pointer to store the PIT12 reset value.
Returns
  • XST_SUCCESS always.
XPlmi_WaitForDmaDone_t XPlmi_GetPlmiWaitForDone ( u64  DestAddr)

This function is used to check and wait for DMA done when sending data to SSIT Slave SLRs.

This function is used to check and wait for DMA done.

Parameters
DestAddrholds the address of the destination buffer
Returns
  • XST_SUCCESS on success and error code on failure
Parameters
DestAddris the address of destination
Returns
XST_SUCCESS on success and error code on failure

Referenced by XPlmi_DmaXfr().

u32 XPlmi_GetPlmUpdateIpiMask ( void  )

This function gets PlmUpdateIpiMask variable value.

Returns
PlmUpdateIpiMask value

References XPLMI_RTCFG_INPLACE_UPDATE_IPI_MASK.

u32* XPlmi_GetPmcIroFreq ( void  )

This function provides the pointer to PmcIroFreq variable.

Returns
Pointer to PmcIroFreq variable

Referenced by XPlmi_UtilPollNs().

u32 * XPlmi_GetPsmCrState ( void  )

This function provides IsPsmChanged variable.

Returns
Pointer to IsPsmCrChanged
u32 XPlmi_GetReadbackLen ( u32  Len)

This function processes and provides readback length.

Parameters
Lenis the current readback length
Returns
Readback length
void XPlmi_GetReadbackSrcDest ( u32  SlrType,
u64 *  SrcAddr,
u64 *  DestAddrRead 
)

This function processes and provides SrcAddr and DestAddr for cfi readback.

Parameters
SlrTypeis the type of Slr passed in readback cmd
SrcAddris the pointer to the SrcAddr variable
DestAddrReadis the pointer to the DestAddrRead variable

References XPLMI_SLR1_CFU_FDRO_2_ADDR, XPLMI_SLR1_CFU_STREAM_2_ADDR, XPLMI_SLR2_CFU_FDRO_2_ADDR, XPLMI_SLR2_CFU_STREAM_2_ADDR, XPLMI_SLR3_CFU_FDRO_2_ADDR, and XPLMI_SLR3_CFU_STREAM_2_ADDR.

u32 XPlmi_GetRomIroFreq ( void  )

This function provides the Iro Frequency used in ROM.

Returns
RomIroFreq value

Referenced by XPlmi_PrintRomTime().

u32 XPlmi_GetRomKatStatus ( void  )

This function returns ROM KAT status.

Returns
ROM KAT status

References XPLMI_ROM_KAT_MASK.

u32 XPlmi_GetSlavesSlrMask ( void  )

This function is used to get the combined mask of all slave SLRs.

Returns
Returns combined mask of all slave SLRs
u8 XPlmi_GetSlrIndex ( void  )

This function is used to get the local SLR index.

Returns
Returns Local SLR index
int XPlmi_GetSsitSecCommStatus ( XPlmi_Cmd *  Cmd)

This function gives SSIT secure communication status Command payload parameters are.

     * SLR index for which secure communication status is requested
Parameters
Cmdis pointer to the command structure
Returns
  • Returns the Status of get secure communication status command

References XPLMI_SSIT_MASTER_SLR, and XPLMI_SSIT_MONOLITIC.

XSysMonPsv* XPlmi_GetSysmonInst ( void  )

This function provides address of Sysmon Instance.

Returns
Address of SysmonInst

Referenced by XPlmi_SysMonInit().

XPlmi_TaskNode* XPlmi_GetTaskInstance ( int(*)(void *Arg)  Handler,
const void *  PrivData,
const u32  IntrId 
)

This function returns the instance of the task with matching handler and private data or with matching interrupt id.

Parameters
Handleris pointer to the task handler
PrivDatais argument to be passed to the task handler
IntrIdis the interrupt id associated with the task
Returns
Instance of the task in case of a match, NULL otherwise

Referenced by XPlmi_EmInit(), XPlmi_ErrIntrHandler(), XPlmi_GicIntrAddTask(), XPlmi_IpiIntrHandler(), XPlmi_PlmUpdate(), XPlmi_RegisterTamperIntrHandler(), XPlmi_SchedulerAddTask(), and XPlmi_TaskCreate().

u64 XPlmi_GetTimerValue ( void  )

This function is used to read the 64 bit timer value.

It reads from PIT1 and PIT2 and makes it 64 bit.

Returns
Returns 64 bit timer value

Pit1 starts at 0 and preload the full value after pit2 expires. So, recasting TPit1 0 value to highest so that u64 comparison works for Tpit1 0 and TPit1 0xfffffffe

References XPlmi_GetIOModuleInst().

Referenced by XPlmi_DmaXfr(), XPlmi_GenericMaskPoll(), XPlmi_MeasurePerfTime(), XPlmi_SchedulerHandler(), XPlmi_SchedulerInit(), XPlmi_TaskDispatchLoop(), and XPlmi_UtilPollNs().

XInterruptHandler * XPlmi_GetTopLevelIntrTbl ( void  )

This function provides pointer to g_TopLevelInterruptTable.

Returns
Pointer to g_TopLevelInterruptTable structure

Referenced by XPlmi_SetUpInterruptSystem().

u8 XPlmi_GetTopLevelIntrTblSize ( void  )

This function provides size of g_TopLevelInterruptTable.

Returns
Size g_TopLevelInterruptTable structure

Referenced by XPlmi_SetUpInterruptSystem().

XPlmi_CircularBuffer * XPlmi_GetTraceLogInst ( void  )

This function provides TraceLog instance.

Returns
Pointer to TraceLog variable

Referenced by XPlmi_EventLogging().

u32 * XPlmi_GetUartBaseAddr ( void  )

This function provides LpdInitialized variable pointer.

Returns
Pointer to LpdInitialized variable

< Base address of Uart

< Base address of Uart

< Base address of Uart

Referenced by outbyte(), XPlmi_ConfigUart(), and XPlmi_InitUart().

u32 XPlmi_GetUpdatePdiAddr ( void  )

This function gets UpdatePdiAddr variable value.

Returns
UpdatePdiAddr value
void XPlmi_GicAddTask ( u32  PlmIntrId)

This will add the GIC interrupt task handler to the TaskQueue.

Parameters
PlmIntrIdis the GIC interrupt ID of the task

References XPlmi_GetIpiIntrId(), and XPlmi_GicIntrAddTask().

Referenced by XPlmi_GicIntrHandler().

void XPlmi_GicIntrAddTask ( u32  Index)

This function adds the GiC task handler to the TaskQueue.

Parameters
Indexis the interrupt index with GicPx and its corresponding bit details.
Returns
  • None

References XPlmi_GetTaskInstance(), and XPlmi_TaskTriggerNow().

Referenced by XPlmi_GicAddTask().

void XPlmi_GicIntrClearStatus ( u32  GicPVal,
u32  GicPxVal 
)

This will clear the GIC interrupt.

Parameters
GicPValindicates GICP source
GicPxValindicates GICPx source
Returns
  • None
  • Get the GicP mask.
  • Clear interrupt by writing 1 to the interrupt bit.

References XPLMI_GICPX_LEN, and XPlmi_UtilRMW().

Referenced by XPlmi_GenericHandler().

void XPlmi_GicIntrDisable ( u32  GicPVal,
u32  GicPxVal 
)

This will disable the GIC interrupt.

Parameters
GicPValindicates GICP source
GicPxValindicates GICPx source
Returns
  • None
  • Get the GicP mask.
  • Disable interrupt by writing 1 to the interrupt bit.

References XPLMI_GICPX_LEN, and XPlmi_UtilRMW().

void XPlmi_GicIntrEnable ( u32  GicPVal,
u32  GicPxVal 
)

This will enable the GIC interrupt.

Parameters
GicPValindicates GICP source
GicPxValindicates GICPx source
Returns
  • None
  • Get the GicP mask.
  • Enable interrupt by writing 1 to the interrupt bit.

References XPLMI_GICPX_LEN, and XPlmi_UtilRMW().

void XPlmi_GicIntrHandler ( void *  CallbackRef)

This is handler for GIC interrupts.

Parameters
CallbackRefNot used in the function currently
Returns
  • None
  • Loop across all the GICPx status registers and check for every set bit in them.
  • Disable the interrputs if the mask bit is set.
  • Call the corresponding the handler after disabling the interrupt.
  • After handler returns, clear the interrupt the status bit.

References XPlmi_GicAddTask(), XPLMI_GICP_INDEX_SHIFT, XPLMI_GICP_SOURCE_COUNT, XPLMI_GICPX_INDEX_SHIFT, and XPLMI_GICPX_LEN.

int XPlmi_GicRegisterHandler ( u32  GicPVal,
u32  GicPxVal,
GicIntHandler_t  Handler,
void *  Data 
)

This will register the GIC handler.

Parameters
GicPValindicates GICP source
GicPxValindicates GICPx source
Handleris the interrupt handler
Datais the pointer to arguments to interrupt handler
Returns
  • XST_SUCCESS on success.
  • XPLM_ERR_TASK_CREATE if failed to create task.
  • Create a Task for the handler.
  • Set the interrupt ID for the task.

References XPLM_ERR_TASK_CREATE, XPlmi_GetGicIntrId(), and XPlmi_TaskCreate().

static void XPlmi_HandleLinkDownError ( u32  DeviceIrStatusReg,
u32  GenralStsReg,
u32  ProcId 
)

This function handles the CPM_NCR PCIE link down error.

This function handles the PCIE link down error.

Parameters
Cpm5PcieIrStatusRegis the PCIE0/1 IR status register address
Cpm5DmaCsrIntDecRegis the DMA0/1 CSR INT DEC register address
ProcIdis the ProcId for PCIE0/1 link down error
DeviceIrStatusRegis the PCIE0/1 Device IR status register address
GenralStsRegis the PCIE0/1 General status register address
ProcIdis the ProcId for PCIE0/1 link down error

References XPlmi_ErrMgr(), and XPlmi_ExecuteProc().

void XPlmi_HandleLinkUpEvent ( u32  Cpm5NPcieCdxIrStatusReg,
u32  Cpm5NCdxPcieBReg,
u32  ProcId 
)

This function handles the CPM_NCR PCIE link up event.

Parameters
Cpm5NPcieCdxIrStatusRegis the PCIE0/1/2/3 IR status register address
Cpm5NCdxPcieBRegis the Pcie Bridge Misc Status register address
ProcIdis the ProcId for PCIE0/1/2/3 link up event

References XPlmi_ErrMgr(), and XPlmi_ExecuteProc().

void XPlmi_HandleSwError ( u32  ErrorNodeId,
u32  RegMask 
)

This function handles the Software error triggered from within PLM.

Parameters
ErrorNodeIdis the node ID for the error event
RegMaskis the register mask of the error received

References XPlmi_EmDisable(), XPlmi_GetErrorId(), XPlmi_GetErrorTable(), XPlmi_PORHandler(), XPlmi_SoftResetHandler(), and XPlmi_UpdateNumErrOutsCount().

int XPlmi_Init ( void  )

This function will initialize the PLMI module.

Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_PRE_INIT if pre initialization fails.

References XPLMI_ERR_PRE_INIT, XPlmi_PreInit(), XPlmi_SetPlmLiveStatus(), and XPlmi_SetUpInterruptSystem().

int XPlmi_InitCdo ( XPlmiCdo *  CdoPtr)

This function initializes the CDO pointer structure.

Parameters
CdoPtris pointer to the CDO structure
Returns
XST_SUCCESS on success and error code on failure

References XPlmi_MemSetBytes().

int XPlmi_InitNVerifyMem ( u64  Addr,
u32  Len 
)

This function initializes the memory using PZM and verifies by reading back initialized memory.

Parameters
AddrMemory address to be initialized
LenLength of the area to be initialized in bytes
Returns
  • XST_SUCCESS on success and error codes on failure
  • Initialize the data
  • Read and verify the initialized data

References XPlmi_EccInit(), and XPLMI_WORD_LEN.

int XPlmi_InitUart ( void  )

This function initializes the PS UART.

Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_UART_MEMSET on UART instance failure.
  • XPLMI_ERR_UART_LOOKUP if UART driver lookup fails.
  • XPLMI_ERR_UART_CFG if UART driver configuration fails.
  • XPLMI_ERR_UART_PSV_SET_BAUD_RATE if failed to set the baud rate.
  • Initialize UART, If UART is already initialized, just return success.

References UART_INITIALIZED, UART_PRINT_ENABLED, XPLMI_ERR_UART_CFG, XPLMI_ERR_UART_LOOKUP, XPLMI_ERR_UART_MEMSET, XPLMI_ERR_UART_PSV_SET_BAUD_RATE, XPlmi_GetUartBaseAddr(), XPlmi_MemSetBytes(), and XPlmi_SetLpdInitialized().

Referenced by XPlmi_LpdInit().

int XPlmi_InPlacePlmUpdate ( XPlmi_Cmd *  Cmd)

This function provides In Place PLM Update support.

Parameters
Cmdis pointer to the command structure Command payload parameters are
  • High Addr
  • Low Addr
Returns
  • XST_SUCCESS on success and error code on failure

References XPlmi_PlmUpdate().

Referenced by XPlmi_InPlacePlmUpdate_DDR(), and XPlmi_InPlacePlmUpdate_ImageStore().

void XPlmi_InterSlrSldHandshake ( void  )

This function performs handshake between SLRs on SSIT ERR lines.

This has to be done on SSIT devices before doing secure lockdown

References XPLMI_SSIT_MASTER_SLR, XPLMI_SSIT_MONOLITIC, XPlmi_UtilPoll(), XPlmi_UtilPollForMask(), and XPlmi_UtilPollNs().

void XPlmi_IntrHandler ( void *  CallbackRef)

This function is default interrupt handler for the device.

Parameters
CallbackRefis presently the interrupt number that is received.

Referenced by XPlmi_SetUpInterruptSystem().

void XPlmi_IpiIntrHandler ( void *  CallbackRef)

This function is the Ipi interrupt handler for the device.

Parameters
CallbackRefis a dummy argument

References XPlmi_GetIpiIntrId(), XPlmi_GetTaskInstance(), XPlmi_PlmIntrClear(), and XPlmi_TaskTriggerNow().

int XPlmi_IpiPollForAck ( u32  DestCpuMask,
u32  TimeOutCount 
)

This function polls for IPI acknowledgment from destination CPU.

Parameters
DestCpuMaskDestination CPU IPI mask
TimeOutCountTimeout value
Returns
  • XST_SUCCESS on success
int XPlmi_IpiRead ( u32  SrcCpuMask,
u32 *  MsgPtr,
u32  MsgLen,
u8  Type 
)

This function reads an IPI message or response from source CPU.

Parameters
SrcCpuMaskSource CPU IPI mask
MsgPtrIPI read message buffer
MsgLenIPI message length
TypeIPI buffer type
Returns
  • XST_SUCCESS on success.
int XPlmi_IpiTrigger ( u32  DestCpuMask)

This function triggers the IPI interrupt to destination CPU.

Parameters
DestCpuMaskDestination CPU IPI mask
Returns
  • XST_SUCCESS on success
int XPlmi_IpiWrite ( u32  DestCpuMask,
const u32 *  MsgPtr,
u32  MsgLen,
u8  Type 
)

This function writes an IPI message or a response to destination CPU.

Parameters
DestCpuMaskDestination CPU IPI mask
MsgPtrPointer to message to be written
MsgLenIPI message length
TypeIPI buffer type
Returns
  • XST_SUCCESS on success
u32 XPlmi_IsCryptoKatEn ( void  )

This function will return the crypto kat enable status from efuse cache.

Returns
TRUE If crypto kat bit is set FALSE If crypto kat bit is not set

Referenced by XPlmi_IsKatRan().

u32 XPlmi_IsFipsModeEn ( void  )

This function return FIPS mode.

Returns
TRUE If FIPS mode is enabled FALSE If FIPS mode is disabled

Referenced by XPlmi_CheckAndUpdateFipsState().

u8 XPlmi_IsKatRan ( u32  PlmKatMask)

This function will return KAT status of given mask.

Parameters
PlmKatMaskcontains the KAT mask
Returns
TRUE If KAT ran FALSE If KAT didn't ran

References XPlmi_IsCryptoKatEn().

u8 XPlmi_IsPlmUpdateDone ( void  )

This function checks if Inplace PLM update occurs or not.

Returns
TRUE if Inplace PLM Update and FALSE otherwise

References XPLMI_UPDATE_DONE.

Referenced by XPlmi_ClearSSSCfgErr(), XPlmi_EmInit(), XPlmi_ErrMgr(), XPlmi_LpdInit(), XPlmi_PrintPlmBanner(), XPlmi_RunTimeConfigInit(), and XPlmi_StartTimer().

u8 XPlmi_IsPlmUpdateDoneTmp ( void  )

This function checks if Inplace PLM update occurs or not.

Returns
TRUE if Inplace PLM Update and FALSE otherwise

References XPLMI_UPDATE_DONE.

Referenced by XPlmi_RunTimeConfigInit().

u8 XPlmi_IsPlmUpdateInProgress ( void  )

This function checks if Inplace PLM update is in progress or not.

Returns
TRUE if Inplace PLM Update is in progress and FALSE otherwise

References XPLMI_UPDATE_IN_PROGRESS.

Referenced by XPlmi_PlmUpdate().

void XPlmi_KickWdt ( u32  NodeId)

This function is used to kick the WDT.

Parameters
NodeIdis the Node ID of external WDT or internal PMC WDT
Returns
None
int XPlmi_ListMaskPoll ( XPlmi_Cmd *  Cmd)

This function will execute mask poll for the requested list of addresses.

Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success and error code if failure

References XPLMI_ADDRESS_OFFSET_MASK, XPlmi_GenericMaskPoll(), XPLMI_LIST_ID_MASK, XPLMI_LIST_ID_SHIFT, XPLMI_LIST_MASK_POLL_CMD_ID, and XPlmi_SearchBufferList().

int XPlmi_ListMaskWrite ( XPlmi_Cmd *  Cmd)

This function will execute mask write for the requested list of addresses.

Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success and error code if failure

References XPLMI_ADDRESS_OFFSET_MASK, XPLMI_LIST_ID_MASK, XPLMI_LIST_ID_SHIFT, XPLMI_LIST_MASK_WRITE_CMD_ID, XPlmi_SearchBufferList(), and XPlmi_UtilRMW().

int XPlmi_ListSet ( XPlmi_Cmd *  Cmd)

This function will create a list with given list of addresses.

Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success and error code if failure

References XPLMI_LIST_ID_INDEX, XPLMI_LIST_ID_MASK, XPLMI_LIST_ID_SHIFT, XPLMI_LIST_SET_CMD_ID, and XPlmi_StoreBuffer().

int XPlmi_ListWrite ( XPlmi_Cmd *  Cmd)

This function will execute write for the requested list of addresses.

Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success and error code if failure

References XPLMI_ADDRESS_OFFSET_MASK, XPLMI_LIST_ID_MASK, XPLMI_LIST_ID_SHIFT, XPLMI_LIST_WRITE_CMD_ID, and XPlmi_SearchBufferList().

void XPlmi_LogPlmErr ( int  ErrStatusVal)

This function is called for logging PLM error into FW_ERR register.

Parameters
ErrStatusValis the error code written to the FW_ERR register
  • Print the PLM Warning
  • Print the PLM Error

References XPlmi_UtilRMW().

Referenced by XPlmi_CmdExecute(), XPlmi_ErrMgr(), XPlmi_LpdInit(), and XPlmi_ProcessCdo().

void XPlmi_LpdInit ( void  )

This function calls all the PS LPD init functions of all the different modules.

As a part of init functions, modules can register the command handlers, interrupt handlers with the interface layer.

Enable Slave Error for PSM Global

References LPD_INITIALIZED, XPlmi_InitUart(), XPlmi_IsPlmUpdateDone(), XPlmi_LogPlmErr(), XPlmi_LpdSlcrEmInit(), XPlmi_PsEmInit(), XPlmi_SetLpdInitialized(), XPlmi_UtilRMW(), and XPLMI_WARNING_MAJOR_MASK.

int XPlmi_LpdSlcrEmInit ( void  )

This function initializes the error actions in LPD Slcr Disables all the LPD SLCR error actions and registers default action.

Returns
  • XST_SUCCESS always.
  • Disable all the Error Actions
  • Clear the error status registers.
  • Set the default actions as defined in the Error table.

References GET_RTCFG_LPDSLCR_ERR_ADDR, XPlmi_EmDisableLpdSlcrErrors(), XPlmi_EmSetAction(), and XPlmi_GetErrorTable().

Referenced by XPlmi_LpdInit().

void XPlmi_MeasurePerfTime ( u64  TCur,
XPlmi_PerfTime *  PerfTime 
)

This function measures the total time taken between two points for performance measurement.

Parameters
TCuris current time
PerfTimeis the variable to hold the time elapsed

References XPlmi_GetTimerValue().

Referenced by XPlmi_DmaXfr(), XPlmi_GenericMaskPoll(), XPlmi_PrintPlmTimeStamp(), XPlmi_SchedulerAddTask(), and XPlmi_TaskDispatchLoop().

int XPlmi_MemCpy64 ( u64  DestAddress,
u64  SrcAddress,
u32  Length 
)

This function can copy the content of memory for both 32 and 64-bit address space.

Parameters
DestAddressis the address of the destination where content of SrcAddr memory should be copied.
SrcAddressis the address of the source where copy should start from.
Lengthis size of memory to be copied in bytes.
Returns
  • XST_SUCCESS on success and error code on failure

References XPlmi_DmaXfr(), and XPLMI_WORD_LEN.

int XPlmi_MemSet ( u64  DestAddress,
u32  Val,
u32  Len 
)

This function is used to Set the memory with a value.

Parameters
DestAddressis the address where the val need to be set
Valis the value that has to be set
Lenis size of memory to be set in words
Returns
  • Status of the DMA transfer

References XPlmi_DmaXfr(), XPlmi_EccInit(), and XPLMI_WORD_LEN.

Referenced by XPlmi_MemSetBytes(), and XPlmi_RunTimeConfigInit().

int XPlmi_MemSetBytes ( void *const  DestPtr,
u32  DestLen,
u8  Val,
u32  Length 
)

This function is used to Set the memory with a value.

If Len is greater than DestLen, then DestPtr is filled with Val till DestLen bytes and is considered as a failure.

Parameters
DestPtris the pointer where the val need to be set
DestLenis the memory allotted to destination buffer in bytes
Valis the value that has to be set
Lengthis size of memory to be set in bytes
Returns
  • XST_SUCCESS on success and error code on failure

References XPlmi_MemSet(), and XPLMI_WORD_LEN.

Referenced by XPlmi_ExecuteProc(), XPlmi_InitCdo(), and XPlmi_InitUart().

void XPlmi_ModuleRegister ( XPlmi_Module *  Module)

This function registers the module.

Parameters
Moduleis pointer to XPlmi Module
int XPlmi_MoveBuffer ( u32  BufferIndex,
XPlmi_BufferList *  BufferList 
)

This function provides functionality to move procs when proc command is received for existing BufferId.

Parameters
BufferIndexis the index of BufferId to be moved
BufferListis the list of buffers whose buffers need to be moved
Returns
  • XST_SUCCESS on success and error code on failure
  • If only one proc is available and if a new proc command is received with same ID, it can directly be overwritten.
  • If proc command is received for existing BufferId, move all procs behind this to front
  • Call XPlmi_DmaTransfer with flags DMA0 and INCR
  • Update BufferList with moved data

References XPlmi_DmaTransfer(), and XPLMI_WORD_LEN.

Referenced by XPlmi_StoreBuffer().

void XPlmi_NotifySldSlaveSlrs ( void  )

This function notifies other SLRs about Secure Lockdown or tamper condition in SSIT devices.

  • Do nothing for monolithic devices.

References XPLMI_SSIT_MASTER_SLR, and XPLMI_SSIT_MONOLITIC.

Referenced by XPlmi_TriggerTamperResponse().

int XPlmi_PlmIntrClear ( u32  IntrId)

This function will clear the Iomodule interrupt.

Parameters
IntrIdInterrupt ID as specified in the xplmi_proc.h
Returns
  • XST_SUCCESS on success and error code on failure

References XPlmi_GetIOModuleInst().

Referenced by XPlmi_ErrorTaskHandler(), XPlmi_GenericHandler(), XPlmi_IpiIntrHandler(), and XPlmi_Versal2Ve2VmEAMHandler().

int XPlmi_PlmIntrDisable ( u32  IntrId)

This function will disable the Iomodule interrupt.

Parameters
IntrIdInterrupt ID as specified in the xplmi_proc.h
Returns
  • XST_SUCCESS on success and error code on failure

References XPlmi_GetIOModuleInst().

Referenced by XPlmi_ErrIntrHandler(), and XPlmi_GenericHandler().

void XPlmi_PlmIntrEnable ( u32  IntrId)

This function will enable the Iomodule interrupt.

Parameters
IntrIdInterrupt ID as specified in the xplmi_proc.h

References XPlmi_GetIOModuleInst().

Referenced by XPlmi_ErrorTaskHandler(), and XPlmi_Versal2Ve2VmEAMHandler().

int XPlmi_PlmUpdate ( XPlmi_Cmd *  Cmd)

This function does In-Place PLM Update.

Parameters
Cmdis the command pointer of in place update command
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_INPLACE_UPDATE_IN_PROGRESS if a task cannot be executed as the update is in progress.
  • XPLMI_ERR_INPLACE_UPDATE_DISABLED if PLM Update is disabled in ROM_RSV efuse.
  • XPLMI_ERR_INVALID_RSVD_DDR_REGION_UPDATE if invalid/no DDR region reserved for PLM.
  • XPLMI_ERR_INPLACE_UPDATE_SHUTDOWN_INIT if failed to shutdown initiate of modules during InPlace PLM Update
  • XPLMI_ERR_INPLACE_UPDATE_TASK_NOT_FOUND if PLM Update task is not found.
  • XPLMI_ERR_INPLACE_UPDATE_INVALID_PAYLOAD_LEN if Invalid Payload Len.
  • XPLMI_ERR_INPLACE_UPDATE_FROM_IMAGE_STORE error during update from IS.

References XPLMI_ERR_INPLACE_UPDATE_DISABLED, XPLMI_ERR_INPLACE_UPDATE_FROM_IMAGE_STORE, XPLMI_ERR_INPLACE_UPDATE_IN_PROGRESS, XPLMI_ERR_INPLACE_UPDATE_INVALID_PAYLOAD_LEN, XPLMI_ERR_INPLACE_UPDATE_SHUTDOWN_INIT, XPLMI_ERR_INPLACE_UPDATE_TASK_NOT_FOUND, XPLMI_ERR_INSUFFICIENT_PLM_RSVD_DDR_REGION, XPLMI_ERR_INVALID_RSVD_DDR_REGION_UPDATE, XPlmi_GetTaskInstance(), XPLMI_INVALID_PLM_RSVD_DDR_ADDR, XPLMI_INVALID_PLM_RSVD_DDR_SIZE, XPlmi_IsPlmUpdateInProgress(), XPLMI_MODULE_NO_OPERATION, XPLMI_MODULE_SHUTDOWN_ABORT, XPLMI_MODULE_SHUTDOWN_INITIATE, XPLMI_RTCFG_IMG_STORE_ADDRESS_HIGH, XPLMI_RTCFG_INPLACE_UPDATE_IPI_MASK, XPLMI_RTCFG_INPLACE_UPDATE_IPI_RESP_BUFF, XPLMI_RTCFG_PLM_RSVD_DDR_ADDR, XPLMI_RTCFG_PLM_RSVD_DDR_SIZE, XPlmi_TaskTriggerNow(), XPLMI_UPDATE_FLAG_MASK, XPLMI_UPDATE_IN_PROGRESS, XPLMI_UPDATE_PAYLOAD_LEN, XPLMI_UPDATE_TASK_ID, and XPLMI_UPDATE_USING_IMAGE_STORE.

Referenced by XPlmi_InPlacePlmUpdate().

void XPlmi_PORHandler ( void  )

This function triggers Power on Reset.

Returns
  • None

References XPlmi_SysmonClkSetIro(), and XPlmi_UtilRMW().

Referenced by XPlmi_ErrMgr(), and XPlmi_HandleSwError().

int XPlmi_PreInit ( void  )

This function performs plmi pre-initializaton.

Returns
  • Reset reason status.
  • XST_SUCCESS always.

Referenced by XPlmi_Init().

void XPlmi_Print ( u16  DebugType,
const char8 *  Ctrl1,
  ... 
)

This function prints debug messages with timestamp.

Parameters
DebugTypeis the PLM Debug level for the message
Ctrl1is the format specified string to print

References XPlmi_PrintPlmTimeStamp().

Referenced by XPlmi_ScatterWrite(), XPlmi_ScatterWrite2(), and XPlmi_SetFipsKatMask().

void XPlmi_PrintArray ( u16  DebugType,
const u64  BufAddr,
u32  Len,
const char *  Str 
)

This function is used to print the entire array in bytes as specified by the debug type.

Parameters
DebugTypeprinting of the array will happen as defined by the debug type
BufAddrpointer to the buffer to be printed
Lenlength of the bytes to be printed
Strpointer to the data that is printed along the data

References XPLMI_WORD_LEN.

void XPlmi_PrintPlmBanner ( void  )
void XPlmi_PrintPlmTimeStamp ( void  )

This function prints the PLM time stamp.

References XPlmi_MeasurePerfTime().

Referenced by XPlmi_Print().

void XPlmi_PrintRomTime ( void  )

This function prints the ROM time.

References XPlmi_GetRomIroFreq().

void XPlmi_PrintRomVersion ( void  )

This function prints ROM version using ROM digest value.

Referenced by XPlmi_PrintPlmBanner().

int XPlmi_ProcessCdo ( XPlmiCdo *  CdoPtr)

This function process the CDO file.

Parameters
CdoPtris pointer to the CDO structure
Returns
  • XST_SUCCESS on success.
  • XPLMI_INVALID_BREAK_LENGTH on invalid break length provided in CDO.
  • Verify the header for the first chunk of CDO
  • Check if BufLen is greater than CdoLen This is required if more buffer is copied than CDO len. Mainly for PLM CDO where BufLen is not present and is given as Max PRAM len.
  • In case CmdEnd is detected in previous iteration, it just returns
  • Check if cmd data is copied partially during the last iteration
  • Handle the break command occured in previous chunk
  • If the end is not present in current chunk, skip this chunk
  • If the end is present in current chunk, jump to end command
  • Execute the commands in the Cdo Buffer
  • Check if cmd has to be resumed
  • In case of any error, check if secure lockdown proc is running and continue executing the proc further without exiting the loop. Otherwise, exit the loop.
  • If command end is detected, exit the loop
  • Handle the break command processed in current chunk
  • If the end is present in current chunk, jump to it
  • If the end is not present in current chunk, skip processing rest of the chunk
  • Update the parameters for next iteration

References XPLMI_ERR_MAX_RECURSIVE_CDO_PROCESS, XPLMI_INVALID_BREAK_LENGTH, XPlmi_LogPlmErr(), XPLMI_MAX_RECURSIVE_CDO_PROCESS, XPlmi_SetPlmLiveStatus(), XPLMI_SLD_IN_PROGRESS, and XPlmi_SldState().

Referenced by XPlmi_ExecuteProc().

int XPlmi_PsmSequence ( XPlmi_Cmd *  Cmd)

This function is used to transfer all psm_sequence commands to PSM RAM regions which are then processed by PSM immediately.

Parameters
Cmdis a pointer to command structure
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_PROC_LPD_NOT_INITIALIZED if failed to initialize LPD.
  • XPLMI_UNSUPPORTED_PROC_LENGTH if received proc does not fit in the proc memory.

References XPlmi_DmaTransfer(), XPLMI_ERR_PROC_LPD_NOT_INITIALIZED, XPlmi_GetBufferList(), XPLMI_PSM_SEQUENCE_CMD_ID, XPLMI_UNSUPPORTED_PROC_LENGTH, and XPLMI_WORD_LEN.

void XPlmi_ReconfigErrActions ( void  )

This function reconfigures error actions after the update.

Returns
None

References XPlmi_EmConfig().

Referenced by XPlmi_EmInit().

int XPlmi_RegisterHandler ( u32  IntrId,
GicIntHandler_t  Handler,
void *  Data 
)

This function will register the handler and enable the Iomodule interrupt.

Parameters
IntrIdInterrupt ID as specified in the xplmi_hw.h
Handlerto be registered for the interrupt
Datato be passed to handler
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_REGISTER_IOMOD_HANDLER if failed to register the handler.

References XPLMI_ERR_REGISTER_IOMOD_HANDLER, and XPlmi_GetIOModuleInst().

int XPlmi_RegisterNEnableIpi ( void  )

This function registers and enables IPI interrupt.

Returns
  • XST_SUCCESS on success and XST_FAILURE on failure
XST_SUCCESS on success and XST_FAILURE on failure
int XPlmi_RegisterTamperIntrHandler ( void  )

This function registers the handler for tamper interrupt.

Returns
  • XST_SUCCESS - On success
  • XPLMI_INVALID_ERROR_ID - On invalid ID
  • XPLMI_INVALID_ERROR_HANDLER - On Null handler

Register handler

Enable tamper interrupt in PMC GLOBAL

References XPLM_ERR_TASK_CREATE, XPlmi_EmSetAction(), XPlmi_GetTaskInstance(), and XPlmi_TaskCreate().

Referenced by XPlmi_EmInit().

void XPlmi_ResetLpdInitialized ( void  )

This function resets LpdInitialized variable to 0.

References LPD_WDT_INITIALIZED, XPlmi_DisableWdt(), and XPlmi_GetLpdInitialized().

int XPlmi_RestoreDataBackup ( void  )

This function restore all the data structures after InPlace PLM udpate.

Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_DB_HDR_VERSION_MISMATCH if the DB Hdr version of old PLM is not matching with that of updated PLM.
  • XPLMI_ERR_DB_HDR_SIZE_MISMATCH if the DB Hdr size of old PLM is not matching with the size of updated PLM.
  • XPLMI_ERR_DB_ENDADDR_INVALID if the DB end address calculated is not in a valid range that is accepted by updated PLM. Data Structures during InPlace PLM Update.
  • XPLMI_ERR_INVALID_RESTORE_DS_HANDLER if invalid Data Structure Handler used in restoring of Data Structures during InPlace PLM Update.

References XPLMI_DS_CNT, XPLMI_DS_HDR_SIZE, XPLMI_ERR_DB_ENDADDR_INVALID, XPLMI_ERR_DB_HDR_SIZE_MISMATCH, XPLMI_ERR_DB_HDR_VERSION_MISMATCH, XPLMI_ERR_INVALID_RESTORE_DS_HANDLER, XPlmi_GetDsEntry(), XPLMI_UPDATE_DB_VERSION, and XPLMI_WORD_LEN.

void XPlmi_RestoreMultiboot ( void  )

This is a placeholder function used in case the feature is disabled.

void XPlmi_RestoreWdt ( void  )

This function is used to restore wdt after the In-Place PLM Update.

int XPlmi_RestrictErrActions ( XPlmi_EventType  NodeType,
u32  RegMask,
u32  ErrorAction 
)

This function restricts error actions.

Parameters
NodeTypeof Error
RegMaskof Error
ErrorActionof the the Error
Returns
XST_SUCCESS on success and error code on failure
Parameters
NodeTypeof Error
RegMaskof Error
ErrorActionof the the Error
Returns
  • XST_SUCCESS if success.
  • XPLMI_INVALID_ERROR_ACTION on invalid error action.

For HBM Cattrip, only support actions are:

  • XPLMI_EM_ACTION_INVALID
  • XPLMI_EM_ACTION_POR
  • XPLMI_EM_ACTION_SRST
  • XPLMI_EM_ACTION_CUSTOM
  • XPLMI_EM_ACTION_ERROUT

Referenced by XPlmi_Versal2Ve2VmSetAction().

int XPlmi_RomISR ( XPlmi_RomIntr  RomServiceReq)

This function raises an interrupt request to ROM and waits for completion.

Before calling this API all pre-requsites for ROM service shall be completed.

Parameters
RomServiceReqvariable of enum type XPlmi_RomIntr
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_INVALID_ROM_INT_REQ on invalid interrupt request for ROM.

References XPLMI_DME_CHL_SIGN_GEN, XPLMI_ERR_INVALID_ROM_INT_REQ, XPLMI_INVALID_INT, XPLMI_PLM_UPDT_REQ, and XPLMI_ROM_SERVICE_TIMEOUT.

void XPlmi_RtcaPlatInit ( void  )

This function performs initialization of platform specific RCTA registers.

Referenced by XPlmi_RunTimeConfigInit().

int XPlmi_RunProc ( XPlmi_Cmd *  Cmd)

This function will run the already stored proc if present.

Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success and error code if failure

References XPlmi_ExecuteProc(), and XPLMI_RUN_PROC_CMD_ID.

int XPlmi_RunTimeConfigInit ( void  )

This function initializes the Runtime Configuration Area with default values.

Returns
XST_SUCCESS on success and error code on failure

Clear the Runtime configuration area

Set the default PLM Run time configuration values

Initialize platform specific RTCA Registers

References XPlmi_IsPlmUpdateDone(), XPlmi_IsPlmUpdateDoneTmp(), XPlmi_MemSet(), XPLMI_PLM_MAJOR_VERSION, XPLMI_PLM_MAJOR_VERSION_SHIFT, XPLMI_PLM_MINOR_VERSION, XPLMI_PLM_MINOR_VERSION_SHIFT, XPLMI_PLM_RC_VERSION, XPLMI_PLM_RC_VERSION_SHIFT, XPLMI_PLM_USER_DEFINED_VERSION, XPlmi_RtcaPlatInit(), XPLMI_RTCFG_BASEADDR, XPLMI_RTCFG_DDRMC_CALIB_CHECK_SKIP_ADDR, XPLMI_RTCFG_IMG_STORE_ADDRESS_HIGH, XPLMI_RTCFG_IMG_STORE_ADDRESS_LOW, and XPLMI_RTCFG_IMG_STORE_SIZE.

int XPlmi_SbiDmaXfer ( u64  DestAddr,
u32  Len,
u32  Flags 
)

This function is used to transfer the data from SBI to DMA.

Parameters
DestAddrto which data has to be stored
Lenof the data in words
Flagsto select PMC DMA and DMA Burst type
Returns
  • XST_SUCCESS on success and error codes on failure
  • Configure the secure stream switch
  • Transfer the data from SBI to DMA.
int XPlmi_ScatterWrite ( XPlmi_Cmd *  Cmd)

This function will write single 32 bit value to multiple addresses which are specified in the payload.

            Command payload parameters are
            - Value
            - Address[N]: array of N addresses
Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_INVALID_PAYLOAD_LEN on invalid payload length.

References XPLMI_ERR_INVALID_PAYLOAD_LEN, XPlmi_Print(), XPLMI_SCATTER_WRITE_CMD_ID, and XPLMI_SCATTER_WRITE_PAYLOAD_LEN.

int XPlmi_ScatterWrite2 ( XPlmi_Cmd *  Cmd)

This function will write 2 32-bit values to multiple addresses which are specified by the payload.

            Command payload parameters are
            - Value1
                    - Value2
            - Address[N]: array of N addresses
            where Address[i] = Value1 and Address[i] + 4 = Value2
Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_INVALID_PAYLOAD_LEN on invalid payload length.

References XPLMI_ERR_INVALID_PAYLOAD_LEN, XPlmi_Print(), XPLMI_SCATTER_WRITE2_CMD_ID, XPLMI_SCATTER_WRITE2_PAYLOAD_LEN, and XPLMI_WORD_LEN.

int XPlmi_SchedulerAddTask ( u32  OwnerId,
XPlmi_Callback_t  CallbackFn,
XPlmi_ErrorFunc_t  ErrorFunc,
u32  MilliSeconds,
TaskPriority_t  Priority,
void *  Data,
u8  TaskType 
)

The function adds user periodic task to scheduler queue.

The user shall call this function to register their scheduler task.

Parameters
OwnerIdId of the owner, used while removing the task.
CallbackFncallback function that should be called
ErrorFuncerror function to be called when task does not execute on scheduled interval
MilliSecondsFor Periodic tasks, it's the Periodicity of the task. For Non-Periodic tasks, it's the delay after which task has to be scheduled. Value should be in multiples of 10ms
Priorityis the priority of the task
Datais the pointer to the private data of the task
TaskTypeis the type of Task (periodic or non-periodic)
Returns
  • XST_SUCCESS if scheduler task is registered properly.
  • XPLMI_ERR_INVALID_TASK_TYPE on invalid task type.
  • XPLMI_ERR_INVALID_TASK_PERIOD on invalid task period.
  • XPLMI_ERR_TASK_EXISTS if task is already present.
  • XPLM_ERR_TASK_CREATE if failed to create the task.
  • Get the Next Free Task Index
  • Add Interval as a factor of TICK_MILLISECONDS
  • Create a new task if task instance not found

References XPLM_ERR_TASK_CREATE, XPLMI_ERR_INVALID_TASK_PERIOD, XPLMI_ERR_INVALID_TASK_TYPE, XPLMI_ERR_TASK_EXISTS, XPlmi_GetTaskInstance(), XPlmi_MeasurePerfTime(), and XPlmi_TaskCreate().

void XPlmi_SchedulerHandler ( void *  Data)

The function is scheduler handler and it is called at regular intervals based on configured interval.

Scheduler handler checks and adds the user periodic task to PLM task queue.

Parameters
Data- Not used currently. Added as a part of generic interrupt handler
  • Check if the task is active and has a valid Callback
  • Skip the task, if its already present in the queue
  • Check if a module has registered ErrorFunc for the task and the previously scheduled task is executed or not
  • Update scheduler task state with task missed flag
  • Call the task specific ErrorFunc if previously scheduled task is not executed
  • Remove the task from scheduler if it is non-periodic

Decrement AES and SHA timeout and release resource if timeout has reached

References XPLMI_ERR_SCHED_TASK_MISSED, XPlmi_GetTimerValue(), XPlmi_TaskTriggerNow(), XPlmi_UtilRMW(), and XPlmi_WdtHandler().

Referenced by XPlmi_SetUpInterruptSystem().

void XPlmi_SchedulerInit ( void  )

The function initializes scheduler and returns the initialization status.

References XPlmi_GetTimerValue().

Referenced by XPlmi_StartTimer().

int XPlmi_SchedulerRemoveTask ( u32  OwnerId,
XPlmi_Callback_t  CallbackFn,
u32  MilliSeconds,
const void *  Data 
)

The function removes scheduler task from scheduler queue.

                    The function called by the user for deregistering the scheduler
                    task.
Parameters
OwnerIdId of the owner, removed only if matches the ownerid while adding the task.
CallbackFncallback function that is given while adding.
MilliSecondsPeriodicity of the task given while adding.
Datais the pointer to the private data of the task
Returns
  • XST_SUCCESS on success and error code on failure
int XPlmi_SearchBufferList ( XPlmi_BufferList *  BufferList,
u32  BufferId,
u64 *  BufAddr,
u32 *  BufLen 
)

This function searches Buffer list with the buffer Id to provide buffer address and buffer length.

Parameters
BufferListis the pointer to the list of buffers to search
BufferIdis the id of the buffer to search for
BufAddris the address of the Buffer found
BufLenis the length of the Buffer found
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_BUFFER_MEM_NOT_AVAILABLE if Buffer memory is not available for storing.
  • XPLMI_ERR_PROCID_NOT_VALID if provided proc id is invalid.
  • Check if Buffer Memory is available.
  • Search for the buffer index which has a matching BufferId.
  • Execute proc if the received BufferId is valid.
  • Fill BufAddr and BufLen pointers with resulting values.

References XPLMI_ERR_BUFFER_MEM_NOT_AVAILABLE, XPLMI_ERR_PROCID_NOT_VALID, and XPLMI_WORD_LEN.

Referenced by XPlmi_ExecuteProc(), XPlmi_ListMaskPoll(), XPlmi_ListMaskWrite(), and XPlmi_ListWrite().

int XPlmi_SendIpiCmdToSlaveSlr ( u32 *  Payload,
u32 *  RespBuf 
)

This function handles invalid commands.

Parameters
Payloadholds the inputs of the slaves
RespBufStores the response of the slaves
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_CMD_APIID on unregistered command ID.
  • XPLMI_SSIT_INTR_NOT_ENABLED if interrupts are not enabled.

References XPLMI_ERR_CMD_APIID, XPLMI_SLR_INDEX_SHIFT, XPLMI_SSIT_MONOLITIC, and XPlmi_SsitSendMsgEventAndGetResp().

void XPlmi_SetAddrBufferList ( void  )

This function initializes Address Buffer List.

References XPLMI_MAX_ADDR_BUFFERS, and XPLMI_MAX_ADDR_LIST_CNT.

int XPlmi_SetBufferList ( u32  Address,
u16  Size 
)

This function sets PSM BufferList address to given Address and Size.

Parameters
Addressis the address of Buffer reserved memory for PSM BufferList
Sizeis the size of Buffer reserved memory for PSM BufferList in bytes
Returns
  • XST_SUCCESS on success and error code on failure
  • XPLMI_ERR_PROC_INVALID_ADDRESS_RANGE if provided proc address is invalid.
  • Validate the allocated memory address range. Otherwise return an error.
  • Initialize first Data address of PSM BufferList to the given Address and BufferMemSize with the given Size

References XPLMI_ERR_PROC_INVALID_ADDRESS_RANGE, and XPlmi_GetBufferList().

int XPlmi_SetDDRMCMainRegSts ( u32  DDRMCNum,
u32  RegSts 
)

This function sets the access status of DDR MC main registers.

Parameters
DDRMCNum- DDR MC number
RegSts- To be set status(Busy/Free)
Returns
  • XST_SUCCESS on success.
  • error code on failure

References MAX_DEV_DDRMC, XPLMI_DDRMC_UB0_BASE_ADDR, XPLMI_DDRMC_UB1_BASE_ADDR, XPLMI_DDRMC_UB2_BASE_ADDR, XPLMI_DDRMC_UB3_BASE_ADDR, XPLMI_DDRMC_UB4_BASE_ADDR, XPLMI_DDRMC_UB_PCSR_LOCK_OFFSET, XPLMI_DDRMC_UB_PMC2UB_INFO_OFFSET, XPLMI_ERR_INVALID_PARAM, and XPlmi_UtilRMW().

void XPlmi_SetEmSubsystemId ( const u32 *  Id)

This function sets EmSubsystemId.

Parameters
Idpointer to set the EmSubsystemId
int XPlmi_SetFipsKatMask ( XPlmi_Cmd *  Cmd)

This function will store the KAT mask set by the user so that PLM can monitor the RTCA and compare it with KAT masks before going into FIPS operational state.

Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS if success.
  • XPLMI_ERR_INVALID_PAYLOAD_LEN on invalid payload length.

References XPlmi_CheckAndUpdateFipsState(), XPLMI_ERR_INVALID_PAYLOAD_LEN, XPLMI_FIPS_WRITE_KATMASK_PAYLOAD_LEN, XPlmi_GetFipsKatMaskInstance(), XPLMI_HNIC_CPM5N_PCIDE_KAT_MASK, XPLMI_KAT_MASK, XPLMI_PKI_KAT_MASK, XPlmi_Print(), XPLMI_ROM_KAT_MASK, and XPLMI_SET_FIPS_MASK_CMD_ID.

void XPlmi_SetKatMask ( u32  PlmKatMask)

This function sets XPLMI_RTCFG_PLM_KAT_ADDR with PlmKatMask.

Parameters
PlmKatMaskcontains the kat mask that needs to be set

References XPlmi_GetKatStatus(), and XPlmi_UpdateKatStatus().

void XPlmi_SetLpdInitialized ( u32  Flag)

This function sets LpdInitialized variable with given flag.

Parameters
Flagto set the UART or LPD WDT initialization state.

References XPlmi_GetLpdInitialized().

Referenced by XPlmi_ConfigUart(), XPlmi_EnableWdt(), XPlmi_InitUart(), and XPlmi_LpdInit().

void XPlmi_SetMaxOutCmds ( u8  Val)

This function is used to set the MaxOutCmds variable.

This is required to support non blocking DMA.

Parameters
Valto be set
void XPlmi_SetPlmUpdateIpiMask ( u32  value)

This function sets PlmUpdateIpiMask variable value.

Parameters
valueof PlmUpdateIpiMask
Returns
None

References XPLMI_RTCFG_INPLACE_UPDATE_IPI_MASK.

int XPlmi_SetPmcIroFreq ( void  )

It sets the PMC IRO frequency.

This functions sets the PMC IRO frequency.

Returns
  • XST_SUCCESS on success and error code failure
- XST_SUCCESS on success
  • XST_FAILURE on failure

During PLM phase, set PMC IRO frequency to 400MHz for MP,HP parts Added redundancy to make it single glitch immune

Update PPU1 MB frequency used in BSP for timing calculations

During PLM phase, set PMC IRO frequency to 400MHz for MP,HP parts if production sample and for HP parts if ES1. Added redundancy to make it single glitch immune

Update PPU1 MB frequency used in BSP for timing calculations

Referenced by XPlmi_StartTimer().

int XPlmi_SetUpInterruptSystem ( void  )

This function connects the interrupt handler of the IO Module to the processor.

Returns
  • XST_SUCCESS if handlers are registered properly.
  • XPLMI_ERR_IOMOD_CONNECT if IOModule driver fails to establish connection.
  • Connect a device driver handler that will be called when an interrupt for the device occurs, the device driver handler performs the specific interrupt processing for the device
  • Register the IO module interrupt handler with the exception table.
  • Enable interrupts
  • Clear Break In Progress to get interrupts

References XPlmi_EnableIomoduleIntr(), XPLMI_ERR_IOMOD_CONNECT, XPlmi_GetIOModuleInst(), XPlmi_GetTopLevelIntrTbl(), XPlmi_GetTopLevelIntrTblSize(), XPlmi_IntrHandler(), and XPlmi_SchedulerHandler().

Referenced by XPlmi_Init().

void XPlmi_SetXRamAvailable ( void  )

Flag to indicate XRAM is available.

This function sets XRAM Available Flag

u32 XPlmi_SldState ( void  )

This function returns Secure Lockdown State.

Returns
Secure Lockdown State

Referenced by XPlmi_ProcessCdo(), and XPlmi_TriggerTamperResponse().

void XPlmi_SoftResetHandler ( void  )

This function sets clock source to IRO for ES1 silicon and resets the device.

References XPlmi_SysmonClkSetIro().

Referenced by XPlmi_HandleSwError().

int XPlmi_SsitAcknowledgeEvent ( u8  SlrIndex,
u32  EventIndex 
)

This function is used to acknowledge the event after handling.

Parameters
SlrIndexis index of the SLR for which the event was triggered
EventIndexis the event to acknowledge
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitCfgSecComm ( XPlmi_Cmd *  Cmd)

This function provides SSIT config secure communication command execution.

                Command payload parameters are
     * SLR number, base address of buffer which consists of
       IV1,IV2,Key in master
     * IV1(128-bit), IV2(128-bit) and Key(256-bit) in slave
Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS If command is successful
  • XST_FAILURE If there is failure

References XPLMI_KEY_SIZE_BYTES, XPLMI_SSIT_MASTER_SLR, XPLMI_SSIT_MONOLITIC, XPlmi_SsitSendMsgEventAndGetResp(), and XPlmi_VerifyAddrRange().

u64 XPlmi_SsitGetSlrAddr ( u32  Address,
u8  SlrIndex 
)

This function is used to get the global SLR address for the given local address.

Parameters
Addressis the local address for which the global SLR address need to be calculated
SlrIndexis the index of the SLR for which the address need to be calculated
Returns
  • Returns 0x0 for non-SSIT designs
int XPlmi_SsitReadEventBuffer ( u32 *  ReqBuf,
u32  ReqBufSize 
)

This function is used to read the event buffer of Master SLR in Slave SLRs where the message event is received.

Parameters
ReqBufis the buffer to which the event buffer data to be written
ReqBufSizeis the size of the ReqBuf
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitReadResponse ( u8  SlrIndex,
u32 *  RespBuf,
u32  RespBufSize 
)

This function is used to read the response (if applicable) in Master SLR once the event is acknowledged by Slave SLR.

Parameters
SlrIndexis the SLR index from the response need to be read
RespBufis the Response Buffer to where the response to be written
RespBufSizeis the size of the response buffer
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitRegisterEvent ( u32  EventIndex,
XPlmi_EventHandler_t  Handler,
u8  EventOrigin 
)

This function is used to register any event between Master and Slave SLRs.

Parameters
EventIndexis the Index of the event to be registered
Handleris the handler to be executed when this Event occurs
EventOriginis the SLR origin which can trigger the event
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitSendMsgEventAndGetResp ( u8  SlrIndex,
u32 *  ReqBuf,
u32  ReqBufSize,
u32 *  RespBuf,
u32  RespBufSize,
u32  WaitForEventCompletion 
)

This function sends a message event with given request buffer to a slave SLR, waits for event completion, reads the response from the slave SLR and returns it to the caller.

Parameters
SlrIndexis the SLR index from which the response need to be read
ReqBufis the buffer to which the event buffer data to be written
ReqBufSizeis the size of the ReqBuf
RespBufis the Response Buffer to where the response to be written
RespBufSizeis the size of the response buffer
WaitForEventCompletionis the maximum time to wait before the requested message event is handled by a slave SLR [in microseconds]
Returns
  • Returns XST_SUCCESS for non-SSIT designs

Referenced by XPlmi_SendIpiCmdToSlaveSlr(), and XPlmi_SsitCfgSecComm().

int XPlmi_SsitSyncMaster ( XPlmi_Cmd *  Cmd)

This function provides SSIT Sync Master command execution.

Parameters
Cmdis pointer to the command structure
Returns
Returns the Status of SSIT Sync Master command
  • Initiate synchronization to PLM running on master SLR
  • Wait for Master SLR to reach synchronization point
  • Complete synchronization from slave
  • Clear existing status to know the actual status from Master SLR

References XPLMI_SSIT_SYNC_MASTER_CMD_ID, and XPlmi_UtilRMW().

int XPlmi_SsitSyncSlaves ( XPlmi_Cmd *  Cmd)

This function provides SSIT Sync Slaves command execution.

            Command payload parameters are
                    * Slaves Mask
                    * Timeout
Parameters
Cmdis pointer to the command structure
Returns
  • Returns the Status of SSIT Sync Slaves command
  • XPLMI_ERR_SSIT_SLAVE_SYNC if master timedout on slave sync.
  • Wait until all Slaves initiate synchronization point.
  • Acknowledge synchronization.
  • Clear existing status to know the actual status from Slave SLRs.
  • If the timeout is exceeded, return an error code.
  • De-assert synchronization acknowledgement from master.

References XPlmi_SetPlmLiveStatus(), and XPLMI_SSIT_SYNC_SLAVES_CMD_ID.

int XPlmi_SsitTriggerEvent ( u8  SlrIndex,
u32  EventIndex 
)

This function is used to trigger the given event to the given SLR.

Parameters
SlrIndexis the index of the SLR to which the event to be triggered
EventIndexis the Index of the event to be triggered
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitWaitForEvent ( u8  SlrIndex,
u32  EventIndex,
u32  TimeOut 
)

This function is used to wait for the event to be acknowledged by the given SLR after triggering.

Parameters
SlrIndexis the SLR index where the event is triggered
EventIndexis the Index of the event triggered
TimeOutis the timeout in us to wait for the acknowledgment
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitWaitSlaves ( XPlmi_Cmd *  Cmd)

This function provides SSIT Wait Slaves command execution.

                     Command payload parameters are
                    * Slaves Mask
                    * Timeout
Parameters
Cmdis pointer to the command structure
Returns
  • Returns the Status of SSIT Wait Slaves command
  • XPLMI_ERR_SSIT_SLAVE_SYNC if master timedout on slave sync.
  • Clear any existing SSIT errors in PMC_ERR1_STATUS register.
  • Wait until all Slaves initiate synchronization point.
  • If the timeout is exceeded, return an error code.

References XPlmi_SetPlmLiveStatus(), and XPLMI_SSIT_WAIT_SLAVES_CMD_ID.

int XPlmi_SsitWriteEventBufferAndTriggerMsgEvent ( u8  SlrIndex,
u32 *  ReqBuf,
u32  ReqBufSize 
)

This function is used to write the event buffer data and trigger the Message Event.

Parameters
SlrIndexis the index of the SLR to which the event buffer need to be written
ReqBufis the buffer from where the event buffer data to be written to Slave SLRs event buffer
ReqBufSizeis the size of the ReqBuf
Returns
  • Returns XST_SUCCESS for non-SSIT designs
int XPlmi_SsitWriteResponseAndAckMsgEvent ( u32 *  RespBuf,
u32  RespBufSize 
)

This function is used to write the response (if applicable) in Slave SLR once the event is handled and acknowledge the message event.

Parameters
RespBufis the Response Buffer data to be written
RespBufSizeis the size of the response buffer
Returns
  • Returns XST_SUCCESS for non-SSIT designs
void XPlmi_SssMask ( u32  DmaSrc)

This function masks the secure stream switch value.

Parameters
DmaSrc- DMA0 or DMA1
int XPlmi_StartTimer ( void  )

It initializes the IO module structures and PIT timers.

Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_IOMOD_INIT if IOModdule drive lookup fails.
  • XPLMI_ERR_IOMOD_START if IOModdule drive startup fails.
  • XPLMI_ERR_SET_PMC_IRO_FREQ if failed to set PMC IRO frequency.
  • Initialize all the interrupt Handlers to default handler
  • Initialize the IO Module so that it's ready to use, specify the device ID that is generated in xparameters.h
  • Initialize and start the timer
    • Use PIT1 and PIT2 in prescaler mode
    • Set the Prescaler mode

References XPLMI_ERR_IOMOD_INIT, XPLMI_ERR_IOMOD_START, XPLMI_ERR_SET_PMC_IRO_FREQ, XPlmi_GetIOModuleInst(), XPlmi_IsPlmUpdateDone(), XPlmi_SchedulerInit(), and XPlmi_SetPmcIroFreq().

void XPlmi_StopWdt ( u32  NodeId)

This function stops PMC WDT.

Used during In-Place PLM update.

Parameters
NodeIdis the Node ID of external WDT or internal PMC WDT
Returns
None
int XPlmi_StoreBuffer ( XPlmi_Cmd *  Cmd,
u32  BufferId,
XPlmi_BufferList *  BufferList 
)

This function stores the buffer data into the buffer list provided.

Parameters
Cmdis pointer to the command structure
BufferIdis the Id of the Buffer to be stored in the buffer list
BufferListis the pointer to the BufferList
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_BUFFER_MEM_NOT_AVAILABLE if Buffer memory is not available for storing.
  • XPLMI_UNSUPPORTED_PROC_LENGTH if received proc does not fit in proc memory.
  • XPLMI_MAX_PROC_COMMANDS_RECEIVED on maximum supported proc commands received.

References XPlmi_DmaTransfer(), XPLMI_ERR_BUFFER_MEM_NOT_AVAILABLE, XPLMI_MAX_PROC_COMMANDS_RECEIVED, XPlmi_MoveBuffer(), XPLMI_UNSUPPORTED_PROC_LENGTH, and XPLMI_WORD_LEN.

Referenced by XPlmi_ListSet().

void XPlmi_StoreMultiboot ( void  )

This is a placeholder function used in case the feature is disabled.

void XPlmi_SysmonClkSetIro ( void  )

This function sets the sysmon clock to IRO for ES1 silicon.

References XPLMI_SYSMON_CLK_SRC_IRO_VAL, and XPlmi_UtilRMW().

Referenced by XPlmi_PORHandler(), XPlmi_SoftResetHandler(), and XPlmi_TriggerFwNcrError().

int XPlmi_SysMonInit ( void  )

This function initializes the SysMon.

Returns
XST_SUCCESS on success and error code on failure

Get Instance of SysMon Driver

Enable Over-temperature handling. We need to unlock PCSR to enable SysMon interrupt. Lock it back in after write.

Enable SLVERR for Sysmon

Enable SLVERR for Sysmon SAT0

Enable SLVERR for Sysmon SAT1

References XPlmi_GetSysmonInst(), XPLMI_SYSMON_PCSR_CTRL_SLVERREN_MASK, XPLMI_SYSMON_SAT0_PCSR_MASK_OFFSET, and XPLMI_SYSMON_SAT1_PCSR_MASK_OFFSET.

void XPlmi_SysMonOTDetect ( u32  WaitInMSecVal)

This function detects if we are still in over-temperature condition.

Parameters
WaitInMSecValis the time in milliseconds for which the firmware must wait before proceeding after over temperature event clears up

Check for over-temperature condition in Interrupt Status Regiser.

Wait until over-temperature condition is resolved.

In case of boot after an OT event, wait for this additional time after OT clears to allow the temperature across the chip to cool down

References XPlmi_SetPlmLiveStatus().

Referenced by XPlmi_EmInit().

XPlmi_TaskNode* XPlmi_TaskCreate ( TaskPriority_t  Priority,
int(*)(void *Arg)  Handler,
void *  PrivData 
)

This function creates the task and initializes its fields with the user parameters.

Parameters
PriorityPriority of the task
Handlerfunction pointer to the task handler
PrivDataPrivate Data to be passed with task handler
Returns
Pointer to the task node structure

References XPlmi_GetTaskInstance().

Referenced by XPlmi_EmInit(), XPlmi_GicRegisterHandler(), XPlmi_RegisterTamperIntrHandler(), and XPlmi_SchedulerAddTask().

void XPlmi_TaskDispatchLoop ( void  )

This function will be checking for tasks in the queue based on the priority.

After calling every task handlers, next high priority task will be called.

Perform Priority based task handling

If no pending tasks are present, go to sleep

  • Get the next task in round robin

Goto sleep when all queues are empty

References XPlmi_ErrMgr(), XPlmi_GetTimerValue(), XPlmi_MeasurePerfTime(), and XPlmi_SetPlmLiveStatus().

void XPlmi_TaskInit ( void  )

This function initializes the task queues list.

void XPlmi_TaskTriggerNow ( XPlmi_TaskNode *  Task)

This function adds the task to the task queue so that it can be triggered based on its priority.

Parameters
TaskPointer to the task node

Referenced by XPlmi_ErrIntrHandler(), XPlmi_GicIntrAddTask(), XPlmi_IpiIntrHandler(), XPlmi_PlmUpdate(), XPlmi_SchedulerHandler(), and XPlmi_TriggerTamperResponse().

void XPlmi_TriggerFwNcrError ( void  )

This function sets clock source to IRO for ES1 silicon and triggers FW NCR error.

References XPlmi_GetErrorTable(), XPlmi_SysmonClkSetIro(), and XPlmi_UtilRMW().

Referenced by XPlmi_ErrMgr().

void XPlmi_TriggerSLDOnHaltBoot ( u32  Flag)

This function triggers secure lockdown if haltboot efuses are programmed.

Parameters
Flagdenotes whether processing has to occur immediately or as a task. The possible values are:
  • XPLMI_TRIGGER_TAMPER_TASK,
  • XPLMI_TRIGGER_TAMPER_IMMEDIATE.

References XPlmi_TriggerTamperResponse().

Referenced by XPlmi_ErrMgr().

void XPlmi_TriggerTamperResponse ( u32  Response,
u32  Flag 
)

This functions Triggers Tamper Response processing immediately or as a task.

Parameters
Responseis the Tamper Response that has to occur
Flagdenotes whether processing has to occur immediately or as a task. The possible values are: XPLMI_TRIGGER_TAMPER_TASK, XPLMI_TRIGGER_TAMPER_IMMEDIATE.

If Tamper Task is already triggered, Do nothing

For versal SSIT devices, Notify slave SLRs about SLD

Trigger tamper response task

Process tamper response immediately

References XPlmi_NotifySldSlaveSlrs(), XPLMI_SLD_NOT_TRIGGERED, XPLMI_SLD_TRIGGERED, XPlmi_SldState(), XPlmi_TaskTriggerNow(), and XPLMI_TRIGGER_TAMPER_TASK.

Referenced by XPlmi_TriggerSLDOnHaltBoot().

void XPlmi_UnSetLpdInitialized ( u32  Flag)

This function clears LpdInitialized variable with given flag.

Parameters
Flagto unset the UART or LPD WDT initialization state.

References XPlmi_GetLpdInitialized().

Referenced by XPlmi_ConfigUart().

void XPlmi_UpdateCryptoStatus ( u32  Mask,
u32  Val 
)

This function sets or clears crypto bit in RTCA based on mask.

Parameters
MaskMask to set or clear crypto status
ValValue to set or clear crypto status

References XPLMI_RTCFG_PLM_CRYPTO_STATUS_ADDR, and XPlmi_UtilRMW().

void XPlmi_UpdateErrorSubsystemId ( u32  ErrorNodeId,
u32  ErrorMasks,
u32  SubsystemId 
)

This function updates the SubystemId for the given error index.

Parameters
ErrorNodeIdis the node Id for the error event
ErrorMasksis the Register mask of the Errors
SubsystemIdis the Subsystem ID for the error node.

References XPlmi_GetErrorTable().

void XPlmi_UpdateKatStatus ( u32  PlmKatStatus)

This function sets XPLMI_RTCFG_PLM_KAT_ADDR with PlmKatStatus.

Parameters
PlmKatStatuscontains the KAT status updated by PLM

References XPlmi_CheckAndUpdateFipsState(), XPLMI_KAT_MASK, and XPlmi_UtilRMW().

Referenced by XPlmi_ClearKatMask(), and XPlmi_SetKatMask().

u32 XPlmi_UpdateNumErrOutsCount ( u8  UpdateType)

This function updates NumErrOuts and returns number of error outs count to the caller.

Parameters
UpdateTypeis increment/decrement
Returns
Number of ErrOuts count

References XPlmi_GetNumErrOuts().

Referenced by XPlmi_HandleSwError().

int XPlmi_UtilPoll ( u32  RegAddr,
u32  Mask,
u32  ExpectedValue,
u32  TimeOutInUs,
void(*)(void)  ClearHandler 
)

This function polls a register till the masked bits are set to expected value or till timeout occurs.

Parameters
RegAddris the address of the register
Maskdenotes the bits to be modified
ExpectedValueis the value for which the register is polled
TimeOutInUsis the max time in microseconds for which the register would be polled for the expected value
ClearHandleris the handler to clear the latched values if required before reading them
Returns
  • XST_SUCCESS on success and error code on failure
  • If timeout value is zero, then set it to default maximum timeout value of 268 seconds.
  • Read the Register value.
  • Loop until the expedted value is read or a timeout occurs.
  • wait for 1 microsecond.
  • Clear the Latched Status if any.
  • Read the register value again.
  • Decrement the TimeOut Count.

References XPlmi_SetPlmLiveStatus().

Referenced by XPlmi_GenericMaskPoll(), and XPlmi_InterSlrSldHandshake().

int XPlmi_UtilPoll64 ( u64  RegAddr,
u32  Mask,
u32  ExpectedValue,
u32  TimeOutInUs 
)

This function polls a 64 bit address till the masked bits are set to expected value or till timeout occurs.

Parameters
RegAddr64 bit address
Maskis the bit field to be polled
ExpectedValueis value to be polled
TimeOutInUsis delay time in micro sec
Returns
  • XST_SUCCESS on success and error code on failure
  • If timeout value is zero, then set it to default maximum timeout value of 268 seconds.
  • Read the Register value.
  • Loop until the expedted value is read or a timeout occurs.
  • wait for 1 microsecond.
  • Read the register value again.
  • Decrement the TimeOut Count.

References XPlmi_SetPlmLiveStatus().

Referenced by XPlmi_GenericMaskPoll().

int XPlmi_UtilPollForMask ( u32  RegAddr,
u32  Mask,
u32  TimeOutInUs 
)

This function polls a 64 bit register till the masked bits are set to expected value or till timeout occurs.

Parameters
RegAddris the register address
Maskis the bit field to be updated
TimeOutInUsis delay time in micro sec
Returns
  • XST_SUCCESS on success and error code on failure
  • Read the Register value.
  • Loop until the expedted value is read or a timeout occurs.
  • Read the register value again.
  • Decrement the TimeOut Count.

References XPlmi_SetPlmLiveStatus().

Referenced by XPlmi_InterSlrSldHandshake().

int XPlmi_UtilPollForMask64 ( u32  HighAddr,
u32  LowAddr,
u32  Mask,
u32  TimeOutInUs 
)

This function polls a 64 bit register till the masked bits are set to expected value or till timeout occurs.

Parameters
HighAddris higher 32-bits of 64-bit address
LowAddris lower 32-bits of 64-bit address
Maskis the bit field to be updated
TimeOutInUsis delay time in micro sec
Returns
  • XST_SUCCESS on success and error code on failure
  • Read the Register value.
  • Loop until the expedted value is read or a timeout occurs.
  • wait for 1 microsecond.
  • Read the register value again.
  • Decrement the TimeOut Count.

References XPlmi_SetPlmLiveStatus().

int XPlmi_UtilPollNs ( u32  RegAddr,
u32  Mask,
u32  ExpectedValue,
u64  TimeOutInNs,
void(*)(void)  ClearHandler 
)

This function polls a register till the masked bits are set to expected value or till timeout occurs.

The timeout is specified in nanoseconds. Also provides a clearhandler to clear the latched values before reading them.

Parameters
RegAddris the address of the register
Maskdenotes the bits to be modified
ExpectedValueis the value for which the register is polled
TimeOutInNsis the max time in nanoseconds for which the register would be polled for the expected value
ClearHandleris the handler to clear the latched values if required before reading them
Returns
  • XST_SUCCESS on success and XST_FAILURE on failure
  • Read the Register value
  • Loop until the expedted value is read or a timeout occurs.
  • Return XST_SUCCESS if TimeDiff is less than timeout

References XPlmi_GetPmcIroFreq(), and XPlmi_GetTimerValue().

Referenced by XPlmi_InterSlrSldHandshake().

void XPlmi_UtilRMW ( u32  RegAddr,
u32  Mask,
u32  Value 
)

This function will Read, Modify and Write to a register.

Parameters
RegAddris the address of the register
Maskdenotes the bits to be modified
Valueis the value to be written to the register
  • Read the value from the register.
  • Reset designated bits in a register value to zero, and replace them with the specified value.
  • Update the value to the register.

Referenced by XPlmi_ClearNpiErrors(), XPlmi_DisableCFrameIso(), XPlmi_ErrMgr(), XPlmi_GicIntrClearStatus(), XPlmi_GicIntrDisable(), XPlmi_GicIntrEnable(), XPlmi_ListMaskWrite(), XPlmi_LogPlmErr(), XPlmi_LpdInit(), XPlmi_PORHandler(), XPlmi_SchedulerHandler(), XPlmi_SetDDRMCMainRegSts(), XPlmi_SsitSyncMaster(), XPlmi_SysmonClkSetIro(), XPlmi_TriggerFwNcrError(), XPlmi_UpdateCryptoStatus(), and XPlmi_UpdateKatStatus().

void XPlmi_UtilWrite64 ( u32  HighAddr,
u32  LowAddr,
u32  Value 
)

This function writes to a 64 bit address.

Parameters
HighAddris higher 32-bits of 64-bit address
LowAddris lower 32-bits of 64-bit address
Valueis value to be updated
int XPlmi_ValidateIpiCmd ( XPlmi_Cmd *  Cmd,
u32  SrcIndex 
)

This function checks whether the Cmd passed is supported via IPI mechanism or not.

Parameters
Cmdis the pointer to Cmd structure
SrcIndexis the source index of IPI command
Returns
  • XST_SUCCESS on success.
int XPlmi_VerifyAddrRange ( u64  StartAddr,
u64  EndAddr 
)

This function is used to check if the given address range is valid.

This function can be called before loading any elf or assigning any buffer in that address range

Parameters
StartAddris the starting address
EndAddris the ending address
Returns
  • XST_SUCCESS on success and error code on failure

This function can be called before loading any elf or assigning any buffer in that address range

Parameters
StartAddris the starting address
EndAddris the ending address
Returns
XST_SUCCESS on success and error code on failure

Referenced by XPlmi_SsitCfgSecComm().

int XPlmi_Versal2Ve2VmEAMHandler ( void *  Data)

This function is the interrupt handler for the EAM errors.

Parameters
Datais presently passed as NULL
Returns
  • XST_SUCCESS always.
  • Interrupt is selected as response for Custom, subsystem shutdown and subsystem restart actions. For these actions, error will be disabled. Agent should clear the source and enable the error again using SetAction. In SetAction, error will be cleared and enabled. For subsystem cases, during subsystem restart, error will be enabled again.
  • Clear and enable EAM errors at IOMODULE level

References GET_PMC_ERR_ACTION_OFFSET, GET_PMC_IRQ_MASK, XPlmi_EmClearError(), XPlmi_EmDisable(), XPlmi_GetErrorTable(), XPlmi_PlmIntrClear(), and XPlmi_PlmIntrEnable().

Referenced by XPlmi_ErrorTaskHandler().

int XPlmi_Versal2Ve2VmSetAction ( XPlmi_Cmd *  Cmd)

This function sets the error action as prescribed by the command.

            Command payload parameters are
                    * Error Node ID
                    * Error Action
                            0 - Invalid
                            1 - POR
                            2 - SRST
                            3 - Custom(Not supported)
                            4 - ErrOut
                            5 - Subsystem Shutdown
                            6 - Subsystem Restart
                            7 - Print to log
                            8 - SLD
                            9 - SLD with TRI
                            10 - None
            * Error ID Mask
Parameters
Cmdis pointer to the command structure
Returns
  • XST_SUCCESS on success.
  • XPLMI_INVALID_NODE_ID on invalid node ID.
  • XPLMI_INVALID_ERROR_ACTION on invalid error action.
  • XPLMI_CANNOT_CHANGE_ACTION if failed to change error action.
  • XPLMI_LPD_UNINITIALIZED if LPD failed to initialize.

References XPlmi_EmSetAction(), XPlmi_GetEmSubsystemId(), XPlmi_GetEventIndex(), and XPlmi_RestrictErrActions().

int XPlmi_WaitForNonBlkDestDma ( u32  DmaFlags)

This function is used set wait on non blocking DMA.

It is called when Dest DMA is non blocking.

Parameters
DmaFlagsto differentiate between PMCDMA_0 and PMCDMA_1
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_NON_BLOCK_DEST_DMA_WAIT if Non Block destination Dma transfer wait failed.
  • Wait until the DMA destination channel transfer completes.
  • Clear the source channel done interrupt bits.
  • Reconfigure the DMA destination channel.

References XPLMI_ERR_NON_BLOCK_DEST_DMA_WAIT.

int XPlmi_WaitForNonBlkDma ( u32  DmaFlags)

This function is used to wait on non blocking DMA.

Parameters
DmaFlagsto differentiate between PMCDMA_0 and PMCDMA_1
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_NON_BLOCK_DMA_WAIT_DEST if Non Block Dma transfer wait failed in destination channel WaitForDone.
  • XPLMI_ERR_NON_BLOCK_DMA_WAIT_SRC if Non Block Dma transfer wait failed in source channel WaitForDone.
  • Configure the DMA source channel.
  • Wait until the DMA destination channel transfer completes.
  • Wait until the DMA source channel transfer completes.
  • Clear the source and destination channel done interrupt bits.
  • Reconfigure the DMA source and destination channel.

References XPLMI_ERR_NON_BLOCK_DMA_WAIT_DEST, and XPLMI_ERR_NON_BLOCK_DMA_WAIT_SRC.

int XPlmi_WaitForNonBlkSrcDma ( u32  DmaFlags)

This function is used set wait on non blocking DMA.

It is called when Src DMA is non blocking.

Parameters
DmaFlagsto differentiate between PMCDMA_0 and PMCDMA_1
Returns
  • XST_SUCCESS on success.
  • XPLMI_ERR_NON_BLOCK_SRC_DMA_WAIT if Non Block source Dma transfer wait failed.
  • Configure the DMA source channel.
  • Wait until the DMA source channel transfer completes.
  • Clear the source channel done interrupt bits.
  • Reconfigure the DMA source channel.

References XPLMI_ERR_NON_BLOCK_SRC_DMA_WAIT.

void XPlmi_WdtHandler ( void  )

This function is handler for WDT.

Scheduler calls this function periodically to check the PLM Live status and to toggle the MIO.

  • if WDT is not enabled, just return
  • Toggle MIO only when last reset period exceeds periodicity

References XPLMI_SCHEDULER_PERIOD, and XPLMI_WDT_PERIODICITY_MIN.

Referenced by XPlmi_SchedulerHandler().

Variable Documentation

u32 XPlmi_Wdt::GpioAddr

GPIO address corresponding to MIO used for WDT.

u32 XPlmi_Wdt::GpioMask

GPIO Mask corresponding to MIO used for WDT.

u8 XPlmi_Wdt::IsEnabled

Used to indicate if WDT is enabled or not.

u32 XPlmi_Wdt::LastResetPeriod

Last reset period is used to check last tick time.

u32 XPlmi_Wdt::Periodicity

WDT period at which PLM should set the live status.

u8 XPlmi_Wdt::PlmLiveStatus

PLM sets this bit to indicate it is alive.