Page 1 of 1

PCI-to-ISA bridge programming (and LPC?)

Posted: Sun Apr 08, 2012 1:55 pm
by andymc
I'm working with a chipset that has an LPC (Low Pin Count) chip, which implements a bunch of the old-fashioned PC motherboard hardware (PIC, PIT, HPET, etc). It is visible to software in PCI space as an "PCI-to-ISA bridge" device (PCI class 6, subclass 1). I've looked at the specs for a few of these ISA bridge devices, and the PCI device-specific configuration space for them looks mostly proprietary (no real standard interface) except, possibly, for the bytes 60h-67h, which *may* be a standard place to to PIRQ routing. Can anyone elaborate on any of what I've described so far? Any docs or links that talk generally about these devices?

Cheers,
Andy

Re: PCI-to-ISA bridge programming (and LPC?)

Posted: Sun Apr 08, 2012 7:12 pm
by Brendan
Hi,
andymc wrote:I'm working with a chipset that has an LPC (Low Pin Count) chip, which implements a bunch of the old-fashioned PC motherboard hardware (PIC, PIT, HPET, etc). It is visible to software in PCI space as an "PCI-to-ISA bridge" device (PCI class 6, subclass 1). I've looked at the specs for a few of these ISA bridge devices, and the PCI device-specific configuration space for them looks mostly proprietary (no real standard interface) except, possibly, for the bytes 60h-67h, which *may* be a standard place to to PIRQ routing. Can anyone elaborate on any of what I've described so far? Any docs or links that talk generally about these devices?
Configuration space bytes 0x000 to 0x00F should be standard for everything. The "header type" field determines the layout for bytes 0x010 to 0x03F - e.g. if header type is 0x00 (or 0x80) then it's "type 0", and bytes 0x010 to 0x03F have the layout specified in the PCI spec for "type 0" (but most of these fields will probably be unused for a PCI to LPC bridge, as it doesn't make sense for it to actually use BARs, etc).

Configuration space bytes 0x040 to 0xFFF depend on the device itself and could be used for anything the specific device wants; except for cases where there's a standard that defines the meaning of the "programming interface" field of the class code for the specific base class and subclass. This isn't the case for PCI to LPC bridges (there's no standard that defines the meaning of the "programming interface" field for "baes class 6, subclass 1").

Basically, for a PCI to LPC bridge there are no standards that determine anything for configuration space bytes 0x040 to 0xFFF. This means that configuration space bytes 0x060 to 0x067 might be anything, including the ASCII string "foo bar\0" or PIRQ routing registers or anything else.

If you're specifically interested in PIRQ, then there was support for it in the PCI BIOS specification (a "Get PCI Interrupt Routing Options" function and a "Set PCI Hardware Interrupt" function) from around 1992. Then in about 2001 Microsoft invented a "PCI IRQ Routing Table Specification" which used a fixed table in ROM rather than a (dynamic) function. At about the same time, everyone started shifting to IO APICs and stopped caring about how PCI IRQs are mapped to the PIC chips. ;)


Cheers,

Brendan