[PATCH v3 6/7] riscv: dts: spacemit: k1-orangepi-rv2: add SD card support with UHS modes
Michael Opdenacker
michael.opdenacker at rootcommit.com
Tue Mar 17 08:54:14 PDT 2026
Hi Iker
Thanks for the update!
On 3/16/26 3:03 PM, 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.
>
> Tested-by: Anand Moon <linux.amoon at gmail.com>
> Tested-by: Trevor Gamblin <tgamblin at baylibre.com>
> 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 f1533c99881dbf38e16cff5e91e33253cfa7a56d..aff23846085d22d1e9cd77434bffd2816ad59e12 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 @@ aldo1: 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 = <&buck4>;
> + vqmmc-supply = <&aldo1>;
> + sd-uhs-sdr25;
> + sd-uhs-sdr50;
> + sd-uhs-sdr104;
> + status = "okay";
> +};
Tested successfully on OrangePi RV2.
Tested-by: Michael Opdenacker <michael.opdenacker at rootcommit.com>
Cheers
Michael
--
Root Commit
Embedded Linux Training and Consulting
https://rootcommit.com
More information about the linux-riscv
mailing list