Search notes:

PCI

PCI stands for Peripheral Component Interconnect. It connects the CPU with some things that are attached to a PC via the PCI: graphic card, memory, USB controllers, SATA controllers.

BDF

BDF (or B/D/F) stands for Bus, Device, Function. It it a 16 bit number that locates a device's function.
The PCI specification permits a system to host up to 256 buses. (8 bits)
Each bus can have up to 32 devices. (5 bits)
Each device can have up to 8 functions. (3 bits)
Usually, the BDF is represented in hexadecimal whose values are separated by a colon and a dot (for example 00:1f.2).
The BDF can be printed with lspci.

Vendor and device ID

Every PCI has a unique vendor and device ID.
The device number distinguishes between PCI devices with the same vendor and device ID.

Accessing the PCI configuration space

In the x86 architecture, the PCI configuration space is accessed with the 0xcf8 (address) and 0xcfc (data) I/O ports.
The Linux Kernel source file drivers/virt/acrn/ioreq.c has the following comment:
/*
 * A PCI configuration space access via PIO 0xCF8 and 0xCFC normally has two
 * following steps:
 *   1) writes address into 0xCF8 port
 *   2) accesses data in/from 0xCFC
 * This function combines such paired PCI configuration space I/O requests into
 * one ACRN_IOREQ_TYPE_PCICFG type I/O request and continues the processing.
 */
The Kernel source file arch/x86/pci/direct.c contains functionality for «low-level direct config space access».

TODO

PCI ISA bridge

See also

lspci (part of the PCI Utilities Suite.
include/linux/pci_ids.h
/usr/share/hwdata/pci.ids
/sys/bus/pci
motherboard

Index