RTEMS: bsps/mips/malta/pci/pci.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Macros | Functions | Variables
pci.c File Reference
`#include <rtems.h>`
`#include <bsp.h>`
`#include <bsp/pci.h>`
`#include <bsp/irq.h>`
`#include <rtems/bspIo.h>`
`#include <rtems/endian.h>`

## 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) (0x80000000|((bus)<<16)|(PCI_DEVFN((slot),(function))<<8)|(((offset)&~3)))
#define | JPRINTK(fmt, ...)
#define | PCI_CONFIG_WR_ADDR(addr, val) out_le32((uint32_t)(addr), (val))
#define | PCI_CONFIG_SET_ADDR(addr, bus, slot, function, offset)
#define | PRINT_MSG()

## Functions
void | print_bars (unsigned char slot, unsigned char func)
int | direct_pci_read_config_byte (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint8_t *val)
int | direct_pci_read_config_word (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint16_t *val)
int | direct_pci_read_config_dword (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint32_t *val)
int | direct_pci_write_config_byte (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint8_t val)
int | direct_pci_write_config_word (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint16_t val)
int | direct_pci_write_config_dword (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint32_t val)
int | test_intname (const struct _int_map *row, int pbus, int pslot, int pfun, int int_pin, int int_name)
void | pci_memory_enable (unsigned char bus, unsigned char slot, unsigned char function)
void | pci_io_enable (unsigned char bus, unsigned char slot, unsigned char function)
void | pci_busmaster_enable (unsigned char bus, unsigned char slot, unsigned char function)
void | pci_out_32 (uint32_t base, uint32_t addr, uint32_t val)
void | pci_out_le32 (uint32_t base, uint32_t addr, uint32_t val)
uint8_t | pci_in_8 (uint32_t base, uint32_t addr)
int16_t | pci_in_le16 (uint32_t base, uint32_t addr)
int16_t | pci_in_16 (uint32_t base, uint32_t addr)
uint32_t | pci_in_32 (uint32_t base, uint32_t addr)
uint32_t | pci_in_le32 (uint32_t base, uint32_t addr)
void | pci_out_8 (uint32_t base, uint32_t addr, uint8_t val)
void | pci_out_le16 (uint32_t base, uint32_t addr, uint16_t val)
void | pci_out_16 (uint32_t base, uint32_t addr, uint16_t val)
int | indirect_pci_read_config_byte (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint8_t *val)
int | indirect_pci_read_config_word (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint16_t *val)
int | indirect_pci_read_config_dword (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint32_t *val)
int | indirect_pci_write_config_byte (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint8_t val)
int | indirect_pci_write_config_word (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint16_t val)
int | indirect_pci_write_config_dword (unsigned char bus, unsigned char slot, unsigned char function, unsigned char offset, uint32_t val)
int | FindPCIbridge (int mybus, struct pcibridge *pb)
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

This file was based on the powerpc.

## Macro Definition Documentation

## ◆ PCI_CONFIG_SET_ADDR

#define PCI_CONFIG_SET_ADDR | ( |  | addr,
|  |  | bus,
|  |  | slot,
|  |  | function,
|  |  | offset
| ) |  |

Value:
PCI_CONFIG_WR_ADDR( \
(addr), \
PCI_CONFIG_ADDR_VAL((bus), (slot), (function), (offset))\
)

## ◆ 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
}