diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp_hw.h b/XilinxProcessorIPLib/drivers/dp/src/xdp_hw.h index b8312b00..aba6ceb4 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp_hw.h +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp_hw.h @@ -2388,6 +2388,21 @@ #define XDP_SBMSG_QUERY_STREAM_ENCRYPT_STATUS 0x38 /* @} */ +/** @name Sideband message codes when the driver is in MST mode. + * @{ + */ +#define XDP_SBMSG_NAK_REASON_WRITE_FAILURE 0x01 +#define XDP_SBMSG_NAK_REASON_INVALID_RAD 0x02 +#define XDP_SBMSG_NAK_REASON_CRC_FAILURE 0x03 +#define XDP_SBMSG_NAK_REASON_BAD_PARAM 0x04 +#define XDP_SBMSG_NAK_REASON_DEFER 0x05 +#define XDP_SBMSG_NAK_REASON_LINK_FAILURE 0x06 +#define XDP_SBMSG_NAK_REASON_NO_RESOURCES 0x07 +#define XDP_SBMSG_NAK_REASON_DPCD_FAIL 0x08 +#define XDP_SBMSG_NAK_REASON_I2C_NAK 0x09 +#define XDP_SBMSG_NAK_REASON_ALLOCATE_FAIL 0x0A +/* @} */ + #define XDP_RX_NUM_I2C_ENTRIES_PER_PORT 3 /**< The number of I2C user- defined entries in the I2C map of each port. */ diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c b/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c index a789a3bd..7f940b59 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp_mst.c @@ -152,6 +152,7 @@ static void XDp_RxSetLinkAddressReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); static void XDp_RxSetClearPayloadIdReply(XDp_SidebandMsg *Msg); static void XDp_RxSetAllocPayloadReply(XDp_SidebandMsg *Msg); static void XDp_RxSetEnumPathResReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); +static void XDp_RxSetGenericNackReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); static u32 XDp_RxSetRemoteDpcdReadReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); static u32 XDp_RxSetRemoteIicReadReply(XDp *InstancePtr, XDp_SidebandMsg *Msg); static void XDp_RxDeviceInfoToRawData(XDp *InstancePtr, XDp_SidebandMsg *Msg); @@ -2360,6 +2361,7 @@ u32 XDp_RxHandleDownReq(XDp *InstancePtr) break; default: + XDp_RxSetGenericNackReply(InstancePtr, &Msg); break; } @@ -2875,6 +2877,46 @@ static u32 XDp_RxSetRemoteIicReadReply(XDp *InstancePtr, XDp_SidebandMsg *Msg) return XST_SUCCESS; } + +/******************************************************************************/ +/** + * This function will set and format a sideband message structure for replying + * with a NAK + * + * @param Msg is a pointer to the message to be formatted. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ +static void XDp_RxSetGenericNackReply(XDp *InstancePtr, XDp_SidebandMsg *Msg) +{ + u8 ReplyIndex = 0; + u8 GuidIndex; + + Msg->Header.LinkCountTotal = 1; + Msg->Header.LinkCountRemaining = 0; + Msg->Header.BroadcastMsg = 0; + Msg->Header.PathMsg = 0; + Msg->Header.MsgHeaderLength = 3; + + /* Reply type for NACK. */ + Msg->Body.MsgData[ReplyIndex++] |= (1 << 7); + /* 16 bytes of GUID. */ + for (GuidIndex = 0; GuidIndex < 16; GuidIndex++) { + Msg->Body.MsgData[ReplyIndex++] = (0xFF & + (InstancePtr->RxInstance.Topology.LinkAddressInfo.Guid[ + GuidIndex / 4] >> (8 * (3 - (GuidIndex % 4))))); + } + /* Reason for NACK. */ + Msg->Body.MsgData[ReplyIndex++] = XDP_SBMSG_NAK_REASON_WRITE_FAILURE; + /* NACK Data */ + Msg->Body.MsgData[ReplyIndex++] = 0x00; + + Msg->Body.MsgDataLength = ReplyIndex; +} + /******************************************************************************/ /** * This function will set and format a sideband message structure for replying