From nobody Mon Oct 14 22:17:33 2024 X-Original-To: dev-commits-src-all@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 4XSBRx4RHdz5ZG5B; Mon, 14 Oct 2024 22:17:33 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XSBRx1V3rz3xNw; Mon, 14 Oct 2024 22:17:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728944253; 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=DEYYQjT2sQ6qvukPZOK3p59XFivj8Y8fKKthXquLnHs=; b=Ro69RfSgRSnrjx0f0Id0SgiIpP+vJZl3joiJMGDXGZKJWOQnXjTi4joCsLuuIlYpjPEUDO BmyUgY4XF6k8xNHsNDneV65Xjtq+wzcAe47LMwsoF9Q7zOztJOs6vAc4bhvXiE6P6MOlmJ wCqTqJgoVk8p+nNPQnfTseXyHzwyL5PkEf2E6c4IsA89MvXm6tdJ567DZSdFoHKfBlpGJi 7gTOpKqsTBX9MMdtCspgPUwmkfcJHeZ/tNnVziZqE770RvvVfz6X+xhcYw7WtOnocu54/c T9FMm5Xxn3/MoMnp+o78hMW5upUAKHSZwl1sDx4vjD8qeTBnksRy1CJ6M+B4WQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728944253; 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=DEYYQjT2sQ6qvukPZOK3p59XFivj8Y8fKKthXquLnHs=; b=nP71BDhAojBVOWnSLCBAMGWKK+Ba/DkH84Q1tap7I5WGf2P0CzJuOr7O/KMC5R6aN0EGcK dG+brrqOxGs4rDoM9HsrpmKrAcPHdcEDmZyzemWDUuPOHTR4KdYbfbaDpiRGYhgFRMM1ck Uj4s5gSjM+am+o0SfCynRSWlmK4tsLHMRueACP5+s6h2yx0zPlSW/lA6kSryUAz65ZNEgm HBR2tgz6Krt6Xu6beq/5Uc6u8UwUVtPjU1DfkZUE+crZCGgSZLTnsRyx+TcxSMDnxhF4U4 NwonFbot21goiZvkIaO0drCNq03JWYSqxrWqv+tDyZVj5qYVTIAC0AJyxnGktw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728944253; a=rsa-sha256; cv=none; b=TI9NFxZyy7OdtsN+DARHVZHtL9ohmsA0/1u5bh7GW3CGF4cHNiQ76LdBtO0PgT3xvdZw6a c/j9ZF7esewkOhJ2zrej7DmrqBzb/7xjSc2vZMeP14HNq2zFM3ngMXkYpQDqrHa59uxwC5 loGDcsAHj5HJivGscgyFrErgZavp8d084fN32kcpmXOXR0hAahi7XXjXqxac4HwVJazUGZ nmj7yWetke0bi7pUKUU4c21QIfSXf2VR0DS1M3x7mC6J4jhEg8WEYUgrHkT17um/gzp1ve NBNJwjeT4fWxMlQ3bu+ikoWb07aZjhsxQQgAy4sNRwJKhdW9tFlWCA5VI6ZriQ== 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 4XSBRx0sTgzwPB; Mon, 14 Oct 2024 22:17:33 +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 49EMHX59074711; Mon, 14 Oct 2024 22:17:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49EMHXXT074708; Mon, 14 Oct 2024 22:17:33 GMT (envelope-from git) Date: Mon, 14 Oct 2024 22:17:33 GMT Message-Id: <202410142217.49EMHXXT074708@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 2be228603754 - main - uart: Document the hw.uart.console string format. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 2be22860375440641f6e57b03724fe38b87b0dd1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2be22860375440641f6e57b03724fe38b87b0dd1 commit 2be22860375440641f6e57b03724fe38b87b0dd1 Author: Warner Losh AuthorDate: 2024-10-14 21:57:20 +0000 Commit: Warner Losh CommitDate: 2024-10-14 22:03:58 +0000 uart: Document the hw.uart.console string format. Sponsored by: Netflix Reviewed by: adrian, andrew Differential Revision: https://reviews.freebsd.org/D47071 --- share/man/man4/uart.4 | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 89 insertions(+), 1 deletion(-) diff --git a/share/man/man4/uart.4 b/share/man/man4/uart.4 index 90ab2fd4cb57..c7950e86ddc9 100644 --- a/share/man/man4/uart.4 +++ b/share/man/man4/uart.4 @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd July 11, 2020 +.Dd October 11, 2024 .Dt UART 4 .Os .Sh NAME @@ -269,6 +269,89 @@ be locked for devices that support more than one setting. The CLOCAL flag on callin ports should be locked off for logins to avoid certain security holes, but this needs to be done by getty if the callin port is used for anything else. +.Sh Console Tuneable +The +.Nm +driver can be designated as a system console. +.Bl -tag -width indent +.It Va hw.uart.console +Contains a number of +.Pa /etc/remote +like tag:value pairs, separated by commas. +.Bl -tag -width indent +.It Cm \&bd +Busy Detect. +Enable the so-called +.Dq Busy Detect +quirk for the device. +For NS 16550-compatible devices, this will use heuristics to ensure that the +UART is no longer busy before manipulating line control. +DesignWare-based UARTs need this due to a design flaw in the UART. +.It Cm \&br +Baudrate. +The data rate (bits per second) used for communications on the serial port. +When the device clock rate (see below) is set to 0, then the baud rate will be +used with the divisor to compute the device clock rate the first time the device +is initialized. +Only the traditional baud rates are allowed. +Rates larger than 19200 must be a multiple of 19200. +Baud rates between 1200 and 19200 must be a multiple of 1200. +Otherwise the baud rate must be a multiple of 75. +A value of '0' instructs the +.Nm +driver to not program the baud rate divisor and use the hardware as-is. +.It Cm \&ch +Channel. +Defaults to 0. +Has no effect on UARTs with only one channel. +.It Cm \&db +Data bits. +Defaults to 8. +.It Cm \&dt +Device type. +Specify the uart class to use for this device. +.Bl -tag -width indent +.It ns8250 +Traditional PC UART National Semiconductor 16550 and compatible devices. +.It pl011 +Common ARM UART, based on ARM Limited designs. +.El +.It Cm \&io +I/O port address. +Specifies the address of a UART in an Intel processor's I/O space. +Mutually exclusive with +.Sq mm . +.It Cm \&mm +Memory mapped I/O address. +Specifies the physical address of a memory-mapped UART. +Mutually exclusive with +.Sq io . +.It Cm \&pa +Parity. +The type of parity to use when sending data +to the host. +This may be one of ``even'', +``odd'', ``none'', ``zero'' (always set bit 8 to zero), +``one'' (always set bit 8 to 1). +The default is even parity. +.It Cm \&rs +Register shift. +Number of bits to shift left the base register offset. +.It Cm \&rw +Register width. +Size of operations to read and write the registers of the device. +.It Cm \&sb +Stopbits. +Defaults to 1. +.It Cm \&xo +Device clock (xtal oscillator). +Base frequency of the oscillator to use for the device. +When set to 0, and the baud rate is also set, the UART's initialization +code will compute this the first time and use that after. +Automatically computed values can be as large as 5% when the base +frequency is a poor match to the traditional baud rates. +.El +.El .Sh FILES .Bl -tag -width "/dev/ttyu?.init" -compact .It Pa /dev/ttyu? @@ -283,6 +366,11 @@ for callout ports .It Pa /dev/cuau?.lock corresponding callout initial-state and lock-state devices .El +.Sh EXAMPLES +.Dl hw.uart.console="io:0x2f8,br=115200" +.Pp +When the kernel is using a serial console port, it should use +COM2 instead of COM1 and set the baud rate to 115200. .Sh SEE ALSO .Xr cu 1 , .Xr puc 4 ,