[PATCH v8 8/9] riscv: dts: spacemit: k1-bananapi-f3: add SD card support with UHS modes
Margherita Milani
margherita.milani at amarulasolutions.com
Thu May 7 01:20:06 PDT 2026
Good morning Iker,
> 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
Tested-by: Margherita Milani <margherita.milani at amarulasolutions.com>
However I noticed it only works when CONFIG_I2C_K1 is enabled.
Michael Opdenacker told me it's necessary to enable the regulators
used by the mmc controller.
Should we add the dependency between CONFIG_MMC_SDHCI_OF_K1 and
CONFIG_I2C_K1? (Unless some boards don't have these dependency?)
Thank you for your patchset which was really nice!
--
Margherita Milani
Embedded Software Engineer
M. +39 334 758 9111
margherita.milani at amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via le Canevare 30, 31100, Treviso, Veneto, IT
T. +39 (0)42 243 5310
info at amarulasolutions.com
www.amarulasolutions.com
On Mon, Apr 13, 2026 at 10:05 AM Iker Pedrosa <ikerpedrosam at gmail.com> 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.
>
> Suggested-by: Anand Moon <linux.amoon at gmail.com>
> Tested-by: Anand Moon <linux.amoon at gmail.com>
> Signed-off-by: Iker Pedrosa <ikerpedrosam at gmail.com>
> ---
> arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 24 ++++++++++++++++++++++--
> 1 file changed, 22 insertions(+), 2 deletions(-)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> index 5790d927b93d..a7d88564630f 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts
> @@ -220,7 +220,7 @@ buck3_1v8: buck3 {
> regulator-always-on;
> };
>
> - buck4 {
> + buck4: buck4 {
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3300000>;
> regulator-ramp-delay = <5000>;
> @@ -241,7 +241,7 @@ buck6 {
> regulator-always-on;
> };
>
> - aldo1 {
> + aldo1: aldo1 {
> regulator-min-microvolt = <500000>;
> regulator-max-microvolt = <3400000>;
> regulator-boot-on;
> @@ -367,3 +367,23 @@ hub_3_0: hub at 2 {
> reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>;
> };
> };
> +
> +&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>;
> + cd-inverted;
> + broken-cd;
> + 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";
> +};
>
> --
> 2.53.0
>
>
--
Margherita Milani
Embedded Software Engineer
M. +39 334 758 9111
margherita.milani at amarulasolutions.com
__________________________________
Amarula Solutions SRL
Via le Canevare 30, 31100, Treviso, Veneto, IT
T. +39 (0)42 243 5310
info at amarulasolutions.com
www.amarulasolutions.com
More information about the linux-riscv
mailing list