[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: PCI Configuration BAR all '1' write
Hi Amits,
I may cause confusion. The following is a serial of software
reading/writing operations to access the BAR0:
For power up software:
Read: 0x0000,0000 -- initial value
Write: 0xffff,ffff -- try to read back memory size
Read: 0xffff,0000 -- determine size
Write: 0x1234,0000 -- memory initial address is:
0x1234,0000
Another software wants to know the BAR0 memory size due to unknown
reason:
Write: 0xffff,ffff -- try to read back memory size
Read: 0xffff,0000 -- determine size
Now two implementations that have two consequences:
Method 1:
Read: 0x1234,0000 -- return value before writing
all '1'
Method 2:
Read: 0xffff,0000 -- return last written value
Which one is right?
Weng
-----Original Message-----
From: amits@agere.com [mailto:amits@agere.com]
Sent: Wednesday, March 06, 2002 1:02 PM
To: WTX@umem.com
Subject: Re: PCI Configuration BAR all '1' write
Hi Weng,
We have always designed the BAR's such that the lower addr bits (which
represent the size) are always tied to zero in hardware and they are
ReadOnly. The upper bits are R/W.
So when software tries to write "1", these bits cannot be overwritten
and they always represents the bar decode size.
Amit
Weng Tianxiang wrote:
> Hi,
> PCI Specs 2.2 p. 203 says about configuratin BAR operations: "Power-up
> software can determine how much address space the device requires by
> writing a value of all 1's to the register and then reading the value
> back. The device will return 0's in all don't-care address bits,
> effectively specifying the address space required."
>
> I have two implementations for the above configuration BAR all '1'
> operation:
> 1. After writing all '1' and reading back the size, it restores the
> contents before writing all '1' to it; 2. After writing all '1' and
> reading back the size, its contents are always the size. The memory
> address before writing all '1' to it is lost after writing all '1' to
> BAR. It requires software polling the size read the contents first and
> store it somewhere, then writing all '1' to it and reading back to get
> memory size, then writing the saved value to the BAR again.
>
> I want to know which one is right. Logic of method 1 is complex, but
> it retains contents after software reads its memory size; Logic of
> method 2 is simple, but it losts its contents after software reads its
> memory size.
>
> Thank you.
>
> Weng