uchcom.4: Add HARDWARE, makeover

Tag spdx, improve document description for apropos, improve synopsis
for clarity and consistency, improve description to explain usage,
improve hardware for hardware release notes, mention the sysctl, xref
the application to use this driver, improve history.

MFC:			no (unless change adding CH9102/CH343 mfcs)
Fixes:			1395712cab (add support for CH9102 and CH343)
Reviewed by:		carlavilla, kevlo
Differential Revision:	https://reviews.freebsd.org/D51036
This commit is contained in:
Alexander Ziaee
2025-06-25 00:37:37 -04:00
parent 5ec268d09a
commit f0ba0b99ef
+64 -24
View File
@@ -1,3 +1,6 @@
.\"
.\" SPDX-License-Identifier: BSD-2-Clause
.\"
.\" $NetBSD: uchcom.4,v 1.2 2008/04/30 13:10:54 martin Exp $
.\"
.\" Copyright (c) 2007 The NetBSD Foundation, Inc.
@@ -27,37 +30,75 @@
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
.\" POSSIBILITY OF SUCH DAMAGE.
.\"
.Dd August 19, 2024
.Dd June 25, 2025
.Dt UCHCOM 4
.Os
.Sh NAME
.Nm uchcom
.Nd WinChipHead CH9102/CH343/CH341/CH340 serial adapter driver
.Nd WinChipHead CH9102/CH343/CH341/CH340 USB to serial UART driver
.Sh SYNOPSIS
To compile this driver into the kernel,
place the following lines in your
kernel configuration file:
.Bd -ragged -offset indent
.Cd "device usb"
.Cd "device ucom"
.Cd "device uchcom"
.Ed
.Pp
Alternatively, to load the driver as a
module at boot time, place the following line in
.Xr loader.conf 5 :
.Bd -literal -offset indent
uchcom_load="YES"
.Ed
In
.Xr rc.conf 5 :
.Cd kld_list="uchcom"
.Pp
In
.Xr sysctl.conf 5 :
.Cd hw.usb.uchcom.debug=1
.Sh DESCRIPTION
The
.Nm
driver provides support for the WinChipHead CH9102/CH343/CH341/CH340
USB-to-RS-232 Bridge chip.
driver provides support for the WinChipHead USB to serial UART adapters.
If the appropriate hardware is detected,
the driver will be loaded automatically by
.Xr devmatch 8 .
To load the driver manually, add it to the
.Ic kld_list
in
.Xr rc.conf 5 ,
or use
.Xr kldload 8
at runtime.
The device is accessed through the
.Xr ucom 4
driver, which makes it behave like a
.Xr tty 4 .
.Pp
The datasheets for the CH340/CH341 list the maximum
supported baud rate as 2,000,000.
CH9102/CH343 devices support any baud rate up to 6 Mbps.
Call out through this interface with applications like
.Xr cu 1
or
.Xr tip 1 .
.Sh HARDWARE
The
.Nm
driver supports the following USB to serial UART controllers:
.Pp
.Bl -bullet -compact
.It
WinChipHead CH9102 (max 6Mbps)
.It
WinChipHead CH343 (max 6Mbps)
.It
WinChipHead CH341 (max 2Mbps)
.It
WinChipHead CH340 (max 2Mbps)
.El
.Sh SYSCTL VARIABLES
These settings can be entered in the
.Xr loader 8
prompt, set in
.Xr loader.conf 5 ,
.Xr sysctl.conf 5 ,
or changed at runtime with
.Xr sysctl 8 :
.Bl -tag -width "hw.usb.uchcom.debug"
.It Va hw.usb.uchcom.debug
Enable debugging messages, default
.Ql 0
.El
.Sh FILES
.Bl -tag -width "/dev/ttyU*.init" -compact
.It Pa /dev/ttyU*
@@ -73,15 +114,14 @@ for callout ports
corresponding callout initial-state and lock-state devices
.El
.Sh SEE ALSO
.Xr cu 1 ,
.Xr tty 4 ,
.Xr ucom 4 ,
.Xr usb 4
.Sh HISTORY
The
.Nm
driver first appeared in
.Nx .
The first
.Fx
release to include it was
.Fx 8.0 .
driver appeared in
.Fx 8.0
from
.Nx 5.0 .