From owner-freebsd-current@FreeBSD.ORG Fri Dec 12 17:49:15 2008 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C8701065676 for ; Fri, 12 Dec 2008 17:49:15 +0000 (UTC) (envelope-from xcllnt@mac.com) Received: from asmtpout015.mac.com (asmtpout015.mac.com [17.148.16.90]) by mx1.freebsd.org (Postfix) with ESMTP id 20D668FC14 for ; Fri, 12 Dec 2008 17:49:15 +0000 (UTC) (envelope-from xcllnt@mac.com) MIME-version: 1.0 Content-type: multipart/mixed; boundary="Boundary_(ID_tkBOjEQzhdlx2dQU1fqXQA)" Received: from sbansal-mbp.jnpr.net (natint3.juniper.net [66.129.224.36]) by asmtp015.mac.com (Sun Java(tm) System Messaging Server 6.3-7.03 (built Aug 7 2008; 32bit)) with ESMTPSA id <0KBR00827YTMV310@asmtp015.mac.com> for freebsd-current@FreeBSD.org; Fri, 12 Dec 2008 09:48:59 -0800 (PST) Message-id: <9939E942-A2FC-4240-BC14-527D45C187B7@mac.com> From: Marcel Moolenaar To: Boris Samorodov In-reply-to: <94539778@bb.ipt.ru> Date: Fri, 12 Dec 2008 09:48:58 -0800 References: <92804393@bb.ipt.ru> <26722819@bb.ipt.ru> <26719629@bb.ipt.ru> <19F75E66-0535-4982-9726-E2C0A03117EA@mac.com> <94541668@bb.ipt.ru> <48144979@bb.ipt.ru> <548CF0A3-1B07-49DA-A177-6EA85FD8CF2F@mac.com> <94539778@bb.ipt.ru> X-Mailer: Apple Mail (2.929.2) Cc: freebsd-current@FreeBSD.org, rea-fbsd@codelabs.ru Subject: Re: Timeda 8-multiport adapter: only 2 ports available X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Dec 2008 17:49:15 -0000 --Boundary_(ID_tkBOjEQzhdlx2dQU1fqXQA) Content-type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-transfer-encoding: 7BIT On Dec 12, 2008, at 2:37 AM, Boris Samorodov wrote: > I may say that SUN1889 uarts are initialized like default. And indeed > two first ports work here. The card contains only one SUN1889 chip > (for > two first ports). All other chips are SUN1699 which (better to say > serial ports) should be initialized with the flag > SUN1699_CLK_DIVIDER_DISABLE (0x10). > > Don't know how/where to do it. :-( Since it's puc(4) that has the visibility, it's puc(4) that should pre-initialize the IER register for ports that need special treatment. Then later when uart(4) probes and attaches, we need to make sure that uart(4) doesn't mess up the settings, but other than that it does not need to know. Unfortunately, there's no existing configuration command for this sort of thing. In particular, you want to pass the resource corresponding to the port to the config function so that it can talk to the hardware without kluges. The attached patch is a quick and dirty way to program the ports. Can you see if it actually works and if it makes a difference? -- Marcel Moolenaar xcllnt@mac.com --Boundary_(ID_tkBOjEQzhdlx2dQU1fqXQA) Content-type: application/octet-stream; x-unix-mode=0644; name=puc.diff Content-transfer-encoding: 7bit Content-disposition: attachment; filename=puc.diff Index: pucdata.c =================================================================== --- pucdata.c (revision 185784) +++ pucdata.c (working copy) @@ -1145,6 +1145,10 @@ case PUC_CFG_GET_TYPE: *res = PUC_TYPE_SERIAL; return (0); + case PUC_CFG_INIT_PORT: + bus_write_1((struct res *)res, 1 /* IER */, + (port >= 2) ? 0x10 : 0); + return (0); default: break; } Index: puc_cfg.c =================================================================== --- puc_cfg.c (revision 185784) +++ puc_cfg.c (working copy) @@ -166,6 +166,8 @@ } *r = PUC_TYPE_SERIAL; return (0); + case PUC_CFG_INIT_PORT: + return (0); case PUC_CFG_SETUP: *r = ENXIO; return (0); Index: puc.c =================================================================== --- puc.c (revision 185784) +++ puc.c (working copy) @@ -296,6 +296,9 @@ goto fail; port->p_rclk = res; + (void)puc_config(sc, PUC_CFG_INIT_PORT, idx, + (void *)port->p_rres); + port->p_dev = device_add_child(dev, NULL, -1); if (port->p_dev != NULL) device_set_ivars(port->p_dev, (void *)port); Index: puc_cfg.h =================================================================== --- puc_cfg.h (revision 185784) +++ puc_cfg.h (working copy) @@ -62,6 +62,7 @@ PUC_CFG_GET_OFS, PUC_CFG_GET_RID, PUC_CFG_GET_TYPE, + PUC_CFG_INIT_PORT, PUC_CFG_SETUP }; --Boundary_(ID_tkBOjEQzhdlx2dQU1fqXQA)--