[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: PCI Configuration BAR all '1' write
Weng Tianxiang wrote:
> 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
>
If software wants to do this, then maybe it should:
Read: 0x1234,0000 - read the current contents of BAR0 and SAVE
Write: 0xffff,ffff
Read: 0xffff,000
Write: 0x1234,0000 - put it back to the original state
However, software better not do this while the PCI interface
is operational - if a third master tries to access address 0x1234,000
right after this master writes it to 0xffff,ffff, the slave won't respond.
The method Amit describes is the common way of doing things.
Usually, another software driver won't try to access the BAR's in
this manner. It's not unreasonable to expect the initial master to
construct a table of memory sizes, if other masters need this info, I think.
Joe