Date: Thu, 28 Jun 2001 20:07:59 +0100 (BST) From: Andrew Gordon <arg@arg1.demon.co.uk> To: Joseph Gleason <clash@fireduck.com> Cc: <hardware@FreeBSD.ORG> Subject: Re:PCI IRQ assignment Message-ID: <20010628190706.I15194-100000@server.arg.sj.co.uk> In-Reply-To: <002d01c0ffe0$a8562930$0a2d2d0a@battleship>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 28 Jun 2001, Joseph Gleason wrote: > > Anyone have an references If you want the full detail, the Mindshare "PCI System Architecture" book is a good read (ISBN 0-0201-40993-3). >/explanations for: > > 1) How do PCI cards get assigned IRQ's? What is the process? Each PCI card has four INT pins (A,B,C,D). Most single-function cards are hard-wired to use INT-A. Multi-function cards, or cards with PCI bridges on them can use more. All of the IRQ pins on the PCI sockets are wired to pins on the motherboard chipset. In order to economise on pins, these are often shared in a 'diagonal' fashion (ie. slot1/INT-A is wired to slot2/INT-B and slot3/INT-C, slot2/INT-A is wired to slot3/INT-B and slot1/INT-D etc), but the exact details are motherboard dependent. Note that this doesn't normally in itself lead to interrupt sharing unless you have more than 4 slots or have some multi-function cards. These chipset pins are then mapped onto the interrupts seen by the CPU in a chipset-specific fashion (eg. a standard chipset emulates a pair of 8259 interrupt controllers for the traditional 15 ISA interrupts, but an SMP chipset has more APIC interrupts available). The BIOS is responsible for knowing how all of this implementation-dependent stuff is wired up: each card (or function within a multi-function card) has a read/write register on it for the interrupt number, so the BIOS can assign an interrupt to the card, configure the interrupt routing logic, then write the chosen interrupt number back into the card so that driver software can find out which interrupt will be generated by that card. > 2) What will happen if two PCI devices get assigned the same IRQ? Is it a > problem with well designed and well behaved devices? It is not normally a problem, provided that the drivers are written to allow interrupt sharing, which most are - particularly under FreeBSD. One source of confusion is where otherwise identical hardware is available in both PCI and ISA versions, with the same driver: the driver must not share interrupts in the ISA case, but can do so in the PCI case. > 3) What does telling the BIOS "Plug and Play OS Installed: Yes" really do? When set to "no", the BIOS configures all PnP hardware (assigns I/O addresses, IRQs etc) before booting. When set to "yes", it need only configure those devices needed for the boot process, and leaves the OS to configure the rest later. The exact details vary: older BIOSes tend to configure all of the PCI devices regardless, such that the 'PnP OS' setting only affects ISA PnP; more recent BIOSes often leave PCI devices unconfigured too (which will then show up at "irq 255" when booting FreeBSD-4.x on such a system). Note that even when the OS is assigning the interrupt, it still needs to interract with the BIOS to do so, since only the BIOS knows how the sockets are wired up on the motherboard. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hardware" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010628190706.I15194-100000>