XilinxProcessorIPLib/drivers/aienginev2/src/interrupt/xaie_interrupt.c
AieRC XAie_IntrCtrlL2IrqSet(XAie_DevInst *DevInst, XAie_LocType Loc,
		u8 NoCIrqId)
{
	AieRC RC;
	u64 RegAddr;
	u32 RegOffset;
	u8 TileType;
	const XAie_L2IntrMod *L2IntrMod;
	XAie_NpiProtRegReq ProtRegReq = {0};

	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_SHIMNOC) {
		XAIE_ERROR("Invalid tile type\n");
		return XAIE_INVALID_TILE;
	}

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

	if(L2IntrMod == NULL || NoCIrqId >= L2IntrMod->NumNoCIntr) {
		XAIE_ERROR("Invalid module type or broadcast ID\n");
		return XAIE_INVALID_ARGS;
	}

	RegOffset = L2IntrMod->IrqRegOff;
	RegAddr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) + RegOffset;

	ProtRegReq.Enable = XAIE_ENABLE;
	XAie_RunOp(DevInst, XAIE_BACKEND_OP_SET_PROTREG, (void *)&ProtRegReq);

	RC = XAie_Write32(DevInst, RegAddr, NoCIrqId);
	if(RC != XAIE_OK) {
		return RC;
	}

	ProtRegReq.Enable = XAIE_DISABLE;
	XAie_RunOp(DevInst, XAIE_BACKEND_OP_SET_PROTREG, (void *)&ProtRegReq);

	return XAIE_OK;
}
/*****************************************************************************/
/**
*
* This API sets NoC interrupt ID to which the interrupt from second level
* interrupt controller shall be driven to.
*
* @param	DevInst: Device Instance
* @param	Loc: Location of AIE Tile
* @param	NoCIrqId: NoC IRQ index on which the interrupt shall be
*			  driven.
*
* @return	XAIE_OK on success, error code on failure.
*
* @note		None.
*
******************************************************************************/
This API sets NoC interrupt ID to which the interrupt from second level
interrupt controller shall be driven to.
This API sets NoC interrupt ID to which the interrupt from second level interrupt controller shall be driven to .
AieRC XAie_IntrCtrlL2IrqSet(XAie_DevInst *DevInst, XAie_LocType Loc,
		u8 NoCIrqId)
{
	AieRC RC;
	u64 RegAddr;
	u32 RegOffset;
	u8 TileType;
	const XAie_L2IntrMod *L2IntrMod;
	XAie_NpiProtRegReq ProtRegReq = {0};
	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_SHIMNOC) {
		XAIE_ERROR("Invalid tile type\n");
		return XAIE_INVALID_TILE;
	}
	L2IntrMod = DevInst->DevProp.DevMod[TileType].L2IntrMod;
	if(L2IntrMod == NULL || NoCIrqId >= L2IntrMod->NumNoCIntr) {
		XAIE_ERROR("Invalid module type or broadcast ID\n");
		return XAIE_INVALID_ARGS;
	}
	RegOffset = L2IntrMod->IrqRegOff;
	RegAddr = _XAie_GetTileAddr(DevInst, Loc.Row, Loc.Col) + RegOffset;
	ProtRegReq.Enable = XAIE_ENABLE;
	XAie_RunOp(DevInst, XAIE_BACKEND_OP_SET_PROTREG, (void *)&ProtRegReq);
	RC = XAie_Write32(DevInst, RegAddr, NoCIrqId);
	if(RC != XAIE_OK) {
		return RC;
	}
	ProtRegReq.Enable = XAIE_DISABLE;
	XAie_RunOp(DevInst, XAIE_BACKEND_OP_SET_PROTREG, (void *)&ProtRegReq);
	return XAIE_OK;
}
AieRC XAie_IntrCtrlL2IrqSet ( XAie_DevInst * DevInst , XAie_LocType Loc , u8 NoCIrqId ) { AieRC RC ; u64 RegAddr ; u32 RegOffset ; u8 TileType ; const XAie_L2IntrMod * L2IntrMod ; XAie_NpiProtRegReq ProtRegReq = { 0 } ; 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_SHIMNOC ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_TILE ; } L2IntrMod = DevInst -> DevProp . DevMod [ TileType ] . L2IntrMod ; if ( L2IntrMod == NULL || NoCIrqId >= L2IntrMod -> NumNoCIntr ) { XAIE_ERROR ( " \n " ) ; return XAIE_INVALID_ARGS ; } RegOffset = L2IntrMod -> IrqRegOff ; RegAddr = _XAie_GetTileAddr ( DevInst , Loc . Row , Loc . Col ) + RegOffset ; ProtRegReq . Enable = XAIE_ENABLE ; XAie_RunOp ( DevInst , XAIE_BACKEND_OP_SET_PROTREG , ( void * ) & ProtRegReq ) ; RC = XAie_Write32 ( DevInst , RegAddr , NoCIrqId ) ; if ( RC != XAIE_OK ) { return RC ; } ProtRegReq . Enable = XAIE_DISABLE ; XAie_RunOp ( DevInst , XAIE_BACKEND_OP_SET_PROTREG , ( void * ) & ProtRegReq ) ; return XAIE_OK ; }
This API sets NoC interrupt ID to which the interrupt from second level
interrupt controller shall be driven to.
This API sets NoC interrupt ID to which the interrupt from second level interrupt controller shall be driven to .