Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Dec 2008 09:48:58 -0800
From:      Marcel Moolenaar <xcllnt@mac.com>
To:        Boris Samorodov <bsam@ipt.ru>
Cc:        freebsd-current@FreeBSD.org, rea-fbsd@codelabs.ru
Subject:   Re: Timeda 8-multiport adapter: only 2 ports available
Message-ID:  <9939E942-A2FC-4240-BC14-527D45C187B7@mac.com>
In-Reply-To: <94539778@bb.ipt.ru>
References:  <92804393@bb.ipt.ru> <26722819@bb.ipt.ru> <dgryeQY4GEVsW/%2Bo7hiHda0rsyw@Nv45r0f9gWT8HCu35qu0Xm2Zg98> <26719629@bb.ipt.ru> <19F75E66-0535-4982-9726-E2C0A03117EA@mac.com> <u86IhinAe98poBxKoJlfe3b/pNw@TT2a40bhZF2dUby2PPEihZ1bSVY> <94541668@bb.ipt.ru> <BE3580EA-BACC-4FF3-9683-CCDE48858D96@mac.com> <48144979@bb.ipt.ru> <548CF0A3-1B07-49DA-A177-6EA85FD8CF2F@mac.com> <94539778@bb.ipt.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--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)--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9939E942-A2FC-4240-BC14-527D45C187B7>