XilinxProcessorIPLib/drivers/dp14rxss/examples/src/rx_only/xdprxss_dp14_rx.c
u32 DpRxSs_SetupIntrSystem(void)
{
	u32 Status;
	XINTC *IntcInstPtr = &IntcInst;

	/* Set callbacks for all the interrupts */
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_PWR_CHG_EVENT,
			    DpRxSs_PowerChangeHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_NO_VID_EVENT,
			    DpRxSs_NoVideoHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_VBLANK_EVENT,
			    DpRxSs_VerticalBlankHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_TLOST_EVENT,
			    DpRxSs_TrainingLostHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_VID_EVENT,
			    DpRxSs_VideoHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_TDONE_EVENT,
			    DpRxSs_TrainingDoneHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_UNPLUG_EVENT,
			    DpRxSs_UnplugHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_LINKBW_EVENT,
			    DpRxSs_LinkBandwidthHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_PLL_RESET_EVENT,
			    DpRxSs_PllResetHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_BW_CHG_EVENT,
			    DpRxSs_BWChangeHandler, &DpRxSsInst);
//	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_ACCESS_LANE_SET_EVENT,
//			    DpRxSs_AccessLaneSetHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_ACCESS_LINK_QUAL_EVENT,
			    DpRxSs_AccessLinkQualHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst,
			    XDPRXSS_HANDLER_ACCESS_ERROR_COUNTER_EVENT,
			    DpRxSs_AccessErrorCounterHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_CRC_TEST_EVENT,
			    DpRxSs_CRCTestEventHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_INFO_PKT_EVENT,
			&DpRxSs_InfoPacketHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_EXT_PKT_EVENT,
			&DpRxSs_ExtPacketHandler, &DpRxSsInst);

	/* Set custom timer wait */
	XDpRxSs_SetUserTimerHandler(&DpRxSsInst, &CustomWaitUs, &TmrCtr);

#ifndef PLATFORM_MB
	/* The configuration parameters of the interrupt controller */
	XScuGic_Config *IntcConfig;

	/* Initialize the interrupt controller driver so that it is ready to
	 * use.
	 */
	IntcConfig = XScuGic_LookupConfig(XINTC_DEVICE_ID);
	if (NULL == IntcConfig) {
		return XST_FAILURE;
	}

	Status = XScuGic_CfgInitialize(IntcInstPtr, IntcConfig,
				       IntcConfig->CpuBaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	/* Connect the device driver handler that will be called when an
	 * interrupt for the device occurs, the handler defined above performs
	 * the specific interrupt processing for the device
	 */
	Status = XScuGic_Connect(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID,
				(Xil_InterruptHandler)XDpRxSs_DpIntrHandler,
				&DpRxSsInst);
	if (Status != XST_SUCCESS) {
		xil_printf("ERR: DP RX SS DP interrupt connect failed!\n\r");
		return XST_FAILURE;
	}
	/* Enable the interrupt for the DP device */
	XScuGic_Enable(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID);

#else

	/*
	 * Initialize the interrupt controller driver so that it's ready to use.
	 */
	Status = XIntc_Initialize(&IntcInst, XINTC_DEVICE_ID);

	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}

	Status = XIntc_Connect(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID, \
					(XInterruptHandler) XDpRxSs_DpIntrHandler, \
					&DpRxSsInst);
		if (Status != XST_SUCCESS) {
			xil_printf("ERR: DP RX SS DP interrupt connect failed!\n\r");
			return XST_FAILURE;
		}

			/*
			 * Start the interrupt controller so interrupts are enabled for all
			 * devices that cause interrupts.
			 */
			Status = XIntc_Start(IntcInstPtr, XIN_REAL_MODE);
			if (Status != XST_SUCCESS) {
				return XST_FAILURE;
			}

		/* Enable the interrupt for the DP device */
		XIntc_Enable(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID);
#endif

	/* Initialize the exception table. */
	Xil_ExceptionInit();

	/* Register the interrupt controller handler with the
	 * exception table.
	 */
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				     (Xil_ExceptionHandler)XINTC_HANDLER,
				     IntcInstPtr);

	/* Enable exceptions. */
	Xil_ExceptionEnable();

	return (XST_SUCCESS);
}
/*****************************************************************************/
/**
*
* This function sets up the interrupt system so interrupts can occur for the
* DisplayPort RX Subsystem core. The function is application-specific since
* the actual system may or may not have an interrupt controller. The DPRX
* Subsystem core could be directly connected to a processor without an
* interrupt controller. The user should modify this function to fit the
* application.
*
* @param    None
*
* @return
*        - XST_SUCCESS if interrupt setup was successful.
*        - A specific error code defined in "xstatus.h" if an error
*        occurs.
*
* @note        None.
*
******************************************************************************/
This function sets up the interrupt system so interrupts can occur for the
DisplayPort RX Subsystem core. The function is application-specific since
the actual system may or may not have an interrupt controller. The DPRX
Subsystem core could be directly connected to a processor without an
interrupt controller. The user should modify this function to fit the
application.
This function sets up the interrupt system so interrupts can occur for the DisplayPort RX Subsystem core . The function is application - specific since the actual system may or may not have an interrupt controller . The DPRX Subsystem core could be directly connected to a processor without an interrupt controller . The user should modify this function to fit the application .
u32 DpRxSs_SetupIntrSystem(void)
{
	u32 Status;
	XINTC *IntcInstPtr = &IntcInst;
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_PWR_CHG_EVENT,
			    DpRxSs_PowerChangeHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_NO_VID_EVENT,
			    DpRxSs_NoVideoHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_VBLANK_EVENT,
			    DpRxSs_VerticalBlankHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_TLOST_EVENT,
			    DpRxSs_TrainingLostHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_VID_EVENT,
			    DpRxSs_VideoHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_TDONE_EVENT,
			    DpRxSs_TrainingDoneHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_UNPLUG_EVENT,
			    DpRxSs_UnplugHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_LINKBW_EVENT,
			    DpRxSs_LinkBandwidthHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_PLL_RESET_EVENT,
			    DpRxSs_PllResetHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_BW_CHG_EVENT,
			    DpRxSs_BWChangeHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_ACCESS_LINK_QUAL_EVENT,
			    DpRxSs_AccessLinkQualHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst,
			    XDPRXSS_HANDLER_ACCESS_ERROR_COUNTER_EVENT,
			    DpRxSs_AccessErrorCounterHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_CRC_TEST_EVENT,
			    DpRxSs_CRCTestEventHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_INFO_PKT_EVENT,
			&DpRxSs_InfoPacketHandler, &DpRxSsInst);
	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_DP_EXT_PKT_EVENT,
			&DpRxSs_ExtPacketHandler, &DpRxSsInst);
	XDpRxSs_SetUserTimerHandler(&DpRxSsInst, &CustomWaitUs, &TmrCtr);
#ifndef PLATFORM_MB
	XScuGic_Config *IntcConfig;
	IntcConfig = XScuGic_LookupConfig(XINTC_DEVICE_ID);
	if (NULL == IntcConfig) {
		return XST_FAILURE;
	}
	Status = XScuGic_CfgInitialize(IntcInstPtr, IntcConfig,
				       IntcConfig->CpuBaseAddress);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XScuGic_Connect(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID,
				(Xil_InterruptHandler)XDpRxSs_DpIntrHandler,
				&DpRxSsInst);
	if (Status != XST_SUCCESS) {
		xil_printf("ERR: DP RX SS DP interrupt connect failed!\n\r");
		return XST_FAILURE;
	}
	XScuGic_Enable(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID);
#else
	Status = XIntc_Initialize(&IntcInst, XINTC_DEVICE_ID);
	if (Status != XST_SUCCESS) {
		return XST_FAILURE;
	}
	Status = XIntc_Connect(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID, \
					(XInterruptHandler) XDpRxSs_DpIntrHandler, \
					&DpRxSsInst);
		if (Status != XST_SUCCESS) {
			xil_printf("ERR: DP RX SS DP interrupt connect failed!\n\r");
			return XST_FAILURE;
		}
			Status = XIntc_Start(IntcInstPtr, XIN_REAL_MODE);
			if (Status != XST_SUCCESS) {
				return XST_FAILURE;
			}
		XIntc_Enable(IntcInstPtr, XINTC_DPRXSS_DP_INTERRUPT_ID);
#endif
	Xil_ExceptionInit();
	Xil_ExceptionRegisterHandler(XIL_EXCEPTION_ID_INT,
				     (Xil_ExceptionHandler)XINTC_HANDLER,
				     IntcInstPtr);
	Xil_ExceptionEnable();
	return (XST_SUCCESS);
}
u32 DpRxSs_SetupIntrSystem ( void ) { u32 Status ; XINTC * IntcInstPtr = & IntcInst ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_PWR_CHG_EVENT , DpRxSs_PowerChangeHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_NO_VID_EVENT , DpRxSs_NoVideoHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_VBLANK_EVENT , DpRxSs_VerticalBlankHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_TLOST_EVENT , DpRxSs_TrainingLostHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_VID_EVENT , DpRxSs_VideoHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_TDONE_EVENT , DpRxSs_TrainingDoneHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_UNPLUG_EVENT , DpRxSs_UnplugHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_LINKBW_EVENT , DpRxSs_LinkBandwidthHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_PLL_RESET_EVENT , DpRxSs_PllResetHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_BW_CHG_EVENT , DpRxSs_BWChangeHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_ACCESS_LINK_QUAL_EVENT , DpRxSs_AccessLinkQualHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_ACCESS_ERROR_COUNTER_EVENT , DpRxSs_AccessErrorCounterHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_CRC_TEST_EVENT , DpRxSs_CRCTestEventHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_INFO_PKT_EVENT , & DpRxSs_InfoPacketHandler , & DpRxSsInst ) ; XDpRxSs_SetCallBack ( & DpRxSsInst , XDPRXSS_HANDLER_DP_EXT_PKT_EVENT , & DpRxSs_ExtPacketHandler , & DpRxSsInst ) ; XDpRxSs_SetUserTimerHandler ( & DpRxSsInst , & CustomWaitUs , & TmrCtr ) ; #ifndef PLATFORM_MB XScuGic_Config * IntcConfig ; IntcConfig = XScuGic_LookupConfig ( XINTC_DEVICE_ID ) ; if ( NULL == IntcConfig ) { return XST_FAILURE ; } Status = XScuGic_CfgInitialize ( IntcInstPtr , IntcConfig , IntcConfig -> CpuBaseAddress ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XScuGic_Connect ( IntcInstPtr , XINTC_DPRXSS_DP_INTERRUPT_ID , ( Xil_InterruptHandler ) XDpRxSs_DpIntrHandler , & DpRxSsInst ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \n \r " ) ; return XST_FAILURE ; } XScuGic_Enable ( IntcInstPtr , XINTC_DPRXSS_DP_INTERRUPT_ID ) ; #else Status = XIntc_Initialize ( & IntcInst , XINTC_DEVICE_ID ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } Status = XIntc_Connect ( IntcInstPtr , XINTC_DPRXSS_DP_INTERRUPT_ID , ( XInterruptHandler ) XDpRxSs_DpIntrHandler , & DpRxSsInst ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " \n \r " ) ; return XST_FAILURE ; } Status = XIntc_Start ( IntcInstPtr , XIN_REAL_MODE ) ; if ( Status != XST_SUCCESS ) { return XST_FAILURE ; } XIntc_Enable ( IntcInstPtr , XINTC_DPRXSS_DP_INTERRUPT_ID ) ; #endif Xil_ExceptionInit ( ) ; Xil_ExceptionRegisterHandler ( XIL_EXCEPTION_ID_INT , ( Xil_ExceptionHandler ) XINTC_HANDLER , IntcInstPtr ) ; Xil_ExceptionEnable ( ) ; return ( XST_SUCCESS ) ; }
This function sets up the interrupt system so interrupts can occur for the
DisplayPort RX Subsystem core.
This function sets up the interrupt system so interrupts can occur for the DisplayPort RX Subsystem core .
/* Set callbacks for all the interrupts */ //	XDpRxSs_SetCallBack(&DpRxSsInst, XDPRXSS_HANDLER_ACCESS_LANE_SET_EVENT, //			    DpRxSs_AccessLaneSetHandler, &DpRxSsInst); /* Set custom timer wait */ /* The configuration parameters of the interrupt controller */ /* Initialize the interrupt controller driver so that it is ready to
	 * use.
	 */ /* Connect the device driver handler that will be called when an
	 * interrupt for the device occurs, the handler defined above performs
	 * the specific interrupt processing for the device
	 */ /* Enable the interrupt for the DP device */ /*
	 * Initialize the interrupt controller driver so that it's ready to use.
	 */ /*
			 * Start the interrupt controller so interrupts are enabled for all
			 * devices that cause interrupts.
			 */ /* Enable the interrupt for the DP device */ /* Initialize the exception table. */ /* Register the interrupt controller handler with the
	 * exception table.
	 */ /* Enable exceptions. */