pciepsu
Vitis Drivers API Documentation
xpciepsu_ep.c File Reference

Overview

Implements all of functions for psu_pci IP EndPoint driver.

MODIFICATION HISTORY:
Ver   Who  Date     Changes


1.0 tk 02/13/2019 First release

Functions

void XPciePsu_EP_CfgInitialize (XPciePsu *PciePsuPtr, const XPciePsu_Config *ConfigPtr)
 This function initializes the config space. More...
 
void XPciePsu_EP_BridgeInitialize (XPciePsu *PciePsuPtr)
 This function initializes PCIe bridge. More...
 
void XPciePsu_Egress_EP_BridgeInitialize (XPciePsu *PciePsuPtr)
 This function initializes Egress PCIe bridge. More...
 
void XPciePsu_EP_WaitForLinkup (XPciePsu *PciePsuPtr)
 This function waits for Pcie link to come up. More...
 
void XPciePsu_EP_WaitForEnumeration (XPciePsu *PciePsuPtr)
 This function waits for host to enumerate. More...
 
void Do_Egress_Test (u32 *egress_src_lo)
 This function does Egress test. More...
 
int XPciePsu_EP_SetupIngress (XPciePsu *PciePsuPtr, u32 IngressNum, u32 BarNum, u64 Dst)
 This function sets up ingress translation. More...
 
int XPciePsu_EP_SetupEgress (XPciePsu *PciePsuPtr, u32 EgressNum)
 This function sets up Egress translation. More...
 

Function Documentation

void Do_Egress_Test ( u32 *  egress_src_lo)

This function does Egress test.

Parameters
egresssource address

Referenced by XPciePsu_EP_SetupEgress().

void XPciePsu_Egress_EP_BridgeInitialize ( XPciePsu *  PciePsuPtr)

This function initializes Egress PCIe bridge.

Parameters
PciePsuPtrpointer to XPciePsu Instance Pointer

References XPciePsu_ReadReg(), and XPciePsu_WriteReg().

Referenced by main().

void XPciePsu_EP_BridgeInitialize ( XPciePsu *  PciePsuPtr)

This function initializes PCIe bridge.

Parameters
PciePsuPtrpointer to XPciePsu Instance Pointer

References XPciePsu_ReadReg(), and XPciePsu_WriteReg().

void XPciePsu_EP_CfgInitialize ( XPciePsu *  PciePsuPtr,
const XPciePsu_Config *  ConfigPtr 
)

This function initializes the config space.

Parameters
PciePsuPtrpointer to XPciePsu Instance Pointer
ConfigPtrpointer to XPciePsu_Config instrance Pointer.
Returns
XST_SUCCESS on success err on failure

Referenced by XPciePsu_InitEndPoint().

int XPciePsu_EP_SetupEgress ( XPciePsu *  PciePsuPtr,
u32  EgressNum 
)

This function sets up Egress translation.

Parameters
PciePsuPtrpointer to XPciePsu_Config Instance Pointer
EgressNumingress must be 0 to 7
Returns
XST_SUCCESS if setup is successful XST_FAILURE if setup is fail

References Do_Egress_Test(), XPciePsu_ReadReg(), and XPciePsu_WriteReg().

Referenced by main().

int XPciePsu_EP_SetupIngress ( XPciePsu *  PciePsuPtr,
u32  IngressNum,
u32  BarNum,
u64  Dst 
)

This function sets up ingress translation.

Parameters
PciePsuPtrpointer to XPciePsu_Config Instance Pointer
IngressNumingress must be 0 to 7
BarNumbar no to setup ingress
Dst32 or 64 bit destination address
Returns
XST_SUCCESS if setup is successful XST_FAILURE if setup is fail

References XPciePsu_ReadReg(), and XPciePsu_WriteReg().

void XPciePsu_EP_WaitForEnumeration ( XPciePsu *  PciePsuPtr)

This function waits for host to enumerate.

On x86 BIOS sets memory enable bit On ARM64 it is set when driver gets inserted

Parameters
PciePsuPtrpointer to XPciePsu_Config Instance Pointer

References XPciePsu_ReadReg().

void XPciePsu_EP_WaitForLinkup ( XPciePsu *  PciePsuPtr)

This function waits for Pcie link to come up.

Parameters
PciePsuPtrpointer to XPciePsu_Config Instance Pointer

References XPciePsu_ReadReg().

Referenced by main().