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 60C36C77B78 for ; Wed, 3 May 2023 13:30:59 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id CE0AF847B5; Wed, 3 May 2023 15:28:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="DKf6lHRu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 968C3847B5; Wed, 3 May 2023 15:28:16 +0200 (CEST) Received: from mail-yw1-x1130.google.com (mail-yw1-x1130.google.com [IPv6:2607:f8b0:4864:20::1130]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A48DD84785 for ; Wed, 3 May 2023 15:28:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-55a214572e8so56242257b3.0 for ; Wed, 03 May 2023 06:28:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; t=1683120492; x=1685712492; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=ldAxbtljnWFTLwvrInlerUyl9Fmw0WjQmGq02pirxmE=; b=DKf6lHRuWhtuaWi6Azudkfd59er3FvnP0CzemREt5cVtZSyX98UOa25G2iQT1nKzj2 2oJ31WIfLjbQaVsXk7yuhw7CcE6Krb5bTRuxI6bUGnpN/6zWfmjtb/VVefak186urEVN mMHZLyhCbqHpZAffgBpRrXsMcaPLNzn22eB1Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683120492; x=1685712492; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ldAxbtljnWFTLwvrInlerUyl9Fmw0WjQmGq02pirxmE=; b=ddMfINl+oVwCjxYzogtN7bbd+Ea0WSJu8wGj3sHwgnLW1S83nQD26QHPxhZPIz0bjH HDgDnJfBHg1o6hKxOWrYW8LhJrXyolLUH4IoblWyPIlTeUCy+mIAVoQ62v38iZnvBfcB w4HDVBgJx2sI9BI8pwHux2QTWw6BKD4LIZ4/qaVORe9JDKOWoi/E6NDBLiug0Jfcanqk ppGXxJY1cgfkSi0MhJqYLic4WrAjmUbWP69WVTAuNELL8ahY3kwEt+u5pXzyvcR+Qmtv Te2lG8IU5MRPOZkzSJxQ/WevAXmYqMcf43lf2wwL2oQ6DGrY2fy2qOIBRQkne2jrSnbX oERw== X-Gm-Message-State: AC+VfDwd6KRqbbL8K6RFX6ijE9URk3OLyvi4uZS/qkuYUFmazjJd1mTh Uy1bSA/uRPB7plheJopXAJiIRA== X-Google-Smtp-Source: ACHHUZ4Y4qQN3mMcWuntoaiB5QAS59u4VgkVd9Vqyjeb44b6WOtQB+DBNDFxkVoSXQgFjKwOw/9Ynw== X-Received: by 2002:a0d:d8d1:0:b0:55a:abf6:6216 with SMTP id a200-20020a0dd8d1000000b0055aabf66216mr4449103ywe.17.1683120492435; Wed, 03 May 2023 06:28:12 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b00-6400-bb57-3cc0-e28c-ec2f.res6.spectrum.com. [2603:6081:7b00:6400:bb57:3cc0:e28c:ec2f]) by smtp.gmail.com with ESMTPSA id b124-20020a0dd982000000b0055a8e67d55dsm1054225ywe.23.2023.05.03.06.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 06:28:11 -0700 (PDT) Date: Wed, 3 May 2023 09:28:10 -0400 From: Tom Rini To: Daniel Golle Cc: u-boot@lists.denx.de, Sam Shih , GSS_MTK_Uboot_upstream , Chunfeng Yun , Weijie Gao , Ryder Lee , Frank Wunderlich , Steven Liu =?utf-8?B?KOWKieS6uuixqik=?= , John Crispin Subject: Re: [PATCH] pinctrl: mediatek: set R1/R0 in case pullen/pullsel succeeded Message-ID: <20230503132810.GU1134230@bill-the-cat> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/tMu2xyFC1G0hZSM" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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.8 at phobos.denx.de X-Virus-Status: Clean --/tMu2xyFC1G0hZSM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Apr 12, 2023 at 09:36:43PM +0100, Daniel Golle wrote: > Commit dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and > related functions") changed the logic deciding to set R0 and R1 > registers for V1 devices. >=20 > Before: > /* Also set PUPD/R0/R1 if the pin has them */ > err =3D mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_PUPD, !pullup); > if (err !=3D -EINVAL) { > mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R0, r0); > mtk_hw_set_value(dev, pin, PINCTRL_PIN_REG_R1, r1); > } >=20 > After: > /* try pupd_r1_r0 if pullen_pullsel return error */ > err =3D mtk_pinconf_bias_set_pullen_pullsel(dev, pin, disable, pullup, > val); > if (err) > return mtk_pinconf_bias_set_pupd_r1_r0(dev, pin, disable, > pullup, val); >=20 > Tracing mtk_pinconf_bias_set_pullen_pullsel shows that the function > always either returns 0 in case of success or -EINVAL in case any error > has occurred. Hence the logic responsible of the decision to program R0 > and R1 has been inverted. >=20 > This leads to problems on BananaPi R2 (MT7623N) when booting from > SDMMC, it turns out accessing eMMC no longer works since > U-Boot 2022.07: >=20 > MT7623> mmc dev 0 > Card did not respond to voltage select! : -110 >=20 > The problem wasn't detected for a long time as both eMMC and SDMMC work > fine if they are used to boot from, and hence R0 and R1 were already > setup by the bootrom and/or preloader. >=20 > Fix the logic to restore the originally intended and correct behavior > and also change the descriptive comment accordingly. >=20 > Fixes: dafe0fbfb0f3 ("pinctrl: mediatek: rewrite mtk_pinconf_set and rela= ted functions") > Signed-off-by: Daniel Golle > Tested-By: Frank Wunderlich Applied to u-boot/master, thanks! --=20 Tom --/tMu2xyFC1G0hZSM Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmRSYWoACgkQFHw5/5Y0 tywd1Qv+K4T6BLB3U9SKGPB2jsDYRZmQaT7aaTq/4uAc0meWhtk9XIcXo15I7ROm cZgq9UxpcyV9RsFLzyMaQAHg3pfJPpxu2reFKibVkdVtOLPhmsS6orz4s7gIiG6p tn4ure6GNt400ZQ9nG/sX00zU+3+tJnysVrUhV57sV08n282PLKqD8nYbnQgEsYP hof7HpXxikRdhgKRw34xtbp+c+dAGzC3WJfdXq3lWqmAQZq1ggHSXNr6bupavnoX BK86VbYeSrNflx2So3KLCrntGFrWFTyV3457w71tvn2/Y4Z/iEbDrsss9Dynzpu6 7M1b49dr+jsUvmiHbvNK6rLj1oZ1pL9rrN1kTeWHkwXUqZ/YavFiRT5Wa498ZkS0 xkNYyygJgjR4Xs4XHaE5HbpWtxXSmILkkI/QFuf/A9b/W895p76O0TSE2F8uyvcg abisDNMopQ/jwSQL9qS9Ps8EZd6QxcaCkyxLjeR/QoaLjCuMxlMwT0n9YUovFGRd 5+NDaV8H =gjlw -----END PGP SIGNATURE----- --/tMu2xyFC1G0hZSM--