From nobody Wed Nov 02 17:03:09 2022 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 4N2Y9p1NMSz4gP85; Wed, 2 Nov 2022 17:03:10 +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 4N2Y9p0XPxz3qP0; Wed, 2 Nov 2022 17:03:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667408590; 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=10vkYIqV7PZ5of1rofA+fgZqfvrswCsRiqAYYRNTr8A=; b=wLqBRnOQylyQxj3tkuo5fruh8xrLY5tvYypFNLOFy2ie7r9UYb6XY7Y/BUK07doZvnA4Ob O1JTpifVds6PR3LsRd1zglCQYUzNilq/oBO/ILJOL7wJPCkp0ErNzupGQsu3NHQklTetrZ +AfXUB0XWAvh6g9OB8JguP3I7NaRqEcZ3R+tvswSbzBMkjSBG9RnI7wZzC+6AmXgx2FW6C j9gAzFSAWAk6SwNAWh5kkzHwRTfCDH9BMXzhcbiA6G4L2vO1SIOpd/JhOgwavkDuEnnN+0 onMghB0N30GRNVEew90HQ3U2X550b+c4pHBq8/Y3iLNBuj62tPoKZBeswJTEAg== 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 4N2Y9n6RPhz13M4; Wed, 2 Nov 2022 17:03:09 +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 2A2H39qQ065035; Wed, 2 Nov 2022 17:03:09 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A2H39Xk065034; Wed, 2 Nov 2022 17:03:09 GMT (envelope-from git) Date: Wed, 2 Nov 2022 17:03:09 GMT Message-Id: <202211021703.2A2H39Xk065034@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kyle Evans Subject: git: af0995b7f365 - stable/13 - uart: uart_cpu_arm64: fix the build without FDT 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/stable/13 X-Git-Reftype: branch X-Git-Commit: af0995b7f3655a8f31c6d2e5d93cbbb5a4b09570 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667408590; 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=10vkYIqV7PZ5of1rofA+fgZqfvrswCsRiqAYYRNTr8A=; b=AtXQuIC4WuwP4jmcyHhS9cM6jzmfGKBa7MjA3IN0jGFKCkegOkchRk8EoA19YN+jfsKA8x gSZAIEL8ftuEdzS8GK1fhuhDm4EnP5+zjuqFRsyNqzLs6i/ZHV5QYBQHivLm2KwWpHNqq6 qAt9oePIScQ7Mh83Lmm56c7jxtHhdMcLukBGLMb2KY8zbJ25mkSGoA6D8Me6061k9m+Ti3 BKCt7LcgUvohjnhvQ2L8vs8eiGDHFBLTNXxvaJFoOD4/ivTP56kUOaUNwKrmbPuZzDMw8E lRso5+Vwm51Vys487KtUwjZqVdFaHaJpf2taMm9jtsXLnd7JXDowvtc4MIPrRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667408590; a=rsa-sha256; cv=none; b=W/RfEFlauSRIYgML7ijNPb3xMozyAaWNayEyGYCQzQx5TQ36pSbMNq4abdBODPr4VK0oNo v0I5mHgq1nXGRHxrK/wjeOsT11vA9fIvyg1tyAcVWY6T0ngYwaQdajgcCg0tKh10zBbh8O EE2eHSzaXN9IU8+/3cw1/AOeaedplCRjtaOBUP6yY5ym26sXdCetNZFJzbxLy/MgVT4XYa 4c0XqaUqwlDBjOhgaPQNtU3RBYJzEAOgmJLRn5pMuwkL228ks6omHKd3TmNLc7P/QBn2Gb 4zWmEKDKJiernLD1fnp1e2sOuUqWXR/wvNzIBRlKzlcony0fwIeI6NtZHm2+3Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kevans: URL: https://cgit.FreeBSD.org/src/commit/?id=af0995b7f3655a8f31c6d2e5d93cbbb5a4b09570 commit af0995b7f3655a8f31c6d2e5d93cbbb5a4b09570 Author: Kyle Evans AuthorDate: 2022-09-29 19:33:32 +0000 Commit: Kyle Evans CommitDate: 2022-11-02 17:02:24 +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) (cherry picked from commit 4a4ad02da3c8f598b4ccf15b6cac9de3ebce3ba1) --- 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); +}