Transaction-Level Modeling Framework for Space Applications
#include "pcitest.h"
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) |
#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().
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().
void init_pci | ( | ) |
References init_grpci(), and pci_allocate_resources().
Referenced by pci_test().
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().
References PCI_COMMAND, PCI_COMMAND_MASTER, pci_read_config_dword(), and pci_write_config_dword().
References PCI_COMMAND, PCI_COMMAND_MEMORY, pci_read_config_dword(), and pci_write_config_dword().
Referenced by pci_allocate_resources().
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().
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.
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().
int pci_write_config_dword | ( | unsigned char | bus, |
unsigned char | slot, | ||
unsigned char | function, | ||
unsigned char | offset, | ||
unsigned int | val | ||
) |
References PCIBIOS_BAD_REGISTER_NUMBER, and PCIBIOS_SUCCESSFUL.
Referenced by init_grpci(), pci_allocate_resources(), pci_master_enable(), pci_mem_enable(), pci_write_config_byte(), and pci_write_config_word().
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.