From owner-freebsd-hackers Tue Jan 9 20:37:14 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id UAA05665 for hackers-outgoing; Tue, 9 Jan 1996 20:37:14 -0800 (PST) Received: from sl-022.sl.cybercomm.net (sl-022.sl.cybercomm.net [199.171.196.150]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id UAA05655 for ; Tue, 9 Jan 1996 20:37:03 -0800 (PST) Received: from sl-022.sl.cybercomm.net (localhost [127.0.0.1]) by sl-022.sl.cybercomm.net (8.6.12/8.6.12) with SMTP id XAA08010; Tue, 9 Jan 1996 23:36:41 -0500 Date: Tue, 9 Jan 1996 23:36:40 -0500 (EST) From: Sujal Patel X-Sender: smpatel@sl-022.sl.cybercomm.net To: "Amancio Hasty Jr." cc: freebsd-hackers@freebsd.org, Mike Grupenhoff Subject: PnP Proposal, Ideas & Issues [Was: PnP problem...] In-Reply-To: <199601100111.RAA01689@rah.star-gate.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@freebsd.org Precedence: bulk On Tue, 9 Jan 1996, Amancio Hasty Jr. wrote: > Well, I have a GUS PnP and it has a few devices on the card. Any cool > suggestions on how to tackle the PnP problem of auto-magically configuring > PnP devices when we have something like the GUS PnP? [...] > From: Sujal Patel [...] > Grand Total: 4 Interrupts, 3 DMA Channels, 7 sets of I/O ports... Let me apologize before I start because this is pretty long. I did some more work on the PnP code today and it seems more and more that auto-magic configuration just isn't going to work. There are way too many problems with detecting what resources are free (at boot time) and what resources aren't. Also, Cards like Amancio's GUS PnP require incredible amounts of resouces (see above). So the first goal was to be able to specify certain resources that a PnP card should use: I was hoping that we could strive for something along of the lines of: device sio2 at isa? pnp "SUP1310" port "IO_COM3" tty irq 15 vector siointr This would be nice and simple-- Say that PnP device "SUP1310" is handled by driver sio2 and configure the card and the driver for port 0x3e8 and irq 15. But unfortunately, the solution is not going to nearly this simple. Cards like the GUS PnP and other multi-function cards cannot be configured like this at all. To make matters worse the Specification is pretty complex (Intel engineers must had been on LSD or something :) Here's the scoop: Each card can have as many "Logical" devices that it wants (simple cards like my PnP modem & PnP network card have only 1 Logical Device, complex cards like Amancio's Gus have *5* logical devices). Each Logical Device can ask for: up to 8 sets of I/O Ports up to 2 IRQs up to 2 DMA Channels up to 4 Memory Regions and countless other things.. To support this complicated specification. I suggest this: controller pnp0 pnpconfig device "SUP1310" port0 0x3e8-0x3f7 irq0 15 pnpconfig device "GRV0000" port0 0x220 port1 ox320 port2 0x32c irq0 12 drq0 5 drq1 7 pnpconfig device "GRV0001" port0 0xie8 port1 0x3ee irq0 11 pnpconfig device "GRV0003" port0 0x388 irq0 5 drq0 1 This is a partial config file, which supports my Modem and 3 out of 5 logical devices from Amancio's GUS. It is pretty simple for my modem, but gets very complicated for cards like the GUS PnP... Unfortuantely, I just can't think of any simpler way-- There is just too much information that needs to be expressed to configure a device. Phew... I think that's about it for manual configuration of PnP devices (hope it all made sense, it's pretty late). Next on the menu, auto-configuration of PnP devices. I'm sure that we're gonna always need some kind of manual configuration of PnP devices (for those really though cards like the GUS). The majority of PnP cards should be very simple to configure (and could be done automatically at boot-time). The problem is that it seems VERY difficult to determine exactly what resources are going to be used when the system is booting. The first problem that I see is that the ISA/EISA/PCI devices all fill in these own structures about I/O port usage, iomem usage, IRQ usage, etc. Also, there is no way to determine exactly what resources an ISA device is going to use (For example, I say device sio port 0x3f8, but I don't know how many ports this device is really going to use). Is there any practical way to get around these difficulties. I think that if every ISA device throughly reported what resources it was going to use, and the PnP configuration routine occured after PCI, EISA, PCCARD, then you could fairly easily find free resources. It would be as simple as wading through the isa_device structure to find resources that will be used by ISA devs, and marking off the stuff that PCI/EISA/PCCARD already used. I think that doing the auto-configuration is probably not an immediate goal (nor is it practical to do immediately). I'm going to focus on getting the manual-configuration of PnP cards working (which should come some time soon Amancio :). I would like to hear comments on the proposed config file format somewhere near the middle of this E-Mail, and any other ideas for simplifying this. Sujal