(clausi@chemie.fu-berlin.de)

CPUMemory

PCI-Bridge

PCI-Bus

PCI
#0

PCI
#n

PCI
#1
.............

http://www.llp.fu-berlin.de/cat /proc/pci

PCI devices found:
Bus 0, device 12, function 0:
SCSI storage controller: Adaptec AIC-7881U (rev 0).
Medium devsel. Fast back-to-back capable. IRQ 11.
Master Capable. Latency=32. Min Gnt=8.Max Lat=8.
I/O at 0xd800.
Non-prefetchable 32 bit memory at 0xf7fff000.
Bus 0, device 11, function 0:
VGA compatible controller: S3 Inc. Vision 968 (rev 0).
Medium devsel. IRQ 10.
Non-prefetchable 32 bit memory at 0xf2000000.
Bus 0, device 10, function 0:
Ethernet controller: 3Com 3C590 10bT (rev 0).
Medium devsel. IRQ 12. Master Capable. Latency=248. Min Gnt=3.Max Lat=8.
I/O at 0xe000.
Bus 0, device
7, function 2:
Unknown class: Intel Unknown device (rev 0).
Vendor id=8086. Device id=7020.
Medium devsel. Fast back-to-back capable. IRQ 9. Master Capable. Latency=32.
I/O at 0xe400.
Bus 0, device
7, function 1:
IDE interface: Intel 82371SB Triton II PIIX (rev 0).
Medium devsel. Fast back-to-back capable. Master Capable. Latency=32.
I/O at 0xe800.
Bus 0, device
7, function 0:
ISA bridge: Intel 82371SB Triton II PIIX (rev 0).
Medium devsel. Fast back-to-back capable. Master Capable. No bursts.
Bus 0, device
0, function 0:
Host bridge: Intel 82439HX Triton II (rev 1).
Medium devsel. Master Capable. Latency=32.

/proc/pci

CONFIG ADDRESS

http://www.llp.fu-berlin.de/(0xcf8)

CONFIG DATA (0xcfc)
pcibios present()

pcibios find device()

pcibios read config byte()
pcibios read config word()
pcibios read config dword()

pcibios write config byte()
pcibios write config word()
pcibios write config dword()#if defined(CONFIG_PCI)
if (pcibios_present()) {int pci_index;
for (pci_index = 0; pci_index < 8; pci_index++) {unsigned char pci_bus, pci_device_fn;
unsigned int pci_ioaddr;/* Currently only Realtek are making PCI ne2k clones. */if (pcibios_find_device (PCI_VENDOR_ID_REALTEK,PCI_DEVICE_ID_REALTEK_8029, pci_index,&pci_bus, &pci_device_fn) != 0)
break;/* OK, now try to probe for std. ISA card */pcibios_read_config_byte(pci_bus, pci_device_fn,PCI_INTERRUPT_LINE, &pci_irq_line);
pcibios_read_config_dword(pci_bus, pci_device_fn,PCI_BASE_ADDRESS_0, &pci_ioaddr);/* Strip the I/O address out of the returned value */pci_ioaddr &= PCI_BASE_ADDRESS_IO_MASK;/* Avoid already found cards from previous ne_probe() calls */if (check_region(pci_ioaddr, NE_IO_EXTENT))
continue;
printk("ne.c: PCI BIOS reports ne2000 clone at i/o %#x, irq %d.\n",pci_ioaddr, pci_irq_line);
if (ne_probe1(dev, pci_ioaddr) != 0) {/* Shouldn’t happen. */printk(KERN_ERR "ne.c: Probe of PCI card at %#x failed.\n", pci_ioaddr);
break;/* Hrmm, try to probe for ISA card... */}http://www.llp.fu-berlin.de/pci_irq_line = 0;
return 0;}}#endif/* defined(CONFIG_PCI) */inb()/outb(), inw()/outw()
inl()/outl()

readb()/writeb(), readw()/writew()
readl()/writel()
memcpy()PCI BASE ADDRESS MEM MASKPCI BASE ADDRESS IO MASKpcibios XXX()

include/linux/pci.h

PCI COMMAND MASTER

http://www.llp.fu-berlin.de/

PCI COMMAND

PCI STATUS
PCI STATUS REC TARGET ABORTPCI STATUS REC MASTER ABORTPCI VENDOR IDpci.h

PCI DEVICE IDpci.h

PCI COMMAND
PCI STATUS
PCI CLASS REVISIONPCI CLASS DEVICEPCI BISTPCI BIST CAPABLE
PCI BIST START
PCI BIST CODE MASKPCI HEADER TYPE
PCI LATENCY TIMERPCI CACHE LINE SIZE
PCI BASE ADDRESS [0-5]

PCI ROM ADDRESSPCI MIN GNTPCI MIN LATPCI INTERRUPT PIN
PCI INTERRUPT LINE

http://www.llp.fu-berlin.de/

PCI COMMAND IO
PCI COMMAND MEMORYPCI COMMAND MASTERPCI COMMAND SPECIALPCI COMMAND INVALIDATEPCI COMMAND VGA PALETTEPCI COMMAND PARITYPCI COMMAND WAIT
PCI COMMAND SERRPCI COMMAND FAST BACKPCI STATUS 66MHZPCI STATUS UDF
PCI STATUS FAST BACKPCI STATUS PARITY
PCI STATUS DEVSEL [MASK|FAST|MEDIUM|SLOW]PCI STATUS SIG TARGET ABORTPCI STATUS REC TARGET ABORTPCI STATUS REC MASTER ABORTPCI STATUS SIG SYSTEM ERRORPCI STATUS DETECTED PARITY

http://www.llp.fu-berlin.de/