XilinxProcessorIPLib/drivers/dp14rxss/src/xdprxss_mcdp6000.c
int XDpRxSs_MCDP6000_Read_ErrorCounters(XDpRxSs *DpRxSsPtr, u8 I2CSlaveAddress)
{
	int Result;
	unsigned int ReadVal;

	/* Verify argument.*/
	Xil_AssertNonvoid(DpRxSsPtr != NULL);

	/* Set lane count to 0 in [2:1] */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, (ReadVal & 0xFFFFFFF9));
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Read error counter */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane0): %0x%x \n\r",ReadVal);

	/* Set lane count to 1 in [2:1] */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, (ReadVal | 0x2));
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Read error counter */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane1): %0x%x \n\r",ReadVal);

	/* Set lane count to 2 in [2:1] */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, ReadVal | 0x4);
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Read error counter */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane2): %0x%x \n\r",ReadVal);

	/* Set lane count to 3 in [2:1] */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				        0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, ReadVal | 0x6);
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Read error counter */
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane3): %0x%x \n\r",ReadVal);

	return Result;
}
/*****************************************************************************/
/**
*
* This function reads error counters for all lanes
*
* @param DpRxSsPtr is a pointer to the XDpRxSs core instance.
* @param I2CSlaveAddress is the 7-bit I2C slave address.
*
* @return
*    - XST_SUCCESS Enable request was successful.
*    - XST_FAILURE I2C error.
*
* @note None.
*
******************************************************************************/
This function reads error counters for all lanes
This function reads error counters for all lanes
int XDpRxSs_MCDP6000_Read_ErrorCounters(XDpRxSs *DpRxSsPtr, u8 I2CSlaveAddress)
{
	int Result;
	unsigned int ReadVal;
	Xil_AssertNonvoid(DpRxSsPtr != NULL);
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, (ReadVal & 0xFFFFFFF9));
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane0): %0x%x \n\r",ReadVal);
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, (ReadVal | 0x2));
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane1): %0x%x \n\r",ReadVal);
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, ReadVal | 0x4);
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane2): %0x%x \n\r",ReadVal);
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				        0x061C);
	Result = XDpRxSs_MCDP6000_SetRegister(DpRxSsPtr, I2CSlaveAddress,
				      0x061C, ReadVal | 0x6);
	if (Result != XST_SUCCESS) {
		return XST_FAILURE;
	}
	ReadVal = XDpRxSs_MCDP6000_GetRegister(DpRxSsPtr, I2CSlaveAddress,
				       0x0620);
	xil_printf("MCDP Error Counter (Lane3): %0x%x \n\r",ReadVal);
	return Result;
}
int XDpRxSs_MCDP6000_Read_ErrorCounters ( XDpRxSs * DpRxSsPtr , u8 I2CSlaveAddress ) { int Result ; unsigned int ReadVal ; Xil_AssertNonvoid ( DpRxSsPtr != NULL ) ; ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C ) ; Result = XDpRxSs_MCDP6000_SetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C , ( ReadVal & 0xFFFFFFF9 ) ) ; if ( Result != XST_SUCCESS ) { return XST_FAILURE ; } ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x0620 ) ; xil_printf ( " \n \r " , ReadVal ) ; ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C ) ; Result = XDpRxSs_MCDP6000_SetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C , ( ReadVal | 0x2 ) ) ; if ( Result != XST_SUCCESS ) { return XST_FAILURE ; } ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x0620 ) ; xil_printf ( " \n \r " , ReadVal ) ; ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C ) ; Result = XDpRxSs_MCDP6000_SetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C , ReadVal | 0x4 ) ; if ( Result != XST_SUCCESS ) { return XST_FAILURE ; } ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x0620 ) ; xil_printf ( " \n \r " , ReadVal ) ; ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C ) ; Result = XDpRxSs_MCDP6000_SetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x061C , ReadVal | 0x6 ) ; if ( Result != XST_SUCCESS ) { return XST_FAILURE ; } ReadVal = XDpRxSs_MCDP6000_GetRegister ( DpRxSsPtr , I2CSlaveAddress , 0x0620 ) ; xil_printf ( " \n \r " , ReadVal ) ; return Result ; }
This function reads error counters for all lanes
This function reads error counters for all lanes
/* Verify argument.*/ /* Set lane count to 0 in [2:1] */ /* Read error counter */ /* Set lane count to 1 in [2:1] */ /* Read error counter */ /* Set lane count to 2 in [2:1] */ /* Read error counter */ /* Set lane count to 3 in [2:1] */ /* Read error counter */