RTEMS 7.0-rc1
Loading...
Searching...
No Matches
Data Structures | Macros | Functions | Variables
pci.c File Reference

Basic PCI I/O functions. More...

#include <rtems.h>
#include <bsp.h>
#include <libcpu/io.h>
#include <bsp/pci.h>
#include <rtems/bspIo.h>

Data Structures

struct  pcibridge
 

Macros

#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()
 

Functions

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)
 

Variables

unsigned char ucMaxPCIBus
 
const pci_config_access_functions pci_indirect_functions
 
rtems_pci_config_t BSP_pci_configuration
 
const pci_config_access_functions pci_direct_functions
 

Detailed Description

Basic PCI I/O functions.

This code is heavily inspired by the public specification of STREAM V2 that can be found at:

Macro Definition Documentation

◆ PRINT_MSG

#define PRINT_MSG ( )
Value:
printk("pci : Device %d:0x%02x:%d routed to interrupt_line %d\n", \
pbus, pslot, pfun, int_name )

Variable Documentation

◆ BSP_pci_configuration

rtems_pci_config_t BSP_pci_configuration
Initial value:
= {
(volatile unsigned char*)PCI_CONFIG_ADDR,
(volatile unsigned char*)PCI_CONFIG_DATA,
&pci_indirect_functions
}

◆ pci_direct_functions

const pci_config_access_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

const pci_config_access_functions 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
}