PCI Emulation

PCI emulation is experimental.

TEMU provides support for PCI bus based devices. This is based on a split between bridges, devices and buses.

A generic PCIBus class exists to provide bus connectivity. Devices of this class maintains the configuration space object.

When a BAR is written the memory and I/O spaces are updated automatically.

Normally the IO and memory spaces can be mapped directly into target memory. That said, som bridges may remap addresses. In that case the bridge should provide memory interfaces much like an MMU.

Bridge Modelling

TBW

Device Modelling

While it is sometimes necessary to implement PCI bridges (e.g. GRPCI2), the more common task is to implement PCI devices.

A PCI device in TEMU must support the following interfaces:

  • PCIDevIface implementing the PCI device interface. Used for for accessing config info about the PCI device.

  • MemAccessIface[6] implementing the PCI memory access functions for each BAR.

  • ExpROMAccessIface implementing accesses to PCI expansion ROM.

  • ConfigAccessIface implementing the memory access interface for the configuration space.

That means that MemAccessIface may be either IO or PCI mem. This depends on the hard coded value in the bar.

Examples

An example of a PCI device is provided in share/temu/examples/pci-device/.