Re: Weird PCI problem

Stephen Williams (steve@icarus.com)
Wed, 12 May 1999 15:50:49 -0700


> Interestingly enough, the NT Diagnostics indicates that the _same_
> resource Linux tries to allocate (i.e., f9e00000-f9efffff) are being
> allocated by NT, just in the right way.

mj@atrey.karlin.mff.cuni.cz said:
> It's quite possible both the DOS diag program and the NT driver
> completely ignore the region type bit.

The NT Diagnostics information is supplied by the driver, and is
purely advisory. Presumably, the driver assumes that the region is
memory space and passes the correct flags to the IoAssignResources
insanity.

mj@atrey.karlin.mff.cuni.cz said:
> If it turns out it's a real hardware bug, I can add it to the
> work-around table in the kernel to trick the kernel that it's really a
> memory region ;)

I use PLX9080 interface chips all the time and do not see this problem.
Nor do our customers report troubles. However, I also use PLX9080 in
an embedded situation where I wrote my own PCI scanning and mapping
BIOS, and I know that *I* always write 0 in the low bit when scanning
BARS for region sizes. BAR1 of the PLX9080 behaves correctly (in that
it doesn't turn into a memory region) so maybe just BAR2 of the device
is broken at that bit.

Here is what happens when I try to write to BAR2 bogus bits:

beeker.icarus.com % ucrpipe
Picture Elements, Inc. ISE
% load {} isedma
% load {} bios32
% bios32_find all
{0x12c5 0x0010 1 0x08} {0x1011 0x0024 1 0x20} {0x12c5 0x0003 2 0x00}
# 1.0x8 is a PLX9080 device.
% bios32_read 1 8 0x18
0x100000
# try to write an unwriteable bit, no change
% bios32_write 1 8 0x18 0x100001
% bios32_read 1 8 0x18
0x100000
# These are the writeable bits...
% bios32_write 1 8 0x18 0xffffffff
% bios32_read 1 8 0x18
0xfff00000

Looks correct to me. There has to be a hardware or driver problem. Not
even the BIOS should be able to write to the BAR IO/Mem bit. However,
you can change that bit in the PLX by writing to the LAS0RR regster.
To wit:

# PLX registers located by BAR0
% bios32_read 1 8 0x10
0x2000
# LAS0RR is here...
% peekl 0x2000
0xfff00000
% pokel 0x2000 0xfff00001
% bios32_read 1 8 0x18
0xfff00001

Get it?

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/