This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: PCI - address management
On Fri, 2003-02-21 at 12:15, Robin Farine wrote:
> On Fri, 2003-02-21 at 19:52, Gary Thomas wrote:
>
> > > You lost me here. I thought that any PCI device powers up "dumb" and
> > > remains in this state until a host/bridge configures and enables it.
> > >
> >
> > Indeed. However, this device looks like it only has one PCI region
> > when it turns on, but after initialization, it has four! The PCI
> > library scanning code will only set up the first one which is
> > insufficient for my needs.
>
> Ah, that makes it clearer.
>
> > Truly, this is only a guess. The problem is that the device can only
> > tell the library how big a given segment is by resizing it :-( The code
> > has always just punted on this - note the comment which says something
> > like "device active, probed sizes are invalid".
>
> In a normal case, I guess that either the OS has already initialized and
> registered the device in a table somewhere (and thus knows the BARs'
> sizes) or it can safely disable it (since it doesn't use it yet) and
> resize the BARs. So I suppose that in your case, this device needs a
> initialization in three steps: setup first BAR, peek/poke some values in
> this first region, initialize the remaining BARs?
>
> If this assumption is correct, wouldn't it then be possible for this
> device's driver to detect that the remaining BARs need initialization
> and do it after the initial PCI setup stuff?
>
Yes, but because of the way we do PCI resource allocation, there's no
[safe] way because it wasn't really keeping track of what resources
were in use. My [small] changes fix this, and as I said, should have
no effect on any other system. All current systems with PCI only expect
the devices to be configured once and for all, so this change won't
affect them.
> >
> > This really only matters if you need to enable a device which didn't
> > get configured the first time around - my very special case. In all
> > other cases, this code will have no real effect.
>
> Agreed.
>
> --
> rnf
>