On 11/14/06, Cyril Plisko <[EMAIL PROTECTED]> wrote:
On 11/14/06, Dan Mick <[EMAIL PROTECTED]> wrote:

> >> Cyril, what happens when you enabled this BAR - presumably it needs
> >> resources allocated to it?
> >
> > Yes, I need to map this BAR. If that is what you mean by allocating
> > resources
>
> well, "map this BAR" is ambiguous.  Physical memory space needs to be

Hm, by "map this BAR" I mean that I want ddi_regs_map_setup() call to succeed.
Is it less ambiguous now ?

> carved out from the memory map of the machine, of a length appropriate for
> the registers on the card.  I've no idea how a generic PCI enumerator is
> supposed to handle such an abomination.

Abomination is strong word, but it, probably, appropriate here...

>
> >
> >> Does the device work in a degraded mode without this register enabled?
> >
> > It is more like the device is doing something else. This vendor specific
> > register has far reaching implication. When I set the bit I want, not only
> > additional BAR appears, but even PCI subclass is changing reflecting
> > the fact that device has new capability.
> >
> > I think the designers of that hardware assumed that tinkering with the
> > vendor specific register and enumeration is done as one step, but
> > with Solaris that is not true.
>
> or other OSes, I bet.

I lack a relevant experience to say that for other OSes.
Would, say, Linux have similar problems with such a device ?


Probably. Fir x86 at least, Linux relies on the BIOS to do the bus
enumeration and I'm sure the vendors of this device did not expect
BIOS tweaks to get it to work.
Can you sacrifice any of the existing BARs? If so you could copy the
address information across into the 'hidden' bar and then use
ddi_regs_map_setup() specifying the old bar index number (which start
with 1 on Solaris, since 0 is reserved for mapping PCI config. space
itself).

> The only thought that comes to mind is a device-specific hack in the
> generic allocation routines.

I am willing to invest some time into hacking this, what would be the
place to start looking at (from your experience) ? pci_autoconfig ?


If I were you, I'd follow through what happens when you do
ddi_regs_map_setup(). There's a nexus upcall which uses the reg and
assigned-addresses props to do figure out the mapping. If you can't
sacrifice an existing BAR and want to add a BAR, assuming you can find
a spare bit of physical address space then you should be able to tag
on an entry to the reg and assigned-addresses props. It will be a
pretty grotesque hack though.

 Paul

--
Paul Durrant
http://www.linkedin.com/in/pdurrant
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to