Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 31 Jul 1997 14:46:17 +0200 (MET DST)
From:      Luigi Rizzo <luigi@labinfo.iet.unipi.it>
To:        hasty@rah.star-gate.com (Amancio Hasty)
Cc:        se@FreeBSD.ORG, hackers@FreeBSD.ORG, multimedia@FreeBSD.ORG
Subject:   Re: Advice sought on PnP configuration
Message-ID:  <199707311246.OAA05722@labinfo.iet.unipi.it>
In-Reply-To: <199707311008.DAA05428@rah.star-gate.com> from "Amancio Hasty" at Jul 31, 97 03:08:26 am

next in thread | previous in thread | raw e-mail | index | archive | help
> Yes, it is a quick hack and it is also a manual mechanism to override 
> very intelligent algorithms;additionally, is not and all encompassing
> solution and one that will allow us to get the stuff out soon *safely*.

As a matter of fact I do like this approach and have done (and/or planned)
something very similar to test my cards. However I would go a step
further and use some bits in the "flags" field to say things like

  - do not use this entry to configure a plain isa device; rather,
    use it for the i-th PnP device which matches card type TT

i.e. something like

    #standard entry for isa devices
    device pcm0 at isa? port 0x220 irq 11 drq 5 flags 0x17
    #                                                   ||
    #                   use dual dma channel  ----------'|
    *                   secondary dma channel -----------'
    #
    #special entry for PnP device
    device pcm1 at isa? port 0x604 irq 7  drq 1 flags 0x10TT10
    #                                                   ||||||
    #                   special entry for PnP ----------'|||||
    #                   use it for device 0   -----------'||||
    #                   matching type TT      ------------''||
    #                   use two dma channels  --------------'|
    #                   secondary dma is 0    ---------------'

The device type TT is a unique identifier associated with the card and
presumably returned by the PnP probe code in the kernel.

I have almost all of this (including the device type) implemented in my
code.  Note however that not always things are so simple. Some (many)
PnP cards use multiple address ranges, some of which might not be
associated with any particular function. An example, the OPTi931 (I
have two here and plan to support them rsn) has a block of addresses
used for configuration purposes and not associated with any I/O.

Conclusion: the manual override mechanism is surely needed, the problem
is that there are not enough bits in the config line to specify the
desired ranges. Maybe we can modify "config" to allow a syntax like

device pnp0 id "CSC4236" config "io 0x604 0x300 0x200 mem 0x300 irq 6 dma 5 6"
device pnp1 id "OPT9310" config "io 0x530 0x330 irq 7 dma 5 6"
...

	Cheers
	Luigi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707311246.OAA05722>