Skip to content

Commit

Permalink
hdmitx:hdmirx:phy: Updated driver IP version
Browse files Browse the repository at this point in the history
Update of all driver code

Signed-off-by: Shikhar Mishra <shikharm@xilinx.com>
  • Loading branch information
shikharmxlnx committed Oct 12, 2018
1 parent 5bc312b commit f9994e8
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 28 deletions.
2 changes: 1 addition & 1 deletion hdmi/phy-xilinx-vphy/xhdcp1x_cipher.c
Expand Up @@ -313,7 +313,7 @@ int XHdcp1x_CipherDoRequest(XHdcp1x *InstancePtr,

/* Verify arguments. */
Xil_AssertNonvoid(InstancePtr != NULL);
Xil_AssertNonvoid(Request >= (XHDCP1X_CIPHER_REQUEST_BLOCK));
Xil_AssertNonvoid(Request < (XHDCP1X_CIPHER_REQUEST_MAX));

/* Check that it is not disabled */
if (!XHdcp1x_CipherIsEnabled(InstancePtr)) {
Expand Down
5 changes: 3 additions & 2 deletions hdmi/phy-xilinx-vphy/xhdcp1x_rx.c
Expand Up @@ -890,10 +890,11 @@ int XHdcp1x_RxGetRepeaterInfo(XHdcp1x *InstancePtr,
******************************************************************************/
static void XHdcp1x_RxDebugLog(const XHdcp1x *InstancePtr, const char *LogMsg)
{
char Label[20];
char Label[16];

/* Format Label */
snprintf(Label, 20, "hdcp-rx(%d) - ", InstancePtr->Config.DeviceId);
snprintf(Label, sizeof(Label), "hdcp-rx(%hu) - ",
InstancePtr->Config.DeviceId);

/* Log it */
XHDCP1X_DEBUG_LOGMSG(Label);
Expand Down
3 changes: 2 additions & 1 deletion hdmi/phy-xilinx-vphy/xhdcp1x_tx.c
Expand Up @@ -987,7 +987,8 @@ static void XHdcp1x_TxDebugLog(const XHdcp1x *InstancePtr, const char *LogMsg)
char Label[16];

/* Format Label */
snprintf(Label, 16, "hdcp-tx(%d) - ", InstancePtr->Config.DeviceId);
snprintf(Label, sizeof(Label), "hdcp-tx(%hu) - ",
InstancePtr->Config.DeviceId);

/* Log it */
XHDCP1X_DEBUG_LOGMSG(Label);
Expand Down
6 changes: 4 additions & 2 deletions hdmi/phy-xilinx-vphy/xv_hdmic.c
Expand Up @@ -29,6 +29,7 @@
* Ver Who Date Changes
* ----- ---- -------- -----------------------------------------------
* 1.0 EB 21/12/17 Initial release.
* 1.1 EB 10/04/18 Fixed a bug in XV_HdmiC_ParseAudioInfoFrame
* </pre>
*
*******************************************************************************/
Expand Down Expand Up @@ -210,7 +211,8 @@ void XV_HdmiC_ParseAudioInfoFrame(XHdmiC_Aux *AuxPtr, XHdmiC_AudioInfoFrame *Aud
AudIFPtr->ChannelCount = (AuxPtr->Data.Byte[1]) & 0x7;

/* PB2 */
AudIFPtr->SampleFrequency = AuxPtr->Data.Byte[2] & 0x1f;
AudIFPtr->SampleFrequency = (AuxPtr->Data.Byte[2] >> 2) & 0x7;
AudIFPtr->SampleSize = AuxPtr->Data.Byte[2] & 0x3;

/* PB4 */
AudIFPtr->ChannelAllocation = AuxPtr->Data.Byte[4];
Expand Down Expand Up @@ -281,7 +283,7 @@ XHdmiC_Aux XV_HdmiC_AVIIF_GeneratePacket(XHdmiC_AVI_InfoFrame *infoFramePtr)

/* PB6 */
aux.Data.Byte[6] = infoFramePtr->TopBar & 0xff;

aux.Data.Byte[7] = 0;

/* PB8 */
Expand Down
8 changes: 5 additions & 3 deletions hdmi/phy-xilinx-vphy/xvidc_timings_table.c
Expand Up @@ -38,6 +38,8 @@
* aad 07/10/17 Add XVIDC_VM_3840x2160_60_P_RB video format
* aad 09/05/17 Fixed timings for 1366x768_60_P
* aad 09/05/17 Added 1366x768_60_P_RB
* 4.4 eb 09/04/18 Fixed timings for 1280x720_24_P, 1280x720_25_P,
* 1280x720_30_P
* </pre>
*
*******************************************************************************/
Expand Down Expand Up @@ -193,13 +195,13 @@ const XVidC_VideoTimingMode XVidC_VideoTimingModes[XVIDC_VM_NUM_SUPPORTED] =
{1152, 64, 128, 256, 1600, 1,
864, 1, 3, 32, 900, 0, 0, 0, 0, 1} },
{ XVIDC_VM_1280x720_24_P, "1280x720@24Hz", XVIDC_FR_24HZ,
{1280, 970, 905, 970, 4125, 1,
{1280, 1760, 40, 220, 3300, 1,
720, 5, 5, 20, 750, 0, 0, 0, 0, 1} },
{ XVIDC_VM_1280x720_25_P, "1280x720@25Hz", XVIDC_FR_25HZ,
{1280, 970, 740, 970, 3960, 1,
{1280, 2420, 40, 220, 3960, 1,
720, 5, 5, 20, 750, 0, 0, 0, 0, 1} },
{ XVIDC_VM_1280x720_30_P, "1280x720@30Hz", XVIDC_FR_30HZ,
{1280, 970, 80, 970, 3300, 1,
{1280, 1760, 40, 220, 3300, 1,
720, 5, 5, 20, 750, 0, 0, 0, 0, 1} },
{ XVIDC_VM_1280x720_50_P, "1280x720@50Hz", XVIDC_FR_50HZ,
{1280, 440, 40, 220, 1980, 1,
Expand Down
8 changes: 8 additions & 0 deletions hdmi/xilinx-hdmi-rx/xv_hdmirx_intr.c
Expand Up @@ -46,6 +46,7 @@
* 16/11/17 Update Reset sequence with dedicated reset for
* each clock domain
* MMO 08/02/18 Adding proper handling for Sync Loss/Sync Recover
* 2.10 YH 13/04/18 Fixed a bug in PioIntrHandler
* </pre>
*
******************************************************************************/
Expand Down Expand Up @@ -693,6 +694,13 @@ void HdmiRx_PioIntrHandler(XV_HdmiRx *InstancePtr)
}
}

/* Bridge Overflow event has occurred */
if ((Event) & (XV_HDMIRX_PIO_IN_BRDG_OVERFLOW_MASK)) {
// Check if user callback has been registered
if (InstancePtr->IsBrdgOverflowCallbackSet) {
InstancePtr->BrdgOverflowCallback(InstancePtr->BrdgOverflowRef);
}
}

}

Expand Down
44 changes: 32 additions & 12 deletions hdmi/xilinx-hdmi-rx/xv_hdmirxss.c
Expand Up @@ -97,6 +97,10 @@
* XV_HdmiRxSs_GetVSIF
* Updated XV_HdmiRxSs_ConfigBridgeMode so Pixel
* Pepetition is based on received AVI InfoFrame
* 5.10 MMO 06/04/18 Updated XV_HdmiRxSs_ToggleHpd and XV_HdmiRxSs_Stop
* for cleaner HPD flow during transition from HDMI2.0
* to HDMI1.4
* YH 13/04/18 Fixed a bug in XV_HdmiRxSs_BrdgOverflowCallback
******************************************************************************/

/***************************** Include Files *********************************/
Expand Down Expand Up @@ -617,7 +621,7 @@ void XV_HdmiRxSs_Start(XV_HdmiRxSs *InstancePtr)
#ifdef XV_HDMIRXSS_LOG_ENABLE
XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_START, 0);
#endif
/* Set RX hot plug detect */
/* Drive HDMI RX HPD High */
XV_HdmiRx_SetHpd(InstancePtr->HdmiRxPtr, TRUE);

/* Disable Audio Peripheral */
Expand All @@ -638,6 +642,16 @@ void XV_HdmiRxSs_Start(XV_HdmiRxSs *InstancePtr)
void XV_HdmiRxSs_Stop(XV_HdmiRxSs *InstancePtr)
{
Xil_AssertVoid(InstancePtr != NULL);

/* Clear SCDC variables */
XV_HdmiRx_DdcScdcClear(InstancePtr->HdmiRxPtr);

/* Disable the scrambler */
XV_HdmiRx_SetScrambler(InstancePtr->HdmiRxPtr, (FALSE));

/* Drive HDMI RX HPD Low */
XV_HdmiRx_SetHpd(InstancePtr->HdmiRxPtr, (FALSE));

#ifdef XV_HDMIRXSS_LOG_ENABLE
XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_STOP, 0);
#endif
Expand Down Expand Up @@ -762,8 +776,8 @@ static void XV_HdmiRxSs_BrdgOverflowCallback(void *CallbackRef)
XV_HdmiRxSs *HdmiRxSsPtr = (XV_HdmiRxSs *)CallbackRef;

// Check if user callback has been registered
if (HdmiRxSsPtr->ConnectCallback) {
HdmiRxSsPtr->ConnectCallback(HdmiRxSsPtr->ConnectRef);
if (HdmiRxSsPtr->BrdgOverflowCallback) {
HdmiRxSsPtr->BrdgOverflowCallback(HdmiRxSsPtr->BrdgOverflowRef);
}

}
Expand Down Expand Up @@ -862,7 +876,7 @@ static void XV_HdmiRxSs_AuxCallback(void *CallbackRef)
// Parse Aux to retrieve Avi InfoFrame
XV_HdmiC_ParseAVIInfoFrame(AuxPtr, AviInfoFramePtr);
HdmiRxSsPtr->HdmiRxPtr->Stream.Video.ColorFormatId =
XV_HdmiRx_GetAviColorSpace(HdmiRxSsPtr->HdmiRxPtr);
XV_HdmiRx_GetAviColorSpace(HdmiRxSsPtr->HdmiRxPtr);
HdmiRxSsPtr->HdmiRxPtr->Stream.Vic =
XV_HdmiRx_GetAviVic(HdmiRxSsPtr->HdmiRxPtr);
HdmiRxSsPtr->HdmiRxPtr->Stream.Video.AspectRatio =
Expand Down Expand Up @@ -903,7 +917,7 @@ static void XV_HdmiRxSs_SyncLossCallback(void *CallbackRef)
XV_HdmiRxSs *HdmiRxSsPtr = (XV_HdmiRxSs *)CallbackRef;

if (HdmiRxSsPtr->HdmiRxPtr->Stream.SyncStatus ==
XV_HDMIRX_SYNCSTAT_SYNC_LOSS) {
XV_HDMIRX_SYNCSTAT_SYNC_LOSS) {
// Push sync loss event to HDCP event queue
#ifdef XV_HDMIRXSS_LOG_ENABLE
XV_HdmiRxSs_LogWrite(HdmiRxSsPtr, XV_HDMIRXSS_LOG_EVT_SYNCLOSS, 0);
Expand All @@ -915,7 +929,7 @@ static void XV_HdmiRxSs_SyncLossCallback(void *CallbackRef)
}
// Sync is recovered/establish
else if (HdmiRxSsPtr->HdmiRxPtr->Stream.SyncStatus ==
XV_HDMIRX_SYNCSTAT_SYNC_EST) {
XV_HDMIRX_SYNCSTAT_SYNC_EST) {
// Push sync loss event to HDCP event queue
#ifdef XV_HDMIRXSS_LOG_ENABLE
XV_HdmiRxSs_LogWrite(HdmiRxSsPtr, XV_HDMIRXSS_LOG_EVT_SYNCEST, 0);
Expand Down Expand Up @@ -1542,7 +1556,7 @@ void XV_HdmiRxSs_LoadEdid(XV_HdmiRxSs *InstancePtr, u8 *EdidDataPtr,
******************************************************************************/
void XV_HdmiRxSs_SetHpd(XV_HdmiRxSs *InstancePtr, u8 Value)
{
/* Drive HPD low */
/* Drive HDMI RX HPD based on the input value */
XV_HdmiRx_SetHpd(InstancePtr->HdmiRxPtr, Value);
}

Expand All @@ -1558,13 +1572,19 @@ void XV_HdmiRxSs_SetHpd(XV_HdmiRxSs *InstancePtr, u8 Value)
******************************************************************************/
void XV_HdmiRxSs_ToggleHpd(XV_HdmiRxSs *InstancePtr)
{
/* Drive HPD low */
/* Clear SCDC variables */
XV_HdmiRx_DdcScdcClear(InstancePtr->HdmiRxPtr);

/* Disable the scrambler */
XV_HdmiRx_SetScrambler(InstancePtr->HdmiRxPtr, (FALSE));

/* Drive HDMI RX HPD Low */
XV_HdmiRx_SetHpd(InstancePtr->HdmiRxPtr, (FALSE));

/* Wait 500 ms */
XV_HdmiRxSs_WaitUs(InstancePtr, 500000);

/* Drive HPD high */
/* Drive HDMI RX HPD High */
XV_HdmiRx_SetHpd(InstancePtr->HdmiRxPtr, (TRUE));
}

Expand Down Expand Up @@ -2042,11 +2062,11 @@ static void XV_HdmiRxSs_ConfigBridgeMode(XV_HdmiRxSs *InstancePtr) {
// Pixel Repetition factor of 3 and above are not supported by the bridge
if (AviInfoFramePtr->PixelRepetition > XHDMIC_PIXEL_REPETITION_FACTOR_2) {
#ifdef XV_HDMIRXSS_LOG_ENABLE
XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_PIX_REPEAT_ERR,
AviInfoFramePtr->PixelRepetition);
XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_PIX_REPEAT_ERR,
AviInfoFramePtr->PixelRepetition);
#endif

return;
return;
}

if (HdmiRxSsVidStreamPtr->ColorFormatId == XVIDC_CSF_YCRCB_420) {
Expand Down
15 changes: 8 additions & 7 deletions hdmi/xilinx-hdmirx.c
Expand Up @@ -147,14 +147,15 @@ static const u8 xilinx_edid[] = {
0x58, 0x2C, 0x45, 0x00, 0x40, 0x84, 0x63, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x18,
0x4B, 0x0F, 0x8C, 0x3C, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFC,
0x00, 0x58, 0x49, 0x4C, 0x49, 0x4E, 0x58, 0x20, 0x48, 0x44, 0x4D, 0x49, 0x0A, 0x20, 0x01, 0x85,
0x02, 0x03, 0x37, 0xF0, 0x57, 0x61, 0x10, 0x1F, 0x04, 0x13, 0x05, 0x14, 0x20, 0x21, 0x22, 0x5D,

0x02, 0x03, 0x3B, 0xF1, 0x57, 0x61, 0x10, 0x1F, 0x04, 0x13, 0x05, 0x14, 0x20, 0x21, 0x22, 0x5D,
0x5E, 0x5F, 0x60, 0x65, 0x66, 0x62, 0x63, 0x64, 0x07, 0x16, 0x03, 0x12, 0x23, 0x09, 0x07, 0x07,
0x67, 0x03, 0x0C, 0x00, 0x10, 0x00, 0x78, 0x78, 0x67, 0xD8, 0x5D, 0xC4, 0x01, 0x78, 0xC0, 0x07,
0xE3, 0x0F, 0x01, 0xE0, 0xE2, 0x00, 0xCF, 0x02, 0x3A, 0x80, 0x18, 0x71, 0x38, 0x2D, 0x40, 0x58,
0x2C, 0x45, 0x00, 0x20, 0xC2, 0x31, 0x00, 0x00, 0x1E, 0x08, 0xE8, 0x00, 0x30, 0xF2, 0x70, 0x5A,
0x80, 0xB0, 0x58, 0x8A, 0x00, 0x20, 0xC2, 0x31, 0x00, 0x00, 0x1E, 0x04, 0x74, 0x00, 0x30, 0xF2,
0x70, 0x5A, 0x80, 0xB0, 0x58, 0x8A, 0x00, 0x20, 0x52, 0x31, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xAC
0x6B, 0x03, 0x0C, 0x00, 0x10, 0x00, 0x78, 0x3C, 0x20, 0x00, 0x20, 0x03, 0x67, 0xD8, 0x5D, 0xC4,
0x01, 0x78, 0x80, 0x07, 0xE3, 0x0F, 0x01, 0xE0, 0xE2, 0x00, 0xCF, 0x02, 0x3A, 0x80, 0x18, 0x71,
0x38, 0x2D, 0x40, 0x58, 0x2C, 0x45, 0x00, 0x20, 0xC2, 0x31, 0x00, 0x00, 0x1E, 0x08, 0xE8, 0x00,
0x30, 0xF2, 0x70, 0x5A, 0x80, 0xB0, 0x58, 0x8A, 0x00, 0x20, 0xC2, 0x31, 0x00, 0x00, 0x1E, 0x04,
0x74, 0x00, 0x30, 0xF2, 0x70, 0x5A, 0x80, 0xB0, 0x58, 0x8A, 0x00, 0x20, 0x52, 0x31, 0x00, 0x00,
0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xDC
};

static inline struct xhdmi_device *to_xhdmi(struct v4l2_subdev *subdev)
Expand Down

0 comments on commit f9994e8

Please sign in to comment.