From 81cb2fe9135566c4b8c5b369c6c8e31fc8589e25 Mon Sep 17 00:00:00 2001 From: Andrei-Liviu Simion Date: Fri, 9 Jan 2015 13:54:30 -0800 Subject: [PATCH] dp: Export IP configuration parameter for the DisplayPort core type - TX or RX. Exporting the C_FLOW_DIRECTION configuration parameter. XDp_Config's IsRx member specifies that the core is an RX if = 0, TX if = 1. Signed-off-by: Andrei-Liviu Simion --- XilinxProcessorIPLib/drivers/dp/data/dp.tcl | 6 +++--- XilinxProcessorIPLib/drivers/dp/src/xdp.h | 24 +++++++++++++++++++++ XilinxProcessorIPLib/drivers/dp/src/xdptx.c | 2 ++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/dp/data/dp.tcl b/XilinxProcessorIPLib/drivers/dp/data/dp.tcl index 5156e4fa..8ce0141a 100644 --- a/XilinxProcessorIPLib/drivers/dp/data/dp.tcl +++ b/XilinxProcessorIPLib/drivers/dp/data/dp.tcl @@ -30,9 +30,9 @@ ## ##*****************************************************************************/ proc generate {drv_handle} { - xdefine_include_file $drv_handle "xparameters.h" "XDp" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_LANE_COUNT" "C_LINK_RATE" "C_MAX_BITS_PER_COLOR" "C_QUAD_PIXEL_ENABLE" "C_DUAL_PIXEL_ENABLE" "C_YCRCB_ENABLE" "C_YONLY_ENABLE" "C_GT_DATAWIDTH" "C_SECONDARY_SUPPORT" "C_AUDIO_CHANNELS" "C_MST_ENABLE" "C_NUMBER_OF_MST_STREAMS" "C_PROTOCOL_SELECTION" "S_AXI_ACLK" - xdefine_config_file $drv_handle "xdptx_g.c" "XDp" "DEVICE_ID" "C_BASEADDR" "S_AXI_ACLK" "C_LANE_COUNT" "C_LINK_RATE" "C_MAX_BITS_PER_COLOR" "C_QUAD_PIXEL_ENABLE" "C_DUAL_PIXEL_ENABLE" "C_YCRCB_ENABLE" "C_YONLY_ENABLE" "C_GT_DATAWIDTH" "C_SECONDARY_SUPPORT" "C_AUDIO_CHANNELS" "C_MST_ENABLE" "C_NUMBER_OF_MST_STREAMS" "C_PROTOCOL_SELECTION" - xdefine_canonical_xpars $drv_handle "xparameters.h" "XDp" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_LANE_COUNT" "C_LINK_RATE" "C_MAX_BITS_PER_COLOR" "C_QUAD_PIXEL_ENABLE" "C_DUAL_PIXEL_ENABLE" "C_YCRCB_ENABLE" "C_YONLY_ENABLE" "C_GT_DATAWIDTH" "C_SECONDARY_SUPPORT" "C_AUDIO_CHANNELS" "C_MST_ENABLE" "C_NUMBER_OF_MST_STREAMS" "C_PROTOCOL_SELECTION" "S_AXI_ACLK" + xdefine_include_file $drv_handle "xparameters.h" "XDp" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_LANE_COUNT" "C_LINK_RATE" "C_MAX_BITS_PER_COLOR" "C_QUAD_PIXEL_ENABLE" "C_DUAL_PIXEL_ENABLE" "C_YCRCB_ENABLE" "C_YONLY_ENABLE" "C_GT_DATAWIDTH" "C_SECONDARY_SUPPORT" "C_AUDIO_CHANNELS" "C_MST_ENABLE" "C_NUMBER_OF_MST_STREAMS" "C_PROTOCOL_SELECTION" "C_FLOW_DIRECTION" "S_AXI_ACLK" + xdefine_config_file $drv_handle "xdptx_g.c" "XDp" "DEVICE_ID" "C_BASEADDR" "S_AXI_ACLK" "C_LANE_COUNT" "C_LINK_RATE" "C_MAX_BITS_PER_COLOR" "C_QUAD_PIXEL_ENABLE" "C_DUAL_PIXEL_ENABLE" "C_YCRCB_ENABLE" "C_YONLY_ENABLE" "C_GT_DATAWIDTH" "C_SECONDARY_SUPPORT" "C_AUDIO_CHANNELS" "C_MST_ENABLE" "C_NUMBER_OF_MST_STREAMS" "C_PROTOCOL_SELECTION" "C_FLOW_DIRECTION" + xdefine_canonical_xpars $drv_handle "xparameters.h" "XDp" "NUM_INSTANCES" "DEVICE_ID" "C_BASEADDR" "C_LANE_COUNT" "C_LINK_RATE" "C_MAX_BITS_PER_COLOR" "C_QUAD_PIXEL_ENABLE" "C_DUAL_PIXEL_ENABLE" "C_YCRCB_ENABLE" "C_YONLY_ENABLE" "C_GT_DATAWIDTH" "C_SECONDARY_SUPPORT" "C_AUDIO_CHANNELS" "C_MST_ENABLE" "C_NUMBER_OF_MST_STREAMS" "C_PROTOCOL_SELECTION" "C_FLOW_DIRECTION" "S_AXI_ACLK" } # diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp.h b/XilinxProcessorIPLib/drivers/dp/src/xdp.h index 863307ea..ebb209fe 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp.h +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp.h @@ -244,6 +244,8 @@ typedef struct { u8 DpProtocol; /**< The DisplayPort protocol version that this core instance is configured for. 0 = v1.1a, 1 = v1.2. */ + u8 IsRx; /**< The type of DisplayPort core. + 0 = TX, 1 = RX. */ } XDp_Config; /**************************** Function Prototypes *****************************/ @@ -251,6 +253,28 @@ typedef struct { /* xdp_sinit.c: Configuration extraction function.*/ XDp_Config *XDp_LookupConfig(u16 DeviceId); +/******************* Macros (Inline Functions) Definitions ********************/ + +#define XDP_TX 0 +#define XDP_RX 1 + +/******************************************************************************/ +/** + * This is function determines whether the DisplayPort core that the + * configuration structure represents is a transmitter (TX) or a receiver (RX). + * + * @param ConfigPtr is a pointer to the DisplayPort core's configuration + * structure. + * + * @return XDP_RX if the configuration structure is for a core of type RX. + * XDP_TX if the configuration structure is for a core of type TX. + * + * @note C-style signature: + * u32 XDp_CfgGetCoreType(XDp_Config *ConfigPtr) + * +*******************************************************************************/ +#define XDp_CfgGetCoreType(ConfigPtr) ((ConfigPtr)->IsRx ? XDP_RX : XDP_TX) + /******************************* Compatibility ********************************/ #define XDptx_LookupConfig XDp_LookupConfig diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdptx.c b/XilinxProcessorIPLib/drivers/dp/src/xdptx.c index ea8ca437..3da1d6a4 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdptx.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdptx.c @@ -277,6 +277,8 @@ void XDptx_CfgInitialize(XDptx *InstancePtr, XDp_Config *ConfigPtr, InstancePtr->Config.DpProtocol = ConfigPtr->DpProtocol; + InstancePtr->Config.IsRx = ConfigPtr->IsRx; + /* Set the DisplayPort TX's voltage swing and pre-emphasis levels to * their defaults. */ XDptx_CfgTxVsOffset(InstancePtr, XDPTX_VS_LEVEL_OFFSET);