linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Javier Martinez Canillas <javierm@redhat.com>,
	Mark Brown <broonie@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Heiko Stuebner <heiko@sntech.de>, Chen-Yu Tsai <wens@csie.org>,
	Peter Robinson <pbrobinson@gmail.com>,
	Robin Murphy <robin.murphy@arm.com>,
	devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND
	FLATTENED DEVICE TREE BINDINGS),
	linux-arm-kernel@lists.infradead.org (moderated
	list:ARM/Rockchip SoC support),
	linux-rockchip@lists.infradead.org (open list:ARM/Rockchip SoC
	support)
Subject: [PATCH] rk3399-nanopi4.dtsi: enable sdmmc regulator on boot
Date: Wed,  6 Oct 2021 12:08:17 -0400	[thread overview]
Message-ID: <20211006160817.13808-1-twoerner@gmail.com> (raw)

When trying to boot a nanopi-m4 board with an SDHC-class uSD card, the boot
comes to a full stop shortly after initializing the mmc subsystem. The boot
can be cajoled into continuing if, after waiting a minute or so, the uSD
card is ejected and re-inserted. Waiting a minute or so before ejecting and
re-inserting the uSD card is crucial since the boot will not continue if
the card is ejected/re-inserted too soon after the boot has stopped.

The nanopi-m4 has a uSD card and an optional eMMC module, either of which
can be used for booting. In my case I don't have the optional eMMC module,
therefore I'm booting from the uSD card. When booting from the uSD card,
its regulator needs to be enabled at boot.

Curiously, this should have been an issue from day one, but it only started
to become a problem after commit 98e48cd9283d ("regulator: core: resolve
supply for boot-on/always-on regulators") was merged. Additionally, by
coincidence, I happened to be using an SDHC-class card in my device, and
saw the failure. However, if I use an SDXC-class uSD card the problem does
not occur.

Much thanks to Mark Brown and Javier Martinez Canillas for their assistance
on irc!

Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
index 8c0ff6c96e03..5cf02e2ef9b3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi4.dtsi
@@ -71,6 +71,7 @@ vcc3v0_sd: vcc3v0-sd {
 		pinctrl-names = "default";
 		pinctrl-0 = <&sdmmc0_pwr_h>;
 		regulator-always-on;
+		regulator-boot-on;
 		regulator-min-microvolt = <3000000>;
 		regulator-max-microvolt = <3000000>;
 		regulator-name = "vcc3v0_sd";
-- 
2.30.0.rc0


             reply	other threads:[~2021-10-06 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 16:08 Trevor Woerner [this message]
2021-10-07 14:25 ` [PATCH] rk3399-nanopi4.dtsi: enable sdmmc regulator on boot Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211006160817.13808-1-twoerner@gmail.com \
    --to=twoerner@gmail.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=heiko@sntech.de \
    --cc=javierm@redhat.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=pbrobinson@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=wens@csie.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).