From owner-freebsd-stable@FreeBSD.ORG Mon Nov 22 18:05:18 2004 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 36CEE16A4CE for ; Mon, 22 Nov 2004 18:05:18 +0000 (GMT) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id DCA2543D31 for ; Mon, 22 Nov 2004 18:05:17 +0000 (GMT) (envelope-from jmg@hydrogen.funkthat.com) Received: (qmail 24899 invoked from network); 22 Nov 2004 18:05:17 -0000 Received: from gate.funkthat.com (HELO hydrogen.funkthat.com) ([69.17.45.168]) (envelope-sender ) by mail2.speakeasy.net (qmail-ldap-1.03) with SMTP for ; 22 Nov 2004 18:05:17 -0000 Received: from hydrogen.funkthat.com (zmjktu@localhost.funkthat.com [127.0.0.1])iAMI5FB6001331; Mon, 22 Nov 2004 10:05:16 -0800 (PST) (envelope-from jmg@hydrogen.funkthat.com) Received: (from jmg@localhost) by hydrogen.funkthat.com (8.12.10/8.12.10/Submit) id iAMI5FmM001330; Mon, 22 Nov 2004 10:05:15 -0800 (PST) Date: Mon, 22 Nov 2004 10:05:15 -0800 From: John-Mark Gurney To: Paul Sandys Message-ID: <20041122180515.GX57546@funkthat.com> Mail-Followup-To: Paul Sandys , freebsd-stable@freebsd.org References: <20041114231939.Y71461@bsd3.nyct.net> <20041120084456.GU57546@funkthat.com> <20041122113525.G31812@bsd3.nyct.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20041122113525.G31812@bsd3.nyct.net> User-Agent: Mutt/1.4.1i X-Operating-System: FreeBSD 4.2-RELEASE i386 X-PGP-Fingerprint: B7 EC EF F8 AE ED A7 31 96 7A 22 B3 D8 56 36 F4 X-Files: The truth is out there X-URL: http://resnet.uoregon.edu/~gurney_j/ X-Resume: http://resnet.uoregon.edu/~gurney_j/resume.html cc: freebsd-stable@freebsd.org Subject: Re: SIIG cards and puc X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: John-Mark Gurney List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Nov 2004 18:05:18 -0000 Paul Sandys wrote this message on Mon, Nov 22, 2004 at 11:46 -0500: > The SIIG card I have does use shared interrupt for both ports, so I don't see > any other way around it. > > The 0x40000001 is a regular flag that's used by sio.c . I found an undocumented > feature in there, that allows you to set a FIFO size, so I used it in > combination with the shared irq flag. Ahh, yes... Then we now have the interesting problem that it appears that PUC and sio share flags... :( from puc.c: type = (sc->sc_desc.ports[i].flags & PUC_FLAGS_MEMORY) ? SYS_RES_MEMORY : SYS_RES_IOPORT; and: device_set_flags(sc->sc_ports[i].dev, sc->sc_desc.ports[i].flags); which means you are also turning on memory mapping for the card... I'm not comfortable including a flag for an undocumented feature as a standard part of the system.. Care to document it? :) Also, are you sure it's the ISMULTIPORT that needs to be set? (and not the MEMORY flag you are acidentally also setting?) From what I've read of the PUC driver, it handles the multiport case for you since it hands out the interrupts to the sio driver... see this comment above puc_intr: * This is an interrupt handler. For boards that can't tell us which * device generated the interrupt it just calls all the registered * handlers sequencially, but for boards that can tell us which hmmm.. that's probably how it gets around the fact that it doesn't need to pass in the multiport flag, so we should probably be clearing that flag before passing it down to the lower layers... > from sio.c: > #define COM_ISMULTIPORT(flags) ((flags) & 0x01) > #define COM_FIFOSIZE(flags) (((flags) & 0xff000000) >> 24) > > Here's the diff: > > *** pucdata.c.orig Mon Nov 22 11:40:30 2004 > --- pucdata.c Mon Nov 22 11:41:02 2004 > *************** > *** 539,546 **** > { 0x131f, 0x2031, 0, 0 }, > { 0xffff, 0xffff, 0, 0 }, > { > ! { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ }, > ! { PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ }, > }, > }, > > --- 539,546 ---- > { 0x131f, 0x2031, 0, 0 }, > { 0xffff, 0xffff, 0, 0 }, > { > ! { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ, 0x40000001 }, > ! { PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ, 0x40000001 }, > }, > }, > > > On Sat, 20 Nov 2004, John-Mark Gurney wrote: > > > Date: Sat, 20 Nov 2004 00:44:56 -0800 > > From: John-Mark Gurney > > To: Paul Sandys > > Cc: freebsd-stable@freebsd.org > > Subject: Re: SIIG cards and puc > > > > Paul Sandys wrote this message on Sun, Nov 14, 2004 at 23:25 -0500: > > > I've tried to get one of the 20x family 16C650 64-byte buffer SIIG cards to > > > work. It does not work out of the box. > > > > > > I had to add 0x40000001 into the flags in pucdata.c for my card and "options > > > > where does this magic value come from? Could you express it in defines > > in the code? i.e. PUC_FLAGS_MEMORY > > > > > COM_MULTIPORT" into the kernel config. It's still limited to 115200 baud, but > > > all I was interested is 9600 anyway. > > > > COM_MULTIPORT will not be default due to the impact of having to test > > every sio port on any sio interrupt... > > > > > Can this be implemented into the source tree ? > > > > A patch is helpful. -- John-Mark Gurney Voice: +1 415 225 5579 "All that I will do, has been done, All that I have, has not."