uninitialized PCI VGA cards and matroxfb

G.W. Wettstein (dave@thor.sbay.org)
Wed, 16 Jun 1999 13:42:16 -0700 (PDT)


I'm trying to setup my my dual head (TNT2 and Matrox Millennium II) using
Linux's Framebuffer subsystem. I specifically want X on the primary video
card (TNT2/vesafb) and a plain text console on the matroxfb.

While trying to enable this setup, I found that my BIOS doesn't initialize
the secondary video card. This caused the matroxfb to crash when it tried
to access the Millennium II's framebuffer/registers.

After playing with the kernel, I could enable the memory for the secondary
video card with this piece of code from arch/i386/kernel/bios32.c ("dev"
is the secondary VGA card in question):

unsigned short cmd;
pci_read_config_word(dev, PCI_COMMAND, &cmd);
if (!(cmd & PCI_COMMAND_MEMORY)) {
printk("PCI: Enabling memory for device %02x:%02x\n",
dev->bus->number, dev->devfn);
cmd |= PCI_COMMAND_MEMORY;
pci_write_config_word(dev, PCI_COMMAND, cmd);
}

And this function would enable the secondary video card's bus mastering
capability:

pci_set_master(dev);

But the Matrox Millennium II is still not configured correctly.

It's IRQ is 0, and it's three base_address registers appear to be
suspiciously incorrect:

Memory at ff000000 (32-bit, prefetchable)
Memory at ffffc000 (32-bit, non-prefetchable)
Memory at ff800000 (32-bit, non-prefetchable)

The size of the memory regions are respectively:
0 is 16 megabytes
1 is 16 kilobytes
2 is 8 megabytes

Hmmm...

base_address[0] == -16MB
base_address[1] == -16KB
base_address[2] == -8MB

The size of each of these memory locations and where they are located in
memory cause ioremap to fail:

/*
* Don't allow mappings that wrap..
*/
if (!size || size > phys_addr + size)
return NULL;

I'm currently trying to figure out what to do next. Working inside the
kernel is rather new to me, and I don't know way around the PCI subsystem
either. So if I made a mistake, or you think I'm doing something wrong,
please enlighten me.

In short, any assistance would be greatly appreciated! :-)

I've appended the output of lspci -vvvxxx WRT the Millennium II for the
curious (the output is from an unmodificed 2.2.9 kernel).

davez

--
Dave Zarzycki
http://thor.sbay.org/~dave/
http://www.sbay.net/

00:13.0 VGA compatible controller: Matrox Graphics, Inc. MGA 2164W [Millennium II] Subsystem: Unknown device 102b:1000 Control: I/O- Mem- BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- Status: Cap- 66Mhz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- Interrupt: pin A routed to IRQ 0 Region 0: Memory at ff000000 (32-bit, prefetchable) [disabled] Region 1: Memory at ffffc000 (32-bit, non-prefetchable) [disabled] Region 2: Memory at ff800000 (32-bit, non-prefetchable) [disabled] 00: 2b 10 1b 05 00 00 80 02 00 00 00 03 00 00 00 00 10: 08 00 00 ff 00 c0 ff ff 00 00 80 ff 00 00 00 00 20: 00 00 00 00 00 00 00 00 00 00 00 00 2b 10 00 10 30: 00 00 ff ff 00 00 00 00 00 00 00 00 ff 01 00 00 40: 00 01 00 5f 00 00 00 00 ff ff ff ff 00 00 00 00 50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 b0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

- 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/