From nobody Wed Jun 25 12:38:20 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4bS1ZN6XPDz600DL; Wed, 25 Jun 2025 12:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4bS1ZN51vxz3nQQ; Wed, 25 Jun 2025 12:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d7cA4so8E3QtHT7qy6qw3KOk7wPMtufqpUWooRiQXKI=; b=TxY5STFjvW27q3g34NOMdGNIpBGp7Zk2mNITC/RsxBGrDrFDMGk2pblZCjlmh0g3X0h7Pf l3KvtVwFGfUkc1NXOvf0Lf3eEX/Urbxov0AbFCiAHBYS8DYOLD8B7kGpF1iUUEHUk/I0Zd Rfdu9un9DTsFA/vZ1HQa7hiUepuGNGgy6Pq1WzgicQa70WU+JJNuWfuYX2RtAV9ttSNdqI 3S8kp13XEo2MtpbDi6oCbXNDmly+zn8IVJa/t/0SBvaUINHCb4uF9rrU19i5vtqC75yrTV +gh93nw5slRwAmjKElM+gBDn1ZjhagYqUL5C9dpvKBR+hdFIhe1pO5lEtPqZhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1750855100; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=d7cA4so8E3QtHT7qy6qw3KOk7wPMtufqpUWooRiQXKI=; b=JirNh5r9przgLD9XGjxp/5Lf0bvVnJQDYT3uxfWNgC5JfDcxJkFgfxJtLXReFzJuoiI9CT sAiQbauUQ8WalbdpyBs6dyiC4BWDTyFS44i00n9Q3o8H0M106RsOL9oM13sBujNLs+rWZK GEQFA6CD+Jk1RAsYKdMBRUpAVpiTaf9ePUe7hH9vexR8EORuHSqgnh0nYwuVTfyJIchRIz b0/xrXtD+slM9VQh5sDwfOx8vI1p6VzGjtj8sg0tR1k190wQR/Ei7cqi8RGwZ3NW9D2UQf tvNfYwv8BXwK3QEwZm9lwAWpzZJw/43buhuvf5bHxoBHrzrAtwy8yOB0bzKADg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1750855100; a=rsa-sha256; cv=none; b=HPrMwDquwOHetGAiWTYRqLChBzAGoojebmP9OhZKz8jtH2Q8wW9NZPVXhJxmHuX7B6EAtF GNECHGNaWSCZ9YW5aA9bGZgs4BVE8tK/os8ekaKHIgxDn498VX3+hXdVAtLP91ZHo+mf74 tEZnvgFTsf0aLrPcfVkFux2JydKH4MLWdz/1OrR+FMQ3bD9T7GFryH4+QsmQdxUhnv2wDy OyPHaaqdUldp4zHvZoJJxtTdsqTRAkuNgqJQe+j6lKLMm3b2B7iYvlZIeG3MnL+2kPg+1S lpkjzmET+9uiujuSB8AwRA3paxlVRT1hTi6C3OOixR0K8v7Y5q5Jf2qZcEp1yw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4bS1ZN1rSjz2g1; Wed, 25 Jun 2025 12:38:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 55PCcKpA034055; Wed, 25 Jun 2025 12:38:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 55PCcK3h034052; Wed, 25 Jun 2025 12:38:20 GMT (envelope-from git) Date: Wed, 25 Jun 2025 12:38:20 GMT Message-Id: <202506251238.55PCcK3h034052@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Ziaee Subject: git: f0ba0b99ef0a - main - uchcom.4: Add HARDWARE, makeover List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0ba0b99ef0a9cf9e7822278d7d2bc0a80911361 Auto-Submitted: auto-generated The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=f0ba0b99ef0a9cf9e7822278d7d2bc0a80911361 commit f0ba0b99ef0a9cf9e7822278d7d2bc0a80911361 Author: Alexander Ziaee AuthorDate: 2025-06-25 04:37:37 +0000 Commit: Alexander Ziaee CommitDate: 2025-06-25 12:35:11 +0000 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: 1395712cab8e9 (add support for CH9102 and CH343) Reviewed by: carlavilla, kevlo Differential Revision: https://reviews.freebsd.org/D51036 --- share/man/man4/uchcom.4 | 88 +++++++++++++++++++++++++++++++++++-------------- 1 file changed, 64 insertions(+), 24 deletions(-) diff --git a/share/man/man4/uchcom.4 b/share/man/man4/uchcom.4 index 4d395573589f..6cee3d82c2ce 100644 --- a/share/man/man4/uchcom.4 +++ b/share/man/man4/uchcom.4 @@ -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 +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 -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. +.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 .