[lkml]   [2000]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: VGA PCI IO port reservations
On Fri, 17 Nov 2000, Jeff Garzik wrote:

> Russell King wrote:
> > I've been looking at a number of VGA cards recently, and I've started
> > wondering out the Linux resource management as far as allocation of
> > IO ports. I've come to the conclusion that it does not contain all
> > information necessary to allow allocations to be made safely.
> >
> > Thus far, VGA cards that I've looked at scatter extra registers through
> > out the PCI IO memory region without appearing in the PCI BARs. In fact,
> > for some cards there wouldn't be enough BARs to list them all.
> > For example, S3 cards typically use:
> >
> > 0x0102, 0x42e8, 0x46e8, 0x4ae8, 0x8180 - 0x8200, 0x82e8, 0x86e8,
> > 0x8ae8, 0x8ee8, 0x92e8, 0x96e8, 0x9ae8, 0x9ee8, 0xa2e8, 0xa6e8,
> > 0xaae8, 0xaee8, 0xb2e8, 0xb6e8, 0xbae8, 0xbee8, 0xe2e8,
> > 0xff00 - 0xff44
> [...]
> > Surely we should be reserving these regions before we start to allocate
> > resources to PCI cards?

This can't be. If the IO decode doesn't exist in the BAR, the board
can't access that address if it exists above 0x1000. Some ISA compatibable
ports are decoded by some SVGA boards so that the BIOS can do an
early initialization of compatible boards before the board's ROM bios
is located, shadowed, then executed.

Anything you see above 0x1000, that seems to be coming from a PCI
video board, has got to be an ISA alias and can be ignored.

When you write bits to the base address registers, these turn out
to be the physical bits set into the hardware decoder. That's why,
if you need N kb of address space, it needs to be on a N kb boundary.

If these bits are not set, the board is isolated.

In the same vain, Linux may not have the information available to
properly allocate addresses to PCI and AGP boards. This happens
because some devices will fail if you change their addresses once
they are initialized (Most SCSI controllers). Therefore you
can't change them.

This means that you can't really change anything else.

What the BIOS does:

(1) Learn the last address occupied by memory.
(2) Learn the lowest unaliased port address above 0x1000.
(3) Starting with the bridge, allocate resources both
ports and memory addresses.
The memory addresses start after the last RAM.
The port addresses start after the last alias.
The I/O or memory enables are usually left OFF.
(4) Copy any BIOS found for screen cards and IPL devices,
shadow them, remove the BIOS decode, then execute
their initialization code. These I/O or memory enables
are left ON.

If Linux tries to do this after, say a BusLogic SCSI controller
booted it, it may set a different I/O address for the SCSI controller.
Since the SCSI controller needs a hardware reset to accept new
I/O decodes, you are dead. Several "smart" controllers are like
this. They have processors that "remember" stuff that you'd like
them to forget.

Dick Johnson

Penguin : Linux version 2.4.0 on an i686 machine (799.54 BogoMips).

"Memory is like gasoline. You use it up when you are running. Of
course you get it all back when you reboot..."; Actual explanation
obtained from the Micro$oft help desk.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 12:47    [W:2.158 / U:0.136 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site