Devicetree
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Iker Pedrosa" <ikerpedrosam@gmail.com>
Cc: devicetree@vger.kernel.org, krzk+dt@kernel.org,
	conor+dt@kernel.org, robh@kernel.org
Subject: Re: [PATCH v10 4/4] riscv: dts: spacemit: k1-musepi-pro: add SD card support with UHS modes
Date: Fri, 15 May 2026 11:59:58 +0000	[thread overview]
Message-ID: <20260515115959.3D9D2C2BCB0@smtp.kernel.org> (raw)
In-Reply-To: <20260515-orangepi-sd-card-uhs-v10-4-094af27e310d@gmail.com>

Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] The SD card detect GPIO (`cd-gpios`) is configured with incorrect active polarity (`GPIO_ACTIVE_HIGH`), which will invert card detection.
- [Medium] The UHS-I I/O voltage supply (`aldo1`) is incorrectly marked `regulator-always-on`, preventing the MMC core from physically power-cycling the SD card during error recovery.
--

commit 6129b29ed8762cd8d45153d74898125f35ee85bc
Author: Trevor Gamblin <tgamblin@baylibre.com>

riscv: dts: spacemit: k1-musepi-pro: add SD card support with UHS modes

This commit updates the Muse Pi Pro devicetree with SD card support to match
the OrangePi RV2. It enables the sdhci0 controller, configures the pmic
regulators for card power and I/O switching, and adds UHS-I mode support.

Link: https://lore.kernel.org/linux-riscv/20260316-orangepi-sd-card-uhs-v3-0-aefd3b7832df@gmail.com/T/#

> diff --git a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> --- a/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-musepi-pro.dts

[ ... ]

> +	pmic@41 {
> +		compatible = "spacemit,p1";
> +		reg = <0x41>;

[ ... ]

> +		regulators {
> +			buck4: buck4 {
> +				regulator-min-microvolt = <500000>;
> +				regulator-max-microvolt = <3300000>;
> +				regulator-ramp-delay = <5000>;
> +				regulator-always-on;
> +			};
> +
> +			aldo1: aldo1 {
> +				regulator-min-microvolt = <500000>;
> +				regulator-max-microvolt = <3400000>;
> +				regulator-boot-on;
> +				regulator-always-on;

Will marking aldo1 as regulator-always-on prevent the MMC subsystem from
power-cycling the SD card during error recovery?

If a UHS-I voltage switch fails, the MMC core calls regulator_disable() on
vqmmc to drop the voltage to 0V and reset the card's internal state
machine.

The commit message notes this matches the OrangePi RV2, but the OrangePi
RV2 leaves aldo1 without the regulator-always-on constraint.

> +			};
> +		};
> +	};
> +};
> +
> +&sdhci0 {
> +	pinctrl-names = "default", "uhs";
> +	pinctrl-0 = <&mmc1_cfg>;
> +	pinctrl-1 = <&mmc1_uhs_cfg>;
> +	bus-width = <4>;
> +	cd-gpios = <&gpio K1_GPIO(80) (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>;

Does using GPIO_ACTIVE_HIGH invert the card detection logic?

With the internal pull-up enabled, the physical pin inherently reads high
when the slot is empty. To map the physical low state of a card insertion
to a logical true, this usually requires GPIO_ACTIVE_LOW.

The commit message mentions matching the OrangePi RV2, which uses
GPIO_ACTIVE_LOW for this same pin.

> +	no-mmc;
> +	no-sdio;

[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260515-orangepi-sd-card-uhs-v10-0-094af27e310d@gmail.com?part=4

      reply	other threads:[~2026-05-15 11:59 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-15 10:48 [PATCH v10 0/4] riscv: spacemit: enable SD card support with UHS modes for OrangePi RV2 Iker Pedrosa
2026-05-15 10:48 ` [PATCH v10 1/4] riscv: dts: spacemit: k1: add SD card controller and pinctrl support Iker Pedrosa
2026-05-15 10:49 ` [PATCH v10 2/4] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes Iker Pedrosa
2026-05-15 11:27   ` sashiko-bot
2026-05-15 10:49 ` [PATCH v10 3/4] riscv: dts: spacemit: k1-bananapi-f3: " Iker Pedrosa
2026-05-15 11:43   ` sashiko-bot
2026-05-15 10:49 ` [PATCH v10 4/4] riscv: dts: spacemit: k1-musepi-pro: " Iker Pedrosa
2026-05-15 11:59   ` sashiko-bot [this message]

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=20260515115959.3D9D2C2BCB0@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ikerpedrosam@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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