- Accessing configuration space of PCI-express bridge
- Posted by Koen on April 13th, 2007
Hi,
I've been searching a safe but fast method to access the configuration
space of a PCI-e bridge/switch. We're building a device with multiple
FPGA's behind and PCI-e bridge. To configure these FPGA's after power
on, we need to send a byte stream (several Mbytes) to some of the
bridge's I/O pins by writing one byte at a time to one of its extended
configuration space registers.
I've been looking at three ways to do this:
1. Writing directly to the PCI configuration space registers using
WRITE_PORT_UCHAR(). This is the method suggested by the vendor of the
bridge. This however is considered to be unsafe and, as far as I know,
will not allow our driver to get thru the WHQL tests to get signed
(the latter being an requirement as we are targetting 64-bit Vista).
2. Sending, from a driver or from a user mode application,
IRP_MN_WRITE_CONFIG DeviceIoControls to the pci driver. This method
will probably be slow as we'll face the overhead from an I/O operation
for each byte that needs to be sent.
3. Getting a BUS_INTERFACE_STANDARD driver interface standard from the
bridge device allowing us to have direct access to the functions that
write data to the configuration space. This would be our preferred
method since I believe it is safe as well as fast.
Both methods 2 and 3 require some kind of handle to the bridge's
device object. Thus far I did not find any method to get such handle.
The bridge (which is owned by the pci.sys driver) does however not
have a SymbolicName that I can use as input to
IoGetDeviceObjectPointer(). It also does not export any device
interface that I could query using the SetupDi functions in order to
obtain a device information path that I can use as input to
CreateFile().
As I am stuck here, I'm open to any idea ...
Koen
- Posted by Gianluca Varenni on April 13th, 2007
"Koen" <user1964@yahoo.com> wrote in message
news:1176452906.594653.147370@d57g2000hsg.googlegr oups.com...
Having a driver that doesn't pass the WHQL tests is a *bad* idea, *but* you
don't need to WHQL certify a driver to have it run on Vista. The requirement
is that the driver is signed (e.g. using a certificate obtained by one of
the certification authorities blessed by MS).
Ciao
GV
- Posted by Don Burn on April 13th, 2007
"Gianluca Varenni" <gianluca.varenni@community.nospam> wrote in message
news:OJ%23gNDefHHA.4636@TK2MSFTNGP03.phx.gbl...
I don't have a problem with it not being WHQL certified, but doing your own
writes to the PCI configuration space is a great way to cause spurious
crashes that are very hard to find. I know of a case where a firm did this
crap, and it took forever to find the problem. Fortunately when it was
found, they were trying to sell their part to a company that had been stuck
trying to chase down some of the crashes they caused, the company not only
did not buy the part, they let a lot of other people know the firm was
selling crap.
Doing this is a great way for a developer and his firm to be cursed forever
by the Windows driver community.
--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
Website: http://www.windrvr.com
Blog: http://msmvps.com/blogs/WinDrvr
Remove StopSpam to reply
- Posted by Gianluca Varenni on April 13th, 2007
"Don Burn" <burn@stopspam.windrvr.com> wrote in message
news:%23JmM6MefHHA.1240@TK2MSFTNGP04.phx.gbl...
I agree 150% with you. My "doesn't pass the WHQL tests is a *bad* idea" was
a subtle way to say "if your driver doesnt pass the tests there are very
good chances that your driver smells really badly. Uh... playing with the
PCI configuration space is definitely one of those stinky things"
Have a nice day
GV
- Posted by Koen on April 16th, 2007
On 13 apr, 20:58, "Gianluca Varenni"
<gianluca.vare...@community.nospam> wrote:
Thanks for your comments. I didn't know you don't need to pass the
WHQL tests to get your driver properly signed.
Knowing this doesn't help me really however as I do understand that
writing to the PCI config space directly from within a signed driver
is as dangerous as doing it from within an unsigned driver.
Any idea how to do it properly ?
Koen
- Posted by mapyn on March 9th, 2008
Hi Koen,
Did you get solution for your problem? Please let me know. I am als
stuck in a similar problem. Any help will be appreciated.
Mapy
--
mapy
http://www.techtalkz.com - Technology and Computer Troubleshooting Forum