Software Drivers

xdptx.c File Reference


Detailed Description

Contains a minimal wset of functions for the XDptx driver that allow access to all the DisplayPort transmitter's functionality. See xdptx.h for a detailed description of the driver.

 MODIFICATION HISTORY:

 Ver   Who  Date     Changes
 ----- ---- -------- -----------------------------------------------
 1.00a als  05/17/14 Initial release.
 

#include "xdptx.h"
#include "xstatus.h"
#include "xenv.h"

Data Structures

struct  XDptx_AuxTransaction

Enumerations

enum  XDptx_TrainingState

Functions

u32 XDptx_InitializeTx (XDptx *InstancePtr)
void XDptx_CfgInitialize (XDptx *InstancePtr, XDptx_Config *ConfigPtr, u32 EffectiveAddr)
u32 XDptx_GetSinkCapabilities (XDptx *InstancePtr)
u32 XDptx_GetEdid (XDptx *InstancePtr)
u32 XDptx_CfgMainLinkMax (XDptx *InstancePtr)
u32 XDptx_EstablishLink (XDptx *InstancePtr)
u32 XDptx_CheckLinkStatus (XDptx *InstancePtr, u8 LaneCount)
void XDptx_EnableTrainAdaptive (XDptx *InstancePtr, u8 Enable)
void XDptx_SetHasRedriverInPath (XDptx *InstancePtr, u8 Set)
u32 XDptx_AuxRead (XDptx *InstancePtr, u32 Address, u32 NumBytes, void *Data)
u32 XDptx_AuxWrite (XDptx *InstancePtr, u32 Address, u32 NumBytes, void *Data)
u32 XDptx_IicWrite (XDptx *InstancePtr, u8 IicAddress, u8 RegStartAddress, u8 NumBytes, u8 *DataBuffer)
u32 XDptx_IicRead (XDptx *InstancePtr, u8 IicAddress, u8 RegStartAddress, u8 NumBytes, u8 *DataBuffer)
u32 XDptx_SetDownspread (XDptx *InstancePtr, u8 Enable)
u32 XDptx_SetEnhancedFrameMode (XDptx *InstancePtr, u8 Enable)
u32 XDptx_SetLaneCount (XDptx *InstancePtr, u8 LaneCount)
u32 XDptx_SetLinkRate (XDptx *InstancePtr, u8 LinkRate)
u32 XDptx_SetScrambler (XDptx *InstancePtr, u8 Enable)
void XDptx_EnableMainLink (XDptx *InstancePtr)
void XDptx_DisableMainLink (XDptx *InstancePtr)
void XDptx_ResetPhy (XDptx *InstancePtr, u32 Reset)
void XDptx_SetUserTimerHandler (XDptx *InstancePtr, XDptx_TimerHandler CallbackFunc, void *CallbackRef)
void XDptx_WaitUs (XDptx *InstancePtr, u32 MicroSeconds)


Enumeration Type Documentation

enum XDptx_TrainingState

This typedef enumerates the list of training states used in the state machine during the link training process.


Function Documentation

u32 XDptx_AuxRead ( XDptx InstancePtr,
u32  Address,
u32  NumBytes,
void *  Data 
)

This function issues a read request over the AUX channel.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Address is the starting address to read from the receiver.
NumBytes is the number of bytes to read from the receiver.
Data is a pointer to the data buffer that will be filled with read data.
Returns:
  • XST_SUCCESS if the AUX read request was successfully acknowledged.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_NO_DATA if no data was provided.
  • XST_ERROR_COUNT_MAX if the AUX request timed out.
  • XST_FAILURE otherwise.

u32 XDptx_AuxWrite ( XDptx InstancePtr,
u32  Address,
u32  NumBytes,
void *  Data 
)

This function issues a write request over the AUX channel.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Address is the starting address to write to the receiver.
NumBytes is the number of bytes to write to the receiver.
Data is a pointer to the data buffer that contains the data to be written to the receiver.
Returns:
  • XST_SUCCESS if AUX write request was successfully acknowledged.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_NO_DATA if no data was provided.
  • XST_ERROR_COUNT_MAX if the AUX request timed out.
  • XST_FAILURE otherwise.

void XDptx_CfgInitialize ( XDptx InstancePtr,
XDptx_Config ConfigPtr,
u32  EffectiveAddr 
)

This function retrieves the configuration for this DisplayPort TX instance and fills in the InstancePtr->TxConfig structure.

Parameters:
InstancePtr is a pointer to the XDptx instance.
ConfigPtr is a pointer to the configuration structure that will be used to copy the settings from.
EffectiveAddr is the device base address in the virtual memory space. If the address translation is not used, then the physical address is passed.
Note:
Unexpected errors may occur if the address mapping is changed after this function is invoked.

u32 XDptx_CfgMainLinkMax ( XDptx InstancePtr  ) 

This function determines the common capabilities between the DisplayPort TX core and the receiver.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Returns:
  • XST_SUCCESS if main link settings were successfully set.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_INVALID_PARAM if the specified link configuration specifies a link rate or lane count that isn't valid.
  • XST_FAILURE otherwise.

u32 XDptx_CheckLinkStatus ( XDptx InstancePtr,
u8  LaneCount 
)

This function checks if the reciever's DPCD indicates the reciever has achieved and maintained clock recovery, channel equalization, symbol lock, and interlane alignment for all lanes currently in use.

Parameters:
InstancePtr is a pointer to the XDptx instance.
LaneCount is the number of lanes to check.
Returns:
  • XST_SUCCESS if the receiver has maintained clock recovery, channel equalization, symbol lock, and interlane alignment.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_INVALID_PARAM if the number of lanes to check does not match 1, 2, or 4 lanes.
  • XST_FAILURE otherwise.

void XDptx_DisableMainLink ( XDptx InstancePtr  ) 

This function disables the main link.

Parameters:
InstancePtr is a pointer to the XDptx instance.

void XDptx_EnableMainLink ( XDptx InstancePtr  ) 

This function enables the main link.

Parameters:
InstancePtr is a pointer to the XDptx instance.

void XDptx_EnableTrainAdaptive ( XDptx InstancePtr,
u8  Enable 
)

This function enables or disables downshifting during the training process.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Enable controls the downshift feature in the training process.

u32 XDptx_EstablishLink ( XDptx InstancePtr  ) 

This function determines the common capabilities between the DisplayPort TX core and the receiver.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Returns:
  • XST_SUCCESS was either already trained, or has been trained successfully.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_INVALID_PARAM if the current link rate or lane count isn't valid.
  • XST_FAILURE otherwise.

u32 XDptx_GetEdid ( XDptx InstancePtr  ) 

This function retrieves the receiver's EDID.

Parameters:
InstancePtr is a pointer to the XDptx instance.

u32 XDptx_GetSinkCapabilities ( XDptx InstancePtr  ) 

This function retrieves sink device capabilities from the receiver's DPCD.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Returns:
  • XST_SUCCESS if the DPCD was read successfully.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_FAILURE otherwise.

u32 XDptx_IicRead ( XDptx InstancePtr,
u8  IicAddress,
u8  RegStartAddress,
u8  NumBytes,
u8 *  DataBuffer 
)

This function performs an I2C read over the AUX channel.

Parameters:
InstancePtr is a pointer to the XDptx instance.
IicAddress is the address on the I2C bus of the target device.
RegStartAddress is the subaddress of the targeted I2C device that the read will start from.
NumBytes is the number of bytes to read.
DataBuffer is a pointer to a buffer that will be filled with the I2C read data.
Returns:
  • XST_SUCCESS if the I2C read has successfully completed with no errors.
  • XST_ERROR_COUNT_MAX if the AUX request timed out.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_FAILURE otherwise.

u32 XDptx_IicWrite ( XDptx InstancePtr,
u8  IicAddress,
u8  RegStartAddress,
u8  NumBytes,
u8 *  DataBuffer 
)

This function performs an I2C write over the AUX channel.

Parameters:
InstancePtr is a pointer to the XDptx instance.
IicAddress is the address on the I2C bus of the target device.
RegStartAddress is the sub-address of the targeted I2C device that the write will start at.
NumBytes is the number of bytes to write.
DataBuffer is a pointer to a buffer which will be used as the data source for the write.
Returns:
  • XST_SUCCESS if the I2C write has successfully completed with no errors.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_ERROR_COUNT_MAX if the AUX request timed out.
  • XST_FAILURE otherwise.

u32 XDptx_InitializeTx ( XDptx InstancePtr  ) 

This function prepares the DisplayPort TX core for use.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Returns:
  • XST_SUCCESS if the DisplayPort TX core was successfully initialized.
  • XST_INVALID_PARAM if the supplied link rate does not correspond to either 1.62, 2.70, or 5.40 Gbps.
  • XST_FAILURE otherwise.

void XDptx_ResetPhy ( XDptx InstancePtr,
u32  Reset 
)

This function does a PHY reset.

Parameters:
InstancePtr is a pointer to the XDptx instance. &
Reset is the type of reset to assert.

u32 XDptx_SetDownspread ( XDptx InstancePtr,
u8  Enable 
)

This function enables or disables 0.5% spreading of the clock for both the DisplayPort and the sink device.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Enable will enable or disable down-spread control.
Returns:
  • XST_SUCCESS if setting the downspread control enable was successful.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_FAILURE otherwise.

u32 XDptx_SetEnhancedFrameMode ( XDptx InstancePtr,
u8  Enable 
)

This function enables or disables the enhanced framing symbol sequence for both the DisplayPort TX core and the sink device.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Enable will enable or disable enhanced frame mode.
Returns:
  • XST_SUCCESS if setting the enhanced frame mode enable was successful.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_FAILURE otherwise.

void XDptx_SetHasRedriverInPath ( XDptx InstancePtr,
u8  Set 
)

This function sets a software switch that signifies whether or not a redriver exists on the DisplayPort output path. XDptx_SetVswingPreemp uses this switch to determine which set of voltage swing and pre-emphasis values to use in the TX core.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Set establishes that a redriver exists in the DisplayPort output path.

u32 XDptx_SetLaneCount ( XDptx InstancePtr,
u8  LaneCount 
)

This function sets the number of lanes to be used by the main link for both the DisplayPort TX core and the sink device.

Parameters:
InstancePtr is a pointer to the XDptx instance.
LaneCount is the number of lanes to be used over the main link.
Returns:
  • XST_SUCCESS if setting the new lane count was successful.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_INVALID_PARAM if the supplied lane count is not either 1, 2, or 4 lanes.
  • XST_FAILURE otherwise.

u32 XDptx_SetLinkRate ( XDptx InstancePtr,
u8  LinkRate 
)

This function sets the data rate to be used by the main link for both the DisplayPort TX core and the sink device.

Parameters:
InstancePtr is a pointer to the XDptx instance.
LinkRate is the link rate to be used over the main link based on one of the following selects:
  • XDPTX_LINK_BW_SET_162GBPS = 0x06 (for a 1.62 Gbps data rate)
  • XDPTX_LINK_BW_SET_270GBPS = 0x0A (for a 2.70 Gbps data rate)
  • XDPTX_LINK_BW_SET_540GBPS = 0x14 (for a 5.40 Gbps data rate)
Returns:
  • XST_SUCCESS if setting the new link rate was successful.
  • XST_DEVICE_NOT_FOUND if no receiver is connected.
  • XST_INVALID_PARAM if the supplied link rate does not correspond to either 1.62, 2.70, or 5.40 Gbps.
  • XST_FAILURE otherwise.

u32 XDptx_SetScrambler ( XDptx InstancePtr,
u8  Enable 
)

This function enables or disables scrambling of symbols for both the DisplayPort and the sink device.

Parameters:
InstancePtr is a pointer to the XDptx instance.
Enable will enable or disable scrambling.
Returns:
  • XST_SUCCESS if setting the scrambling enable was successful.
  • XST_FAILURE otherwise.

void XDptx_SetUserTimerHandler ( XDptx InstancePtr,
XDptx_TimerHandler  CallbackFunc,
void *  CallbackRef 
)

This function installs a custom delay/sleep function to be used by the XDdptx driver.

Parameters:
InstancePtr is a pointer to the XDptx instance.
CallbackFunc is the address to the callback function.
CallbackRef is the user data item (microseconds to delay) that will be passed to the custom sleep/delay function when it is invoked.

void XDptx_WaitUs ( XDptx InstancePtr,
u32  MicroSeconds 
)

This function is the delay/sleep function for the XDptx driver. For the Zynq family, there exists native sleep functionality. For MicroBlaze however, there does not exist such functionality. In the MicroBlaze case, the default method for delaying is to use a predetermined amount of loop iterations. This method is prone to inaccuracy and dependent on system configuration; for greater accuracy, the user may supply their own delay/sleep handler, pointed to by InstancePtr->UserTimerWaitUs, which may have better accuracy if a hardware timer is used.

Parameters:
InstancePtr is a pointer to the XDptx instance.
MicroSeconds is the number of microseconds to delay/sleep for.

Copyright @ 1995-2014 Xilinx, Inc. All rights reserved.