lib/sw_services/xilplmi/src/xplmi_err.c
static void XPlmi_EmClearError(u32 ErrorNodeType, u32 ErrorId)
{
	u32 RegMask = XPlmi_ErrRegMask(ErrorId);
	u32 NumErrOuts = 0U;

	switch ((XPlmi_EventType)ErrorNodeType) {
	case XPLMI_NODETYPE_EVENT_PMC_ERR1:
		/* Clear previous errors */
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS, RegMask);
		break;
	case XPLMI_NODETYPE_EVENT_PMC_ERR2:
		/* Clear previous errors */
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR2_STATUS, RegMask);
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR1:
		/* Clear previous errors */
		XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR1_STATUS, RegMask);
		/* If action is error out, clear PMC FW_CR error */
		if ((ErrorTable[ErrorId].Action == XPLMI_EM_ACTION_ERROUT) &&
			(ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action !=
					XPLMI_EM_ACTION_ERROUT)) {
			NumErrOuts =
					XPlmi_UpdateNumErrOutsCount(XPLMI_UPDATE_TYPE_DECREMENT);
			if (NumErrOuts == 0U) {
				XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS,
						PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK);
			}
		}
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR2:
		/* Clear previous errors */
		XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR2_STATUS, RegMask);
		/* If action is error out, clear PMC FW_CR error */
		if ((ErrorTable[ErrorId].Action == XPLMI_EM_ACTION_ERROUT) &&
			(ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action !=
					XPLMI_EM_ACTION_ERROUT)) {
			NumErrOuts =
					XPlmi_UpdateNumErrOutsCount(XPLMI_UPDATE_TYPE_DECREMENT);
			if (NumErrOuts == 0U) {
				XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS,
						PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK);
			}
		}
		break;
	case XPLMI_NODETYPE_EVENT_SW_ERR:
		/* Clear previous erros */
		if (ErrorTable[ErrorId].Action == XPLMI_EM_ACTION_ERROUT) {
			NumErrOuts =
					XPlmi_UpdateNumErrOutsCount(XPLMI_UPDATE_TYPE_DECREMENT);
			if (NumErrOuts == 0U) {
				XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS,
						PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK);
			}
		}
		break;
	default:
		/* Invalid Error Type */
		XPlmi_Printf(DEBUG_GENERAL,
			"Invalid ErrType 0x%x for Error Mask: 0x%0x\n\r",
			ErrorNodeType, RegMask);
		break;
	}
}
/*****************************************************************************/
/**
 * @brief	This function clears any previous errors before enabling them.
 *
 * @param	ErrorNodeType is the node type for the error event
 * @param	ErrorId is the index of the error to be cleared
 *
 * @return	None
 *
 *****************************************************************************/
@brief       This function clears any previous errors before enabling them.
@param       ErrorNodeType is the node type for the error event
@param       ErrorId is the index of the error to be cleared

@return      None
@brief This function clears any previous errors before enabling them . @param ErrorNodeType is the node type for the error event @param ErrorId is the index of the error to be cleared @return None
static void XPlmi_EmClearError(u32 ErrorNodeType, u32 ErrorId)
{
	u32 RegMask = XPlmi_ErrRegMask(ErrorId);
	u32 NumErrOuts = 0U;
	switch ((XPlmi_EventType)ErrorNodeType) {
	case XPLMI_NODETYPE_EVENT_PMC_ERR1:
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS, RegMask);
		break;
	case XPLMI_NODETYPE_EVENT_PMC_ERR2:
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR2_STATUS, RegMask);
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR1:
		XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR1_STATUS, RegMask);
		if ((ErrorTable[ErrorId].Action == XPLMI_EM_ACTION_ERROUT) &&
			(ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action !=
					XPLMI_EM_ACTION_ERROUT)) {
			NumErrOuts =
					XPlmi_UpdateNumErrOutsCount(XPLMI_UPDATE_TYPE_DECREMENT);
			if (NumErrOuts == 0U) {
				XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS,
						PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK);
			}
		}
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR2:
		XPlmi_Out32(PSM_GLOBAL_REG_PSM_ERR2_STATUS, RegMask);
		if ((ErrorTable[ErrorId].Action == XPLMI_EM_ACTION_ERROUT) &&
			(ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action !=
					XPLMI_EM_ACTION_ERROUT)) {
			NumErrOuts =
					XPlmi_UpdateNumErrOutsCount(XPLMI_UPDATE_TYPE_DECREMENT);
			if (NumErrOuts == 0U) {
				XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS,
						PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK);
			}
		}
		break;
	case XPLMI_NODETYPE_EVENT_SW_ERR:
		if (ErrorTable[ErrorId].Action == XPLMI_EM_ACTION_ERROUT) {
			NumErrOuts =
					XPlmi_UpdateNumErrOutsCount(XPLMI_UPDATE_TYPE_DECREMENT);
			if (NumErrOuts == 0U) {
				XPlmi_Out32(PMC_GLOBAL_PMC_ERR1_STATUS,
						PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK);
			}
		}
		break;
	default:
		XPlmi_Printf(DEBUG_GENERAL,
			"Invalid ErrType 0x%x for Error Mask: 0x%0x\n\r",
			ErrorNodeType, RegMask);
		break;
	}
}
static void XPlmi_EmClearError ( u32 ErrorNodeType , u32 ErrorId ) { u32 RegMask = XPlmi_ErrRegMask ( ErrorId ) ; u32 NumErrOuts = 0U ; switch ( ( XPlmi_EventType ) ErrorNodeType ) { case XPLMI_NODETYPE_EVENT_PMC_ERR1 : XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR1_STATUS , RegMask ) ; break ; case XPLMI_NODETYPE_EVENT_PMC_ERR2 : XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR2_STATUS , RegMask ) ; break ; case XPLMI_NODETYPE_EVENT_PSM_ERR1 : XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_ERR1_STATUS , RegMask ) ; if ( ( ErrorTable [ ErrorId ] . Action == XPLMI_EM_ACTION_ERROUT ) && ( ErrorTable [ XPLMI_ERROR_PMC_PSM_CR ] . Action != XPLMI_EM_ACTION_ERROUT ) ) { NumErrOuts = XPlmi_UpdateNumErrOutsCount ( XPLMI_UPDATE_TYPE_DECREMENT ) ; if ( NumErrOuts == 0U ) { XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR1_STATUS , PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK ) ; } } break ; case XPLMI_NODETYPE_EVENT_PSM_ERR2 : XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_ERR2_STATUS , RegMask ) ; if ( ( ErrorTable [ ErrorId ] . Action == XPLMI_EM_ACTION_ERROUT ) && ( ErrorTable [ XPLMI_ERROR_PMC_PSM_CR ] . Action != XPLMI_EM_ACTION_ERROUT ) ) { NumErrOuts = XPlmi_UpdateNumErrOutsCount ( XPLMI_UPDATE_TYPE_DECREMENT ) ; if ( NumErrOuts == 0U ) { XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR1_STATUS , PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK ) ; } } break ; case XPLMI_NODETYPE_EVENT_SW_ERR : if ( ErrorTable [ ErrorId ] . Action == XPLMI_EM_ACTION_ERROUT ) { NumErrOuts = XPlmi_UpdateNumErrOutsCount ( XPLMI_UPDATE_TYPE_DECREMENT ) ; if ( NumErrOuts == 0U ) { XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR1_STATUS , PMC_GLOBAL_PMC_ERR1_TRIG_FW_CR_MASK ) ; } } break ; default : XPlmi_Printf ( DEBUG_GENERAL , " \n \r " , ErrorNodeType , RegMask ) ; break ; } }
@brief       This function clears any previous errors before enabling them.
@brief This function clears any previous errors before enabling them .
/* Clear previous errors */ /* Clear previous errors */ /* Clear previous errors */ /* If action is error out, clear PMC FW_CR error */ /* Clear previous errors */ /* If action is error out, clear PMC FW_CR error */ /* Clear previous erros */ /* Invalid Error Type */