NetBSD Problem Report #44956

From dtyson@rakelane.anduin.org.uk  Wed May 11 20:19:12 2011
Return-Path: <dtyson@rakelane.anduin.org.uk>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 0CE3263B95D
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 11 May 2011 20:19:12 +0000 (UTC)
Message-Id: <20110511201909.8003C6884F@rakelane.anduin.org.uk>
Date: Wed, 11 May 2011 21:19:09 +0100 (BST)
From: dtyson@wirralcavinggroup.org.uk
Reply-To: dtyson@wirralcavinggroup.org.uk
To: gnats-bugs@gnats.NetBSD.org
Subject: add support for Qinheng PCI cards to the puc driver
X-Send-Pr-Version: 3.95

>Number:         44956
>Category:       kern
>Synopsis:       add support for Qinheng PCI cards to the puc driver
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed May 11 20:20:01 +0000 2011
>Closed-Date:    Sat May 14 22:11:02 +0000 2011
>Last-Modified:  Sat May 14 22:11:02 +0000 2011
>Originator:     Dave Tyson
>Release:        NetBSD 5.99.51
>Organization:
	Wirral Caving Group
>Environment:
NetBSD tester.anduin.org.uk 5.99.51 NetBSD 5.99.51 (GENERIC) #4: Tue May 10 22:09:55 BST 2011  root@tester.anduin.org.uk:/usr/obj/sys/arch/i386/compile/GENERIC i386
Architecture: i386
Machine: i386
>Description:
	The popular PCI serial/parallel port cards using the CH353 chip from
	Nanjing Qinheng Electronics Co are not supported by the current puc
	driver
>How-To-Repeat:
	Insert a serial card using the Qinheng chipset, boot machine, notice
	the card is not configured
>Fix:
	Patch pcidevs and regen:

$ diff -u /usr/src/sys/dev/pci/pcidevs.orig /usr/src/sys/dev/pci/pcidevs
--- /usr/src/sys/dev/pci/pcidevs.orig   2011-05-02 15:06:50.000000000 +0100
+++ /usr/src/sys/dev/pci/pcidevs        2011-05-10 21:11:07.000000000 +0100
@@ -631,6 +631,7 @@
 vendor 3DLABS          0x3d3d  3D Labs
 vendor AVANCE2         0x4005  Avance Logic (2nd PCI Vendor ID)
 vendor ADDTRON         0x4033  Addtron Technology
+vendor QINHENG         0x4348  Nanjing QinHeng Electronics
 vendor ICOMPRESSION    0x4444  Conexant (iCompression)
 vendor INDCOMPSRC      0x494f  Industrial Computer Source
 vendor NETVIN          0x4a14  NetVin

Patch pucdata.c and rebuild kernel:

$ diff -u /usr/src/sys/dev/pci/pucdata.c.orig /usr/src/sys/dev/pci/pucdata.c
--- /usr/src/sys/dev/pci/pucdata.c.orig 2011-05-02 15:23:24.000000000 +0100
+++ /usr/src/sys/dev/pci/pucdata.c      2011-05-10 21:48:19.000000000 +0100
@@ -1294,6 +1294,34 @@
            },
        },

+       /*
+        * Nanjing QinHeng Electronics 
+        * Products based on CH353 chip which can be
+        * configured to provide various combinations
+        * including 2 serial ports and a parallel port
+        * or 4 serial ports (using a CH432 parallel to
+        * 2 serial port converter. Product codes from
+        * documentation (and physical 2 port serial card)
+        */
+       {   "Nanjing QinHeng Electronics 2S",
+           {   PCI_VENDOR_QINHENG, 0x3253, PCI_VENDOR_QINHENG, 0x3253  },
+           {   0xffff, 0xffff, 0xffff, 0xffff  },
+           {
+               { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ },
+               { PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ },
+           },
+       },
+
+       {   "Nanjing QinHeng Electronics 2S, 1P",
+           {   PCI_VENDOR_QINHENG, 0x7053, PCI_VENDOR_QINHENG, 0x7053  },
+           {   0xffff, 0xffff, 0xffff, 0xffff  },
+           {
+               { PUC_PORT_TYPE_COM, 0x10, 0x00, COM_FREQ },
+               { PUC_PORT_TYPE_COM, 0x14, 0x00, COM_FREQ },
+               { PUC_PORT_TYPE_LPT, 0x18, 0x00, 0x00 },
+           },
+       },
+
        /* VScom PCI-200: 2S */
        {   "VScom PCI-200",
            {   PCI_VENDOR_PLX, 0x1103, PCI_VENDOR_PLX, 0x1103  },


After reboot the serial ports are detected and work for the 2 port serial card:

puc0 at pci2 dev 11 function 0: Nanjing QinHeng Electronics 2S (com, com)
com3 at puc0 port 0: interrupting at ioapic0 pin 23
com3: ns16550a, working fifo
com4 at puc0 port 1: interrupting at ioapic0 pin 23
com4: ns16550a, working fifo

>Release-Note:

>Audit-Trail:
From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44956 CVS commit: src/sys/dev/pci
Date: Sat, 14 May 2011 21:57:53 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat May 14 21:57:52 UTC 2011

 Modified Files:
 	src/sys/dev/pci: pcidevs

 Log Message:
 Add Nanjing QinHeng Electronics, from PR kern/44956.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1074 -r1.1075 src/sys/dev/pci/pcidevs

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/44956 CVS commit: src/sys/dev/pci
Date: Sat, 14 May 2011 22:07:39 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat May 14 22:07:39 UTC 2011

 Modified Files:
 	src/sys/dev/pci: pucdata.c

 Log Message:
 PR kern/44956: add support for Qinheng PCI cards to the puc driver


 To generate a diff of this commit:
 cvs rdiff -u -r1.73 -r1.74 src/sys/dev/pci/pucdata.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: martin@NetBSD.org
State-Changed-When: Sat, 14 May 2011 22:11:02 +0000
State-Changed-Why:
Commited, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.