Subject: kern/37566: OX16PCI954 based cards have mis-match COM_FREQ in pucdata.c
To: None <kern-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <h-masuda@ootani.nagata.kobe.jp>
List: netbsd-bugs
Date: 12/19/2007 06:35:00
>Number:         37566
>Category:       kern
>Synopsis:       OX16PCI954 based cards have mis-match COM_FREQ in pucdata.c
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 19 06:35:00 +0000 2007
>Originator:     MASUDA Hideo
>Release:        NetBSD 3.1_STABLE (i386)
>Organization:
>Environment:
NetBSD serial1 3.1_STABLE NetBSD 3.1_STABLE (SERIAL1) #1: Mon Nov 19 23:19:56 JST 2007  h-masuda@serial1:/usr/netbsd-3/src/sys/arch/i386/compile/SERIAL1 i386

>Description:
Install "IO-DATA RS-232C RSA-PCI2/P4" into my PC. dmesg(1) says as following:

puc0 at pci1 dev 5 function 0: Oxford Semiconductor OX16PCI954 UARTs (com, com,
com, com)
com3 at puc0 port 0: interrupting at irq 5
com3: st16650a, working fifo
com4 at puc0 port 1: interrupting at irq 5
com4: st16650a, working fifo
com5 at puc0 port 2: interrupting at irq 5
com5: st16650a, working fifo
com6 at puc0 port 3: interrupting at irq 5
com6: st16650a, working fifo
puc1 at pci1 dev 5 function 1: Oxford Semiconductor OX16PCI954 Parallel port (lpt)
lpt3 at puc1 port 0: interrupting at irq 5

 I want to connect the NetBSD/sparc machine with serial console via com3.

| # cu -l /dev/dty03 -s 9600
| Connected.

then, no response from the target. but

| # cu -l /dev/dty03 -s 1200
| Connected.
| 
| NetBSD/sparc (madoka) (console)
| 
| login:

I can communicate with the server of 9600bps setting.

>How-To-Repeat:
See Full Description.

>Fix:
I apply the following patch, it will work fine. This can be applied for netbsd-4 and -current.

Index: pucdata.c
===================================================================
RCS file: /cvs/cvsroot/src/sys/dev/pci/pucdata.c,v
retrieving revision 1.40.2.4
diff -u -r1.40.2.4 pucdata.c
--- pucdata.c   20 Nov 2006 15:49:38 -0000      1.40.2.4
+++ pucdata.c   19 Dec 2007 02:55:08 -0000
@@ -890,10 +890,22 @@
            {   0x1415, 0x9501, 0,      0       },
            {   0xffff, 0xffff, 0,      0       },
            {
-               { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ },
-               { PUC_PORT_TYPE_COM, 0x10, 0x08, COM_FREQ },
-               { PUC_PORT_TYPE_COM, 0x10, 0x10, COM_FREQ },
-               { PUC_PORT_TYPE_COM, 0x10, 0x18, COM_FREQ },
+               { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ * 8 },
+               { PUC_PORT_TYPE_COM, 0x10, 0x08, COM_FREQ * 8 },
+               { PUC_PORT_TYPE_COM, 0x10, 0x10, COM_FREQ * 8 },
+               { PUC_PORT_TYPE_COM, 0x10, 0x18, COM_FREQ * 8 },
+           },
+       },