From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A6F0C433FE for ; Thu, 31 Mar 2022 23:34:23 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id ADD74842F1; Fri, 1 Apr 2022 01:26:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 2A773842C6; Fri, 1 Apr 2022 01:23:50 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 2F5058429B for ; Fri, 1 Apr 2022 01:23:08 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 9C173139F; Thu, 31 Mar 2022 16:23:07 -0700 (PDT) Received: from slackpad.lan (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 773413F73B; Thu, 31 Mar 2022 16:23:06 -0700 (PDT) Date: Fri, 1 Apr 2022 00:19:26 +0100 From: Andre Przywara To: Samuel Holland Cc: u-boot@lists.denx.de, Jagan Teki , Sean Anderson , Simon Glass , Heinrich Schuchardt , Heiko Schocher , Joe Hershberger Subject: Re: [PATCH v2 06/23] sunxi: Skip non-DM UART pin setup when PINCTRL=y Message-ID: <20220401001926.32221fda@slackpad.lan> In-Reply-To: <20220318035420.15058-7-samuel@sholland.org> References: <20220318035420.15058-1-samuel@sholland.org> <20220318035420.15058-7-samuel@sholland.org> Organization: Arm Ltd. X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.31; x86_64-slackware-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On Thu, 17 Mar 2022 22:54:03 -0500 Samuel Holland wrote: Hi Samuel, > When a pinctrl driver is available, it will take care of setting up > these pins. However, for now this code is still needed in SPL. > > Reviewed-by: Simon Glass > Signed-off-by: Samuel Holland > --- > > (no changes since v1) > > arch/arm/mach-sunxi/board.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c > index 0071de19ff..32e2477ae7 100644 > --- a/arch/arm/mach-sunxi/board.c > +++ b/arch/arm/mach-sunxi/board.c > @@ -79,6 +79,7 @@ ulong board_get_usable_ram_top(ulong total_size) > static int gpio_init(void) > { > __maybe_unused uint val; > +#if !CONFIG_IS_ENABLED(PINCTRL) So first this looks somewhat redundant, since the whole function (and its caller) is already wrapped in #ifdef CONFIG_SPL_BUILD. Unless you plan to have DM_PINCTRL for the RISC-V SPL? But more importantly this function is already a nested #ifdef nightmare. I experimented with: if (CONFIG_IS_ENABLED(PINCTRL)) return 0; and the toolchain garbage collection did the rest. This naive version breaks H6, AFAICS, but with a bit of refactoring this could be solved. But this is probably something for an independent cleanup patch. So: if you agree to the SPL == !PINCTRL redundancy, please drop this patch. If you want to keep the extra check, please at least add a comment after the #endif, and I will look at cleaning this up separately. Cheers, Andre > #if CONFIG_CONS_INDEX == 1 && defined(CONFIG_UART0_PORT_F) > #if defined(CONFIG_MACH_SUN4I) || \ > defined(CONFIG_MACH_SUN7I) || \ > @@ -166,6 +167,7 @@ static int gpio_init(void) > #else > #error Unsupported console port number. Please fix pin mux settings in board.c > #endif > +#endif > > #ifdef CONFIG_SUN50I_GEN_H6 > /* Update PIO power bias configuration by copy hardware detected value */