Re: [PATCH v5 5/9] riscv: dts: spacemit: k1: add SD card controller and pinctrl support
From: Troy Mitchell
Date: Mon Mar 30 2026 - 05:20:38 EST
On Mon, Mar 30, 2026 at 16:38:06 CST, Iker Pedrosa wrote:
> Add SD card controller infrastructure for SpacemiT K1 SoC with complete
> pinctrl support for both standard and UHS modes.
>
> - Add sdhci0 controller definition with clocks, resets and interrupts
> - Add mmc1_cfg pinctrl for 3.3V standard SD operation
> - Add mmc1_uhs_cfg pinctrl for 1.8V UHS high-speed operation
> - Configure appropriate drive strength and power-source properties
>
> This provides complete SD card infrastructure that K1-based boards can
> enable.
>
> Tested-by: Anand Moon <linux.amoon@xxxxxxxxx>
> Tested-by: Trevor Gamblin <tgamblin@xxxxxxxxxxxx>
> Signed-off-by: Iker Pedrosa <ikerpedrosam@xxxxxxxxx>
> ---
> arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi | 40 ++++++++++++++++++++++++++++
> arch/riscv/boot/dts/spacemit/k1.dtsi | 13 +++++++++
> 2 files changed, 53 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> index b13dcb10f4d66022d27307de73a6ea3287e97441..8d82011f1af666fb78c282a2abcc0cb88f962053 100644
> --- a/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> +++ b/arch/riscv/boot/dts/spacemit/k1-pinctrl.dtsi
> @@ -570,4 +570,44 @@ pwm14-1-pins {
> drive-strength = <32>;
> };
> };
> +
> + mmc1_cfg: mmc1-cfg {
> + mmc1-data-cmd-pins {
> + pinmux = <K1_PADCONF(104, 0)>, /* mmc1_d3 */
> + <K1_PADCONF(105, 0)>, /* mmc1_d2 */
> + <K1_PADCONF(106, 0)>, /* mmc1_d1 */
> + <K1_PADCONF(107, 0)>, /* mmc1_d0 */
> + <K1_PADCONF(108, 0)>; /* mmc1_cmd */
> + bias-pull-up = <1>;
> + drive-strength = <7>;
I'm a bit concerned about this value. Looking at the downstream 6.6 code, 3.3V uses DS4,
which equals 13mA. Since 7mA maps to DS0, what's the reasoning for using it here?
Do we have any documentation or measurement to back this up?
> + power-source = <3300>;
> + };
> +
> + mmc1-clk-pins {
> + pinmux = <K1_PADCONF(109, 0)>; /* mmc1_clk */
> + bias-pull-down = <1>;
> + drive-strength = <7>;
> + power-source = <3300>;
> + };
> + };
> +
> + mmc1_uhs_cfg: mmc1-uhs-cfg {
> + mmc1-data-cmd-pins {
> + pinmux = <K1_PADCONF(104, 0)>, /* mmc1_d3 */
> + <K1_PADCONF(105, 0)>, /* mmc1_d2 */
> + <K1_PADCONF(106, 0)>, /* mmc1_d1 */
> + <K1_PADCONF(107, 0)>, /* mmc1_d0 */
> + <K1_PADCONF(108, 0)>; /* mmc1_cmd */
> + bias-pull-up = <1>;
> + drive-strength = <13>;
See above.
- Troy