XilinxProcessorIPLib/drivers/dp14txss/examples/src/zcu_pt_dp14_hdcp/rx.c
void DpRxSs_AccessLinkQualHandler(void *InstancePtr)
{
	u32 ReadVal;
	u32 DrpVal;


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

	//xil_printf("DpRxSs_AccessLinkQualHandler : 0x%x\r\n", ReadVal);

	/*Check for PRBS Mode*/
	if( (ReadVal&0x00000007) == XDP_RX_DPCD_LINK_QUAL_PRBS){
		/*Enable PRBS Mode in Video PHY*/
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal | 0x10101010;
		XVphy_WriteReg(VPhyInst.Config.BaseAddr,
			       XVPHY_RX_CONTROL_REG, DrpVal);

		/*Reset PRBS7 Counters*/
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal | 0x08080808;
		XDp_WriteReg(VPhyInst.Config.BaseAddr,
			     XVPHY_RX_CONTROL_REG, DrpVal);
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal & 0xF7F7F7F7;
		XVphy_WriteReg(VPhyInst.Config.BaseAddr,
			       XVPHY_RX_CONTROL_REG, DrpVal);

		/*Set PRBS mode in Retimer*/
		XDpRxSs_MCDP6000_EnablePrbs7_Rx(&DpRxSsInst,
					I2C_MCDP6000_ADDR);
		XDpRxSs_MCDP6000_ClearCounter(&DpRxSsInst,
				      I2C_MCDP6000_ADDR);
	//    	MCDP6000_EnableCounter(XPAR_IIC_0_BASEADDR, I2C_MCDP6000_ADDR);
	} else {
		/*Disable PRBS Mode in Video PHY*/
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal & 0xEFEFEFEF;
		XVphy_WriteReg(VPhyInst.Config.BaseAddr,
			       XVPHY_RX_CONTROL_REG, DrpVal);

		/*Disable PRBS mode in Retimer*/
		XDpRxSs_MCDP6000_DisablePrbs7_Rx(&DpRxSsInst,
											I2C_MCDP6000_ADDR);
		XDpRxSs_MCDP6000_ClearCounter(&DpRxSsInst,
				      I2C_MCDP6000_ADDR);
	//    	MCDP6000_EnableCounter(XPAR_IIC_0_BASEADDR, I2C_MCDP6000_ADDR);
	}
}
/*****************************************************************************/
/**
*
* This function is the callback function for Access link qual request.
*
* @param    InstancePtr is a pointer to the XDpRxSs instance.
*
* @return    None.
*
* @note        None.
*
******************************************************************************/
This function is the callback function for Access link qual request.
This function is the callback function for Access link qual request .
void DpRxSs_AccessLinkQualHandler(void *InstancePtr)
{
	u32 ReadVal;
	u32 DrpVal;
	ReadVal = XDp_ReadReg(DpRxSsInst.DpPtr->Config.BaseAddr,
			XDP_RX_DPC_LINK_QUAL_CONFIG);
	if( (ReadVal&0x00000007) == XDP_RX_DPCD_LINK_QUAL_PRBS){
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal | 0x10101010;
		XVphy_WriteReg(VPhyInst.Config.BaseAddr,
			       XVPHY_RX_CONTROL_REG, DrpVal);
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal | 0x08080808;
		XDp_WriteReg(VPhyInst.Config.BaseAddr,
			     XVPHY_RX_CONTROL_REG, DrpVal);
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal & 0xF7F7F7F7;
		XVphy_WriteReg(VPhyInst.Config.BaseAddr,
			       XVPHY_RX_CONTROL_REG, DrpVal);
		XDpRxSs_MCDP6000_EnablePrbs7_Rx(&DpRxSsInst,
					I2C_MCDP6000_ADDR);
		XDpRxSs_MCDP6000_ClearCounter(&DpRxSsInst,
				      I2C_MCDP6000_ADDR);
	} else {
		DrpVal = XVphy_ReadReg(VPhyInst.Config.BaseAddr,
				       XVPHY_RX_CONTROL_REG);
		DrpVal = DrpVal & 0xEFEFEFEF;
		XVphy_WriteReg(VPhyInst.Config.BaseAddr,
			       XVPHY_RX_CONTROL_REG, DrpVal);
		XDpRxSs_MCDP6000_DisablePrbs7_Rx(&DpRxSsInst,
											I2C_MCDP6000_ADDR);
		XDpRxSs_MCDP6000_ClearCounter(&DpRxSsInst,
				      I2C_MCDP6000_ADDR);
	}
}
void DpRxSs_AccessLinkQualHandler ( void * InstancePtr ) { u32 ReadVal ; u32 DrpVal ; ReadVal = XDp_ReadReg ( DpRxSsInst . DpPtr -> Config . BaseAddr , XDP_RX_DPC_LINK_QUAL_CONFIG ) ; if ( ( ReadVal & 0x00000007 ) == XDP_RX_DPCD_LINK_QUAL_PRBS ) { DrpVal = XVphy_ReadReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG ) ; DrpVal = DrpVal | 0x10101010 ; XVphy_WriteReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG , DrpVal ) ; DrpVal = XVphy_ReadReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG ) ; DrpVal = DrpVal | 0x08080808 ; XDp_WriteReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG , DrpVal ) ; DrpVal = XVphy_ReadReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG ) ; DrpVal = DrpVal & 0xF7F7F7F7 ; XVphy_WriteReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG , DrpVal ) ; XDpRxSs_MCDP6000_EnablePrbs7_Rx ( & DpRxSsInst , I2C_MCDP6000_ADDR ) ; XDpRxSs_MCDP6000_ClearCounter ( & DpRxSsInst , I2C_MCDP6000_ADDR ) ; } else { DrpVal = XVphy_ReadReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG ) ; DrpVal = DrpVal & 0xEFEFEFEF ; XVphy_WriteReg ( VPhyInst . Config . BaseAddr , XVPHY_RX_CONTROL_REG , DrpVal ) ; XDpRxSs_MCDP6000_DisablePrbs7_Rx ( & DpRxSsInst , I2C_MCDP6000_ADDR ) ; XDpRxSs_MCDP6000_ClearCounter ( & DpRxSsInst , I2C_MCDP6000_ADDR ) ; } }
This function is the callback function for Access link qual request.
This function is the callback function for Access link qual request .
//xil_printf("DpRxSs_AccessLinkQualHandler : 0x%x\r\n", ReadVal); /*Check for PRBS Mode*/ /*Enable PRBS Mode in Video PHY*/ /*Reset PRBS7 Counters*/ /*Set PRBS mode in Retimer*/ //    	MCDP6000_EnableCounter(XPAR_IIC_0_BASEADDR, I2C_MCDP6000_ADDR); /*Disable PRBS Mode in Video PHY*/ /*Disable PRBS mode in Retimer*/ //    	MCDP6000_EnableCounter(XPAR_IIC_0_BASEADDR, I2C_MCDP6000_ADDR);