tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: MI overrides of bus_dma(9), bus_space(9), pci(9)



On Mar 11, 2010, at 3:41 PM, David Young wrote:

> On Thu, Mar 11, 2010 at 12:58:30PM -0800, Matt Thomas wrote:
>> 
>> On Mar 11, 2010, at 12:31 PM, David Young wrote:
>> 
>>> On Thu, Mar 11, 2010 at 12:20:41PM -0800, Matt Thomas wrote:
>>>> On Mar 11, 2010, at 11:40 AM, David Young wrote:
>>>>> Resource management:
>>>>> 
>>>>>  PCI-* bridges can override bus_space_alloc(9)/bus_space_free(9)
>>>>>      in order to (1) allocate space from the upstream bus, (2)
>>>>>      widen/narrow its I/O- or memory-space window.  Then we can
>>>>>      provide a reliable rbus-like facility to detachable buses
>>>>>      through bus_space(9).
>>>> 
>>>> bus_dma_subregion can be used for that.  So bus_space_subregion.
>>> 
>>> Matt,
>>> 
>>> How do we open the windows?
>> 
>> I don't see a reason to do that but you could allocate new larger 
>> subregions from the parent.
> 
> Let's say that we have this PCI setup:
> 
> Host-PCI bridge: forwards MMIO 0xff000000-0xffffffff to PCI bus
>    |
>   pci0
>    |
>    +-------- - - -
>    |
> PCI-PCI bridge: forwards MMIO in [0xffff0000-0xffffffff] to secondary
>    |
>   pci1
>    |
>    +------------------------+-----------------------+
>    |                        |                       |
>    PCI-CardBus bridge       IDE controller          video adapter
>    |
>    +--------+
>    |        |
>   cardbus0 cardbus1
>    |        |
>    |        |
>    |        |
>    NIC      NIC
> 
> The BIOS has exclusively assigned MMIO regions to each PCI adapter.  It
> may or may not have assigned a range to the CardBus bridge itself.  It
> has probably not reserved space for the CardBus NICs, especially not if
> they were attached after boot-up.
> 
> We have to exclusively assign MMIO space to each CardBus NIC's
> registers.  If the PCI-PCI bridge does not forward an address range that
> is big enough to fit the NICs' registers, then we have to reprogram the
> bridge to forward a wider range.
> 
> Dave

Since PPB/CBB allocates in 1 MB units, that seems unlikely unless no MEM 
resources have been alloacted at all.  

However I think bus_space(9) needs a bus_space_alloc_tag which will allocates 
like bus_space_alloc but returns that space in its own bus_space tag which can 
be used to allocate pieces of that allocated region.  We'd also need a 
bus_space_free_tag.



Home | Main Index | Thread Index | Old Index