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 D0F9BC433F5 for ; Sun, 10 Apr 2022 05:13:44 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1BE4983565; Sun, 10 Apr 2022 07:13:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="OGBzJRMy"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="cVcwHuox"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7019483988; Sun, 10 Apr 2022 07:13:41 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F0181803F5 for ; Sun, 10 Apr 2022 07:13:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 8F8915C00E3; Sun, 10 Apr 2022 01:13:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Sun, 10 Apr 2022 01:13:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; bh=JjANWhJ0iUIhPreF2YgVUymkTIK35+vWF3vZhwAvmZU=; b=OGBzJ RMyaDo8khUkgY5gdGLs6Z5PVaykCyqsaHffDMa4DFhkiIq2XK92BlumPIX/vb00v dOG/tac9BdZf0d837WZ+43VLNoTLMPu/2HJWsSVAZ7/VkoSnJTJTK3KvgpvjGIgP tB5dcrdkWc3AOnD/kSrpZYNmSEoKEl9pl33VOjWcSPkgKpiDF9R2RmPdCLTw382u iBlHLZ0MnkFY3/PrlhrgamRSRpVuX3LAuiMCOiyheNpuq8ORXoIw4252kJxfjpq3 jg6rxv+ByypN8ERMi/MVGw+AP8LDd0cj7jGYazorLIA/zPG8XZRlZuvEB6oycAfi N81hQf7OPfampSkuA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :from:from:in-reply-to:message-id:mime-version:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=JjANWhJ0iUIhPreF2YgVUymkTIK35 +vWF3vZhwAvmZU=; b=cVcwHuoxk2N/5CMrwyVwhaJmZ3kwQqspstQ4VAtEVNqwH OmOGORWOf4si3QEyjuOgli1zBLJnPVedU/Bcjtu1/w6MgJAqmd2G238Wk6PPIG3k I5tQdpAdqy3MRoYKq35apMbpGlN3m99b51JHCjTAMDYx+9MJknZeJRtlXWSOk7QQ C2qOJnuC9cm+lnl1V58jC3IqsfcxCLp9lf0A4CdLCfrSQ0JmaQoMMukLtldX2vCN gt05koPxNa2hS/Ul5oCsh63c4uKh+nt71WhDXLjwr/wWxBHAfsHL306yUDajTWyp rC/1UyXzec+/Ci1GUaaWFMCybyIOi9yYuvNAUkSjQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudekfedgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeeiteekhfehuddugfeltddufeejjeefgeevheekueffhffhjeekheeiffdt vedtveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 10 Apr 2022 01:13:35 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Jagan Teki , Andre Przywara Cc: Icenowy Zheng , Samuel Holland Subject: [PATCH 1/2] sunxi: Skip MMC0 init when its pinmux conflicts with UART0 Date: Sun, 10 Apr 2022 00:13:33 -0500 Message-Id: <20220410051335.52093-1-samuel@sholland.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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. 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; } -- 2.35.1