lib/sw_services/xilplmi/src/xplmi_err.c
static int XPlmi_EmEnablePSError(u32 ErrorNodeType, u32 RegMask)
{
	int Status = XST_FAILURE;

	/* Enable the specified Error to propagate to ERROUT pin	*/
	switch ((XPlmi_EventType)ErrorNodeType) {
	case XPLMI_NODETYPE_EVENT_PMC_ERR1:
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR_OUT1_EN, RegMask);
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_PMC_ERR2:
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR_OUT2_EN, RegMask);
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR1:
		if (ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action ==
				XPLMI_EM_ACTION_ERROUT) {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_CR_ERR1_EN, RegMask);
		} else {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_NCR_ERR1_EN, RegMask);
		}
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR2:
		if (ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action ==
				XPLMI_EM_ACTION_ERROUT) {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_CR_ERR2_EN, RegMask);
		} else {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_NCR_ERR2_EN, RegMask);
		}
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_SW_ERR:
		/*
		 * Do nothing
		 * Error out will be trigerred through software using
		 * PMC_CR error trigger bit. PMC_CR is configured
		 * to error out by default and is not configurable.
		 */
		Status = XST_SUCCESS;
		break;
	default:
		Status = XPLMI_INVALID_ERROR_TYPE;
		XPlmi_Printf(DEBUG_GENERAL,
			"Invalid ErrType 0x%x for Error Mask: 0x%0x\n\r",
			ErrorNodeType, RegMask);
		break;
	}

	return Status;
}
/*****************************************************************************/
/**
 * @brief	This function enables the ERR OUT response for the given Error ID.
 *
 * @param	ErrorNodeType is the node type for the error event
 * @param	RegMask is the register mask of the error to be enabled
 *
 * @return	XST_SUCCESS on success and error code on failure
 *
 *****************************************************************************/
@brief       This function enables the ERR OUT response for the given Error ID.
@param       ErrorNodeType is the node type for the error event
@param       RegMask is the register mask of the error to be enabled

@return      XST_SUCCESS on success and error code on failure
@brief This function enables the ERR OUT response for the given Error ID . @param ErrorNodeType is the node type for the error event @param RegMask is the register mask of the error to be enabled @return XST_SUCCESS on success and error code on failure
static int XPlmi_EmEnablePSError(u32 ErrorNodeType, u32 RegMask)
{
	int Status = XST_FAILURE;
	switch ((XPlmi_EventType)ErrorNodeType) {
	case XPLMI_NODETYPE_EVENT_PMC_ERR1:
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR_OUT1_EN, RegMask);
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_PMC_ERR2:
		XPlmi_Out32(PMC_GLOBAL_PMC_ERR_OUT2_EN, RegMask);
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR1:
		if (ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action ==
				XPLMI_EM_ACTION_ERROUT) {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_CR_ERR1_EN, RegMask);
		} else {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_NCR_ERR1_EN, RegMask);
		}
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_PSM_ERR2:
		if (ErrorTable[XPLMI_ERROR_PMC_PSM_CR].Action ==
				XPLMI_EM_ACTION_ERROUT) {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_CR_ERR2_EN, RegMask);
		} else {
			XPlmi_Out32(PSM_GLOBAL_REG_PSM_NCR_ERR2_EN, RegMask);
		}
		Status = XST_SUCCESS;
		break;
	case XPLMI_NODETYPE_EVENT_SW_ERR:
		Status = XST_SUCCESS;
		break;
	default:
		Status = XPLMI_INVALID_ERROR_TYPE;
		XPlmi_Printf(DEBUG_GENERAL,
			"Invalid ErrType 0x%x for Error Mask: 0x%0x\n\r",
			ErrorNodeType, RegMask);
		break;
	}
	return Status;
}
static int XPlmi_EmEnablePSError ( u32 ErrorNodeType , u32 RegMask ) { int Status = XST_FAILURE ; switch ( ( XPlmi_EventType ) ErrorNodeType ) { case XPLMI_NODETYPE_EVENT_PMC_ERR1 : XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR_OUT1_EN , RegMask ) ; Status = XST_SUCCESS ; break ; case XPLMI_NODETYPE_EVENT_PMC_ERR2 : XPlmi_Out32 ( PMC_GLOBAL_PMC_ERR_OUT2_EN , RegMask ) ; Status = XST_SUCCESS ; break ; case XPLMI_NODETYPE_EVENT_PSM_ERR1 : if ( ErrorTable [ XPLMI_ERROR_PMC_PSM_CR ] . Action == XPLMI_EM_ACTION_ERROUT ) { XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_CR_ERR1_EN , RegMask ) ; } else { XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_NCR_ERR1_EN , RegMask ) ; } Status = XST_SUCCESS ; break ; case XPLMI_NODETYPE_EVENT_PSM_ERR2 : if ( ErrorTable [ XPLMI_ERROR_PMC_PSM_CR ] . Action == XPLMI_EM_ACTION_ERROUT ) { XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_CR_ERR2_EN , RegMask ) ; } else { XPlmi_Out32 ( PSM_GLOBAL_REG_PSM_NCR_ERR2_EN , RegMask ) ; } Status = XST_SUCCESS ; break ; case XPLMI_NODETYPE_EVENT_SW_ERR : Status = XST_SUCCESS ; break ; default : Status = XPLMI_INVALID_ERROR_TYPE ; XPlmi_Printf ( DEBUG_GENERAL , " \n \r " , ErrorNodeType , RegMask ) ; break ; } return Status ; }
@brief       This function enables the ERR OUT response for the given Error ID.
@brief This function enables the ERR OUT response for the given Error ID .
/* Enable the specified Error to propagate to ERROUT pin	*/ /*
		 * Do nothing
		 * Error out will be trigerred through software using
		 * PMC_CR error trigger bit. PMC_CR is configured
		 * to error out by default and is not configurable.
		 */