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 EE601C433FE for ; Tue, 26 Apr 2022 12:58:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B8AC783BAC; Tue, 26 Apr 2022 14:58:34 +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 12DF583BDB; Tue, 26 Apr 2022 14:58:32 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id 513A1817D8 for ; Tue, 26 Apr 2022 14:58:29 +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 AF98BED1; Tue, 26 Apr 2022 05:58:28 -0700 (PDT) Received: from donnerap.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0AAE43F774; Tue, 26 Apr 2022 05:58:27 -0700 (PDT) Date: Tue, 26 Apr 2022 13:58:25 +0100 From: Andre Przywara To: Samuel Holland Cc: u-boot@lists.denx.de, Jagan Teki , Icenowy Zheng Subject: Re: [PATCH 1/2] sunxi: Skip MMC0 init when its pinmux conflicts with UART0 Message-ID: <20220426135825.331d673b@donnerap.cambridge.arm.com> In-Reply-To: <20220410051335.52093-1-samuel@sholland.org> References: <20220410051335.52093-1-samuel@sholland.org> Organization: ARM X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.32; aarch64-unknown-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 Sun, 10 Apr 2022 00:13:33 -0500 Samuel Holland wrote: > Currently, selecting UART0_PORT_F entirely disables MMC support on sunxi > platforms. But this is a bigger hammer then needed. Muxing UART0 to the > pins on port F only causes a conflict with MMC0, so minimize the impact > by specifically skipping MMC0 init. We can continue to use MMC1/2 if > those are enabled. > > Let's also remove the preprocessor check while refacting this function. I like this very much, that should solve a bunch of problems at once and looks nicer. I will need to test that, but plan on taking it as a fix ASAP. Thanks, Andre. > > Signed-off-by: Samuel Holland > --- > > board/sunxi/board.c | 22 ++++++++++------------ > 1 file changed, 10 insertions(+), 12 deletions(-) > > diff --git a/board/sunxi/board.c b/board/sunxi/board.c > index 89324159d5..7822001d99 100644 > --- a/board/sunxi/board.c > +++ b/board/sunxi/board.c > @@ -516,19 +516,17 @@ static void mmc_pinmux_setup(int sdc) > > int board_mmc_init(struct bd_info *bis) > { > - __maybe_unused struct mmc *mmc0, *mmc1; > - > - mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT); > - mmc0 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT); > - if (!mmc0) > - return -1; > + if (!IS_ENABLED(CONFIG_UART0_PORT_F)) { > + mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT); > + if (!sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT)) > + return -1; > + } > > -#if CONFIG_MMC_SUNXI_SLOT_EXTRA != -1 > - mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA); > - mmc1 = sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA); > - if (!mmc1) > - return -1; > -#endif > + if (CONFIG_MMC_SUNXI_SLOT_EXTRA != -1) { > + mmc_pinmux_setup(CONFIG_MMC_SUNXI_SLOT_EXTRA); > + if (!sunxi_mmc_init(CONFIG_MMC_SUNXI_SLOT_EXTRA)) > + return -1; > + } > > return 0; > }