[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Rules for setting/clearing Memory Access Enable bit of Command Register





Sent: Friday, May 24, 2002 9:20 PM
To: pci-sig@znyx.com
Subject: Re: Rules for setting/clearing Memory Access Enable bit of
Command Register


Hello Daniel,

> A minority of wintel computers are clearing ( or simply not setting )
> the memory access enable bit of the command register.  As a result
> my application software fails to communicate with my PCI board's memory.
>
> My PCI card's BAR is successfully assigned an address at power up.
> After that happens I thought that the PCI-BIOS sets the memory access
> enable bit. Is this the case ?

Some BIOS will only enable the devices which are needed for
boot.  (i.e.  mouse, disk, keyboard, video).  Often they have
a BIOS setup option for this.  (Occasionally, said option is
labled as "PnP OS" - you can set the option to "NO".  This will
cause the BIOS to configure & enable all devices it can.  The 
fact that the BIOS filled the BAR suggests the BIOS configured,
but then disabled your device.

> Could the OS be clearing this bit later?

Yes, Windows 2K, Windows XP will clear the bit on devices that
have been disabled in device manager.  But barring specific
disabling in device mgr, the OS would not usually turn off 
decode.  The BIOS is probably doing it.

> Can an application program set this bit ?

This is really a two part question.  Can?  Should?

Can: Yes by using a device driver, you would call HalGetBusData()
and HalSetBusData() to write the configuration space, and enable
the bit.   Similar routines in other OS like Linux.

Should: No, you should NEVER DO THIS!  The bit is "owned" by the
"PCI Configuration" subsystem.  In english, the BIOS and the OS
kernel.  If a device's memory space enable bit is not enabled, then
the device has been explicityly turned off either by the BIOS or
the OS.   If the OS did it, it was because of "explicit" user diable,
i.e. Device manager, or because of an illegal condition the OS detected.
If the BIOS did it, it was because of specific request:
	1.  Boot devices only.
	2.  PnP OS = YES (on some BIOS means Boot Device only).
	- Try turning both of those setup item to OFF, NO.
Or because the BIOS detected an illegal condition.   

If you second guess the BIOS, its likely a big headache.  (There are
probably a very, very, very few BIOS that actually have an actual
bug.)  Most likely, its one of the two BIOS setup items above....

> What are the rules for setting/ clearing this bit ?
PCI spec. v2.2, table 6-1: this bit "controls a device's response
to Memory Space accesses. A value of 0 disables the device response.
A value of 1 allows the device to respond to Memory Space accesses.
State after RST# is 0."

> Under what conditions would the OS or the PCI-BIOS clear this bit
> or fail to set ths bit ?

Any condition they few requires that the device be disabled.  That can't
really be elaborated on in email.

But probably a BIOS setup issue on these rare BIOS/machines you are
having issues on.

-David O'Shea
Intel Corp.