From owner-freebsd-hardware@FreeBSD.ORG Thu May 26 13:12:15 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 02DF11065677 for ; Thu, 26 May 2011 13:12:15 +0000 (UTC) (envelope-from njm@njm.me.uk) Received: from smtp004.apm-internet.net (smtp004.apm-internet.net [85.119.248.54]) by mx1.freebsd.org (Postfix) with SMTP id 7B6B48FC20 for ; Thu, 26 May 2011 13:12:13 +0000 (UTC) Received: (qmail 42102 invoked from network); 26 May 2011 13:12:11 -0000 Received: from unknown (HELO oberon.njm.me.uk) (86.150.31.19) by smtp004.apm-internet.net with SMTP; 26 May 2011 13:12:11 -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 p4QDCBrn017198; Thu, 26 May 2011 14:12:11 +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 p4QDCAWO014240; Thu, 26 May 2011 14:12:10 +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 p4QDCA5R014239; Thu, 26 May 2011 14:12:10 +0100 (BST) (envelope-from njm@njm.me.uk) Date: Thu, 26 May 2011 14:12:10 +0100 From: "N.J. Mann" To: John Baldwin Message-ID: <20110526131210.GA9481@titania.njm.me.uk> Mail-Followup-To: John Baldwin , freebsd-hardware@freebsd.org, Marcel Moolenaar References: <20110522110002.GB91694@titania.njm.me.uk> <201105241610.49930.jhb@freebsd.org> <20110524215232.GB92553@titania.njm.me.uk> <201105250946.45653.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201105250946.45653.jhb@freebsd.org> X-Operating-System: FreeBSD 8.2-STABLE User-Agent: mutt-NJM (2010-10-31) Cc: Marcel Moolenaar , 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 13:12:15 -0000 Hi John, In message <201105250946.45653.jhb@freebsd.org>, John Baldwin (jhb@freebsd.org) wrote: > On Tuesday, May 24, 2011 5:52:32 pm N.J. Mann wrote: > > In message <201105241610.49930.jhb@freebsd.org>, > > John Baldwin (jhb@freebsd.org) wrote: > > [snip] > > > > > > Ah, uart_puc_probe() always uses the 'uart_ns8250_class' uart driver which > > > is defined in uart_dev_ns8250.c. ns8250_bus_probe() is what you want to > > > instrument I think. > > > > ns8250_bus_probe() is called twice for each of the working devices as > > follows: > > > > UART2: > > ------ > > ns8250_bus_probe:: entry > > ns8250_probe::uart_getreg REG_IIR = 1 > > ns8250_probe::uart_getreg REG_MCR = 0 > > ns8250_bus_probe:: exit > > ... > > ns8250_bus_probe:: entry > > ns8250_probe::uart_getreg REG_IIR = 193 > > ns8250_probe::uart_getreg REG_MCR = 8 > > ns8250_bus_probe:: exit > > > > UART3 > > ----- > > ns8250_bus_probe:: entry > > ns8250_probe::uart_getreg REG_IIR = 1 > > ns8250_probe::uart_getreg REG_MCR = 0 > > ns8250_bus_probe:: exit > > ... > > ns8250_bus_probe:: entry > > ns8250_probe::uart_getreg REG_IIR = 193 > > ns8250_probe::uart_getreg REG_MCR = 8 > > ns8250_bus_probe:: exit > > > > For the two devices that fail, ns8250_bus_probe() fails on the first > > call: > > > > UART4 > > ----- > > ns8250_bus_probe:: entry > > ns8250_probe::uart_getreg REG_IIR = 1 > > ns8250_probe::uart_getreg REG_MCR = 64 > > ns8250_bus_probe::ns8250_probe returned 6 > > > > UART5 > > ----- > > ns8250_bus_probe:: entry > > ns8250_probe::uart_getreg REG_IIR = 1 > > ns8250_probe::uart_getreg REG_MCR = 64 > > ns8250_bus_probe::ns8250_probe returned 6 > > > > The value returned for the read of REG_MCR is 64, or 0x40, which causes > > the premature exit: > > > > static int > > ns8250_probe(struct uart_bas *bas) > > { > > u_char val; > > > > /* Check known 0 bits that don't depend on DLAB. */ > > val = uart_getreg(bas, REG_IIR); > > if (val & 0x30) > > return (ENXIO); > > val = uart_getreg(bas, REG_MCR); > > if (val & 0xe0) > > return (ENXIO); > > > > return (0); > > } > > > > Do you need to know the contents of 'bas'? > > This goes beyond my level of knowledge. I've cc'd Marcel (author of uart) who > can hopefully help with this more. Thank you for all your help. I now have all four ports working, but a few things still need sorting out. I'll see if Marcel can help me. Best wishes. Cheers, Nick. --