Accessing configuration space of PCI-express bridge



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

.



Relevant Pages


Loading