From nobody Mon Oct 14 22:17:30 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 4XSBRv0Tm6z5ZFY6; Mon, 14 Oct 2024 22:17:31 +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 4XSBRt73bbz3x5F; Mon, 14 Oct 2024 22:17:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728944251; 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=H61B2XWT2qhZIM/7YuGL3ogf2F8qr2dFpaEePxrL/BI=; b=ZI9HxphYH+T1aKNFL47sTyrp0pET4c9Lu+t8t/4zQt87F1Lle761eks54hgC7VtQ1q0jTE 9bMzfGZgnHWIoTRwLaJljKXqKMaz+wvbS1eJG03M+RKSrYWRrE7v4UyEdM5iMljjxevYJi EDuSfk46wJsbLjl1hwzd/THVFnxVAdC5KbFRV+/Go4pAO44YYk+OLIuX90N8VZoPz33jSb SJ5wArmtGaE+b9GzCo5UOIquxhI4Y+8KM5XhYxzQ8hN2phpdgJUxGg1d/ztMF2EMrmLKqK KPsv99SMODr3Mfp9cK0GdT+N8qFtdsrO/QEYsMqzQw63i7h5XtgXUSo6oFppXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728944251; 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=H61B2XWT2qhZIM/7YuGL3ogf2F8qr2dFpaEePxrL/BI=; b=DwJiS9RC8dqm5Su9yT+7QzR5p6LvFMvgX0uciN668FI6SHvVnnbmV2G7pgSZPPi9k+eTpT 1HKC3Mp3NXZI61deLVhgROd1sjf7YoND5sCpt6TgAbb2RP2aiKyRlegx28S/XkY/5sMwa8 YAIM76ZcZm64K8gdlT43AYIKCJWWxqPFn/hL/3MPm/s+QexTWNvOQPIE6XMawsng3/4KGy 3kftBTp3FUdK9vLtC2SZdKIPBjZJsUw31POfQtMW3d5AGIYVnje6sUeKIISt5jIn9PBBGb GmOOSW2Ibmnqqsih/xUCayGfAPrKy9bNd47BTLFyIih+E/O3dIaSEoaQEm8LCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728944251; a=rsa-sha256; cv=none; b=TSf8jFY+Jv0OV+EPUXeYo5xZIjjGzm3FIKUl4d7pCs9TEoMdYtI5ovWFdqEDdhgaH1vxdD kT2d8RqQ0IbA8RYCCk2LlX3DFz7GgN55NKD6cqAnus6siR/fjAS63qBp0BTEAIwaO0hWG8 LzveY3K3ANLb5ga32aiogmCFkIjCIbZKHrZDsqZetHu6l6RsG+nnbygmz1J4SnhM0JsUtk 482iZ9ZhgNlqV44/UkBm/5n4ZYGwJAgLLAoXWslEMgpL3zpjQp/CsNSo9iOBYRdAWY5n9O 7qcpZzoTZp2N+lg9K1VlU7BERyvVGHmp1R/C6YuKRFOjsWHxlSbrYUU8UgWUZQ== 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 4XSBRt6SzjzwBB; Mon, 14 Oct 2024 22:17:30 +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 49EMHUcj074612; Mon, 14 Oct 2024 22:17:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49EMHULp074609; Mon, 14 Oct 2024 22:17:30 GMT (envelope-from git) Date: Mon, 14 Oct 2024 22:17:30 GMT Message-Id: <202410142217.49EMHULp074609@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: fa93443af9fb - main - uart: Prefer rclk passed in over rclk in the class 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: fa93443af9fb05989dc069ea37932be1b760e7f3 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fa93443af9fb05989dc069ea37932be1b760e7f3 commit fa93443af9fb05989dc069ea37932be1b760e7f3 Author: Warner Losh AuthorDate: 2024-10-14 21:57:09 +0000 Commit: Warner Losh CommitDate: 2024-10-14 22:03:58 +0000 uart: Prefer rclk passed in over rclk in the class If rclk is set in sysdev, then it was set during the boot process and is intended to override the defaults. By prefering the sysdev one over the class, xo=XXXX in hw.uart.console can give the user a usable console for non-traditional UARTs, especially on !x86 platforms. The default rclk generally only is good for I/O mapped UARTS or PCI ones that we can do a table lookup on. Other times, it can be hard to know what a good default is without more information. Sponsored by: Netflix Reviewed by: andrew Differential Revision: https://reviews.freebsd.org/D47069 --- sys/dev/uart/uart_core.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/sys/dev/uart/uart_core.c b/sys/dev/uart/uart_core.c index c2bc818a6fc2..71f39e4c71e7 100644 --- a/sys/dev/uart/uart_core.c +++ b/sys/dev/uart/uart_core.c @@ -559,8 +559,14 @@ uart_bus_probe(device_t dev, int regshft, int regiowidth, int rclk, int rid, int uart_cpu_eqres(&sc->sc_bas, &sysdev->bas)) { /* XXX check if ops matches class. */ sc->sc_sysdev = sysdev; - sysdev->bas.rclk = sc->sc_bas.rclk; - } + if (sysdev->bas.rclk != 0) { + /* Let the boot sequence control */ + sc->sc_bas.rclk = sysdev->bas.rclk; + } else { + /* Boot didn't set it, use use class */ + sysdev->bas.rclk = sc->sc_bas.rclk; + } + } } error = UART_PROBE(sc);