dp: rx: Added function to check the link status on all lanes.
Signed-off-by: Andrei-Liviu Simion <andrei.simion@xilinx.com>
This commit is contained in:
parent
0e0e170875
commit
a94f816019
2 changed files with 32 additions and 0 deletions
|
@ -189,6 +189,37 @@ u32 XDprx_InitializeRx(XDprx *InstancePtr)
|
|||
return XST_SUCCESS;
|
||||
}
|
||||
|
||||
u32 XDprx_CheckLinkStatus(XDprx *InstancePtr)
|
||||
{
|
||||
u8 LaneCount;
|
||||
u8 LaneStatus[2];
|
||||
|
||||
LaneCount = XDprx_ReadReg(InstancePtr->Config.BaseAddr,
|
||||
XDPRX_DPCD_LANE_COUNT_SET);
|
||||
|
||||
LaneStatus[0] = XDprx_ReadReg(InstancePtr->Config.BaseAddr,
|
||||
XDPRX_DPCD_LANE01_STATUS);
|
||||
LaneStatus[1] = XDprx_ReadReg(InstancePtr->Config.BaseAddr,
|
||||
XDPRX_DPCD_LANE23_STATUS);
|
||||
|
||||
switch (LaneCount) {
|
||||
case 4:
|
||||
if (LaneStatus[1] != 0x77) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
case 2:
|
||||
if ((LaneStatus[0] & 0x70) != 0x70) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
case 1:
|
||||
if ((LaneStatus[0] & 0x07) != 0x07) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return XST_SUCCESS;
|
||||
}
|
||||
|
||||
void XDprx_DtgEn(XDprx *InstancePtr)
|
||||
{
|
||||
XDprx_WriteReg(InstancePtr->Config.BaseAddr, XDPRX_SOFT_RESET, 0x01);
|
||||
|
|
|
@ -91,6 +91,7 @@ void XDprx_CfgInitialize(XDprx *InstancePtr, XDp_Config *ConfigPtr,
|
|||
u32 XDprx_InitializeRx(XDprx *InstancePtr);
|
||||
|
||||
/* xdprx.c: General usage functions. */
|
||||
u32 XDprx_CheckLinkStatus(XDprx *InstancePtr);
|
||||
void XDprx_DtgEn(XDprx *InstancePtr);
|
||||
void XDprx_DtgDis(XDprx *InstancePtr);
|
||||
void XDprx_SetLinkRate(XDprx *InstancePtr, u8 LinkRate);
|
||||
|
|
Loading…
Add table
Reference in a new issue