Exporting PCI ROMs via syfs
GregKH has suggested that a good interface for accessing the contents of PCI ROMs from user space would be to make them available from sysfs. What would be a good way to structure the code for doing this? Should this be part of the pci driver, and how would this interface into class_simple to make the attribute appear?
Some problems:
Radeon cards need a work around sometimes to enable their ROM. But this can be run once when the driver loads.
There is one card that can't access the ROM and function at the same time, I believe Alan Cox know which one it is.
Would it be possible for this to be an automatic function of class_simple with an API for setting a pre-enable callback? The callback would only be used for cards with bugs like the radeon and Alan's card.
=====
Jon Smirl
[email protected]
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer
Quoted 5 lines · Jon Smirl
GregKH has suggested that a good interface for accessing the contents of PCI ROMs from user space would be to make them available from sysfs. What would be a good way to structure the code for doing this? Should this be part of the pci driver, and how would this interface into
class_simpleto make the attribute appear?
Hmm... how do you make that fit with the "one file, one value" rule for sysfs? Have the "one value" be a nnnK binary blob representing the ROM image?
Quoted 9 lines · On Fri, May 21, 2004 at 07:38:31PM -0400, [email protected] wrote:
Quoted 5 lines · Jon Smirl
GregKH has suggested that a good interface for accessing the contents of PCI ROMs from user space would be to make them available from sysfs. What would be a good way to structure the code for doing this? Should this be part of the pci driver, and how would this interface into
class_simpleto make the attribute appear?Hmm... how do you make that fit with the "one file, one value" rule for sysfs? Have the "one value" be a nnnK binary blob representing the ROM image?
Exactly, just like the pci "config" file is in sysfs today.
thanks,
greg k-h
Quoted 5 lines · Jon Smirl
GregKH has suggested that a good interface for accessing the contents of PCI ROMs from user space would be to make them available from sysfs. What would be a good way to structure the code for doing this? Should this be part of the pci driver, and how would this interface into
class_simpleto make the attribute appear?
No class_simple stuff, what about just the sysfs code for the pci device itself? Like where we export the config info today?
And yes, it sounds like we need a quirks file to keep some cards from doing bad things.
thanks,
greg k-h
Quoted 2 lines · --- Greg KH
And yes, it sounds like we need a quirks file to keep some cards from doing bad things.
Another quirk needs to track the boot graphics device. For the boot graphics device you would export the system RAM at C000:0 instead of exporting it's ROM. This is because some laptops compress their video ROM or hide the video ROM in with the system ROM. This problem only impacts the boot video device other devices don't have this issue.
=====
Jon Smirl
[email protected]
__________________________________
Do you Yahoo!?
Yahoo! Domains – Claim yours for only $14.70/year
http://smallbusiness.promotions.yahoo.com/offer
Hello!
Quoted 5 lines
Some problems:
Radeon cards need a work around sometimes to enable their ROM. But this can be run once when the driver loads.
There is one card that can't access the ROM and function at the same time, I believe Alan Cox know which one it is.
The PCI specs explicitly allow the cards to use a single address decoder for both the ROM address and one of the BARs and there really are cards which make use of this silliness.
Probably the only reasonable way how to do that reliably is to make a copy of the ROM before the device is enabled.
OTOH, it might be sensible to add a sysfs-based interface for reading the ROMs which would be available only to root and which would work only on cards without the shared decoders :-)
Have a nice fortnight
Signature · 3 lines
Martin `MJ' Mares <[email protected]> http://atrey.karlin.mff.cuni.cz/~mj/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth To avoid bugs in your room, just keep Windows closed.