XilinxProcessorIPLib/drivers/aienginev2/src/interrupt/xaie_interrupt.c
static AieRC _XAie_IntrCtrlL1Config(XAie_DevInst *DevInst, XAie_LocType Loc,
		XAie_BroadcastSw Switch, u8 IntrId, u8 Enable)
{
	u64 RegAddr;
	u32 RegOffset;
	u8 TileType;
	const XAie_L1IntrMod *L1IntrMod;

	if((DevInst == XAIE_NULL) ||
			(DevInst->IsReady != XAIE_COMPONENT_IS_READY)) {
		XAIE_ERROR("Invalid device instance\n");
		return XAIE_INVALID_ARGS;
	}

	TileType = DevInst->DevOps->GetTTypefromLoc(DevInst, Loc);
	if(TileType == XAIEGBL_TILE_TYPE_MAX) {
		XAIE_ERROR("Invalid tile type\n");
		return XAIE_INVALID_TILE;
	}

	L1IntrMod = DevInst->DevProp.DevMod[TileType].L1IntrMod;

	if(L1IntrMod == NULL || IntrId >= L1IntrMod->NumIntrIds) {
		XAIE_ERROR("Invalid module type or interrupt ID\n");
		return XAIE_INVALID_ARGS;
	}

	if(Enable == XAIE_ENABLE)
		RegOffset = L1IntrMod->BaseEnableRegOff;
	else
		RegOffset = L1IntrMod->BaseDisableRegOff;

	RegAddr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) + RegOffset +
					Switch * L1IntrMod->SwOff;

	return XAie_Write32(DevInst, RegAddr, XAIE_ENABLE << IntrId);
}
/************************** Constant Definitions *****************************/
/************************** Function Definitions *****************************/
/*****************************************************************************/
/**
*
* This API enables/disables interrupts to first level interrupt controller.
*
* @param	DevInst: Device Instance
* @param	Loc: Location of AIE Tile
* @param	Switch: Switch in the given module. For shim tile value could be
*			XAIE_EVENT_SWITCH_A or XAIE_EVENT_SWITCH_B.
* @param	IntrId: Interrupt index to configure.
* @param	Enable: XAIE_ENABLE or XAIE_DISABLE to enable or disable.
*
* @return	XAIE_OK on success, error code on failure.
*
* @note		Internal Only.
*
******************************************************************************/
Constant Definitions
Function Definitions



This API enables/disables interrupts to first level interrupt controller.
Constant Definitions Function Definitions This API enables / disables interrupts to first level interrupt controller .
static AieRC _XAie_IntrCtrlL1Config(XAie_DevInst *DevInst, XAie_LocType Loc,
		XAie_BroadcastSw Switch, u8 IntrId, u8 Enable)
{
	u64 RegAddr;
	u32 RegOffset;
	u8 TileType;
	const XAie_L1IntrMod *L1IntrMod;
	if((DevInst == XAIE_NULL) ||
			(DevInst->IsReady != XAIE_COMPONENT_IS_READY)) {
		XAIE_ERROR("Invalid device instance\n");
		return XAIE_INVALID_ARGS;
	}
	TileType = DevInst->DevOps->GetTTypefromLoc(DevInst, Loc);
	if(TileType == XAIEGBL_TILE_TYPE_MAX) {
		XAIE_ERROR("Invalid tile type\n");
		return XAIE_INVALID_TILE;
	}
	L1IntrMod = DevInst->DevProp.DevMod[TileType].L1IntrMod;
	if(L1IntrMod == NULL || IntrId >= L1IntrMod->NumIntrIds) {
		XAIE_ERROR("Invalid module type or interrupt ID\n");
		return XAIE_INVALID_ARGS;
	}
	if(Enable == XAIE_ENABLE)
		RegOffset = L1IntrMod->BaseEnableRegOff;
	else
		RegOffset = L1IntrMod->BaseDisableRegOff;
	RegAddr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) + RegOffset +
					Switch * L1IntrMod->SwOff;
	return XAie_Write32(DevInst, RegAddr, XAIE_ENABLE << IntrId);
}
static AieRC _XAie_IntrCtrlL1Config ( XAie_DevInst * DevInst , XAie_LocType Loc , XAie_BroadcastSw Switch , u8 IntrId , u8 Enable ) { u64 RegAddr ; u32 RegOffset ; u8 TileType ; const XAie_L1IntrMod * L1IntrMod ; if ( ( DevInst == XAIE_NULL ) || ( DevInst -> IsReady != XAIE_COMPONENT_IS_READY ) ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_ARGS ; } TileType = DevInst -> DevOps -> GetTTypefromLoc ( DevInst , Loc ) ; if ( TileType == XAIEGBL_TILE_TYPE_MAX ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_TILE ; } L1IntrMod = DevInst -> DevProp . DevMod [ TileType ] . L1IntrMod ; if ( L1IntrMod == NULL || IntrId >= L1IntrMod -> NumIntrIds ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_ARGS ; } if ( Enable == XAIE_ENABLE ) RegOffset = L1IntrMod -> BaseEnableRegOff ; else RegOffset = L1IntrMod -> BaseDisableRegOff ; RegAddr = _XAie_GetTileAddr ( DevInst , Loc . Row , Loc . Col ) + RegOffset + Switch * L1IntrMod -> SwOff ; return XAie_Write32 ( DevInst , RegAddr , XAIE_ENABLE << IntrId ) ; }
Constant Definitions
Function Definitions
Constant Definitions Function Definitions