XilinxProcessorIPLib/drivers/vphy/src/xvphy.c
u32 XVphy_WaitForPmaResetDone(XVphy *InstancePtr, u8 QuadId,
		XVphy_ChannelId ChId, XVphy_DirectionType Dir)
{
	u32 RegVal;
	u32 MaskVal;
	u32 RegOffset;
	u8 Retry = 0;

	/* Suppress Warning Messages */
	QuadId = QuadId;

	if (Dir == XVPHY_DIR_TX) {
		RegOffset = XVPHY_TX_INIT_STATUS_REG;
	}
	else {
		RegOffset = XVPHY_RX_INIT_STATUS_REG;
	}
	if (ChId == XVPHY_CHANNEL_ID_CHA) {
		MaskVal = XVPHY_TXRX_INIT_STATUS_PMARESETDONE_ALL_MASK;
	}
	else {
		MaskVal = XVPHY_TXRX_INIT_STATUS_PMARESETDONE_MASK(ChId);
	}
	do {
		RegVal = XVphy_ReadReg(InstancePtr->Config.BaseAddr, RegOffset);
		if (!(RegVal & MaskVal)){
			XVphy_WaitUs(InstancePtr, 1000);
			Retry++;
		}
	} while ((!(RegVal & MaskVal)) && (Retry < 15));

	if (Retry == 15){
		return XST_FAILURE;
	}
	else {
		return XST_SUCCESS;
	}
}
/*****************************************************************************/
/**
* This function will wait for a PMA reset done on the specified channel(s) or
* time out.
*
* @param	InstancePtr is a pointer to the XVphy core instance.
* @param	QuadId is the GT quad ID to operate on.
* @param	ChId is the channel ID which to operate on.
* @param	Dir is an indicator for TX or RX.
*
* @return
*		- XST_SUCCESS if the PMA reset has finalized.
*		- XST_FAILURE otherwise; waiting for the reset done timed out.
*
* @note		None.
*
******************************************************************************/
This function will wait for a PMA reset done on the specified channel(s) or
time out.
This function will wait for a PMA reset done on the specified channel ( s ) or time out .
u32 XVphy_WaitForPmaResetDone(XVphy *InstancePtr, u8 QuadId,
		XVphy_ChannelId ChId, XVphy_DirectionType Dir)
{
	u32 RegVal;
	u32 MaskVal;
	u32 RegOffset;
	u8 Retry = 0;
	QuadId = QuadId;
	if (Dir == XVPHY_DIR_TX) {
		RegOffset = XVPHY_TX_INIT_STATUS_REG;
	}
	else {
		RegOffset = XVPHY_RX_INIT_STATUS_REG;
	}
	if (ChId == XVPHY_CHANNEL_ID_CHA) {
		MaskVal = XVPHY_TXRX_INIT_STATUS_PMARESETDONE_ALL_MASK;
	}
	else {
		MaskVal = XVPHY_TXRX_INIT_STATUS_PMARESETDONE_MASK(ChId);
	}
	do {
		RegVal = XVphy_ReadReg(InstancePtr->Config.BaseAddr, RegOffset);
		if (!(RegVal & MaskVal)){
			XVphy_WaitUs(InstancePtr, 1000);
			Retry++;
		}
	} while ((!(RegVal & MaskVal)) && (Retry < 15));
	if (Retry == 15){
		return XST_FAILURE;
	}
	else {
		return XST_SUCCESS;
	}
}
u32 XVphy_WaitForPmaResetDone ( XVphy * InstancePtr , u8 QuadId , XVphy_ChannelId ChId , XVphy_DirectionType Dir ) { u32 RegVal ; u32 MaskVal ; u32 RegOffset ; u8 Retry = 0 ; QuadId = QuadId ; if ( Dir == XVPHY_DIR_TX ) { RegOffset = XVPHY_TX_INIT_STATUS_REG ; } else { RegOffset = XVPHY_RX_INIT_STATUS_REG ; } if ( ChId == XVPHY_CHANNEL_ID_CHA ) { MaskVal = XVPHY_TXRX_INIT_STATUS_PMARESETDONE_ALL_MASK ; } else { MaskVal = XVPHY_TXRX_INIT_STATUS_PMARESETDONE_MASK ( ChId ) ; } do { RegVal = XVphy_ReadReg ( InstancePtr -> Config . BaseAddr , RegOffset ) ; if ( ! ( RegVal & MaskVal ) ) { XVphy_WaitUs ( InstancePtr , 1000 ) ; Retry ++ ; } } while ( ( ! ( RegVal & MaskVal ) ) && ( Retry < 15 ) ) ; if ( Retry == 15 ) { return XST_FAILURE ; } else { return XST_SUCCESS ; } }
This function will wait for a PMA reset done on the specified channel(s) or
time out.
This function will wait for a PMA reset done on the specified channel ( s ) or time out .
/* Suppress Warning Messages */