Re: How to use unrecognized COM port card?
On 17/08/2011, at 6:57 AM, 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. For my recent Moxa 2 port serial card addition, I had to include puc in the kernel config; it didn't work as a module. Jan. ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
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.coptional uart isa dev/uart/uart_bus_pccard.c optional uart pccard dev/uart/uart_bus_pci.coptional uart pci -dev/uart/uart_bus_puc.coptional uart puc +dev/uart/uart_bus_puc.coptional uart puc | uart pccard | uart pci dev/uart/uart_bus_scc.coptional uart scc dev/uart/uart_core.c optional uart dev/uart/uart_dbg.coptional uart gdb -- John Baldwin ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
On Tuesday, August 16, 2011 4:59:42 pm Yuri wrote: > On 08/16/2011 13:57, John Baldwin wrote: > > Hmmm, can you get devinfo -v output? Specifically there should be two > > children of puc0 and they should have extra data specifying what type of port > > each child device is. > > > > Here is the only reference to puc0 in devinfo -v output: > > pcib8 pnpinfo vendor=0x8086 device=0x244e subvendor=0x1043 > subdevice=0x82d4 class=0x060401 at slot=30 function=0 handle=\_SB_.PCI0.P0P1 >pci8 > pcm0 pnpinfo vendor=0x1274 device=0x5000 subvendor=0x4942 > subdevice=0x4c4c class=0x040100 at slot=0 function=0 > puc0 pnpinfo vendor=0x4348 device=0x3253 subvendor=0x4348 > subdevice=0x3253 class=0x070002 at slot=1 function=0 > isab0 pnpinfo vendor=0x8086 device=0x3a16 subvendor=0x1043 > subdevice=0x82d4 class=0x060100 at slot=31 function=0 handle=\_SB_.PCI0.SBRG >isa0 > orm0 > Ugh, the dumb driver deletes ports if they don't probe which is rediculous thing for it to do. -- John Baldwin ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
On 08/16/2011 13:57, John Baldwin wrote: Hmmm, can you get devinfo -v output? Specifically there should be two children of puc0 and they should have extra data specifying what type of port each child device is. Here is the only reference to puc0 in devinfo -v output: pcib8 pnpinfo vendor=0x8086 device=0x244e subvendor=0x1043 subdevice=0x82d4 class=0x060401 at slot=30 function=0 handle=\_SB_.PCI0.P0P1 pci8 pcm0 pnpinfo vendor=0x1274 device=0x5000 subvendor=0x4942 subdevice=0x4c4c class=0x040100 at slot=0 function=0 puc0 pnpinfo vendor=0x4348 device=0x3253 subvendor=0x4348 subdevice=0x3253 class=0x070002 at slot=1 function=0 isab0 pnpinfo vendor=0x8086 device=0x3a16 subvendor=0x1043 subdevice=0x82d4 class=0x060100 at slot=31 function=0 handle=\_SB_.PCI0.SBRG isa0 orm0 Yuri ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
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. Yuri ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
On Tuesday, August 16, 2011 3:53:17 pm Yuri wrote: > On 08/16/2011 08:57, John Baldwin wrote: > > For multiport devices you will want to add an entry to sys/dev/puc/pucdata.c > > and use the puc driver instead of patching uart directly. Perhaps this: > > John, > > I did what you suggested: > puc0: port 0xe880-0xe887,0xe800-0xe807 > irq 17 at device 1.0 on pci8 > > But it doesn't show up as a serial device and tty. Hmmm, can you get devinfo -v output? Specifically there should be two children of puc0 and they should have extra data specifying what type of port each child device is. -- John Baldwin ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 08/16/11 12:53, Yuri wrote: > On 08/16/2011 08:57, John Baldwin wrote: >> For multiport devices you will want to add an entry to >> sys/dev/puc/pucdata.c and use the puc driver instead of patching >> uart directly. Perhaps this: > > John, > > I did what you suggested: puc0: port > 0xe880-0xe887,0xe800-0xe807 irq 17 at device 1.0 on pci8 > > But it doesn't show up as a serial device and tty. I found a datasheet: http://wch-ic.com/download/down.asp?id=116 (English) and http://winchiphead.com/download/CH352/CH352DS1.PDF (Chinese) 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)? Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOStUOAAoJEATO+BI/yjfBSw0IANPaoND+0Xa2QtueAxI8Qa42 V86MiUnaZopRb0coiWf8dQNk+nIlayVuFstC9+77zC9NEEu1O7Mp8T4n2Bx2N7WP jtsevUnLJq6lIyo0jYRTf4x84eYd1VDBduHqsWbI0B7aMArgfNtHvPV0qUD9Emrn 4yR6I3/tmO3sX3+cWcggYC4s3DIm7XidiyT/6lcWilsmy2QkQlw00HoAkoKl0V4m DBkKHkmOB2oTUYadpBOKCt6HvdI29xWYF+1zN/sE0B3XwTy+Q1pp4Uq5KiBUyJi3 tNF533Z7COh/mog/Z9cpGpLSRJpWQgI2uCY7gAHZRAMT2+7k1AqkdNPWTJPXoCk= =CcI6 -END PGP SIGNATURE- Index: sys/dev/puc/pucdata.c === --- sys/dev/puc/pucdata.c (revision 224912) +++ sys/dev/puc/pucdata.c (working copy) @@ -862,6 +862,20 @@ const struct puc_cfg puc_pci_devices[] = { .config_function = puc_config_syba }, + { + 0x4348, 0x3253, 0x4348, 0x3253, + "WinChipHead Dual Port RS-232", + DEFAULT_RCLK, + PUC_PORT_2S, 0x10, 4, 0, + }, + + { + 0x4348, 0x5053, 0x4348, 0x5053, + "WinChipHead RS-232 and Printer port", + DEFAULT_RCLK, + PUC_PORT_1S1P, 0x10, 4, 0, + }, + { 0x, 0x0001, 0x, 0, "Decision Computer Inc, PCCOM 4-port serial", DEFAULT_RCLK, ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
On 08/16/2011 08:57, John Baldwin wrote: For multiport devices you will want to add an entry to sys/dev/puc/pucdata.c and use the puc driver instead of patching uart directly. Perhaps this: John, I did what you suggested: puc0: port 0xe880-0xe887,0xe800-0xe807 irq 17 at device 1.0 on pci8 But it doesn't show up as a serial device and tty. Yuri ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
On Tuesday, August 16, 2011 5:25:28 am Yuri wrote: > On 08/16/2011 00:48, Xin LI wrote: > > A wild guess... (You gotta to provide more details rather than just PCI > > IDs). > > > > My guess is that it's using these chips: > > > > http://www.winchiphead.com/product/ch365detail.htm > > http://www.winchiphead.com/product/ch353detail.htm > > > > It didn't talked about possible cards' configuration so I used BAR0, > > which could be 0x14, 0x18, etc. > > Actually, the main chip there is CH352L. Plus there are two more chips > ST75185C, one per COM port. > > Your patch made this pci device to connect to uart driver: uart2@pci0:8:1:0. > > uart2: <16550 or compatible> port 0xe880-0xe887,0xe800-0xe807 irq 17 at > device 1.0 on pci8 > uart2: [FILTER] > > Also new devices showed up: > /dev/cuau2 > /dev/cuau2.init > /dev/cuau2.lock > /dev/ttyu2 > /dev/ttyu2.init > /dev/ttyu2.lock > > cuau2 is probably the same as COM port. I don't have an easy way to > check now. > I believe adding another entry with 0x14 would add the second COM port. For multiport devices you will want to add an entry to sys/dev/puc/pucdata.c and use the puc driver instead of patching uart directly. Perhaps this: Index: pucdata.c === --- pucdata.c (revision 224898) +++ pucdata.c (working copy) @@ -862,6 +862,13 @@ const struct puc_cfg puc_pci_devices[] = { .config_function = puc_config_syba }, + { + 0x4348, 0x3253, 0x, 0, + "WinChipHead Dual Port RS-232", + DEFAULT_RCLK, + PUC_PORT_2S, 0x10, 4, 0, + }, + { 0x, 0x0001, 0x, 0, "Decision Computer Inc, PCCOM 4-port serial", DEFAULT_RCLK, -- John Baldwin ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
On 08/16/2011 00:48, Xin LI wrote: A wild guess... (You gotta to provide more details rather than just PCI IDs). My guess is that it's using these chips: http://www.winchiphead.com/product/ch365detail.htm http://www.winchiphead.com/product/ch353detail.htm It didn't talked about possible cards' configuration so I used BAR0, which could be 0x14, 0x18, etc. Actually, the main chip there is CH352L. Plus there are two more chips ST75185C, one per COM port. Your patch made this pci device to connect to uart driver: uart2@pci0:8:1:0. uart2: <16550 or compatible> port 0xe880-0xe887,0xe800-0xe807 irq 17 at device 1.0 on pci8 uart2: [FILTER] Also new devices showed up: /dev/cuau2 /dev/cuau2.init /dev/cuau2.lock /dev/ttyu2 /dev/ttyu2.init /dev/ttyu2.lock cuau2 is probably the same as COM port. I don't have an easy way to check now. I believe adding another entry with 0x14 would add the second COM port. Thank you! Yuri ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
Re: How to use unrecognized COM port card?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 On 08/15/11 23:21, Yuri wrote: > I have dual COM port pci card: none7@pci0:8:1:0: class=0x070002 > card=0x32534348 chip=0x32534348 rev=0x10 hdr=0x00 class = simple > comms subclass = UART bar [10] = type I/O Port, range 32, base > 0xe880, size 8, enabled bar [14] = type I/O Port, range 32, base > 0xe800, size 8, enabled > > Manufacturer 0x4348 isn't recognized by http://www.pcidatabase.com. > It was purchased from China through ebay. > > How to make it to work in 8.2-STABLE? A wild guess... (You gotta to provide more details rather than just PCI IDs). My guess is that it's using these chips: http://www.winchiphead.com/product/ch365detail.htm http://www.winchiphead.com/product/ch353detail.htm It didn't talked about possible cards' configuration so I used BAR0, which could be 0x14, 0x18, etc. Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -BEGIN PGP SIGNATURE- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJOSiC9AAoJEATO+BI/yjfB5oAH/R0yt8Zx3HDVOXA5jUOXzlWl A+XCmbaau4MNhOtiyVJ8sWERE1CukgQeIE7DWze1rJ6YU7bTXKAgoRbqVJsfiAbH CEhLx+Y2T7HLow9ZojCGrqk6ydrGxheWIyf2AM7nTORZQdEUceEWGLE4GMXJghTp Y4udsGfSRqa+1O7tTOpechDi5jtG/cW+dDFeyZqVo0AjfS78D10wEqoiudloIkBd IAEyy7JGCU/R6AM+DhHHm0dIT68MkHxULOpTLy0GxxzJecWruknqd+h+V36Q3X+h brg2isOawCGLhWgzCDXVZXwJWIXA28RaRmDPeZRNv5TKUESmZEenR8lEpH7ji+s= =KUoE -END PGP SIGNATURE- Index: sys/dev/uart/uart_bus_pci.c === --- sys/dev/uart/uart_bus_pci.c (revision 224900) +++ sys/dev/uart/uart_bus_pci.c (working copy) @@ -111,6 +111,7 @@ { 0x1415, 0x950b, 0x, 0, "Oxford Semiconductor OXCB950 Cardbus 16950 UART", 0x10, 16384000 }, { 0x151f, 0x, 0x, 0, "TOPIC Semiconductor TP560 56k modem", 0x10 }, +{ 0x4348, 0x3253, 0x, 0, "WinChipHead Dual Port RS-232", 0x10 }, { 0x9710, 0x9820, 0x1000, 1, "NetMos NM9820 Serial Port", 0x10 }, { 0x9710, 0x9835, 0x1000, 1, "NetMos NM9835 Serial Port", 0x10 }, { 0x9710, 0x9865, 0xa000, 0x1000, "NetMos NM9865 Serial Port", 0x10 }, ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"
How to use unrecognized COM port card?
I have dual COM port pci card: none7@pci0:8:1:0: class=0x070002 card=0x32534348 chip=0x32534348 rev=0x10 hdr=0x00 class = simple comms subclass = UART bar [10] = type I/O Port, range 32, base 0xe880, size 8, enabled bar [14] = type I/O Port, range 32, base 0xe800, size 8, enabled Manufacturer 0x4348 isn't recognized by http://www.pcidatabase.com. It was purchased from China through ebay. How to make it to work in 8.2-STABLE? Yuri ___ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"