pciepsu: xpciepsu_rc_enumerate_example.c File Reference

| pciepsu Xilinx SDK Drivers API Documentation

- Overview
- APIs
- File List
- Examples

Functions
xpciepsu_rc_enumerate_example.c File Reference

## Overview

This file contains a design example for using PS PCIe root complex and its driver.

This is an example to show the usage of driver APIs which configures PS PCIe root complex.

The example initializes the PS PCIe root complex and shows how to enumerate the PCIe system.

This code will illustrate how the XPciePsu and its standalone driver can be used to:

- Initialize a PS PCIe root complex
- Enumerate PCIe end points in the system
- Assign BARs to endpoints
- find capablities on end point

Please note that this example enumerates and initializes PCIe end points only.

We tried to use as much of the driver's API calls as possible to show the reader how each call could be used and that probably made the example not the shortest way of doing the tasks shown as they could be done.

      MODIFICATION HISTORY:

      Ver   Who  Date     Changes

       1.0   BS  21/08              Initial version
    *

## Functions
int | PcieInitRootComplex (XPciePsu *PciePsuPtr, u16 DeviceId)
| This function initializes a PSU PCIe root complex. More...
int | main (void)
| This function is the entry point for PCIe Root Complex Enumeration Example. More...

## Function Documentation

int main | ( | void |  | ) |

This function is the entry point for PCIe Root Complex Enumeration Example.

Parameters

  None |

Returns
  - XST_SUCCESS if successful
  - XST_FAILURE if unsuccessful.

Note
  None.

References PcieInitRootComplex(), and XPciePsu_EnumerateBus().

int PcieInitRootComplex | ( | XPciePsu * | PciePsuPtr,
|  | u16 | DeviceId
| ) |  |

This function initializes a PSU PCIe root complex.

Parameters

  PciePsuPtr | is a pointer to an instance of XPciePsu data structure represents a root complex.
  DeviceId | is PSU PCIe root complex unique ID

Returns
  - XST_SUCCESS if successful.
  - XST_FAILURE if unsuccessful.

Note
  None.

References XPciePsu_CfgInitialize(), and XPciePsu_LookupConfig().

Referenced by main().