Each PCI/PCI-X device has 256 bytes of configuration address space. Sixty-four bytes of this area are standardized as shown in Figure 6-1. For more details regarding these registers, see PCI-X System Architecture or PCI System Architecture.
On SGI Altix systems, the following registers in the PCI configuration space should not be used directly by device drivers:
Base address registers. These register values are not usable on the CPU as PIO addresses.
Expansion ROM base address registers. SGI Altix systems do not support loading and executing basic input/output systems (BIOS) code resident in PCI ROM. This register is not initialized. Drivers should ensure that all initialization is performed in the driver.
Interrupt Line. On legacy systems, this is the IRQ. SGI Altix systems support IRQs greater than 8 bits (greater than 256 IRQs). The interrupt line value is not used on SGI Altix systems.
Device drivers have to use the addresses and values provided in the pci_dev structure. For methods of programmatically finding your device pci_dev information, see Chapter 5, “Finding Your PCI Device”.
You can read and write PCI/PCI-X configuration space for your device by using the following PCI configuration space routines:
/usr/include/linux/pci.h:
int pci_read_config_byte(struct pci_dev *dev,int where,u8 *ptr);
int pci_read_config_word(struct pci_dev *dev,int where,u16 *ptr);
int pci_read_config_dword(struct pci_dev *dev,int where, u32 *ptr);
int pci_write_config_byte (struct pci_dev *dev,int where, u8 val);
int pci_write_config_word (struct pci_dev *dev,int where, u16 val);
int pci_write_config_word (struct pci_dev *, int where, u32 val);
int pci_write_config_dword (struct pci_dev *dev,int where, u32 val);
|
| Variable | Description | |
| *dev | Pointer to your device pci_dev structure | |
| where | Byte offset into the PCI configuration space of your device | |
| *ptr | Address of the location to store the byte read | |
| val | Value to write into the PCI configuration space of your device |