Good morning, all.
My lower level driver is controlling a PCI card which uses flash to store
it’s bios code and internal program. This flash is mapped to the expansion
memory BAR at 0x30 offset in the PCI header. When the system starts it maps
the BAR to an address, executes the bios code, then un-maps the space. When
I say it un-maps the space, I mean that it writes 0x0 to the BAR. This is
usually OK, but I need to be able to change the contents of the flash from
my driver. By using a PCI sniffer, I am able to determine what address the
system maps the memory to, then manually put that address back into the BAR
and access the flash. This is great for testing, but is obviously not useful
in the field. The BAR at 0x10 (register space inside the card) is mapped
nicely and I can read the PCI address at driver load time just like any PCI
device.
Does anyone know how I can get NT to leave that BAR mapped the way it does
the register BAR at 0x10? Or to get NT to re-map that BAR at driver load
time?
I appreciate any advice.
Chuck.
You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Chuck,
Assuming there’s not a simpler way (like removing the code, assuming it’s in
your flash, that does the ‘unmapping’), you could try the following:
Add a memory resource in IRP_MN_FILTER_RESOURCE_REQUIREMENTS (easier said
than done… the IO_LISTS are an exercise in data structure manipulation, ie
‘tricky’…). Then both a raw and translated address will be passed in the
list to IRP_MN_START_DEVICE. Program the ‘raw’ value into config space
0x30, use the ‘translated’ value to set up a mapping. You should also
adjust the IRP_MN_START_DEVICE lists to remove that resource before passing
it down the stack.
See http://support.microsoft.com/support/kb/articles/Q253/2/32.ASP for how
to program the config space.
-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 Chuck Prichard
Sent: Thursday, May 10, 2001 10:32 PM
To: File Systems Developers
Subject: [ntfsd] PCI Flash memory
Good morning, all.
My lower level driver is controlling a PCI card which uses flash to store
it’s bios code and internal program. This flash is mapped to the expansion
memory BAR at 0x30 offset in the PCI header. When the system
starts it maps
the BAR to an address, executes the bios code, then un-maps the
space. When
I say it un-maps the space, I mean that it writes 0x0 to the BAR. This is
usually OK, but I need to be able to change the contents of the flash from
my driver. By using a PCI sniffer, I am able to determine what address the
system maps the memory to, then manually put that address back
into the BAR
and access the flash. This is great for testing, but is obviously
not useful
in the field. The BAR at 0x10 (register space inside the card) is mapped
nicely and I can read the PCI address at driver load time just
like any PCI
device.
Does anyone know how I can get NT to leave that BAR mapped the way it does
the register BAR at 0x10? Or to get NT to re-map that BAR at driver load
time?
I appreciate any advice.
Chuck.
You are currently subscribed to ntfsd as: xxxxx@driverdev.com
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com
You are currently subscribed to ntfsd as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntfsd-$subst(‘Recip.MemberIDChar’)@lists.osr.com