Re: PCI registry? (PCI device initialization)

teunis (teunis@mauve.computersupportcentre.com)
Thu, 16 Oct 1997 10:54:43 -0600 (MDT)


> [snipped]
> > How does one initialize an unenabled PCI device - say, a secondary
> > or tertiary videocard? (the bios apparently only initializes the first
> > VGA device present - I'm not sure which order)
>
> Noy easy, often the BIOS performs the equivalent of pci_find_class(...0),
> which often (but I don't have the PCI BIOS specs, so I can't guarantee
> this) scans all PCI bus in ascending device number order for each bus.
> Only the first one is initialized and enabled because:
>
> 1) there I/O ports for standard VGA would overlap if several boards were
> enabled, leading to chaos (I/O base address are not programmable for
> VGA boards). Same for the default text/VGA graphics address which is
> at 0xa0000 and must be accessible from real mode (so called) code.
>
> 2) The ROM of the different boards are usually at 0xC0000, only one
> at a time can be enabled. It is usually shadowed in RAM.
>
> 3) There are intricate dependencies between BIOS and VGA ROM code, often
> the BIOS initializes interrupt 10 to provide basic CGA/EGA equivalent
> services to the ROM. The ROM then copies this vector to anotehr
> one (42 AFAIR) and overwrites vector 10 with its own entry point.
> Of course no 2 ROMS have the same entry points. Enabling and initializing
> 2 or more would result in a complete mess ;)

Unless the devices in question are 100% PCI-based MMIO devices
(memory-mapped where PCI tells them to be).

You could run as many of these as you have room for. The problem
apparently is that PCI is _NOT_ telling these cards where they should be -
or telling them to initialize themselves.

[though you may run out of interrupt lines]

> Bottom line, BIOS was designed to work with at least one and at most
> one video interface. If it is not flexible enough for you, find something
> else ;)

That's why I'm working on this :)
It's not like this is BIOS-specific. Only PCI-specific :)

I have enough info to run this on both Intel and Alpha (and PowerPC, ...
actually providing the PCI support in linux is present :).... providing I
know how to tell a PCI device to "initialize itself".

The card in question is an S3-Trio64V+ (or S3-ViRGE). Initializing the
graphics CPU in question does _NOT_ guarantee that the card initializes
RAM amounts or anything else.
S3 cpu's can handle 4M+ of videoram - that doesn't mean there is that much
videoram present. Or that the videoram timings are setup. Or ....

apparently the plug'n'play bios knows how to initialize these properly
BTW...

The only cards I know of that are smart enough to self-boot on reference
are the Matrox cards...

Any ideas?

Incidentally, the only resources the card actually requires is a block of
mapped memory and an interrupt line (I suspect this can be shared).
Only the first initialized card ends up with VGA-compatibility - the card
does not default to this.

Other people have gotten 2+ such devices working (in GGI amongst other
places) so I'm just wondering how to do that....
And I suspect it's the same as initializing, say, two or more AIC-7xxx
cards :)

Otherwise I wouldn't be posting to linux-kernel - I'd be asking people in
GGI. I know they listen here too, so I'm asking here.

G'day, eh? :)
- Teunis

PS : It looks like "scanpci" uses the direct-PCI methods rather than BIOS
calls... DOES Linux have a userspace PCI interface?
(alpha-linux version of "scanpci" implies this is so)