From owner-freebsd-hardware@FreeBSD.ORG Tue May 24 20:01:03 2011 Return-Path: Delivered-To: freebsd-hardware@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 411F8106566C for ; Tue, 24 May 2011 20:01:03 +0000 (UTC) (envelope-from njm@njm.me.uk) Received: from smtp003.apm-internet.net (smtp003.apm-internet.net [85.119.248.52]) by mx1.freebsd.org (Postfix) with SMTP id A68B98FC12 for ; Tue, 24 May 2011 20:01:02 +0000 (UTC) Received: (qmail 1774 invoked from network); 24 May 2011 20:01:01 -0000 Received: from unknown (HELO oberon.njm.me.uk) (86.166.167.42) by smtp003.apm-internet.net with SMTP; 24 May 2011 20:01:01 -0000 Received: from titania.njm.me.uk (titania.njm.me.uk [192.168.144.130]) by oberon.njm.me.uk (8.14.4/8.14.4) with ESMTP id p4OK10rq047009; Tue, 24 May 2011 21:01:00 +0100 (BST) (envelope-from njm@njm.me.uk) Received: from titania.njm.me.uk (localhost [127.0.0.1]) by titania.njm.me.uk (8.14.4/8.14.4) with ESMTP id p4OK10Ot099250; Tue, 24 May 2011 21:01:00 +0100 (BST) (envelope-from njm@njm.me.uk) Received: (from njm@localhost) by titania.njm.me.uk (8.14.4/8.14.4/Submit) id p4OK109J099249; Tue, 24 May 2011 21:01:00 +0100 (BST) (envelope-from njm@njm.me.uk) Date: Tue, 24 May 2011 21:01:00 +0100 From: "N.J. Mann" To: John Baldwin Message-ID: <20110524200100.GA92553@titania.njm.me.uk> Mail-Followup-To: John Baldwin , freebsd-hardware@freebsd.org References: <20110522110002.GB91694@titania.njm.me.uk> <201105240755.38404.jhb@freebsd.org> <20110524155810.GA6748@titania.njm.me.uk> <201105241341.49546.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105241341.49546.jhb@freebsd.org> X-Operating-System: FreeBSD 8.2-STABLE User-Agent: mutt-NJM (2010-10-31) Cc: freebsd-hardware@freebsd.org Subject: Re: Sunix 4056A PCI 4 port RS-232 card - only 2 ports configured X-BeenThere: freebsd-hardware@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General discussion of FreeBSD hardware List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 May 2011 20:01:03 -0000 In message <201105241341.49546.jhb@freebsd.org>, John Baldwin (jhb@freebsd.org) wrote: > On Tuesday, May 24, 2011 11:58:10 am N.J. Mann wrote: > > In message <201105240755.38404.jhb@freebsd.org>, > > John Baldwin (jhb@freebsd.org) wrote: > > > On Monday, May 23, 2011 11:17:08 am N.J. Mann wrote: > > > > In message <201105231026.54178.jhb@freebsd.org>, > > > > John Baldwin (jhb@freebsd.org) wrote: > > > > > On Sunday, May 22, 2011 7:00:02 am N.J. Mann wrote: > > > > > > Hi, > > > > > > > > > > > > > > > > > > I am trying to setup a console server, but I am having a problem > with > > > > > > the hardware. The RS-232 card I am using is a Sunix 4056A Universal > PCI > > > > > > 4 port RS-232 card. However, only two ports are being configured, > uart2 > > > > > > and uart3 - uart0 and uart1 are on the motherboard. I had assumed > that > > > > > > all I had to do was install the card, add puc(4) to my kernel and it > > > > > > would just work. > > > > > > > > > > > > uname: > > > > > > ------ > > > > > > FreeBSD 9.0-CURRENT #0: Thu May 19 15:01:10 UTC 2011 i386 > > > > > > > > > > > > I CVSup'ed about fours before then. > > > > > > > > > > > > > > > > > > relevant parts of verbose dmesg: > > > > > > -------------------------------- > > > > > > found-> vendor=0x1409, dev=0x7168, revid=0x01 > > > > > > domain=0, bus=0, slot=10, func=0 > > > > > > class=07-00-02, hdrtype=0x00, mfdev=0 > > > > > > cmdreg=0x0081, statreg=0x0280, cachelnsz=0 (dwords) > > > > > > lattimer=0x00 (0 ns), mingnt=0x00 (0 ns), maxlat=0x00 (0 ns) > > > > > > intpin=a, irq=3 > > > > > > map[10]: type I/O Port, range 32, base 0xe000, size 5, enabled > > > > > > map[14]: type I/O Port, range 32, base 0xe400, size 4, enabled > > > > > > pcib0: matched entry for 0.10.INTA > > > > > > pcib0: slot 10 INTA hardwired to IRQ 18 > > > > > > [...] > > > > > > puc0: port > 0xe000-0xe01f,0xe400-0xe40f > > > > > > irq 18 at device 10.0 on pci0 > > > > > > ioapic0: routing intpin 18 (PCI IRQ 18) to lapic 0 vector 52 > > > > > > uart2: <16550 or compatible> on puc0 > > > > > > uart2: fast interrupt > > > > > > uart3: <16550 or compatible> on puc0 > > > > > > uart3: fast interrupt > > > > > > > > > > > > > > > > > > I can provide a full verbose dmesg if required, together with any > other > > > > > > information which may be relevant. > > > > > > > > > > > > Any and all help gratefully received. > > > > > > > > > > Hmm, for Timedia it looks like the puc(4) driver uses the subvendor > device ID > > > > > to figure out how many ports your card has, but it does see 4 ports > (the > > > > > device descrption is correct). Does 'devinfo -v' show any other child > > > > > devices of 'puc0' besides the two uart devices? > > > > > > > > No. > > > > > > > > puc0 pnpinfo vendor=0x1409 device=0x7168 subvendor=0x1409 > subdevice=0x4056 class=0x070002 at slot=10 function=0 > > > > uart2 > > > > uart3 > > > > > > > > (If you want the complete output of devinfo just ask - I assumed from > > > > your question you only wanted the puc-releated section.) > > > > > > Yeah, this is all I wanted. Hmm, so from the description we can see that > > > it thinks you have 4 ports: > > > > > > snprintf(desc, sizeof(desc), > > > "Timedia technology %d Port Serial", (int)sc->sc_cfg_data); > > > > > > and the code that sets sc_cfg_data sets it to the number of supported > ports > > > that PUC_CFG_GET_NPORTS returns: > > > > > > case PUC_CFG_GET_NPORTS: > > > ... > > > if (subdev == subdevs[dev].ids[id]) { > > > sc->sc_cfg_data = subdevs[dev].ports; > > > *res = sc->sc_cfg_data; > > > return (0); > > > } > > > > The above code returns 4 each time it is called - three times. > > > > > > > > You might need to just add some printfs to puc_bfe_attach(). It would be > good > > > to see if the PUC_CFG_GET_NPORTS request in attach also returned 4 in res > (the > > > description string is set in puc_bfe_probe()). > > > > Okay, lots of printf's later. :-) > > > > In put_bfe_attach() the second 'for' loop which starts with the comment > > "Probe and attach our children." - puc.c line 352 - the call to > > device_probe_and_attach passes for the first two ports, but fails for > > the second two with an error code of 6. Does that make any sense to > > you? > > Ahh, can you comment out the 'device_delete_child' bit for now? It might be > worth adding some tracing to see if uart_puc_probe() is being called and if so > why it is failing. I commented out device_delete_child and then added printf's in uart_pub_probe() and uart_bus_probe. It is UART_PROBE which is returning 6 for the second two ports. I must be missing something because I cannot find where UART_PROBE is defined. Any chance of giving me a clue? :-) Many thanks. Cheers, Nick. --