XilinxProcessorIPLib/drivers/aienginev2/src/interrupt/xaie_interrupt.c
static AieRC _XAie_GroupErrorInit(XAie_DevInst *DevInst)
{
	AieRC RC;
	u32 GroupErrorEnableMask;
	u8 MemTileStart, MemTileEnd, AieRowStart, AieRowEnd;
	XAie_LocType Loc;

	MemTileStart = DevInst->MemTileRowStart;
	MemTileEnd = DevInst->MemTileRowStart + DevInst->MemTileNumRows;
	AieRowStart = DevInst->AieTileRowStart;
	AieRowEnd = DevInst->AieTileRowStart + DevInst->AieTileNumRows;

	for(u8 Col = 0; Col < DevInst->NumCols; Col++) {
		for(u8 Row = AieRowStart; Row < AieRowEnd; Row++) {
			Loc = XAie_TileLoc(Col, Row);

			if (_XAie_PmIsTileRequested(DevInst, Loc) == XAIE_DISABLE)
				continue;

			GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst,
							Loc, XAIE_MEM_MOD);
			RC = XAie_EventGroupControl(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_EVENT_GROUP_ERRORS_MEM,
					GroupErrorEnableMask);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to configure group errors in memory module\n");
				return RC;
			}

			RC = XAie_EventBroadcast(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_ERROR_BROADCAST_ID,
					XAIE_EVENT_GROUP_ERRORS_MEM);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to setup error broadcast for memory module\n");
				return RC;
			}

			GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst,
							Loc, XAIE_CORE_MOD);
			RC = XAie_EventGroupControl(DevInst, Loc, XAIE_CORE_MOD,
					XAIE_EVENT_GROUP_ERRORS_0_CORE,
					GroupErrorEnableMask);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to configure group error in core module\n");
				return RC;
			}

			RC = XAie_EventBroadcast(DevInst, Loc, XAIE_CORE_MOD,
					XAIE_ERROR_BROADCAST_ID,
					XAIE_EVENT_GROUP_ERRORS_0_CORE);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to setup error broadcast for core module\n");
				return RC;
			}
		}

		for(u8 MemRow = MemTileStart; MemRow < MemTileEnd; MemRow++) {
			Loc = XAie_TileLoc(Col, MemRow);

			if (_XAie_PmIsTileRequested(DevInst, Loc) == XAIE_DISABLE)
				continue;

			GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst,
							Loc, XAIE_MEM_MOD);
			RC = XAie_EventGroupControl(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_EVENT_GROUP_ERRORS_MEM_TILE,
					GroupErrorEnableMask);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to configure group error in mem tile\n");
				return RC;
			}

			RC = XAie_EventBroadcast(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_ERROR_BROADCAST_ID,
					XAIE_EVENT_GROUP_ERRORS_MEM_TILE);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to setup error broadcast for mem tile\n");
				return RC;
			}
		}

		/*
		 * Shim tile only needs to setup error notification with first
		 * level interrupt controller.
		 */
		Loc = XAie_TileLoc(Col, DevInst->ShimRow);
		GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst, Loc,
								XAIE_PL_MOD);
		RC = XAie_EventGroupControl(DevInst, Loc, XAIE_PL_MOD,
					XAIE_EVENT_GROUP_ERRORS_PL,
					GroupErrorEnableMask);
		if(RC != XAIE_OK) {
			XAIE_ERROR("Failed to configure group error in shim tile\n");
			return RC;
		}

		RC = XAie_IntrCtrlL1Event(DevInst, Loc, XAIE_EVENT_SWITCH_A,
				XAIE_ERROR_BROADCAST_ID,
				XAIE_EVENT_GROUP_ERRORS_PL);
		if(RC != XAIE_OK) {
			XAIE_ERROR("Failed to setup L1 internal error interrupt in shim tile\n");
			return RC;
		}
	}

	return XAIE_OK;
}
/*****************************************************************************/
/**
* This API enables default group error events which are marked as fatal errors.
* It also channels them on broadcast line #0.
*
* @param	DevInst: Device Instance
*
* @return	XAIE_OK on success, error code on failure.
*
* @note		None.
*
******************************************************************************/
This API enables default group error events which are marked as fatal errors.
It also channels them on broadcast line #0.
This API enables default group error events which are marked as fatal errors . It also channels them on broadcast line #0 .
static AieRC _XAie_GroupErrorInit(XAie_DevInst *DevInst)
{
	AieRC RC;
	u32 GroupErrorEnableMask;
	u8 MemTileStart, MemTileEnd, AieRowStart, AieRowEnd;
	XAie_LocType Loc;
	MemTileStart = DevInst->MemTileRowStart;
	MemTileEnd = DevInst->MemTileRowStart + DevInst->MemTileNumRows;
	AieRowStart = DevInst->AieTileRowStart;
	AieRowEnd = DevInst->AieTileRowStart + DevInst->AieTileNumRows;
	for(u8 Col = 0; Col < DevInst->NumCols; Col++) {
		for(u8 Row = AieRowStart; Row < AieRowEnd; Row++) {
			Loc = XAie_TileLoc(Col, Row);
			if (_XAie_PmIsTileRequested(DevInst, Loc) == XAIE_DISABLE)
				continue;
			GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst,
							Loc, XAIE_MEM_MOD);
			RC = XAie_EventGroupControl(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_EVENT_GROUP_ERRORS_MEM,
					GroupErrorEnableMask);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to configure group errors in memory module\n");
				return RC;
			}
			RC = XAie_EventBroadcast(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_ERROR_BROADCAST_ID,
					XAIE_EVENT_GROUP_ERRORS_MEM);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to setup error broadcast for memory module\n");
				return RC;
			}
			GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst,
							Loc, XAIE_CORE_MOD);
			RC = XAie_EventGroupControl(DevInst, Loc, XAIE_CORE_MOD,
					XAIE_EVENT_GROUP_ERRORS_0_CORE,
					GroupErrorEnableMask);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to configure group error in core module\n");
				return RC;
			}
			RC = XAie_EventBroadcast(DevInst, Loc, XAIE_CORE_MOD,
					XAIE_ERROR_BROADCAST_ID,
					XAIE_EVENT_GROUP_ERRORS_0_CORE);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to setup error broadcast for core module\n");
				return RC;
			}
		}
		for(u8 MemRow = MemTileStart; MemRow < MemTileEnd; MemRow++) {
			Loc = XAie_TileLoc(Col, MemRow);
			if (_XAie_PmIsTileRequested(DevInst, Loc) == XAIE_DISABLE)
				continue;
			GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst,
							Loc, XAIE_MEM_MOD);
			RC = XAie_EventGroupControl(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_EVENT_GROUP_ERRORS_MEM_TILE,
					GroupErrorEnableMask);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to configure group error in mem tile\n");
				return RC;
			}
			RC = XAie_EventBroadcast(DevInst, Loc, XAIE_MEM_MOD,
					XAIE_ERROR_BROADCAST_ID,
					XAIE_EVENT_GROUP_ERRORS_MEM_TILE);
			if(RC != XAIE_OK) {
				XAIE_ERROR("Failed to setup error broadcast for mem tile\n");
				return RC;
			}
		}
		Loc = XAie_TileLoc(Col, DevInst->ShimRow);
		GroupErrorEnableMask = _XAie_GetFatalGroupErrors(DevInst, Loc,
								XAIE_PL_MOD);
		RC = XAie_EventGroupControl(DevInst, Loc, XAIE_PL_MOD,
					XAIE_EVENT_GROUP_ERRORS_PL,
					GroupErrorEnableMask);
		if(RC != XAIE_OK) {
			XAIE_ERROR("Failed to configure group error in shim tile\n");
			return RC;
		}
		RC = XAie_IntrCtrlL1Event(DevInst, Loc, XAIE_EVENT_SWITCH_A,
				XAIE_ERROR_BROADCAST_ID,
				XAIE_EVENT_GROUP_ERRORS_PL);
		if(RC != XAIE_OK) {
			XAIE_ERROR("Failed to setup L1 internal error interrupt in shim tile\n");
			return RC;
		}
	}
	return XAIE_OK;
}
static AieRC _XAie_GroupErrorInit ( XAie_DevInst * DevInst ) { AieRC RC ; u32 GroupErrorEnableMask ; u8 MemTileStart , MemTileEnd , AieRowStart , AieRowEnd ; XAie_LocType Loc ; MemTileStart = DevInst -> MemTileRowStart ; MemTileEnd = DevInst -> MemTileRowStart + DevInst -> MemTileNumRows ; AieRowStart = DevInst -> AieTileRowStart ; AieRowEnd = DevInst -> AieTileRowStart + DevInst -> AieTileNumRows ; for ( u8 Col = 0 ; Col < DevInst -> NumCols ; Col ++ ) { for ( u8 Row = AieRowStart ; Row < AieRowEnd ; Row ++ ) { Loc = XAie_TileLoc ( Col , Row ) ; if ( _XAie_PmIsTileRequested ( DevInst , Loc ) == XAIE_DISABLE ) continue ; GroupErrorEnableMask = _XAie_GetFatalGroupErrors ( DevInst , Loc , XAIE_MEM_MOD ) ; RC = XAie_EventGroupControl ( DevInst , Loc , XAIE_MEM_MOD , XAIE_EVENT_GROUP_ERRORS_MEM , GroupErrorEnableMask ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } RC = XAie_EventBroadcast ( DevInst , Loc , XAIE_MEM_MOD , XAIE_ERROR_BROADCAST_ID , XAIE_EVENT_GROUP_ERRORS_MEM ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } GroupErrorEnableMask = _XAie_GetFatalGroupErrors ( DevInst , Loc , XAIE_CORE_MOD ) ; RC = XAie_EventGroupControl ( DevInst , Loc , XAIE_CORE_MOD , XAIE_EVENT_GROUP_ERRORS_0_CORE , GroupErrorEnableMask ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } RC = XAie_EventBroadcast ( DevInst , Loc , XAIE_CORE_MOD , XAIE_ERROR_BROADCAST_ID , XAIE_EVENT_GROUP_ERRORS_0_CORE ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } } for ( u8 MemRow = MemTileStart ; MemRow < MemTileEnd ; MemRow ++ ) { Loc = XAie_TileLoc ( Col , MemRow ) ; if ( _XAie_PmIsTileRequested ( DevInst , Loc ) == XAIE_DISABLE ) continue ; GroupErrorEnableMask = _XAie_GetFatalGroupErrors ( DevInst , Loc , XAIE_MEM_MOD ) ; RC = XAie_EventGroupControl ( DevInst , Loc , XAIE_MEM_MOD , XAIE_EVENT_GROUP_ERRORS_MEM_TILE , GroupErrorEnableMask ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } RC = XAie_EventBroadcast ( DevInst , Loc , XAIE_MEM_MOD , XAIE_ERROR_BROADCAST_ID , XAIE_EVENT_GROUP_ERRORS_MEM_TILE ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } } Loc = XAie_TileLoc ( Col , DevInst -> ShimRow ) ; GroupErrorEnableMask = _XAie_GetFatalGroupErrors ( DevInst , Loc , XAIE_PL_MOD ) ; RC = XAie_EventGroupControl ( DevInst , Loc , XAIE_PL_MOD , XAIE_EVENT_GROUP_ERRORS_PL , GroupErrorEnableMask ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } RC = XAie_IntrCtrlL1Event ( DevInst , Loc , XAIE_EVENT_SWITCH_A , XAIE_ERROR_BROADCAST_ID , XAIE_EVENT_GROUP_ERRORS_PL ) ; if ( RC != XAIE_OK ) { XAIE_ERROR ( " \n " ) ; return RC ; } } return XAIE_OK ; }
This API enables default group error events which are marked as fatal errors.
This API enables default group error events which are marked as fatal errors .
/*
		 * Shim tile only needs to setup error notification with first
		 * level interrupt controller.
		 */