From owner-freebsd-multimedia Thu Jul 31 06:46:35 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id GAA09442 for multimedia-outgoing; Thu, 31 Jul 1997 06:46:35 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by hub.freebsd.org (8.8.5/8.8.5) with SMTP id GAA09422; Thu, 31 Jul 1997 06:46:22 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id OAA05722; Thu, 31 Jul 1997 14:46:17 +0200 From: Luigi Rizzo Message-Id: <199707311246.OAA05722@labinfo.iet.unipi.it> Subject: Re: Advice sought on PnP configuration To: hasty@rah.star-gate.com (Amancio Hasty) Date: Thu, 31 Jul 1997 14:46:17 +0200 (MET DST) Cc: se@FreeBSD.ORG, hackers@FreeBSD.ORG, multimedia@FreeBSD.ORG In-Reply-To: <199707311008.DAA05428@rah.star-gate.com> from "Amancio Hasty" at Jul 31, 97 03:08:26 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-multimedia@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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