Re: Proposal: non-PC ISA bus support

From: Benjamin Herrenschmidt (bh40@calva.net)
Date: Thu Jun 22 2000 - 04:37:53 EST


On Thu, Jun 22, 2000, Geert Uytterhoeven <geert@linux-m68k.org> wrote:

>> > There are multiple legacy ISA regions on some PowerMacs, which
>> > have multiple PCI buses and such.
>>
>> I guessed that. I was hoping to get specifics.
>
>Benjamin Herrenschmidt <bh40@calva.net> can tell you more about it.

Ok, here is it again ;)

So basically, what happens on some pmacs (but I've recently discovered
that we are not the only ones in similar situations) is that we have
multiple PCI host bridges, each of them having an IO space, and so
potentially having VGA cards (or other legacy-on-PCI cards).

The typical case is Apple new Uni-N chipset, which provides 3 root PCI
busses (they all have bus number 0 but are really different busses, with
separate IO space, config space, etc...). We don't have legacy ISA
devices, except for VGA cards, and in this case, things gets bad since
the VGA card can be either on the AGP bus (one of the 3 root busses) or
in a PCI slot (another of the 3 root busses). (And in both cases, having
different bases).

If we want legacy VGA drivers to work, we currently have to decide once
for all on which bus will we'll map the ISA space. Fortunately, except
for VGA, those machines will probably never have any legacy ISA device.
It's theorically possible to plug an ISA bridge PCI card with a superio
or something like that in the PCI bus, and have the problem show up, but
I doubt anyone will ever want to do that.

I see no obvious solution to this, since legacy ISA drivers don't use a
base address at all, and have usually no way but the fixed addresses to
probe a card. That mean that we can only show one of the PCI busses as
containing legacy ISA-like devices. The only solution to this would be to
change all ISA drivers so that they request the Nth. ISA iobase (N beeing
0..1..2.. until the kernel returns an error), allowing them to probe
separate ISA-like busses, and then keep track of the iobase in all inb/
outb-like accesses.

Another possibility would be to decide that we have simply no ISA bus on
those machines (but will this apply to other archs ?) and fixup the VGA
driver to use PCI lookup, and a specific mecanism to obtain it's IO base
and mem base from the PCI bus/dev_fn + offset_to_region.

Note that to my knowledge, Apple bridges are configured to not allow VGA
palette snooping, and Apple clearly states that you are not supposed to
do VGA hard-decoding on a Mac. But well, now that Macs are running
Linux... I'm also not sure the bridge will accept to map the ISA mem
space of those VGA cards at all in the CPU space. It's probably possible
to reconfigure the DEC PCI<->PCI bridge used in machines with slots (G4s)
to remap the VGA ISA mem space somewhere in the available decoded range,
but I beleive that's all can be done. What I mean is that the main host
bridge can probably not issue memory cycles to the PCI with addresses
lower than it's main memory map address (0x80000000). Since we dont have
docs on those chipsets, it's difficult to tell what can be actually done
or not. So it's probably not possible at all to use VGA memory space on
the AGP slot (which is not routed via a PCI<->PCI bridge).

Ben.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Fri Jun 23 2000 - 21:00:23 EST