The Linux driver-PCI principle explains why PCI is an auto-config device.

Source: Internet
Author: User
------------- Auto Configuration --------------------

PCI provides two separate 32-bit or 64-bit address spaces corresponding to the memory and I/O port address spaces of the x86 Processor family. addresses in these address spaces are assigned by software. A third address space, called the PCI configuration space, which uses a fixed addressing scheme, allows software to determine the amount of memory and I/O address space needed by each device. each device can request up to six areas of memory space or I/O port space via its configuration space registers.

In a typical system, the firmware (or operating system) queries all PCI buses at startup time (via PCI configuration space) to find out what devices are present and what system resources (memory space, i/O space, interrupt lines, etc .) each needs. it then allocates the resources and tells each device what its allocation is.

The PCI configuration space also contains a small amount of device type information, which helps an operating system choose device drivers for it, or at least to have a dialogue with a user about the system configuration.

Devices may have an on-board Rom ining executable code for x86 or PA-RISC processors, an Open Firmware driver, or an EFI Driver. these are typically necessary for devices used during system startup, before device drivers are loaded by the operating system.

In addition there are PCI latency timers that are a mechanic for PCI bus-mastering devices to share the PCI bus fairly. "Fair" in this case means that devices won't use such a large portion of the available PCI bus bandwidth that other devices aren't able to get needed work done. note, this does not apply to PCI Express.

"How this works is that each PCI device that can operate in bus-master mode is required to implement a timer, called the latency timer, that limits the time that device can hold the PCI bus. the timer starts when the device gains bus ownership, and counts down at the rate of the PCI clock. when the counter reaches zero, the device is required to release the bus. if no other devices are waiting for bus ownership, it may be simply grab the bus again and transfer more data. "[2]

----------------- Interrupts ------------------------------

Devices are required to follow a protocol so that the interrupt lines can be shared. the PCI bus Des Four interrupt lines, all of which are available to each device. however, they are not wired in parallel as are the other traces. the positions of the interrupt lines rotate between slots, So what appears to one device as the INTA # Line is intb # To the next and intc # to the next. single-function devices use their INTA # For interrupt signaling, so the device load is spread fairly evenly encrypted ss the four available interrupt lines. this alleviates a common problem with sharing interrupts.

PCI bridges (between two PCI buses) map the four interrupt traces on each of their sides in varying ways. some bridges use a fixed mapping, and in others it is retriable. in the general case, software cannot determine which interrupt line a device's INTA # pin is connected to construct ss a bridge. the mapping of PCI interrupt lines onto system interrupt lines, through the PCI host bridge, is similarly implementation-dependent. the result is that it can be impossible to determine how a PCI device's interrupts will appear to software. platform-specific BIOS code is meant to know this, and set a field in each device's configuration space indicating which IRQ it is connected to, but this process is not reliable.

PCI interrupt lines are level-triggered. This was chosen over Edge-triggering in order to gain an advantage when servicing a shared interrupt line, and for robustness: edge triggered interrupts are easy to miss.

Later revisions of the PCI specification add support for message-signalled interrupts. in this system a device signals its need for service by executing a memory write, rather than by asserting a dedicated line. this alleviates the problem of scarcity of Interrupt lines. even if interrupt vectors are still shared, it does not suffer the sharing problems of level-triggered interrupts. it also resolves the routing problem, because the memory write is not unpredictably modified between device and host. finally, because the message signaling is in-band, it resolves some synchronization problems that can occur with posted writes and out-of-band interrupt lines.

PCI Express does not have physical interrupt lines at all. It uses message-signalled interrupts exclusively.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.