diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp.h b/XilinxProcessorIPLib/drivers/dp/src/xdp.h index 6d826f95..de7535cc 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp.h +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp.h @@ -762,6 +762,18 @@ typedef struct { passed to the training pattern 3 callback function. */ + XDp_IntrHandler IntrDownReqHandler; /**< Callback function for down + request interrupts. */ + void *IntrDownReqCallbackRef; /**< A pointer to the user data + passed to the down + request callback + function. */ + XDp_IntrHandler IntrDownReplyHandler; /**< Callback function for down + reply interrupts. */ + void *IntrDownReplyCallbackRef; /**< A pointer to the user data + passed to the down + reply callback + function. */ } XDp_Rx; /** @@ -894,6 +906,10 @@ void XDp_RxSetIntrTp2Handler(XDp *InstancePtr, XDp_IntrHandler CallbackFunc, void *CallbackRef); void XDp_RxSetIntrTp3Handler(XDp *InstancePtr, XDp_IntrHandler CallbackFunc, void *CallbackRef); +void XDp_RxSetIntrDownReqHandler(XDp *InstancePtr, + XDp_IntrHandler CallbackFunc, void *CallbackRef); +void XDp_RxSetIntrDownReplyHandler(XDp *InstancePtr, + XDp_IntrHandler CallbackFunc, void *CallbackRef); /* xdp_mst.c: Multi-stream transport (MST) functions for enabling or disabling * MST mode. */ diff --git a/XilinxProcessorIPLib/drivers/dp/src/xdp_intr.c b/XilinxProcessorIPLib/drivers/dp/src/xdp_intr.c index 8ec4434e..83f34d4d 100644 --- a/XilinxProcessorIPLib/drivers/dp/src/xdp_intr.c +++ b/XilinxProcessorIPLib/drivers/dp/src/xdp_intr.c @@ -592,6 +592,62 @@ void XDp_RxSetIntrTp3Handler(XDp *InstancePtr, InstancePtr->RxInstance.IntrTp3CallbackRef = CallbackRef; } +/******************************************************************************/ +/** + * This function installs a callback function for when a down request interrupt + * occurs. + * + * @param InstancePtr is a pointer to the XDp instance. + * @param CallbackFunc is the address to the callback function. + * @param CallbackRef is the user data item that will be passed to the + * callback function when it is invoked. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ +void XDp_RxSetIntrDownReqHandler(XDp *InstancePtr, + XDp_IntrHandler CallbackFunc, void *CallbackRef) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX); + Xil_AssertVoid(CallbackFunc != NULL); + Xil_AssertVoid(CallbackRef != NULL); + + InstancePtr->RxInstance.IntrDownReqHandler = CallbackFunc; + InstancePtr->RxInstance.IntrDownReqCallbackRef = CallbackRef; +} + +/******************************************************************************/ +/** + * This function installs a callback function for when a down reply interrupt + * occurs. + * + * @param InstancePtr is a pointer to the XDp instance. + * @param CallbackFunc is the address to the callback function. + * @param CallbackRef is the user data item that will be passed to the + * callback function when it is invoked. + * + * @return None. + * + * @note None. + * +*******************************************************************************/ +void XDp_RxSetIntrDownReplyHandler(XDp *InstancePtr, + XDp_IntrHandler CallbackFunc, void *CallbackRef) +{ + /* Verify arguments. */ + Xil_AssertVoid(InstancePtr != NULL); + Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX); + Xil_AssertVoid(CallbackFunc != NULL); + Xil_AssertVoid(CallbackRef != NULL); + + InstancePtr->RxInstance.IntrDownReplyHandler = CallbackFunc; + InstancePtr->RxInstance.IntrDownReplyCallbackRef = CallbackRef; +} + /******************************************************************************/ /** * This function is the interrupt handler for the XDp driver operating in TX @@ -738,4 +794,10 @@ static void XDp_RxInterruptHandler(XDp *InstancePtr) InstancePtr->RxInstance.IntrExtPktHandler( InstancePtr->RxInstance.IntrExtPktCallbackRef); } + + /* The TX has issued a down request; a sideband message is ready. */ + if (IntrStatus & XDP_RX_INTERRUPT_CAUSE_DOWN_REQUEST_MASK) { + InstancePtr->RxInstance.IntrDownReqHandler( + InstancePtr->RxInstance.IntrDownReqCallbackRef); + } }