Re: Radeon issue on x86

From: Benjamin Herrenschmidt
Date: Tue Feb 17 2004 - 19:39:45 EST



> I can't help you on that one. You'd have to figure the "which chip is the
> primary" out on yourself, although you are likely to be able to figure it
> out by just following the trace of who has the legacy area mapped (ie who
> has the 0xA0000 - 0xCFFFF IO region enabled).
>
> On PCI bridges, that _should_ be visible by checking which bridge has
> "VGASnoop" on (and if none, default to the VGA device closest to the
> root). But I don't know - I've never tried to do this myself. I assume
> XFree86 must have some strange code to do this.

Hrm... I'm not sure how all of this works. Somebody suggested just
picking the VGA card that has IO enabled at boot (so basically
adding a quirk to x86 that "remembers" the pci_dev of whatever
VGA card had IO enabled during first PCI probe).

> There is no exact format. It's allowed to look pretty much any way it
> wants, although you're _supposed_ to have the marker 0x55, 0xAA in the
> first two bytes. That's how the system BIOS historically figures out that
> there is an extension ROM there somewhere.

Ok.

> The rule is, I think, that the primary video ROM should be at address
> 0xC0000. There might be alternate ROM start points at 2kB boundaries (in
> the whole 0xC0000 .. 0xFFFFF range).
>
> Oh, and byte 2 should have the "length indicator", which is the size of
> the ROM in 512-byte blocks, while "byte 3" is actually the first
> instruction to be run at initialization. So if you want to verify more,
> you should be able to disassemble "start+3" into a valid instruction, and
> "start+2" should have a sensible value, but especially that "rom length" I
> don't know how accurate it is.

I think I'll keep my current loop... so far it worked fine... (just
check for the signature). I may be able to check ATI specific signatures
in there, I don't know if it's worth the pain...

> The reason I say "should be" is that I would not be totally surprised if a
> video ROM that is embedded with the system ROM might not skip that part,
> since the system ROM "knows" that it is there regardless of signature.
>
> I just checked my EVO rom, and I notice that it _does_ have the signature
> 0xAA55 at 0xC0000, and the byte 0x80 at byte offset 2 (implying 65536
> bytes, which should be correct). So that's likely to be the right thing to
> check.

Maybe I should actually do more sanity checking on the values I read
from the BIOS, and based on that, try everything again the "other"
way... Hrm... it's all pretty nasty, I don't even have an x86 box
with a radeon to play with yet ;)

> > I currently copied a search routine from XFree but it does very little
> > verifications in there, I'm a bit paranoid about picking the wrong
> > thing...
> >
> > What do you suggest ?
>
> Does the above match what XFree86 does?

It just does a loop looking for the aa55 signature.

Ben.


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