How to use unrecognized COM port card?

John Baldwin jhb at freebsd.org
Tue Aug 16 23:08:17 UTC 2011


On Tuesday, August 16, 2011 4:57:26 pm Yuri wrote:
> On 08/16/2011 13:37, Xin LI wrote:
> > And I think John's patch is right, I've added a new PCI ID for it
> > though, found from the datasheet.  Did you have uart(4) in your kernel
> > (remove my old patch)?
> 
> Yes, uart(4) is in kernel and puc(4) is the loaded module. I think this 
> might be a problem that puc(4) is a module loaded later and that's why 
> serial device isn't registered. I found the reference to the similar 
> situation with some other card that got cured when puc(4) was compiled 
> into kernel. 
> (http://www.adras.com/Quadtech-DSC-100-PCI-dual-serial-port-on-8-0R-
i386.t6999-79.html)
> 
> I have yet to try building puc(4) into kernel, but the way how I have it 
> now is the default in GENERIC. Should uart(4) instead be removed from 
> kernel and made loadable too to prevent such initialization order issue? 
> Or what would be the right fix? Have too much stuff in kernel isn't 
> right too. uart probably isn't used by 99% of users.

Err, uart is in _lots_ of machines (just about every rack-mounted x86
server I've ever used).

The real bug here is the uart driver and the way it is compiled into
the kernel.  It should just always include the 'puc' attachment I
believe, or do so if any of the busses supported by 'puc' are compiled
in.  The puc attachment for uart is really tiny, and KOBJ is used in
new-bus specifically so that attachments don't require the full bus
driver to be present.  Something like this:

Index: files
===================================================================
--- files	(revision 224879)
+++ files	(working copy)
@@ -1842,7 +1842,7 @@ dev/uart/uart_bus_fdt.c		optional uart fdt
 dev/uart/uart_bus_isa.c		optional uart isa
 dev/uart/uart_bus_pccard.c	optional uart pccard
 dev/uart/uart_bus_pci.c		optional uart pci
-dev/uart/uart_bus_puc.c		optional uart puc
+dev/uart/uart_bus_puc.c		optional uart puc | uart pccard | uart pci
 dev/uart/uart_bus_scc.c		optional uart scc
 dev/uart/uart_core.c		optional uart
 dev/uart/uart_dbg.c		optional uart gdb


-- 
John Baldwin


More information about the freebsd-stable mailing list