MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- ----------------------------------------------- 1.0 als 05/17/14 Initial release. 2.0 als 09/21/14 Added XDptx_IsConnected (previously a macro). 3.0 als 12/16/14 Fixed XDptx_WaitPhyReady for maximum lane counts != 4. Force re-train during XDptx_EstablishLink. Modified XDptx_SetVswingPreemp usage to enable more efficient use of burst writes to a sink DPCD.
#include "xdptx.h"
#include "xstatus.h"
#include "xenv.h"
Classes | |
struct | XDptx_AuxTransaction |
Defines | |
#define | XDPTX_MAXIMUM_VS_LEVEL 3 |
#define | XDPTX_MAXIMUM_PE_LEVEL 3 |
#define | XDPTX_AUX_MAX_DEFER_COUNT 50 |
#define | XDPTX_AUX_MAX_TIMEOUT_COUNT 50 |
#define | XDPTX_IS_CONNECTED_MAX_TIMEOUT_COUNT 50 |
Enumerations | |
enum | XDptx_TrainingState { XDPTX_TS_CLOCK_RECOVERY, XDPTX_TS_CHANNEL_EQUALIZATION, XDPTX_TS_ADJUST_LINK_RATE, XDPTX_TS_ADJUST_LANE_COUNT, XDPTX_TS_FAILURE, XDPTX_TS_SUCCESS } |
Functions | |
u32 | XDptx_InitializeTx (XDptx *InstancePtr) |
void | XDptx_CfgInitialize (XDptx *InstancePtr, XDptx_Config *ConfigPtr, u32 EffectiveAddr) |
u32 | XDptx_GetRxCapabilities (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) |
void | XDptx_CfgTxVsOffset (XDptx *InstancePtr, u8 Offset) |
void | XDptx_CfgTxVsLevel (XDptx *InstancePtr, u8 Level, u8 TxLevel) |
void | XDptx_CfgTxPeLevel (XDptx *InstancePtr, u8 Level, u8 TxLevel) |
u32 | XDptx_IsConnected (XDptx *InstancePtr) |
u32 | XDptx_AuxRead (XDptx *InstancePtr, u32 DpcdAddress, u32 BytesToRead, void *ReadData) |
u32 | XDptx_AuxWrite (XDptx *InstancePtr, u32 DpcdAddress, u32 BytesToWrite, void *WriteData) |
u32 | XDptx_IicRead (XDptx *InstancePtr, u8 IicAddress, u16 Offset, u16 BytesToRead, void *ReadData) |
u32 | XDptx_IicWrite (XDptx *InstancePtr, u8 IicAddress, u8 BytesToWrite, void *WriteData) |
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) |
#define XDPTX_AUX_MAX_DEFER_COUNT 50 |
#define XDPTX_AUX_MAX_TIMEOUT_COUNT 50 |
#define XDPTX_IS_CONNECTED_MAX_TIMEOUT_COUNT 50 |
#define XDPTX_MAXIMUM_PE_LEVEL 3 |
#define XDPTX_MAXIMUM_VS_LEVEL 3 |
enum XDptx_TrainingState |
u32 XDptx_AuxRead | ( | XDptx * | InstancePtr, | |
u32 | DpcdAddress, | |||
u32 | BytesToRead, | |||
void * | ReadData | |||
) |
This function issues a read request over the AUX channel that will read from the RX device's DisplayPort Configuration Data (DPCD) address space. The read message will be divided into multiple transactions which read a maximum of 16 bytes each.
InstancePtr | is a pointer to the XDptx instance. | |
DpcdAddress | is the starting address to read from the RX device. | |
BytesToRead | is the number of bytes to read from the RX device. | |
ReadData | is a pointer to the data buffer that will be filled with read data. |
u32 XDptx_AuxWrite | ( | XDptx * | InstancePtr, | |
u32 | DpcdAddress, | |||
u32 | BytesToWrite, | |||
void * | WriteData | |||
) |
This function issues a write request over the AUX channel that will write to the RX device's DisplayPort Configuration Data (DPCD) address space. The write message will be divided into multiple transactions which write a maximum of 16 bytes each.
InstancePtr | is a pointer to the XDptx instance. | |
DpcdAddress | is the starting address to write to the RX device. | |
BytesToWrite | is the number of bytes to write to the RX device. | |
WriteData | is a pointer to the data buffer that contains the data to be written to the RX device. |
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->Config structure.
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. |
u32 XDptx_CfgMainLinkMax | ( | XDptx * | InstancePtr | ) |
This function determines the common capabilities between the DisplayPort TX core and the RX device.
InstancePtr | is a pointer to the XDptx instance. |
void XDptx_CfgTxPeLevel | ( | XDptx * | InstancePtr, | |
u8 | Level, | |||
u8 | TxLevel | |||
) |
This function sets the pre-emphasis level value in the DisplayPort TX that will be used during link training for a given pre-emphasis training level.
InstancePtr | is a pointer to the XDptx instance. | |
Level | is the pre-emphasis training level to set the DisplayPort TX level for. | |
TxLevel | is the DisplayPort TX pre-emphasis level value to be used during link training. |
void XDptx_CfgTxVsLevel | ( | XDptx * | InstancePtr, | |
u8 | Level, | |||
u8 | TxLevel | |||
) |
This function sets the voltage swing level value in the DisplayPort TX that will be used during link training for a given voltage swing training level.
InstancePtr | is a pointer to the XDptx instance. | |
Level | is the voltage swing training level to set the DisplayPort TX level for. | |
TxLevel | is the DisplayPort TX voltage swing level value to be used during link training. |
void XDptx_CfgTxVsOffset | ( | XDptx * | InstancePtr, | |
u8 | Offset | |||
) |
This function sets the voltage swing offset to use during training when no redriver exists. The offset will be added to the DisplayPort TX's voltage swing level value when pre-emphasis is used (when the pre-emphasis level not equal to 0).
InstancePtr | is a pointer to the XDptx instance. | |
Offset | is the value to set for the voltage swing offset. |
u32 XDptx_CheckLinkStatus | ( | XDptx * | InstancePtr, | |
u8 | LaneCount | |||
) |
This function checks if the reciever's DisplayPort Configuration Data (DPCD) indicates the reciever has achieved and maintained clock recovery, channel equalization, symbol lock, and interlane alignment for all lanes currently in use.
InstancePtr | is a pointer to the XDptx instance. | |
LaneCount | is the number of lanes to check. |
void XDptx_DisableMainLink | ( | XDptx * | InstancePtr | ) |
This function disables the main link.
InstancePtr | is a pointer to the XDptx instance. |
void XDptx_EnableMainLink | ( | XDptx * | InstancePtr | ) |
This function enables the main link.
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.
InstancePtr | is a pointer to the XDptx instance. | |
Enable | controls the downshift feature in the training process. |
u32 XDptx_EstablishLink | ( | XDptx * | InstancePtr | ) |
This function checks if the link needs training and runs the training sequence if training is required.
InstancePtr | is a pointer to the XDptx instance. |
u32 XDptx_GetRxCapabilities | ( | XDptx * | InstancePtr | ) |
This function retrieves the RX device's capabilities from the RX device's DisplayPort Configuration Data (DPCD).
InstancePtr | is a pointer to the XDptx instance. |
u32 XDptx_IicRead | ( | XDptx * | InstancePtr, | |
u8 | IicAddress, | |||
u16 | Offset, | |||
u16 | BytesToRead, | |||
void * | ReadData | |||
) |
This function performs an I2C read over the AUX channel. The read message will be divided into multiple transactions if the requested data spans multiple segments. The segment pointer is automatically incremented and the offset is calibrated as needed. E.g. For an overall offset of:
InstancePtr | is a pointer to the XDptx instance. | |
IicAddress | is the address on the I2C bus of the target device. | |
Offset | is the offset at the specified address of the targeted I2C device that the read will start from. | |
BytesToRead | is the number of bytes to read. | |
ReadData | is a pointer to a buffer that will be filled with the I2C read data. |
u32 XDptx_IicWrite | ( | XDptx * | InstancePtr, | |
u8 | IicAddress, | |||
u8 | BytesToWrite, | |||
void * | WriteData | |||
) |
This function performs an I2C write over the AUX channel.
InstancePtr | is a pointer to the XDptx instance. | |
IicAddress | is the address on the I2C bus of the target device. | |
BytesToWrite | is the number of bytes to write. | |
WriteData | is a pointer to a buffer which will be used as the data source for the write. |
u32 XDptx_InitializeTx | ( | XDptx * | InstancePtr | ) |
This function prepares the DisplayPort TX core for use.
InstancePtr | is a pointer to the XDptx instance. |
u32 XDptx_IsConnected | ( | XDptx * | InstancePtr | ) |
This function checks if there is a connected RX device.
InstancePtr | is a pointer to the XDptx instance. |
void XDptx_ResetPhy | ( | XDptx * | InstancePtr, | |
u32 | Reset | |||
) |
This function does a PHY reset.
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 RX device.
InstancePtr | is a pointer to the XDptx instance. | |
Enable | will downspread the main link signal if set to 1 and disable downspreading if set to 0. |
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 RX device.
InstancePtr | is a pointer to the XDptx instance. | |
Enable | will enable enhanced frame mode if set to 1 and disable it if set to 0. |
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.
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 RX device.
InstancePtr | is a pointer to the XDptx instance. | |
LaneCount | is the number of lanes to be used over the main link. |
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 RX device.
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:
|
u32 XDptx_SetScrambler | ( | XDptx * | InstancePtr, | |
u8 | Enable | |||
) |
This function enables or disables scrambling of symbols for both the DisplayPort and the RX device.
InstancePtr | is a pointer to the XDptx instance. | |
Enable | will enable or disable scrambling. |
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.
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.
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.