Skip to content

Commit

Permalink
hdmitx:hdmirx:vphy: Driver update till 20190814
Browse files Browse the repository at this point in the history
Signed-off-by: Shikhar Mishra <shikhar.mishra@xilinx.com>
  • Loading branch information
Shikhar Mishra committed Oct 12, 2019
1 parent 44d691f commit e8da369
Show file tree
Hide file tree
Showing 31 changed files with 1,190 additions and 423 deletions.
16 changes: 12 additions & 4 deletions hdmi/phy-xilinx-vphy/xhdcp1x.c
Expand Up @@ -71,6 +71,14 @@

/************************** Constant Definitions *****************************/

#if defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
(XPAR_XV_HDMITX1_NUM_INSTANCES > 0)
#define INCLUDE_TX
#endif
#if defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0)
#define INCLUDE_RX
#endif
#if defined(XPAR_XV_HDMITX_NUM_INSTANCES) && (XPAR_XV_HDMITX_NUM_INSTANCES > 0)
#define INCLUDE_TX
#endif
Expand Down Expand Up @@ -137,9 +145,9 @@ int XHdcp1x_CfgInitialize(XHdcp1x *InstancePtr, const XHdcp1x_Config *CfgPtr,
Xil_AssertNonvoid(CfgPtr != NULL);
Xil_AssertNonvoid(EffectiveAddr != (UINTPTR)NULL);

/* clear instance */
memset(InstancePtr, 0, sizeof(XHdcp1x));
/* Setup the InstancePtr. */
(void)memset((void *)InstancePtr, 0, sizeof(XHdcp1x));

/* Initialize InstancePtr. */
InstancePtr->Config = *CfgPtr;
InstancePtr->Config.BaseAddress = EffectiveAddr;
Expand Down Expand Up @@ -226,7 +234,7 @@ int XHdcp1x_CfgInitialize(XHdcp1x *InstancePtr, const XHdcp1x_Config *CfgPtr,
/* Initialize RX */
XHdcp1x_RxInit(InstancePtr);
}

InstancePtr->IsReady = XIL_COMPONENT_IS_READY;

return (XST_SUCCESS);
Expand Down
9 changes: 8 additions & 1 deletion hdmi/phy-xilinx-vphy/xhdcp1x_port.c
Expand Up @@ -43,7 +43,14 @@


/************************** Constant Definitions *****************************/

#if defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
(XPAR_XV_HDMITX1_NUM_INSTANCES > 0)
#define INCLUDE_HDMI_TX
#endif
#if defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0)
#define INCLUDE_HDMI_RX
#endif
#if defined(XPAR_XV_HDMITX_NUM_INSTANCES) && (XPAR_XV_HDMITX_NUM_INSTANCES > 0)
#define INCLUDE_HDMI_TX
#endif
Expand Down
5 changes: 4 additions & 1 deletion hdmi/phy-xilinx-vphy/xhdcp1x_port_hdmi_rx.c
Expand Up @@ -46,7 +46,10 @@
/***************************** Include Files *********************************/


#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
//#include <stdlib.h>
#include <linux/string.h>
#include "xhdcp1x_port.h"
Expand Down
5 changes: 4 additions & 1 deletion hdmi/phy-xilinx-vphy/xhdcp1x_port_hdmi_tx.c
Expand Up @@ -39,7 +39,10 @@
/***************************** Include Files *********************************/


#if defined(XPAR_XV_HDMITX_NUM_INSTANCES) && (XPAR_XV_HDMITX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMITX_NUM_INSTANCES) && \
(XPAR_XV_HDMITX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMITX1_NUM_INSTANCES) && \
(XPAR_XV_HDMITX1_NUM_INSTANCES > 0))
//#include <stdlib.h>
#include <linux/string.h>
#include "xhdcp1x_port.h"
Expand Down
50 changes: 40 additions & 10 deletions hdmi/phy-xilinx-vphy/xhdcp1x_rx.c
Expand Up @@ -72,7 +72,10 @@
#include "xhdcp1x_cipher.h"
#include "xhdcp1x_debug.h"
#include "xhdcp1x_port.h"
#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
#include "xhdcp1x_port_hdmi.h"
#else
#include "xhdcp1x_port_dp.h"
Expand Down Expand Up @@ -1245,7 +1248,10 @@ static void XHdcp1x_RxPollForComputations(XHdcp1x *InstancePtr,
XHdcp1x_PortWrite(InstancePtr, XHDCP1X_PORT_OFFSET_RO,
Buf, 2);

#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
/* No reset required in the sofware for HDMI. KSV fifo
* pointer reset is implemented in the hardware. */

Expand Down Expand Up @@ -1517,7 +1523,10 @@ void XHdcp1x_RxSetTopologyDeviceCnt(XHdcp1x *InstancePtr, u32 Value)
******************************************************************************/
void XHdcp1x_RxSetTopologyMaxCascadeExceeded(XHdcp1x *InstancePtr, u8 Value)
{
#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))

u32 BStatus;

Expand Down Expand Up @@ -1561,7 +1570,10 @@ void XHdcp1x_RxSetTopologyMaxDevsExceeded(XHdcp1x *InstancePtr, u8 Value)
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(Value == FALSE || Value == TRUE);

#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))

u16 DevCntErr = (Value & 0xFFFF);
u32 BStatus;
Expand Down Expand Up @@ -1604,7 +1616,10 @@ void XHdcp1x_RxSetHdmiMode(XHdcp1x *InstancePtr, u8 Value)
/* Verify arguments */
Xil_AssertVoid(InstancePtr != NULL);

#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
u32 BStatus;

/* Update the value of HDMI_MODE bit in the BStatus Register */
Expand Down Expand Up @@ -1655,7 +1670,10 @@ static void XHdcp1x_RxAssembleKSVList(XHdcp1x *InstancePtr,
*NextStatePtr = XHDCP1X_STATE_UNAUTHENTICATED;
}
else {
#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
u32 BCaps;
#else
u32 BInfo;
Expand All @@ -1668,7 +1686,10 @@ static void XHdcp1x_RxAssembleKSVList(XHdcp1x *InstancePtr,
u32 ksvCount, ksvsToWrite;
u16 RepeaterInfo = 0;

#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))

/* Ensure that the READY bit is clear */
/* Update the Ready bit in the BCaps Register */
Expand Down Expand Up @@ -1718,7 +1739,10 @@ static void XHdcp1x_RxAssembleKSVList(XHdcp1x *InstancePtr,
tempKsv = InstancePtr->RepeaterValues.KsvList[ksvCount];
XHDCP1X_PORT_UINT_TO_BUF(Buf, tempKsv ,
(XHDCP1X_PORT_SIZE_BKSV * 8));
#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))

/* Write the KSV to the HDCP_DAT register each time,
* The KSV Fifo will auto increment
Expand All @@ -1737,7 +1761,10 @@ static void XHdcp1x_RxAssembleKSVList(XHdcp1x *InstancePtr,
ksvsToWrite -= 1;
}

#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))
RepeaterInfo = (XHDCP1X_PORT_BIT_BSTATUS_HDMI_MODE) |
(XHDCP1X_PORT_BSTATUS_BIT_DEPTH_NO_ERR) |
(InstancePtr->RepeaterValues.Depth <<
Expand All @@ -1756,7 +1783,10 @@ static void XHdcp1x_RxAssembleKSVList(XHdcp1x *InstancePtr,

XHdcp1x_RxCalculateSHA1Value(InstancePtr,RepeaterInfo);

#if defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && (XPAR_XV_HDMIRX_NUM_INSTANCES > 0)
#if (defined(XPAR_XV_HDMIRX_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX_NUM_INSTANCES > 0)) || \
(defined(XPAR_XV_HDMIRX1_NUM_INSTANCES) && \
(XPAR_XV_HDMIRX1_NUM_INSTANCES > 0))

/* Update the value of V'H0 */
sha1value = 0;
Expand Down

0 comments on commit e8da369

Please sign in to comment.