XilinxProcessorIPLib/drivers/pciepsu/examples/xpciepsu_rc_enumerate_example.c
int PcieInitRootComplex(XPciePsu *PciePsuPtr, u16 DeviceId)
{
	int Status;

	const XPciePsu_Config *ConfigPtr;

	ConfigPtr = XPciePsu_LookupConfig(DeviceId);
	Xil_AssertNonvoid(ConfigPtr != NULL);

	if (ConfigPtr->PcieMode == XPCIEPSU_MODE_ENDPOINT) {
		xil_printf("Failed to initialize... PCIE PSU is configured"
							" as endpoint\r\n");
		return XST_FAILURE;
	}
	Status = XPciePsu_CfgInitialize(PciePsuPtr, ConfigPtr,
					ConfigPtr->BrigReg);

	if (Status != XST_SUCCESS) {
		xil_printf(
			"Failed to initialize PCIe Root Complex IP "
			"Instance\r\n");
		return XST_FAILURE;
	}

	return XST_SUCCESS;
}
/******************************************************************************/
/**
* This function initializes a PSU PCIe root complex.
*
* @param    PciePsuPtr is a pointer to an instance of XPciePsu data
*       structure represents a root complex.
* @param    DeviceId is PSU PCIe root complex unique ID
*
* @return   - XST_SUCCESS if successful.
*		- XST_FAILURE if unsuccessful.
*
* @note     None.
*
*
*******************************************************************************/
This function initializes a PSU PCIe root complex.
This function initializes a PSU PCIe root complex .
int PcieInitRootComplex(XPciePsu *PciePsuPtr, u16 DeviceId)
{
	int Status;
	const XPciePsu_Config *ConfigPtr;
	ConfigPtr = XPciePsu_LookupConfig(DeviceId);
	Xil_AssertNonvoid(ConfigPtr != NULL);
	if (ConfigPtr->PcieMode == XPCIEPSU_MODE_ENDPOINT) {
		xil_printf("Failed to initialize... PCIE PSU is configured"
							" as endpoint\r\n");
		return XST_FAILURE;
	}
	Status = XPciePsu_CfgInitialize(PciePsuPtr, ConfigPtr,
					ConfigPtr->BrigReg);
	if (Status != XST_SUCCESS) {
		xil_printf(
			"Failed to initialize PCIe Root Complex IP "
			"Instance\r\n");
		return XST_FAILURE;
	}
	return XST_SUCCESS;
}
int PcieInitRootComplex ( XPciePsu * PciePsuPtr , u16 DeviceId ) { int Status ; const XPciePsu_Config * ConfigPtr ; ConfigPtr = XPciePsu_LookupConfig ( DeviceId ) ; Xil_AssertNonvoid ( ConfigPtr != NULL ) ; if ( ConfigPtr -> PcieMode == XPCIEPSU_MODE_ENDPOINT ) { xil_printf ( " " " \r \n " ) ; return XST_FAILURE ; } Status = XPciePsu_CfgInitialize ( PciePsuPtr , ConfigPtr , ConfigPtr -> BrigReg ) ; if ( Status != XST_SUCCESS ) { xil_printf ( " " " \r \n " ) ; return XST_FAILURE ; } return XST_SUCCESS ; }
This function initializes a PSU PCIe root complex.
This function initializes a PSU PCIe root complex .