/** * This function will setup and initialize the DisplayPort RX core. The core's * configuration parameters will be retrieved based on the configuration * to the DisplayPort RX core instance with the specified device ID. * * @param InstancePtr is a pointer to the XDp instance. * @param DeviceId is the unique device ID of the DisplayPort RX core * instance. * * @return * - XST_SUCCESS if the device configuration was found and obtained * and if the main link was successfully established. * - XST_FAILURE otherwise. * * @note None. * *******************************************************************************/ static u32 Dprx_SetupExample(XDp *InstancePtr, u16 DeviceId) { XDp_Config *ConfigPtr; u32 Status; /* Obtain the device configuration for the DisplayPort RX core. */ ConfigPtr = XDp_LookupConfig(DeviceId); if (!ConfigPtr) { return XST_FAILURE; } /* Copy the device configuration into the InstancePtr's Config * structure. */ XDp_CfgInitialize(InstancePtr, ConfigPtr, ConfigPtr->BaseAddr); XDp_RxSetLaneCount(InstancePtr, InstancePtr->Config.MaxLaneCount); XDp_RxSetLinkRate(InstancePtr, InstancePtr->Config.MaxLinkRate); /* Initialize the DisplayPort RX core. */ Status = XDp_Initialize(InstancePtr); if (Status != XST_SUCCESS) { return XST_FAILURE; } return XST_SUCCESS; }
/** * The main entry point for the selftest example using the XDp driver. This * function will check whether or not the DisplayPort TX's registers are at * their default reset values to ensure that the core is in a known and working * state. * * @param InstancePtr is a pointer to the XDp instance. * @param DeviceId is the unique device ID of the DisplayPort TX core * instance. * * @return * - XST_SUCCESS if the DisplayPort TX's registers are at their * default reset values. * - XST_FAILURE if the DisplayPort TX's registers do not match * their default values or no DisplayPort TX instance was found. * * @note None. * *******************************************************************************/ u32 Dp_SelfTestExample(XDp *InstancePtr, u16 DeviceId) { u32 Status; XDp_Config *ConfigPtr; /* Obtain the device configuration for the DisplayPort TX core. */ ConfigPtr = XDp_LookupConfig(DeviceId); if (!ConfigPtr) { return XST_FAILURE; } /* Copy the device configuration into the InstancePtr's Config * structure. */ XDp_CfgInitialize(InstancePtr, ConfigPtr, ConfigPtr->BaseAddr); /* Run the self test. */ Status = XDp_SelfTest(InstancePtr); return Status; }