XilinxProcessorIPLib/drivers/aienginev2/src/npi/xaie_npi_aieml.c
static AieRC _XAieMl_NpiSetProtectedRegField(XAie_DevInst *DevInst,
		XAie_NpiProtRegReq *Req, u32 *RegVal)
{
	u32 CFirst, CLast, NumCols;

	if ((Req->StartCol + Req->NumCols) > DevInst->NumCols ||
	    (Req->StartCol != 0  && Req->NumCols == 0)) {
		XAIE_ERROR("Invalid columns (%u, %u) for protected regs.\n",
				Req->StartCol, Req->NumCols);
		return XAIE_INVALID_ARGS;
	}

	*RegVal = XAie_SetField(Req->Enable, _XAieMlNpiMod.ProtRegEnable.Lsb,
			       _XAieMlNpiMod.ProtRegEnable.Mask);

	NumCols = Req->NumCols;
	if (NumCols == 0) {
		/* It is for the whole partition instance */
		NumCols = DevInst->NumCols;
		CFirst = 0;
	} else {
		CFirst = Req->StartCol;
	}

	CLast = CFirst + NumCols - 1;

	*RegVal |= XAie_SetField(CFirst, _XAieMlNpiMod.ProtRegFirstCol.Lsb,
				_XAieMlNpiMod.ProtRegFirstCol.Mask);
	*RegVal |= XAie_SetField(CLast, _XAieMlNpiMod.ProtRegLastCol.Lsb,
				_XAieMlNpiMod.ProtRegLastCol.Mask);

	return XAIE_OK;
}
/************************** Function Definitions *****************************/
/*****************************************************************************/
/**
*
* This is function to setup the protected register configuration value.
*
* @param	DevInst : AI engine partition device pointer
* @param	Req: Protect Register Request
* @param	RegVal: pointer to return calculated register value
*
* @return	XAIE_OK for success, and negative value for failure
*
* @note		None
*
*******************************************************************************/
Function Definitions
This is function to setup the protected register configuration value.
Function Definitions This is function to setup the protected register configuration value .
static AieRC _XAieMl_NpiSetProtectedRegField(XAie_DevInst *DevInst,
		XAie_NpiProtRegReq *Req, u32 *RegVal)
{
	u32 CFirst, CLast, NumCols;
	if ((Req->StartCol + Req->NumCols) > DevInst->NumCols ||
	    (Req->StartCol != 0  && Req->NumCols == 0)) {
		XAIE_ERROR("Invalid columns (%u, %u) for protected regs.\n",
				Req->StartCol, Req->NumCols);
		return XAIE_INVALID_ARGS;
	}
	*RegVal = XAie_SetField(Req->Enable, _XAieMlNpiMod.ProtRegEnable.Lsb,
			       _XAieMlNpiMod.ProtRegEnable.Mask);
	NumCols = Req->NumCols;
	if (NumCols == 0) {
		NumCols = DevInst->NumCols;
		CFirst = 0;
	} else {
		CFirst = Req->StartCol;
	}
	CLast = CFirst + NumCols - 1;
	*RegVal |= XAie_SetField(CFirst, _XAieMlNpiMod.ProtRegFirstCol.Lsb,
				_XAieMlNpiMod.ProtRegFirstCol.Mask);
	*RegVal |= XAie_SetField(CLast, _XAieMlNpiMod.ProtRegLastCol.Lsb,
				_XAieMlNpiMod.ProtRegLastCol.Mask);
	return XAIE_OK;
}
static AieRC _XAieMl_NpiSetProtectedRegField ( XAie_DevInst * DevInst , XAie_NpiProtRegReq * Req , u32 * RegVal ) { u32 CFirst , CLast , NumCols ; if ( ( Req -> StartCol + Req -> NumCols ) > DevInst -> NumCols || ( Req -> StartCol != 0 && Req -> NumCols == 0 ) ) { XAIE_ERROR ( " \n " , Req -> StartCol , Req -> NumCols ) ; return XAIE_INVALID_ARGS ; } * RegVal = XAie_SetField ( Req -> Enable , _XAieMlNpiMod . ProtRegEnable . Lsb , _XAieMlNpiMod . ProtRegEnable . Mask ) ; NumCols = Req -> NumCols ; if ( NumCols == 0 ) { NumCols = DevInst -> NumCols ; CFirst = 0 ; } else { CFirst = Req -> StartCol ; } CLast = CFirst + NumCols - 1 ; * RegVal |= XAie_SetField ( CFirst , _XAieMlNpiMod . ProtRegFirstCol . Lsb , _XAieMlNpiMod . ProtRegFirstCol . Mask ) ; * RegVal |= XAie_SetField ( CLast , _XAieMlNpiMod . ProtRegLastCol . Lsb , _XAieMlNpiMod . ProtRegLastCol . Mask ) ; return XAIE_OK ; }
Function Definitions
This is function to setup the protected register configuration value.
Function Definitions This is function to setup the protected register configuration value .
/* It is for the whole partition instance */