Basic PCI I/O functions.
More...
#include <rtems.h>
#include <bsp.h>
#include <libcpu/io.h>
#include <bsp/pci.h>
#include <rtems/bspIo.h>
|
|
#define | PCI_CONFIG_ADDR 0xcf8 |
| |
|
#define | PCI_CONFIG_DATA 0xcfc |
| |
|
#define | pci BSP_pci_configuration |
| |
|
#define | PCI_CONFIG_ADDR_VAL(bus, slot, funcion, offset) (0x80<<24|((bus)<<16)|(PCI_DEVFN((slot),(function))<<8)|(((offset)&~3))) |
| |
|
#define | PCI_CONFIG_WR_ADDR(addr, val) out_le32((volatile uint32_t*)(addr), (val)) |
| |
|
#define | PCI_CONFIG_SET_ADDR(addr, bus, slot, function, offset) PCI_CONFIG_WR_ADDR((addr), PCI_CONFIG_ADDR_VAL((bus), (slot), (function), (offset))) |
| |
| #define | PRINT_MSG() |
| |
|
|
void | detect_host_bridge (void) |
| |
|
void | FixupPCI (const struct _int_map *bspmap, int(*swizzler)(int, int)) |
| |
|
int | pci_initialize (void) |
| |
|
unsigned char | pci_bus_count (void) |
| |
Basic PCI I/O functions.
This code is heavily inspired by the public specification of STREAM V2 that can be found at:
◆ PRINT_MSG
Value: printk("pci : Device %d:0x%02x:%d routed to interrupt_line %d\n", \
pbus, pslot, pfun, int_name )
◆ BSP_pci_configuration
Initial value:= {
(volatile unsigned char*)PCI_CONFIG_ADDR,
(volatile unsigned char*)PCI_CONFIG_DATA,
&pci_indirect_functions
}
◆ pci_direct_functions
Initial value:= {
direct_pci_read_config_byte,
direct_pci_read_config_word,
direct_pci_read_config_dword,
direct_pci_write_config_byte,
direct_pci_write_config_word,
direct_pci_write_config_dword
}
◆ pci_indirect_functions
Initial value:= {
indirect_pci_read_config_byte,
indirect_pci_read_config_word,
indirect_pci_read_config_dword,
indirect_pci_write_config_byte,
indirect_pci_write_config_word,
indirect_pci_write_config_dword
}