Subject: Re: A TODO list for cardbus/ PCMCIA support.
To: Jonathan Stone <jonathan@DSG.Stanford.EDU>
From: Chris G. Demetriou <>
List: tech-kern
Date: 06/17/1999 15:40:05
Jonathan Stone <jonathan@DSG.Stanford.EDU> writes:
> just to make sure I grok this:
> The people who dont even have PCMCIA support are stuck there because
> their BIOS isnt initializing their bridge (whether pcic or cbb). to
> cure that, we need not just bin-packing, but code to initialize the
> pcic/cbb and/or map its register BAR. Which may mean grovelling
> around PCI attribute space.  Right?

part and parcel with what i think of as the bin-packing necessary to
do PCI configuration is the actually programming of the BARs, yes.

> And the `bin packing' isnt solely figuring out how much space to
> allocate. its also providing support to the child devices (attached
> via pcicma? or cardbus?)  so that when their attach functions get
> called, they can allocate space within the corect window, as seen by
> the parent. Right? Or am I misunderstanding?

That's pretty much right; the 'bin packing' actually includes
configuring the PCI device hierarchy to have the right BARs.

It's a three pass thing, the way i see it:

* You go down the PCI bus hierarchy figuring out where and how big
the devices are.

* You then go back up the PCI bus hierarchy figuring out how to pack
devices into 'bins' (the windows provided by the bridges).

* You then go badn down the PCI bus hierarchy actually filling in
bridges configuration registers and devices' BARs.

(There's also the issue of assigning secondary/subordinate bus
numbers, etc., which is a similar thing.)

Really, since many modern PCI BIOSes (on PCs 8-) don't do PCI address
space assignment, we have to do it.

We have to have the same code to cope with the bin-packing necessary
for CardBus cards and devices behind them.

> That stilll leaves adding code to refrob unitialized CBBs so that
> their BARs are visible and (bletch) maybe turning on the PCMCIA-compat-access,
> if it isn't on (is that what you meant by "get support immediately??)
> can be done in parallel.
> E.g., a derivative of sys/dev/pci/i82365_pci.c, except that it'd match
> based on class and subclass, and enable PCI BAR registers if
> unmapped,, and enable the PCMCIA-compat mode. Is that what you meant
> by ``immediate support'' for pcmcia, or was it something else again?

No.  by 'immediate support' i mean pcic at isa.

In the cases i'm thinking of, the _only_ thing preventing the 'pcic at
isa' compatibility attachment from functioning is the fact that the
CBBs' BARs have not been mapped.

Solve that, and you make some set of people much happier.

Chris Demetriou - -
Disclaimer: Not speaking for NetBSD, just expressing my own opinion.