From owner-freebsd-hardware Thu Jun 28 12: 8: 7 2001 Delivered-To: freebsd-hardware@freebsd.org Received: from arg1.demon.co.uk (arg1.demon.co.uk [194.222.34.166]) by hub.freebsd.org (Postfix) with ESMTP id BC9E237B405 for ; Thu, 28 Jun 2001 12:08:02 -0700 (PDT) (envelope-from arg@arg1.demon.co.uk) Received: by arg1.demon.co.uk (Postfix, from userid 300) id 5DF9C9B03; Thu, 28 Jun 2001 20:07:59 +0100 (BST) Received: from localhost (localhost [127.0.0.1]) by arg1.demon.co.uk (Postfix) with ESMTP id 5611F5D1D; Thu, 28 Jun 2001 20:07:59 +0100 (BST) Date: Thu, 28 Jun 2001 20:07:59 +0100 (BST) From: Andrew Gordon X-X-Sender: To: Joseph Gleason Cc: Subject: Re:PCI IRQ assignment In-Reply-To: <002d01c0ffe0$a8562930$0a2d2d0a@battleship> Message-ID: <20010628190706.I15194-100000@server.arg.sj.co.uk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hardware@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org 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