From nobody Thu Sep 29 19:33:49 2022 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 4Mdk7K6fz5z4V43K; Thu, 29 Sep 2022 19:33:49 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mdk7K63rjz4Nnd; Thu, 29 Sep 2022 19:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664480029; 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=jIE4KEHyknmwlDt4d/ir/a7hgmN0QW+UXxqOcwB0sWc=; b=iETD2BgAjGw89+JPEP4WZ+ODoQlSzFnteJ988A8JxtKqC/k8RbGMHRBqnkP3aMYYFUPd60 eAI4mewODd57h+sL0uNKueXt8fE6M4FQBwsz0Ur1FlDFzSMYltlg6+os78bF+mDxyUKeNJ UBq56comf7lfwUhm8sh2+v+nVUUqM5SXmgTCLavSS3DHpXmL/qkc6lFygf5OgN4X65GBQM CNl2/jH1OP2vTs2BkTE0ROwDfra02f0Wpji0DWmTFKN1+2yMB4sNHajvOTlWAae6slKNy/ IkFN0g+oNeSY1u8vNw6AHH7C4KsRK3W22BrkZKHayfzUQEDrnWohoqJEPaokbQ== 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 4Mdk7K4sy5zw4R; Thu, 29 Sep 2022 19:33:49 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28TJXnwI015045; Thu, 29 Sep 2022 19:33:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28TJXn1Y015044; Thu, 29 Sep 2022 19:33:49 GMT (envelope-from git) Date: Thu, 29 Sep 2022 19:33:49 GMT Message-Id: <202209291933.28TJXn1Y015044@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Kyle Evans Subject: git: 4a4ad02da3c8 - main - uart: uart_cpu_arm64: fix the build without FDT 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: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kevans X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4a4ad02da3c8f598b4ccf15b6cac9de3ebce3ba1 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664480029; 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=jIE4KEHyknmwlDt4d/ir/a7hgmN0QW+UXxqOcwB0sWc=; b=AK0JLd9T6JSnVGL9SUzWYBYIu7I8KF6iOhmzwD4lI8iiaNwtTFRIgK3NjxKufmdbRS6kvW HzrWSymyzjt4tKrqvUasSr59wAUBet/8suVXbmivIVc9sPHNiHVYebbi8a4nckiuTTEVHk DU9iknIxcYlsJoTV2iJ0vqGMrPrQmSwxeFMJ/L/HMj9VOlB0KXqdf7eI30VTsj7rDpOmzE UaNFkdjaHu9t4+7D1LL9vwlGkJC7oRL7wigL/JQVYYZeeNyUmKZ6zBafQq3iCjX0T7uOuJ VqT4Ytq2qdmUJadp0htjWt9xeoDu4PVlwWLk3+FXOn8RWgWm2HfMS9KmK8YMKQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664480029; a=rsa-sha256; cv=none; b=VKAO/BJK59sguQ9h6G2A4fAzG6PJi206/5ZzEGxpeO9bpAxeHIeFOGpXvfxltGgGdHicjq 5gkV2o+awybO0MFlVog9QqiSsTbf1L6+mfaR1rGadoS0CZNgVq25Be8dmjAUST9pxb8NTZ WnOTtBbbi8xR3eeWywFgL6Q5ESOJ4E3+tiNkKldKz+eTfIE4tbopcH8gO4DN1cn7/Dq3Y5 LKpQCDsWu70k+JWLpgjUk6WIxvSO65fYKsuUSY6tFr/c/oW/dNd7i0HAnJx1EmyZP3giWb ol5OuI+djMkbo3eIEqW1a8rrmzu0pCNwc7zhPmZaW10ZsjPqyK87UMsO0liDyw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=4a4ad02da3c8f598b4ccf15b6cac9de3ebce3ba1 commit 4a4ad02da3c8f598b4ccf15b6cac9de3ebce3ba1 Author: Kyle Evans AuthorDate: 2022-09-29 19:33:32 +0000 Commit: Kyle Evans CommitDate: 2022-09-29 19:33:32 +0000 uart: uart_cpu_arm64: fix the build without FDT clang 14 doesn't properly determine that we're unconditionally returning if we have ACPI but not FDT. Push FDT setup entirely into a new function, much like we currently do with ACPI, and just return ENXIO if that doesn't succeed. Reviewed by: andrew, manu (earlier version) Differential Revision: https://reviews.freebsd.org/D36788 --- sys/dev/uart/uart_cpu_arm64.c | 52 ++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/sys/dev/uart/uart_cpu_arm64.c b/sys/dev/uart/uart_cpu_arm64.c index 148bf749f0bb..382e76c57a67 100644 --- a/sys/dev/uart/uart_cpu_arm64.c +++ b/sys/dev/uart/uart_cpu_arm64.c @@ -79,33 +79,17 @@ uart_cpu_eqres(struct uart_bas *b1, struct uart_bas *b2) return ((pmap_kextract(b1->bsh) == pmap_kextract(b2->bsh)) ? 1 : 0); } -int -uart_cpu_getdev(int devtype, struct uart_devinfo *di) +#ifdef FDT +static int +uart_cpu_fdt_setup(struct uart_class *class, int devtype, struct uart_devinfo *di) { - struct uart_class *class; bus_space_handle_t bsh; bus_space_tag_t bst; u_int rclk, shift, iowidth; int br, err; - /* Allow overriding the FDT using the environment. */ - class = &uart_ns8250_class; - err = uart_getenv(devtype, di, class); - if (err == 0) - return (0); - -#ifdef DEV_ACPI - /* Check if SPCR can tell us what console to use. */ - if (uart_cpu_acpi_spcr(devtype, di) == 0) - return (0); -#endif - err = ENXIO; -#ifdef FDT - if (err != 0) { - err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, - &shift, &iowidth, devtype); - } -#endif + err = uart_cpu_fdt_probe(&class, &bst, &bsh, &br, &rclk, + &shift, &iowidth, devtype); if (err != 0) return (err); @@ -128,3 +112,29 @@ uart_cpu_getdev(int devtype, struct uart_devinfo *di) return (0); } +#endif + +int +uart_cpu_getdev(int devtype, struct uart_devinfo *di) +{ + struct uart_class *class; + int err; + + /* Allow overriding ACPI/FDT using the environment. */ + class = &uart_ns8250_class; + err = uart_getenv(devtype, di, class); + if (err == 0) + return (0); + +#ifdef DEV_ACPI + /* Check if SPCR can tell us what console to use. */ + if (uart_cpu_acpi_spcr(devtype, di) == 0) + return (0); +#endif +#ifdef FDT + if (uart_cpu_fdt_setup(class, devtype, di) == 0) + return (0); +#endif + + return (ENXIO); +}