Logo SoCRocket

Transaction-Level Modeling Framework for Space Applications

Classes | Macros | Functions
pcitest.c File Reference
#include "pcitest.h"
Include dependency graph for pcitest.c:

Classes

struct  LEON3_GRPCI_Regs_Map
 
struct  pci_res
 

Macros

#define DBG(x...)
 
#define PCI_CONFIG_ADDR   0xcf8
 
#define PCI_CONFIG_DATA   0xcfc
 
#define PCI_INVALID_VENDORDEVICEID   0xffffffff
 
#define PCI_MULTI_FUNCTION   0x80
 

Functions

int pci_read_config_dword (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned int *val)
 
int pci_read_config_word (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned short *val)
 
int pci_read_config_byte (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned char *val)
 
int pci_write_config_dword (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned int val)
 
int pci_write_config_word (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned short val)
 
int pci_write_config_byte (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, unsigned char val)
 
void init_grpci (void)
 
void pci_mem_enable (unsigned char bus, unsigned char slot, unsigned char function)
 
void pci_master_enable (unsigned char bus, unsigned char slot, unsigned char function)
 
void pci_allocate_resources (void)
 
void init_pci ()
 
int pci_test (int apbaddr, int ioaddr, int ahbaddr)
 

Macro Definition Documentation

#define DBG (   x...)

Referenced by pci_allocate_resources().

#define PCI_CONFIG_ADDR   0xcf8
#define PCI_CONFIG_DATA   0xcfc
#define PCI_INVALID_VENDORDEVICEID   0xffffffff

Referenced by pci_allocate_resources().

#define PCI_MULTI_FUNCTION   0x80

Referenced by pci_allocate_resources().

Function Documentation

void init_grpci ( void  )

References LEON3_GRPCI_Regs_Map::cfg_stat, page0, LEON3_GRPCI_Regs_Map::page1, pci_read_config_dword(), and pci_write_config_dword().

Referenced by init_pci().

Here is the call graph for this function:

void init_pci ( )

References init_grpci(), and pci_allocate_resources().

Referenced by pci_test().

Here is the call graph for this function:

void pci_allocate_resources ( void  )

References pci_res::bar, DBG, func, i, PCI_BASE_ADDRESS_0, PCI_CLASS_BRIDGE_PCI, PCI_CLASS_REVISION, PCI_HEADER_TYPE, PCI_INVALID_VENDORDEVICEID, PCI_MAX_DEVICES, PCI_MAX_FUNCTIONS, pci_mem_enable(), PCI_MULTI_FUNCTION, pci_read_config_byte(), pci_read_config_dword(), PCI_VENDOR_ID, pci_write_config_dword(), and pci_res::size.

Referenced by init_pci().

Here is the call graph for this function:

void pci_master_enable ( unsigned char  bus,
unsigned char  slot,
unsigned char  function 
)

References PCI_COMMAND, PCI_COMMAND_MASTER, pci_read_config_dword(), and pci_write_config_dword().

Here is the call graph for this function:

void pci_mem_enable ( unsigned char  bus,
unsigned char  slot,
unsigned char  function 
)

References PCI_COMMAND, PCI_COMMAND_MEMORY, pci_read_config_dword(), and pci_write_config_dword().

Referenced by pci_allocate_resources().

Here is the call graph for this function:

int pci_read_config_byte ( unsigned char  bus,
unsigned char  slot,
unsigned char  function,
unsigned char  offset,
unsigned char val 
)

References pci_read_config_dword(), and PCIBIOS_SUCCESSFUL.

Referenced by pci_allocate_resources().

Here is the call graph for this function:

int pci_read_config_dword ( unsigned char  bus,
unsigned char  slot,
unsigned char  function,
unsigned char  offset,
unsigned int val 
)
int pci_read_config_word ( unsigned char  bus,
unsigned char  slot,
unsigned char  function,
unsigned char  offset,
unsigned short *  val 
)

References pci_read_config_dword(), PCIBIOS_BAD_REGISTER_NUMBER, and PCIBIOS_SUCCESSFUL.

Here is the call graph for this function:

int pci_test ( int  apbaddr,
int  ioaddr,
int  ahbaddr 
)

References init_pci(), and report_device().

Here is the call graph for this function:

int pci_write_config_byte ( unsigned char  bus,
unsigned char  slot,
unsigned char  function,
unsigned char  offset,
unsigned char  val 
)

References pci_read_config_dword(), and pci_write_config_dword().

Here is the call graph for this function:

int pci_write_config_dword ( unsigned char  bus,
unsigned char  slot,
unsigned char  function,
unsigned char  offset,
unsigned int  val 
)
int pci_write_config_word ( unsigned char  bus,
unsigned char  slot,
unsigned char  function,
unsigned char  offset,
unsigned short  val 
)

References pci_read_config_dword(), pci_write_config_dword(), and PCIBIOS_BAD_REGISTER_NUMBER.

Here is the call graph for this function: