tech-kern archive

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

Re: RFC: device flavours

On Sun, Jul 25, 2010 at 09:22:53PM +0000, Quentin Garnier wrote:
> Hi all,
> I'm looking for comments about what I call "device flavours".  The best
> example of the kind of situation it tries to be an answer for is the
> multiplicity of drivers one can find around the source tree for PCI-ISA
> bridges (mostly on x86).  An even older idea of mine is to finally see
> legacy devices listed in the ACPI tables attached to the PCI-ISA bridge
> where they logically belong, and device flavours can be used for that,
> too.
> Here's an exerpt of the dmesg output I get on my EeeBox, with two
> flavours defined, ichlpc (to replace ichlpcib(4)) and acpiib (to let
> legacy devices attach there;  I've only let npx(4) attach though for the
> sake of the test):
> pcib0 at pci0 dev 31 function 0: vendor 0x8086 product 0x27b9 (rev. 0x02)
> timecounter: Timecounter "pcib0/ichlpc" frequency 3579545 Hz quality 1000
> pcib0/ichlpc: 24-bit timer
> pcib0/ichlpc: TCO (watchdog) timer configured.
> gpio5 at pcib0: 64 pins
> pcib0/acpiib: ACPI node SBRG
> npx1 at pcib0 (COPR, PNP0C04): io 0xf0-0xff irq 13
> npx1: reported by CPUID; using exception 16
> SIOR (PNP0C02) at pcib0 not configured
> RMSC (PNP0C02) at pcib0 not configured
> OMSC (PNP0C02) at pcib0 not configured

ISTM you can accomplish about the same thing and get the pmf(9) support
"for free" with a slightly different approach:

0) Extract ISA "direct configuration" information from ACPI tables (and
   ISA Plug 'N' Play?) and stuff it somewhere that device_register(9)
   can get it.

1) Make device_register() attach ISA direct configuration information to
   each isa(4) instance as device properties.

2) Make isa(4) use direct configuration if the information is available in
   device properties.

3) Refactor ichlpcib0 and pcib0 so that you have
        ichlpc0 at pci0 dev 31 function 0: ...
        timecounter: Timecounter "ichlpc0" frequency 3579545 Hz quality 1000
        ichlpc0: 24-bit timer
        ichlpc0: TCO (watchdog) timer configured.
        pcib0 at ichlpc0: ...
        isa0 at pcib0: ...
        gpio5 at ichlpc0: 64 pins
        npx0 at isa0: ...

ISTM that following such an approach, you get pmf(9) support and
detachment virtually for free.


David Young             OJC Technologies      Urbana, IL * (217) 278-3933

Home | Main Index | Thread Index | Old Index