[PATCH v2 7/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes

Anand Moon linux.amoon at gmail.com
Fri Mar 13 07:42:02 PDT 2026


Hi Trevor,

On Fri, 13 Mar 2026 at 19:26, Trevor Gamblin <tgamblin at baylibre.com> wrote:
>
>
> On 2026-03-09 07:40, Iker Pedrosa wrote:
> > Add complete SD card controller support with UHS high-speed modes.
> >
> > - Enable sdhci0 controller with 4-bit bus width
> > - Configure card detect GPIO with inversion
> > - Connect vmmc-supply to buck4 for 3.3V card power
> > - Connect vqmmc-supply to aldo1 for 1.8V/3.3V I/O switching
> > - Add dual pinctrl states for voltage-dependent pin configuration
> > - Support UHS-I SDR25, SDR50, and SDR104 modes
> >
> > This enables full SD card functionality including high-speed UHS modes
> > for improved performance.
> >
> > Signed-off-by: Iker Pedrosa <ikerpedrosam at gmail.com>
> > ---
> >   arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts | 19 +++++++++++++++++++
> >   1 file changed, 19 insertions(+)
> >
> > diff --git a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> > index 414b03f5e6480f05f5d7eeaaa0afb4e86425ae36..361135269801f436703b6f1d768c91325a52f07f 100644
> > --- a/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> > +++ b/arch/riscv/boot/dts/spacemit/k1-orangepi-rv2.dts
> > @@ -140,3 +140,22 @@ sd_vqmmc: aldo1 {
> >               };
> >       };
> >   };
> > +
> > +&sdhci0 {
> > +     pinctrl-names = "default", "state_uhs";
> > +     pinctrl-0 = <&mmc1_cfg>;
> > +     pinctrl-1 = <&mmc1_uhs_cfg>;
> > +     bus-width = <4>;
> > +     cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>;
> > +     cd-inverted;
> > +     no-mmc;
> > +     no-sdio;
> > +     disable-wp;
> > +     cap-sd-highspeed;
> > +     vmmc-supply = <&sd_vmmc>;
> > +     vqmmc-supply = <&sd_vqmmc>;
> > +     sd-uhs-sdr25;
> > +     sd-uhs-sdr50;
> > +     sd-uhs-sdr104;
> > +     status = "okay";
> > +};
> >
> Hello again,
>
> Thanks for doing this work. My colleagues and I have been testing this
> on an OrangePi RV2, and also a Muse Pi Pro board (making a similar tweak
> to this patch in k1-musepi-pro.dts). To do the testing on my end, I'm
> applying the patch series on top of 6.19 in a Yocto BSP.
>
> I've been finding that I see issues with the UHS support on my side
> (this log comes from an image built and flashed to an SD card):
>
>
> [ 1.072417] sdhci-spacemit d4280000.mmc: Got CD GPIO
> [ 1.109741] mmc0: SDHCI controller on d4280000.mmc [d4280000.mmc] using
> ADMA
> [ 1.114589] clk: Disabling unused clocks
> [ 1.118421] PM: genpd: Disabling unused power domains
> [ 1.123249] ALSA device list:
> [ 1.126[ 1.129949] check access for rdinit=/init failed: -2, ignoring
> [ 1.133284] Waiting for root device
> PARTUUID=e94bfdd7-a36f-4315-a480-476e2a12403d...
> [ 1.176569] mmc0: new UHS-I speed DDR50 SDHC card at address aaaa
> [ 1.180732] mmcblk0: mmc0:aaaa SS16G 14.8 GiB
> [ 1.276268] mmcblk0: recovery failed!
> [ 1.277351] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags
> 0x800000 phys_seg 1 prio class 2
> [ 1.286346] Buffer I/O error on dev mmcblk0, logical block 0, async page
> read
> [ 1.293891] mmcblk0: recovery failed!
> [ 1.297289] I/O error, dev mmcblk0, sector 0 op 0x0:(READ) flags
> 0x800000 phys_seg 1 prio class 2
> [ 1.306269] Buffer I/O error on dev mmcblk0, logical block 0, async page
> read
> [ 1.313522] mmcblk0: unable to read partition table
>
>
> At first I wondered if maybe there was an issue with the card itself,
> but by changing the sdhci0 section to this, I'm able to read the SD just
> fine:
>
I used the same example on the K1-OrangePi-RV2 DTS,
But it’s slightly different from the one you’re working with.
I tested on the latest  7.0-rc3.

> &sdhci0 {
>           pinctrl-names = "default";
>           pinctrl-0 = <&mmc1_cfg>;
>           bus-width = <4>;
>           cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>;
>           cd-inverted;
>           no-mmc;
>           no-sdio;
>           disable-wp;
>           vmmc-supply = <&sd_vmmc>;
>           vqmmc-supply = <&sd_vqmmc>;
>           no-1-8-v;
>           status = "okay";
> };
>
+
+&sdhci0 {
+       pinctrl-names = "default", "state_uhs";
+       pinctrl-0 = <&mmc1_cfg>;
+       pinctrl-1 = <&mmc1_uhs_cfg>;
+       bus-width = <4>;
+       cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>;
+       cd-inverted;
+       no-mmc;
+       no-sdio;
+       disable-wp;
+       cap-sd-highspeed;
+       vmmc-supply = <&sd_vmmc>;
+       vqmmc-supply = <&sd_vqmmc>;
+       sd-uhs-sdr25;
+       sd-uhs-sdr50;
+       sd-uhs-sdr104;
+       status = "okay";
+};

Thanks
-Anand



More information about the linux-riscv mailing list