Re: [PATCH] add PCI ROMs to sysfs

From: Matthew Wilcox
Date: Fri Aug 27 2004 - 11:45:39 EST


On Thu, Aug 26, 2004 at 04:58:03PM +0100, Matthew Wilcox wrote:
> I'm just tracking down another bug with the current code -- it maps the
> ROMs into the wrong address range on my ia64 zx1 box. I'll send more
> mail once I've fixed that.

I fixed it in the ia64 code by ensuring that the ROM resource has a parent
and thus skipping the call to pci_assign_resource().

Of the 15 pci devfns on my system, 6 of them have ROMs:

/sys/devices/pci0000:80/0000:80:00.0/rom
/sys/devices/pci0000:60/0000:60:01.1/rom
/sys/devices/pci0000:60/0000:60:01.0/rom
/sys/devices/pci0000:40/0000:40:01.0/rom
/sys/devices/pci0000:20/0000:20:01.1/rom
/sys/devices/pci0000:20/0000:20:01.0/rom

0000:20:01.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 03)
0000:20:01.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1030 PCI-X Fusion-MPT Dual Ultra320 SCSI (rev 03)
0000:40:01.0 Token ring network controller: IBM 16/4 Token ring UTP/STP controller (rev 04)
0000:60:01.0 SCSI storage controller: LSI Logic / Symbios Logic 53c1010 66MHz Ultra3 SCSI Adapter (rev 01)
0000:60:01.1 SCSI storage controller: LSI Logic / Symbios Logic 53c1010 66MHz Ultra3 SCSI Adapter (rev 01)
0000:80:00.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 04)

The only one that doesn't work is the pair of 1030 chips (these are on the
motherboard, so possibly there's something funky going on). The contents of
these roms are:

00000000 2e 2e 2e 2e 2e 2e 2e 2e 3e 2e 2e 2e 3e 3e 2e 2e |........>...>>..|
00000010 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e |................|
00000020 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e |................|
00000030 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e |................|
00000040 3e 2e 2e 2e 3e 2e 2e 2e 3e 3e 2e 2e 3e 3e 3e 2e |>...>...>>..>>>.|
00000050 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e |................|
00000060 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e |................|
00000070 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e |................|
00000080 2e 2e 2e 2e 2e 2e 2e 2e 3e 3e 2e 2e 2e 2e 2e 2e |........>>......|
00000090 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e |................|
000000a0 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e |................|
000000b0 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e |................|
000000c0 3e 3e 2e 2e 3e 2e 2e 2e 3e 3e 3e 3e 3e 3e 3e 3e |>>..>...>>>>>>>>|
000000d0 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e 2e |................|
000000e0 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e |................|
000000f0 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e 0e |................|

The expansion rom PCI region claims to be 4MB in size, but if we try to
read past 1MB, the machine reboots. This won't be a problem with the latest
patch because it'll return a size of 0.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
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/