From owner-freebsd-hardware@FreeBSD.ORG Thu May 26 20:23:52 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 16002106566C for ; Thu, 26 May 2011 20:23:52 +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 6D1178FC20 for ; Thu, 26 May 2011 20:23:51 +0000 (UTC) Received: (qmail 56489 invoked from network); 26 May 2011 20:23:50 -0000 Received: from unknown (HELO oberon.njm.me.uk) (86.144.179.173) by smtp003.apm-internet.net with SMTP; 26 May 2011 20:23:50 -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 p4QKNoQB040081; Thu, 26 May 2011 21:23:50 +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 p4QKNnpV037605; Thu, 26 May 2011 21:23:49 +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 p4QKNnVD037604; Thu, 26 May 2011 21:23:49 +0100 (BST) (envelope-from njm@njm.me.uk) Date: Thu, 26 May 2011 21:23:49 +0100 From: "N.J. Mann" To: Marcel Moolenaar Message-ID: <20110526202349.GB29605@titania.njm.me.uk> Mail-Followup-To: Marcel Moolenaar , John Baldwin , freebsd-hardware@FreeBSD.org References: <20110522110002.GB91694@titania.njm.me.uk> <201105241610.49930.jhb@freebsd.org> <20110524215232.GB92553@titania.njm.me.uk> <201105250946.45653.jhb@freebsd.org> <803C09E5-8E10-4289-A8B3-952E8A72C7A1@xcllnt.net> <20110526134211.GB9481@titania.njm.me.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 8.2-STABLE User-Agent: mutt-NJM (2010-10-31) Cc: John Baldwin , 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: Thu, 26 May 2011 20:23:52 -0000 In message , Marcel Moolenaar (marcel@xcllnt.net) wrote: > > On May 26, 2011, at 6:42 AM, N.J. Mann wrote: > > *snip* > > >> For you, the first thing is to see whether the UART ports work > >> if you tweak the probe functions, like so: > >> > >> Index: uart_dev_ns8250.c > >> =================================================================== > >> --- uart_dev_ns8250.c (revision 222217) > >> +++ uart_dev_ns8250.c (working copy) > >> @@ -243,7 +243,7 @@ > >> if (val & 0x30) > >> return (ENXIO); > >> val = uart_getreg(bas, REG_MCR); > >> - if (val & 0xe0) > >> + if (val & 0xa0) > >> return (ENXIO); > >> > >> return (0); > > > > I tried this and the result is that ports 3 and 4 now attach okay. > > However, the baud rate of these two is wrong. If I select 9600 they > > actually send and receive at 1200, i.e. eight times slower. The speed > > setting for the first two ports is correct. (I checked all four ports at > > 9600, 38400 and 115200.) > > See John's email for the baudrate issue. > > >> Secondly, I'd like to know the vendor of the Quad-port UART. Either > >> it's Sunix's own implementation (this seems to be the case), or they > >> simply OEM someone else's. In any case: I'd like to see the datasheet > >> of the ASIC so as to understand the meaning/function of the bit. > > > > I took the card out of the PC to see exactly what is on it. There are > > three LSI chips, plus four RS-232 interface chips. The largest of the > > LSI chips is a SUN1889 and it appears to connect to ports 1 and 2, and > > to the PCI bus. The other two LSI chips are both SUN1699. The first of > > these seems to be for port 3 and the second for port 4. I tried finding > > data sheets for these chips on the web, but all I could find was > > marketing leaflets for various single- and multi-port RS-232 and RS-422 > > interface cards. Perhaps you will have better luck in searching than I > > did. > > Thanks! This what really useful. It seems that the SUN1699 has MCR > bit 6 set by default or it's even hardwired as 1. There have been > various reports on the FreeBSD mailing lists relating to the SUN1699 > and how uart(4) doesn't attach due to the MCR having a value of 0x40. > > Looking at the Sunix driver for Linux I cannot see any reference to > this bit at all. The code does not mask it out or force it to 1 > either. So, from what I can tell, it has absolutely no meaning. > > So, I'll change FreeBSD to just ignore this bit. There's even an open > PR for this: > http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/129663 > > Thanks a lot of working with us! John's latest patch has fixed the speed problem, so I now have a fully working card. %%%%% puc0: port 0xdc00-0xdc1f,0xe000-0xe00f irq 17 at device 9.0 on pci0 ioapic0: routing intpin 17 (PCI IRQ 17) to lapic 0 vector 52 uart2: <16550 or compatible> on puc0 uart2: fast interrupt uart3: <16550 or compatible> on puc0 uart3: fast interrupt uart4: <16550 or compatible> on puc0 uart4: fast interrupt uart5: <16550 or compatible> on puc0 uart5: fast interrupt %%%%% Many thanks. Cheers, Nick. --