lib/sw_services/xilplmi/src/xplmi_err.c
int XPlmi_PsEmInit(void)
{
	int Status = XST_FAILURE;
	u32 Index;
	u32 PsmErr1Status;
	u32 PsmErr2Status;
	u32 RegMask;

	/* Disable all the Error Actions */
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_CR_ERR1_DIS, MASK32_ALL_HIGH);
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_NCR_ERR1_DIS, MASK32_ALL_HIGH);
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_IRQ1_DIS, MASK32_ALL_HIGH);

	PsmErr1Status = XPlmi_In32(PSM_GLOBAL_REG_PSM_ERR1_STATUS);
	PsmErr2Status = XPlmi_In32(PSM_GLOBAL_REG_PSM_ERR2_STATUS);
	XPlmi_Out32(XPLMI_RTCFG_PSM_ERR1_STATUS_ADDR, PsmErr1Status);
	XPlmi_Out32(XPLMI_RTCFG_PSM_ERR2_STATUS_ADDR, PsmErr2Status);
	if (PsmErr1Status != 0U) {
		XPlmi_Printf(DEBUG_GENERAL, "PSM_GLOBAL_REG_PSM_ERR1_STATUS: "
			"0x%08x\n\r", PsmErr1Status);
	}
	if (PsmErr2Status != 0U) {
		XPlmi_Printf(DEBUG_GENERAL, "PSM_GLOBAL_REG_PSM_ERR2_STATUS: "
			"0x%08x\n\r", PsmErr2Status);
	}

	/* Clear the error status registers */
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR1_STATUS, MASK32_ALL_HIGH);
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR2_STATUS, MASK32_ALL_HIGH);

	/* Set the default actions as defined in the Error table */
	for (Index = XPLMI_ERROR_PS_SW_CR;
		Index < XPLMI_ERROR_PSMERR1_MAX; Index++) {
		if (ErrorTable[Index].Action != XPLMI_EM_ACTION_INVALID) {
			RegMask = XPlmi_ErrRegMask(Index);
			if (XPlmi_EmSetAction(XPLMI_NODETYPE_EVENT_ERROR_PSM_ERR1, RegMask,
						ErrorTable[Index].Action,
						ErrorTable[Index].Handler) != XST_SUCCESS) {
				XPlmi_Printf(DEBUG_GENERAL,
						"Warning: XPlmi_PsEmInit: Failed to "
						"set action for PSM ERR1: %u\r\n", Index);
			}
		}
	}

	for (Index = XPLMI_ERROR_LPD_SWDT;
		Index < XPLMI_ERROR_PSMERR2_MAX; Index++) {
		if (ErrorTable[Index].Action != XPLMI_EM_ACTION_INVALID) {
			RegMask = XPlmi_ErrRegMask(Index);
			if (XPlmi_EmSetAction(XPLMI_NODETYPE_EVENT_ERROR_PSM_ERR2, RegMask,
						ErrorTable[Index].Action,
						ErrorTable[Index].Handler) != XST_SUCCESS) {
				XPlmi_Printf(DEBUG_GENERAL,
						"Warning: XPlmi_PsEmInit: Failed to "
						"set action for PSM ERR2: %u\r\n", Index);
			}
		}
	}
	Status = XST_SUCCESS;

	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function initializes the PSM error actions. Disables all the
 * PSM error actions and registers default action.
 *
 * @return	XST_SUCCESS
 *
*****************************************************************************/
@brief       This function initializes the PSM error actions. Disables all the
PSM error actions and registers default action.


@brief This function initializes the PSM error actions . Disables all the PSM error actions and registers default action .
int XPlmi_PsEmInit(void)
{
	int Status = XST_FAILURE;
	u32 Index;
	u32 PsmErr1Status;
	u32 PsmErr2Status;
	u32 RegMask;
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_CR_ERR1_DIS, MASK32_ALL_HIGH);
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_NCR_ERR1_DIS, MASK32_ALL_HIGH);
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_IRQ1_DIS, MASK32_ALL_HIGH);
	PsmErr1Status = XPlmi_In32(PSM_GLOBAL_REG_PSM_ERR1_STATUS);
	PsmErr2Status = XPlmi_In32(PSM_GLOBAL_REG_PSM_ERR2_STATUS);
	XPlmi_Out32(XPLMI_RTCFG_PSM_ERR1_STATUS_ADDR, PsmErr1Status);
	XPlmi_Out32(XPLMI_RTCFG_PSM_ERR2_STATUS_ADDR, PsmErr2Status);
	if (PsmErr1Status != 0U) {
		XPlmi_Printf(DEBUG_GENERAL, "PSM_GLOBAL_REG_PSM_ERR1_STATUS: "
			"0x%08x\n\r", PsmErr1Status);
	}
	if (PsmErr2Status != 0U) {
		XPlmi_Printf(DEBUG_GENERAL, "PSM_GLOBAL_REG_PSM_ERR2_STATUS: "
			"0x%08x\n\r", PsmErr2Status);
	}
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR1_STATUS, MASK32_ALL_HIGH);
	XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR2_STATUS, MASK32_ALL_HIGH);
	for (Index = XPLMI_ERROR_PS_SW_CR;
		Index < XPLMI_ERROR_PSMERR1_MAX; Index++) {
		if (ErrorTable[Index].Action != XPLMI_EM_ACTION_INVALID) {
			RegMask = XPlmi_ErrRegMask(Index);
			if (XPlmi_EmSetAction(XPLMI_NODETYPE_EVENT_ERROR_PSM_ERR1, RegMask,
						ErrorTable[Index].Action,
						ErrorTable[Index].Handler) != XST_SUCCESS) {
				XPlmi_Printf(DEBUG_GENERAL,
						"Warning: XPlmi_PsEmInit: Failed to "
						"set action for PSM ERR1: %u\r\n", Index);
			}
		}
	}
	for (Index = XPLMI_ERROR_LPD_SWDT;
		Index < XPLMI_ERROR_PSMERR2_MAX; Index++) {
		if (ErrorTable[Index].Action != XPLMI_EM_ACTION_INVALID) {
			RegMask = XPlmi_ErrRegMask(Index);
			if (XPlmi_EmSetAction(XPLMI_NODETYPE_EVENT_ERROR_PSM_ERR2, RegMask,
						ErrorTable[Index].Action,
						ErrorTable[Index].Handler) != XST_SUCCESS) {
				XPlmi_Printf(DEBUG_GENERAL,
						"Warning: XPlmi_PsEmInit: Failed to "
						"set action for PSM ERR2: %u\r\n", Index);
			}
		}
	}
	Status = XST_SUCCESS;
	return Status;
}
int XPlmi_PsEmInit ( void ) { int Status = XST_FAILURE ; u32 Index ; u32 PsmErr1Status ; u32 PsmErr2Status ; u32 RegMask ; XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_CR_ERR1_DIS , MASK32_ALL_HIGH ) ; XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_NCR_ERR1_DIS , MASK32_ALL_HIGH ) ; XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_IRQ1_DIS , MASK32_ALL_HIGH ) ; PsmErr1Status = XPlmi_In32 ( PSM_GLOBAL_REG_PSM_ERR1_STATUS ) ; PsmErr2Status = XPlmi_In32 ( PSM_GLOBAL_REG_PSM_ERR2_STATUS ) ; XPlmi_Out32 ( XPLMI_RTCFG_PSM_ERR1_STATUS_ADDR , PsmErr1Status ) ; XPlmi_Out32 ( XPLMI_RTCFG_PSM_ERR2_STATUS_ADDR , PsmErr2Status ) ; if ( PsmErr1Status != 0U ) { XPlmi_Printf ( DEBUG_GENERAL , " " " \n \r " , PsmErr1Status ) ; } if ( PsmErr2Status != 0U ) { XPlmi_Printf ( DEBUG_GENERAL , " " " \n \r " , PsmErr2Status ) ; } XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_ERR1_STATUS , MASK32_ALL_HIGH ) ; XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_ERR2_STATUS , MASK32_ALL_HIGH ) ; for ( Index = XPLMI_ERROR_PS_SW_CR ; Index < XPLMI_ERROR_PSMERR1_MAX ; Index ++ ) { if ( ErrorTable [ Index ] . Action != XPLMI_EM_ACTION_INVALID ) { RegMask = XPlmi_ErrRegMask ( Index ) ; if ( XPlmi_EmSetAction ( XPLMI_NODETYPE_EVENT_ERROR_PSM_ERR1 , RegMask , ErrorTable [ Index ] . Action , ErrorTable [ Index ] . Handler ) != XST_SUCCESS ) { XPlmi_Printf ( DEBUG_GENERAL , " " " \r \n " , Index ) ; } } } for ( Index = XPLMI_ERROR_LPD_SWDT ; Index < XPLMI_ERROR_PSMERR2_MAX ; Index ++ ) { if ( ErrorTable [ Index ] . Action != XPLMI_EM_ACTION_INVALID ) { RegMask = XPlmi_ErrRegMask ( Index ) ; if ( XPlmi_EmSetAction ( XPLMI_NODETYPE_EVENT_ERROR_PSM_ERR2 , RegMask , ErrorTable [ Index ] . Action , ErrorTable [ Index ] . Handler ) != XST_SUCCESS ) { XPlmi_Printf ( DEBUG_GENERAL , " " " \r \n " , Index ) ; } } } Status = XST_SUCCESS ; return Status ; }
@brief       This function initializes the PSM error actions.
@brief This function initializes the PSM error actions .
/* Disable all the Error Actions */ /* Clear the error status registers */ /* Set the default actions as defined in the Error table */