Stephen,
I’m assuming this is for a transparent bridge, so for starters it’s just not
available/supported/documented/legal/allowed for your driver to
configure/modify the bridge’s registers (ie. a ‘hard problem’). Have the
hardware designer make a register accessible from the function 1’s memory
mapped or port mapped address space, or solder a big button on the board.
[ note - If, however, it’s a non-transparent bridge, you can just load a
driver specifically for it and access it as you described below from
within that driver (instead of the driver for the i960 - you can communicate
between the drivers). ]
Now, that said, it appears from your messages you’re doing this just for
firmware debugging purposes. One the firmware is ‘right’, I’m assuming
you’ll put that in flash and deploy (… and hoping you’re not considering
using the following technique for upgrading once it’s deployed…).
I would be absolutely loathe to ship a production driver with the
following technique, but I’m guessing (and hoping) you’re only wanting to do
this for debugging your driver/firmware, so I’ll suggest it. If that’s not
the case, please do not associate my name with this technique!
This method contains a synchronization bug (since the bus driver is entirely
possibly doing the exact same thing at the exact same time…) and also
makes a large number of assumptions about the system you’re running on (such
as it’s X86, PCI config mechanism #1 supported or PCI 2.2 compliant, I could
go on.)
You can very easily generate the PCI config cycles just by using the
registers at 0x0CF8 and 0xCFC (for details see PCI config mechanism in 2.2
spec or PCI config mechanism #1 in 2.1). Write the address (in config
space) that you want to access into 0x0CF8 (AS A 32b VALUE), then read/write
the data (ALSO AS A 32b VALUE) to/from 0xCFC. A few minutes of searching on
the web will likely turn up some code to do that to search for a card on all
buses in a machine. The format of the address is also available on the web
and in the PCI spec. You can get most of the address bits from your
function’s PDO by using the IoGetDeviceProperty call as described in
Q253232:
http://support.microsoft.com/support/kb/articles/Q253/2/32.ASP
DO NOT DO NOT DO NOT deploy your driver with such an aggregious hack as what
I’ve suggested here. If the 20 min. it takes to write that hack hack hack
code keeps you from rebooting/reseting your machine a couple hundred times
during debugging of your firmware, however, great…
-Tim
Timothy A. Johns — xxxxx@driverdev.com
Driver Development Corporation — 800.841.0092
Bring Up Your Hardware — Fast. www.driverdev.com
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Stephen Williams
> Sent: Thursday, May 03, 2001 3:54 PM
> To: NT Developers Interest List
> Subject: [ntdev] Extended configuration registers of a bridge.
>
>
>
> OK, I’ve got a problem.
>
> I’m writing a Windows 2000 driver for a device that uses as its interface
> an i960RD (or 80303 in the future). This chip is a multi-function PCI
> device, with function 0 a PCI-to-PCI bridge and function 1 a messaging
> unit for talking with an i960 processor.
>
> The i960 on the board normally starts up on its own via program code
> in its flash, but after the initial boot the processor can be restarted
> and reloaded at will. The “reset button” for the processor is in a
> device specific register of the bridge device. The device drivers
> resets the processor by:
>
> Saving volatile bits of the configuration space of function 1,
> Resetting the processor with a bin in the EBCR, then
> Restoring the function unit 1 configuration space.
>
> The problem here is that I need to be able to locate the associated
> bridge unit given the processor interface.
>
> Under Linux it’s easy. The bus number is the same, the dfn number is
> the same device number but the function number turned to 0. This works
> under NT4 as well as the SlotNumber is the same as the dfn under Linux.
>
> But under Windows 2000 there are two (pertinent) problems:
>
> 1) HalSetBusData is “obsolete”, and
> 2) the PnP monster doesn’t give me the SlotNumber needed
> to pass to HalSetBusData anyhow.
>
> I see that there are PnP IRPs for manipulating the config space
> of the self device, but those IRPs don’t have any slot number parameter
> and can’t (so far as I can tell) be made to apply to another device.
>
> So how can I, under WDM:
>
> 1) Find a PCI device with this very specific relationship,
> 2) Access the config space of said device to do what needs
> to be done.
>
>
> –
> Steve Williams “The woods are lovely, dark and deep.
> xxxxx@icarus.com But I have promises to keep,
> xxxxx@picturel.com and lines to code before I sleep,
> http://www.picturel.com And lines to code before I sleep.”
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@driverdev.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com