XilinxProcessorIPLib/drivers/dp14txss/examples/src/zcu_pt_dp14_hdcp/rx.c
void DpRxSs_CRCTestEventHandler(void *InstancePtr)
{
	u16 ReadVal;
	u32 TrainingAlgoValue;

	ReadVal = XDp_ReadReg(DpRxSsInst.DpPtr->Config.BaseAddr,
			      XDP_RX_CRC_CONFIG);

	/*Record Training Algo Value - to be restored in non-phy test mode*/
	TrainingAlgoValue = XDp_ReadReg(DpRxSsInst.Config.BaseAddress,
			XDP_RX_MIN_VOLTAGE_SWING);

	/*Refer to DPCD 0x270 Register*/
	if( (ReadVal&0x8000) == 0x8000){
			/*Enable PHY test mode - Set Min voltage swing to 0*/
		XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
				XDP_RX_MIN_VOLTAGE_SWING,
				(TrainingAlgoValue&0xFFFFFFFC)|0x80000000);

			/*Disable Training timeout*/
			ReadVal = XDp_ReadReg(DpRxSsInst.Config.BaseAddress,
					XDP_RX_CDR_CONTROL_CONFIG);
					XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
					XDP_RX_CDR_CONTROL_CONFIG, ReadVal|0x40000000);

	}else{
		/* Disable PHY test mode & Set min
		 * voltage swing back to level 1 */
		XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
						XDP_RX_MIN_VOLTAGE_SWING,
						(TrainingAlgoValue&0x7FFFFFFF)|0x1);

			/*Enable Training timeout*/
			ReadVal = XDp_ReadReg(DpRxSsInst.Config.BaseAddress,
					XDP_RX_CDR_CONTROL_CONFIG);
			XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
					XDP_RX_CDR_CONTROL_CONFIG, ReadVal&0xBFFFFFFF);
	}
}
/*****************************************************************************/
/**
*
* This function is the callback function for Test CRC Event request.
*
* @param    InstancePtr is a pointer to the XDpRxSs instance.
*
* @return    None.
*
* @note        None.
*
******************************************************************************/
This function is the callback function for Test CRC Event request.
This function is the callback function for Test CRC Event request .
void DpRxSs_CRCTestEventHandler(void *InstancePtr)
{
	u16 ReadVal;
	u32 TrainingAlgoValue;
	ReadVal = XDp_ReadReg(DpRxSsInst.DpPtr->Config.BaseAddr,
			      XDP_RX_CRC_CONFIG);
	TrainingAlgoValue = XDp_ReadReg(DpRxSsInst.Config.BaseAddress,
			XDP_RX_MIN_VOLTAGE_SWING);
	if( (ReadVal&0x8000) == 0x8000){
		XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
				XDP_RX_MIN_VOLTAGE_SWING,
				(TrainingAlgoValue&0xFFFFFFFC)|0x80000000);
			ReadVal = XDp_ReadReg(DpRxSsInst.Config.BaseAddress,
					XDP_RX_CDR_CONTROL_CONFIG);
					XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
					XDP_RX_CDR_CONTROL_CONFIG, ReadVal|0x40000000);
	}else{
		XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
						XDP_RX_MIN_VOLTAGE_SWING,
						(TrainingAlgoValue&0x7FFFFFFF)|0x1);
			ReadVal = XDp_ReadReg(DpRxSsInst.Config.BaseAddress,
					XDP_RX_CDR_CONTROL_CONFIG);
			XDp_WriteReg(DpRxSsInst.DpPtr->Config.BaseAddr,
					XDP_RX_CDR_CONTROL_CONFIG, ReadVal&0xBFFFFFFF);
	}
}
void DpRxSs_CRCTestEventHandler ( void * InstancePtr ) { u16 ReadVal ; u32 TrainingAlgoValue ; ReadVal = XDp_ReadReg ( DpRxSsInst . DpPtr -> Config . BaseAddr , XDP_RX_CRC_CONFIG ) ; TrainingAlgoValue = XDp_ReadReg ( DpRxSsInst . Config . BaseAddress , XDP_RX_MIN_VOLTAGE_SWING ) ; if ( ( ReadVal & 0x8000 ) == 0x8000 ) { XDp_WriteReg ( DpRxSsInst . DpPtr -> Config . BaseAddr , XDP_RX_MIN_VOLTAGE_SWING , ( TrainingAlgoValue & 0xFFFFFFFC ) | 0x80000000 ) ; ReadVal = XDp_ReadReg ( DpRxSsInst . Config . BaseAddress , XDP_RX_CDR_CONTROL_CONFIG ) ; XDp_WriteReg ( DpRxSsInst . DpPtr -> Config . BaseAddr , XDP_RX_CDR_CONTROL_CONFIG , ReadVal | 0x40000000 ) ; } else { XDp_WriteReg ( DpRxSsInst . DpPtr -> Config . BaseAddr , XDP_RX_MIN_VOLTAGE_SWING , ( TrainingAlgoValue & 0x7FFFFFFF ) | 0x1 ) ; ReadVal = XDp_ReadReg ( DpRxSsInst . Config . BaseAddress , XDP_RX_CDR_CONTROL_CONFIG ) ; XDp_WriteReg ( DpRxSsInst . DpPtr -> Config . BaseAddr , XDP_RX_CDR_CONTROL_CONFIG , ReadVal & 0xBFFFFFFF ) ; } }
This function is the callback function for Test CRC Event request.
This function is the callback function for Test CRC Event request .
/*Record Training Algo Value - to be restored in non-phy test mode*/ /*Refer to DPCD 0x270 Register*/ /*Enable PHY test mode - Set Min voltage swing to 0*/ /*Disable Training timeout*/ /* Disable PHY test mode & Set min
		 * voltage swing back to level 1 */ /*Enable Training timeout*/