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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1C543C44536 for ; Wed, 22 Jul 2026 15:07:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id D374440873; Wed, 22 Jul 2026 15:07:53 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id eHPZtci9XnVQ; Wed, 22 Jul 2026 15:07:53 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=u-boot-bounces@lists.u-boot-project.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org D09FF4087D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.u-boot-project.org ; s=default; t=1784732872; bh=yU0zv+KMs4NSgZFTuzSlJxWSz9CBANOS6N7lH6ksNKI=; h=Date:Subject:References:In-Reply-To:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=UQ0sR7q3ZSrg0n79iS7ErvBFlf1hx+HKVBp16x3906CfVfqg7Dlr3GPat8Z+FGLUI Fcg+BvoHpzKoVOcuFYhaLVb5YzfGdywxeig71YXf077AhrNWk+FUvV2MWSJ69Ns/l3 BYPDKd44HTybCRutftQOH25bt3aDFnX/YHrTFkgcEPyTuukjKfZHvn7JKXIISRR/pj GFPd+1ZacEo+L2yKjky6Q5ELcXvvSbvGQ2cHEC8jxWux7ss/Y4VVjao8YEKuEUQ+Tg TDcaCrzwXuiphnPaLfoDXjgEn/osajtUB7nR23bBCjQfkvSt2icpMmsINmWp2MwbiF B2ON82vJ5mRdg== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id D09FF4087D; Wed, 22 Jul 2026 15:07:52 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 3C1DD313 for ; Wed, 22 Jul 2026 15:07:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 223B080EFB for ; Wed, 22 Jul 2026 15:07:51 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 5vsU2lBp9B22 for ; Wed, 22 Jul 2026 15:07:50 +0000 (UTC) Received-SPF: Softfail (mailfrom) identity=mailfrom; client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=eric.chung@riscstar.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org D44A080F0D DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org D44A080F0D Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) by smtp1.osuosl.org (Postfix) with ESMTPS id D44A080F0D for ; Wed, 22 Jul 2026 15:07:49 +0000 (UTC) Received: by phobos.denx.de (Postfix, from userid 109) id 579FF8494B; Wed, 22 Jul 2026 17:07:48 +0200 (CEST) Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (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 F36EB848BA for ; Wed, 22 Jul 2026 17:07:45 +0200 (CEST) Received: by mail-pg1-x532.google.com with SMTP id 41be03b00d2f7-cbb85186d43so1300923a12.3 for ; Wed, 22 Jul 2026 08:07:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784732864; x=1785337664; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=yU0zv+KMs4NSgZFTuzSlJxWSz9CBANOS6N7lH6ksNKI=; b=YTYQI/crj7izp0g+sK0wox3C0e/kRh2W8HvlfDRr+CBUkEsMs6Hd2fKZPSW3zjmXwG nx2v/WeJX2cOYpJmku8yVotEZU3fImhTawABFl2i6i/ZuislZMuTMqJQ5X2fuld+IPzH ZhERDbaYmePGqBMLOabD7r0/DRSN8Qt5V5yTOwMrcNIaS6sUJXNR90toabYZ7/pc9dMi +P3Q22+b/GH6xSJg/qrwo5o/9TyvSh0EJSA/MMlmquzf5WvWQ8g9z6JaQDQytf8CvQyS 6sI7DeLBzCaWXCUHNnMSu0k1ynXMmAIcp9MZ2Guo7WEkXmpzkCEkVClrtPov2u8prkX2 fLFw== X-Forwarded-Encrypted: i=1; AHgh+Ro+aC0yGh3x8SF4QiiA5JrgSAib2qON64wOC1LfBUVVMx991mBqyLMc9QfLPz14au9Xxathcbg=@lists.denx.de X-Gm-Message-State: AOJu0YyC/3QCc1b95x/ik7seeoZajVgNfWBfZ7nRMHbdbjrMslrjk2CC ysaLbIxudgSdIN2F6rmaHCdzEMknFB2sDmyjNbHVhkJzbOo/FmnjMxvyRqcpJkBJYzE= X-Gm-Gg: AR+sD13jmChrbIlezXRinidZ1cGNSELwmwDIu725RA6DIIQBET1FwMvzrgUB1Ohagfq NjejJlhZyD9g6ri2kbFrUXB/GlPlXHYI0DvKqEvK2ttb+AgG3U+KJtPU5pdxJ0tENsDDwcRZ3s+ vYwt6ZLWEJaUegQEvFhFA/JAKpyzfA6KiD4caWAqIuCikWVZsbte2m6FLREjaA1CECkDwepl7z2 WBSJo2nPF2V5MSsT7Z+xc9Wp1JG/jOweBHBlpd16YvI5DjN+sUzUcZ2HRTKqj3RYKg1Zruylrpb AUd946CNisfLVf2dmT619RWB5Poulw5bRhSirhiBk1RAtKR8PwiB/xsqqGTVkNf9cpLP0iKTFuo x+MQEN5H5CSsT+A8+nSRlM1HALJFkiKERrgvWDkyHr871rQj8AvwHRGFcr0R4nf9/GRV4VWlDxI cdGgYCIUcswOP+Yin64V1aqwMx78Hr8UPa5OWlF9GMyZzJs/2Ik8v4a3o20Ea3aXbcA4MmdksSL kTslNv10LTczlvO1gVF9dqjhiIC8PSsmPKEC+z/GZw= X-Received: by 2002:a05:6a20:7521:b0:3c3:b656:4f5b with SMTP id adf61e73a8af0-3c3b65651c6mr17393040637.56.1784732861825; Wed, 22 Jul 2026 08:07:41 -0700 (PDT) Received: from [127.0.1.1] ([209.170.101.129]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3147e088d3fsm10622267eec.25.2026.07.22.08.07.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2026 08:07:41 -0700 (PDT) Date: Wed, 22 Jul 2026 23:07:00 +0800 Subject: [PATCH v5 4/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: <20260722-m4-v5-4-c41a951e5157@riscstar.com> References: <20260722-m4-v5-0-c41a951e5157@riscstar.com> In-Reply-To: <20260722-m4-v5-0-c41a951e5157@riscstar.com> To: u-boot-spacemit@groups.io, u-boot@lists.denx.de Cc: Tom Rini , Tim Ouyang , Leo Liang , 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 , Sam Protsenko , Eric Chung X-Mailer: b4 0.15.2 X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=riscstar-com.20251104.gappssmtp.com; s=20251104; t=1784732864; x=1785337664; darn=lists.denx.de; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yU0zv+KMs4NSgZFTuzSlJxWSz9CBANOS6N7lH6ksNKI=; b=CZr9oUoBYQi8mouo2/II1LvY1KE417j5LGOlvzALjxaFVb4xGJ5ruBxhEFRFFBKVNL PjAra6A7qDHRpss+x+zZ0qgEJ3idrmDfyHEpEGl9NlvzdKTINpkp53IpG5kZ4n9M3RxR Gyf9D7RAMgSpoN07MpAXQeatb6OIuyJkUwDPR0JrrvvkjFegtFPqWhugymMSjAhRXhiX 5OcrTsk6Ob1PUNGyveSG4FsyNkL9M38wfsbV+3oes18QZ9byyH2Dgay/ztVlTz6MQp2S xU9Mv7KzoHuZa9K/Zr73g9nVJPfrvWxfSXLzQte04tFQH9izQdC7UMB3knRfjkKgr3YS Ox/Q== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=fail (p=none dis=none) header.from=riscstar.com X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=riscstar-com.20251104.gappssmtp.com header.i=@riscstar-com.20251104.gappssmtp.com header.a=rsa-sha256 header.s=20251104 header.b=CZr9oUoB X-Mailman-Original-Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=riscstar.com X-Mailman-Original-Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=eric.chung@riscstar.com X-Mailman-Original-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="CZr9oUoB"; dkim-atps=neutral X-BeenThere: u-boot@lists.u-boot-project.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eric Chung via U-Boot Reply-To: Eric Chung Errors-To: u-boot-bounces@lists.u-boot-project.org Sender: "U-Boot" 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 --- v5: - Append power source field on eMMC/SD pinctrl. 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 | 91 ++++++++++++++++++++++++++++++- arch/riscv/dts/k1-musepi-pro-u-boot.dtsi | 86 ++++++++++++++++++++++++++++- 2 files changed, 173 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..4823cbc1f33 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,86 @@ }; }; +/ { + 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>; + power-source = <3300>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <19>; + power-source = <3300>; + }; + }; + + 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>; + power-source = <1800>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <42>; + power-source = <1800>; + }; + }; +}; + +&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..f730f79e3e7 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,86 @@ }; }; +/ { + 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>; + power-source = <3300>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <19>; + power-source = <3300>; + }; + }; + + 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>; + power-source = <1800>; + }; + grp_clk { + pinmux = ; /* MMC1_CLK */ + bias-pull-down = <1>; + drive-strength = <42>; + power-source = <1800>; + }; + }; +}; + +&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