Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5FEFAC43458 for ; Sun, 5 Jul 2026 06:09:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 12E2C84997; Sun, 5 Jul 2026 08:08:55 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=riscstar.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.b="MN/mYdM6"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CE82384979; Sun, 5 Jul 2026 08:08:53 +0200 (CEST) Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 76F3C83314 for ; Sun, 5 Jul 2026 08:08:51 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=riscstar.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eric.chung@riscstar.com Received: by mail-pj1-x102b.google.com with SMTP id 98e67ed59e1d1-381065a7a03so1372728a91.0 for ; Sat, 04 Jul 2026 23:08:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1783231730; x=1783836530; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=sqMVEiSYs2N2thesoPMmzWiKfFiJMLhmD+aOrCmRcPE=; b=MN/mYdM6PNEUPlsVmxoj1yKmn5D6UgMvnUiPUCFcE877qGSv5xkD1ip9hNrJxxPxQm NBR6AYfwE1atwYDa57duvXi2/CMtw/J38yk7nJXzwnYuohWysVJ/WQdJJ7eI5fAvq3In 8mYw1HPEQ4LBbmf+g7yaH+LG8Wha0qpyf96QdNeBd8rF5xeJtGCejL2dyaEPpWKlnVg3 jgSwvHZTxdugf54S+HyRIMq2b8dw06hctvvmYPfmyE/rajAP7AS3az7EnaX8ZJhr6ukO dIAsSs4++r1cbY7bbnfFbDqEbsss51n0zUmCoF+2vZbokyVMp9wHJ2wQ7ZctLgeggHIs 7PUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783231730; x=1783836530; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=sqMVEiSYs2N2thesoPMmzWiKfFiJMLhmD+aOrCmRcPE=; b=CcAGVWthHkAjeM18q+v2M8N7kxttWr+kxmDNLIfwhMMeXc8mPNzwI20jaq93ICtfOd fOaSsytI7Fsm2x98QqAX+hw17Lv/sLFFjonXypOddgQUfTZxaGuwME3TpYLMkn7vYnZr XSzzTLBuFBOi6ORJLKxR4stVwPuOcfoYA/tsse6sOgW86nf6fD+SoTJF/6Mu/TZY1gGb WZQQZ+8DUnCAg2BLP9Olfo6A3PePoitS9XARD+Ctd5kLoghaWYPcP5cJ5yufG7iPSHMl zUGnGAGIMSyanOuNN+lF+4T94kWud7ozBppzCDxru2PFCOPnKl3PrDIBfoe9hYuWOBG4 FU8A== X-Forwarded-Encrypted: i=1; AHgh+RoHQPklUmeqiU5mxVWV89/NJorN12g1vDJBizPZQrxL0En2/N/tWQNkzRZtwWEtB1AlTqZX4fE=@lists.denx.de X-Gm-Message-State: AOJu0YzHGvgMBtW1BAMjGWTU1j4FdlLOikQQqixYzBGvjQPDv9HzHq27 c9RbYclDjvO/FmXPvxwxkqWMprxbh5ks+FEpes34BKhJ/Gi95IrEjS56qjboVNx6Gcc= X-Gm-Gg: AfdE7cmkhG4qeN59AHNmX9y8EKBCHkbvdXJ0vGznnqX7WhsRM+SL5Llcag9Kg0BgadJ vJdahq9SKFKW9Xvm5UMs1pJ8baNA4Yk7cE9c5DZHFJEk8y4NI/gGuPuOFeqpoqN04EcbbcdZCH6 NyzsYnFMcVIIdVfxY3pOWA7FEVB5FFdYU3aXt7o6NE5yasEZvDANH+ZfDlh9//3xxsa0i2gObxO 0p1Z6ntsNDCmo4sgWWELFs9soC3pT+cEYMNRMz2x2tSMS1fVaAZrke5PCgrY9zKczpgUkoNpe3Y 3a6YUM9aifHXaXpEIAbi1XzFt+TIK63Pkzgzi/ob98XIT+gZkRHAixmOEDr+m3NpvGTNgyAIIAh CRIVDkf16hcdXzZMnyTWfx2vHCkRpZBjinoh+YUpaRsXKX5MlSTDCYzwa9yFj1W76v9Rh5x7yST PXFA6YqZBOPxG2Uil7Vu4H/7XIgmRPsI4n0JddnNE7Ty4Ldlkz1SJ5ToGKWmV3KOXM+rkQ58J3R dmb+lf2DHfsmToO3GUmUodMWiSFBJY+DkeKeGP7fQjNkRO/xUWR/HRC4t8qvDi6 X-Received: by 2002:a17:90b:4d88:b0:37f:d9dc:557 with SMTP id 98e67ed59e1d1-3829d70cc3bmr5184896a91.16.1783231729953; Sat, 04 Jul 2026 23:08:49 -0700 (PDT) Received: from [127.0.1.1] ([209.170.101.129]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30f38ee1333sm22291719eec.24.2026.07.04.23.08.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Jul 2026 23:08:49 -0700 (PDT) From: Eric Chung Date: Sun, 05 Jul 2026 14:07:56 +0800 Subject: [PATCH v3 5/9] dts: k1: add SD card support in u-boot overlay MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260705-m4-v3-5-5a9bc7f25fc5@riscstar.com> References: <20260705-m4-v3-0-5a9bc7f25fc5@riscstar.com> In-Reply-To: <20260705-m4-v3-0-5a9bc7f25fc5@riscstar.com> To: u-boot-spacemit@groups.io, u-boot@lists.denx.de Cc: Tom Rini , Peng Fan , Huan Zhou , Raymond Mao , Jaehoon Chung , Bhimeswararao Matsa , Tanmay Kathpalia , Kaustabh Chakraborty , Han Xu , Yanir Levin , Christoph Stoidner , Balsundar Ponnusamy , Daniel Palmer , Anshul Dalal , Bastien Curutchet , Angelo Dureghello , Johan Jonker , Rick Chen , Leo , Sam Protsenko , Guodong Xu , Tim Ouyang , Leo Liang , Eric Chung X-Mailer: b4 0.15.2 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean Add the SDH0 controller node and its pinctrl groups to the u-boot overlay. The upstream DTS only contains the eMMC node; the SD card controller (sdhci@d4280000) and its MMC1 pinctrl configuration are missing. Place the new node inside the storage-bus via path-based merge so it inherits the dma-ranges from the parent bus. Signed-off-by: Eric Chung --- v3: - Fix SD pinctrl as uhs. v2: - Use vmmc-supply as vqmmc-supply on SD node. - Add alias of mmc0 and mmc1. --- arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi | 87 ++++++++++++++++++++++++++++++- arch/riscv/dts/k1-musepi-pro-u-boot.dtsi | 82 ++++++++++++++++++++++++++++- 2 files changed, 165 insertions(+), 4 deletions(-) diff --git a/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi b/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi index 7f9443d6951..582bd61d27c 100644 --- a/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi +++ b/arch/riscv/dts/k1-bananapi-f3-u-boot.dtsi @@ -6,6 +6,11 @@ #include "binman.dtsi" / { + aliases { + mmc0 = &emmc; + mmc1 = &sdhci0; + }; + memory@0 { device_type = "memory"; reg = <0x00000000 0x00000000 0x00000000 0x80000000>; @@ -76,12 +81,14 @@ bootph-pre-ram; }; - buck3 { + buck3_1v8: buck3 { regulator-name = "vdd_1v8"; bootph-pre-ram; }; - aldo1 { + buck4_3v3: buck4 { }; + + aldo1: aldo1 { regulator-name = "vdd_1v8_mmc"; bootph-pre-ram; }; @@ -89,6 +96,82 @@ }; }; +/ { + soc { + storage-bus { + sdhci0: mmc@d4280000 { + bootph-pre-ram; + compatible = "spacemit,k1-sdhci"; + reg = <0x0 0xd4280000 0x0 0x200>; + clocks = <&syscon_apmu CLK_SDH_AXI>, + <&syscon_apmu CLK_SDH0>; + clock-names = "core", "io"; + interrupts = <99>; + resets = <&syscon_apmu RESET_SDH_AXI>, + <&syscon_apmu RESET_SDH0>; + reset-names = "sdh_axi", "sdh0"; + bus-width = <4>; + max-frequency = <204800000>; + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_LOW>; + pinctrl-names = "default", "uhs"; + pinctrl-0 = <&sdhci0_0_cfg>; + pinctrl-1 = <&sdhci0_1_cfg>; + status = "okay"; + }; + }; + }; +}; + +/* SD card pinctrl groups -- not present in upstream k1-pinctrl.dtsi */ +&pinctrl { + sdhci0_0_cfg: sdhci0-0-cfg { + grp_cmd_data { + pinmux = , /* MMC1_DAT3 */ + , /* MMC1_DAT2 */ + , /* MMC1_DAT1 */ + , /* MMC1_DAT0 */ + ; /* MMC1_CMD */ + bias-pull-up = <1>; + drive-strength = <19>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <19>; + }; + }; + + sdhci0_1_cfg: sdhci0-1-cfg { /* uhs */ + grp_cmd_data { + pinmux = , /* MMC1_DAT3 */ + , /* MMC1_DAT2 */ + , /* MMC1_DAT1 */ + , /* MMC1_DAT0 */ + ; /* MMC1_CMD */ + bias-pull-up = <1>; + drive-strength = <42>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <42>; + }; + }; +}; + +&emmc { + bootph-pre-ram; + resets = <&syscon_apmu RESET_SDH_AXI>, <&syscon_apmu RESET_SDH2>; + reset-names = "sdh_axi", "sdh2"; + vqmmc-supply = <&buck3_1v8>; + vmmc-supply = <&aldo1>; + max-frequency = <204800000>; +}; + +&sdhci0 { + vmmc-supply = <&buck4_3v3>; +}; + &binman { u-boot-spl-ddr { type = "section"; diff --git a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi index 8a9a2a09de9..ac67db13d7b 100644 --- a/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi +++ b/arch/riscv/dts/k1-musepi-pro-u-boot.dtsi @@ -10,6 +10,8 @@ aliases { console = &uart0; serial0 = &uart0; + mmc0 = &emmc; + mmc1 = &sdhci0; }; chosen { @@ -147,7 +149,7 @@ regulator-always-on; }; - buck4 { + buck4_3v3: buck4 { regulator-min-microvolt = <500000>; regulator-max-microvolt = <3300000>; regulator-ramp-delay = <5000>; @@ -168,7 +170,7 @@ regulator-always-on; }; - aldo1 { + aldo1: aldo1 { bootph-pre-ram; regulator-name = "vdd_1v8_mmc"; regulator-min-microvolt = <500000>; @@ -249,6 +251,82 @@ }; }; +/ { + soc { + storage-bus { + sdhci0: mmc@d4280000 { + bootph-pre-ram; + compatible = "spacemit,k1-sdhci"; + reg = <0x0 0xd4280000 0x0 0x200>; + clocks = <&syscon_apmu CLK_SDH_AXI>, + <&syscon_apmu CLK_SDH0>; + clock-names = "core", "io"; + interrupts = <99>; + resets = <&syscon_apmu RESET_SDH_AXI>, + <&syscon_apmu RESET_SDH0>; + reset-names = "sdh_axi", "sdh0"; + bus-width = <4>; + max-frequency = <204800000>; + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_LOW>; + pinctrl-names = "default", "uhs"; + pinctrl-0 = <&sdhci0_0_cfg>; + pinctrl-1 = <&sdhci0_1_cfg>; + status = "okay"; + }; + }; + }; +}; + +/* SD card pinctrl groups -- not present in upstream k1-pinctrl.dtsi */ +&pinctrl { + sdhci0_0_cfg: sdhci0-0-cfg { + grp_cmd_data { + pinmux = , /* MMC1_DAT3 */ + , /* MMC1_DAT2 */ + , /* MMC1_DAT1 */ + , /* MMC1_DAT0 */ + ; /* MMC1_CMD */ + bias-pull-up = <1>; + drive-strength = <19>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <19>; + }; + }; + + sdhci0_1_cfg: sdhci0-1-cfg { /* uhs */ + grp_cmd_data { + pinmux = , /* MMC1_DAT3 */ + , /* MMC1_DAT2 */ + , /* MMC1_DAT1 */ + , /* MMC1_DAT0 */ + ; /* MMC1_CMD */ + bias-pull-up = <1>; + drive-strength = <42>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <42>; + }; + }; +}; + +&emmc { + bootph-pre-ram; + resets = <&syscon_apmu RESET_SDH_AXI>, <&syscon_apmu RESET_SDH2>; + reset-names = "sdh_axi", "sdh2"; + vqmmc-supply = <&buck3_1v8>; + vmmc-supply = <&aldo1>; + max-frequency = <204800000>; +}; + +&sdhci0 { + vmmc-supply = <&buck4_3v3>; +}; + &binman { u-boot-spl-ddr { type = "section"; -- 2.51.0