From mboxrd@z Thu Jan 1 00:00:00 1970 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 B6632CD98CF for ; Fri, 12 Jun 2026 20:19:40 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id EF899848F0; Fri, 12 Jun 2026 22:19:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.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=gmail.com header.i=@gmail.com header.b="JYf6ziBo"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A5CFF848EB; Fri, 12 Jun 2026 22:19:23 +0200 (CEST) Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) (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 72EFB84878 for ; Fri, 12 Jun 2026 22:19:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=raymondmaoca@gmail.com Received: by mail-qt1-x834.google.com with SMTP id d75a77b69052e-51764768c36so17938311cf.0 for ; Fri, 12 Jun 2026 13:19:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781295560; x=1781900360; darn=lists.denx.de; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v19No70bpN4Je3oLlA6kHQ+fEW1ef3s9OcTQiwSvsgc=; b=JYf6ziBo/QYTeqzhptqBjqz4D+eZeepQHzH0NCA4WfTqxcjmIOtk3d0znIcgEv6eS/ KzApd/uE5G8zbYlX1WdzFYQqHCd7AShNdc0kc9d3z4jQVSM6klgXOPnm3w+iW8h8jXTO lMHohbBEVEy01uo6AhCrBNriSn/IHQlsQ54CSAlCsIigkyp8q60JOMBehMwBTccLYPhK Bo+aeng4fX62tJr64AbzpBHy+FMGcevPTgud2Me6Zdm5+F34q/AEJQWG2t0oTEbg8iNq DcRk7A8K7n2a44RPeD3eBV5l+qGcuYOAXANvpLEqBZqNAC4RMV0K3h0VC0dPg04gzgXe NGjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781295560; x=1781900360; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=v19No70bpN4Je3oLlA6kHQ+fEW1ef3s9OcTQiwSvsgc=; b=idGX/ORMAJ/Qir49CVv3f7H7HDCb4vp0lOAVitFYjuqo6A8r1z9bfd4KYXfZjHvTYs jTd7vcUhSBo0YYDxQ/btnc8KtS76wc96+Z8rboVxepzQImkkq+kMj+2eyfZD/7NSYnZf nwIOmS16fA6GENip2WBE/iPryipdMb4FxUW8dz6+bKW1s47lKSPcd4FOpiBsyelcHVNG KNO9ojdMBFgxRBYj1Te607jlrGn3RFyh+FZBnCNGwM5NbeqQEQr05QxXoY0L5ijyago6 /Du2fII//xyHzz02UfYR/75L2qVvTagA0PVJXexbnL0RLlDeikws0fniKHMucupBuiGO MmBw== X-Gm-Message-State: AOJu0YysUxGZWAIyjtWL084pu/p5f+DiHXmz95m4zprgvrCQ5VihiG7J w7Y5RW3ijcoW3F+cjf/Fakl2ZRP7OC+iDwJK4HiVWcP/5l6FYcDUcGV8aBMXiahN X-Gm-Gg: Acq92OFGqNn21N3iJmQXilCsAe1/VZwvYFLrgdWt1/DWACERM8N3fp2Z88LdPfHVI8s X1a3Z+mf3BNeEbOyLLnoduUYCLhj6bcbQHUrDekI7VNDcT8It8J3aGyjSUVQjG+oQxRCrhWWCvy crALGWYLy9fjaZ8gfqcXhgFRhfmyJTPxkPiDJcSlM4KMJM6NmLGt7LZPtg1oyWqcqoXAKdrMhEh tZ2EIsSvfcWNexsLbcooRjRlAEiU/EEEcDDjXMzqnx/bAeY7UgeybcKQlFXZKc5m3MUoxYNg9ua G8JdAzkpyYTA6gpaMX9ewPfIbm+YdNx2cJUZhJ6hHGcCrf9chs0BYzZCzhVth7bvgHZmMK1td5x reLHdmUzCiYP/qinzph93umZqMZjzWyhBPQP3Wn5TtH16ZaP1Qe1FZcbBEhSeFXh8hBSbzK/7Xs P1Bep5ahf/OS6cvbM5usCyGhAAZ/kbVeghIhiQQt3kIGgKT7Puj/zx20T7bBRWMTB7l1nNB0aHK EFRfUhr X-Received: by 2002:a05:622a:6105:b0:517:c65b:f416 with SMTP id d75a77b69052e-51953713949mr19407531cf.54.1781295560235; Fri, 12 Jun 2026 13:19:20 -0700 (PDT) Received: from ubuntu.localdomain (23-91-246-209.cpe.distributel.net. [23.91.246.209]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-517fb7a3c4asm31304551cf.14.2026.06.12.13.19.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2026 13:19:19 -0700 (PDT) From: Raymond Mao To: u-boot@lists.denx.de Cc: uboot@riscstar.com, u-boot-spacemit@groups.io, raymond.mao@riscstar.com, rick@andestech.com, ycliang@andestech.com, trini@konsulko.com, lukma@denx.de, hs@nabladev.com, jh80.chung@samsung.com, peng.fan@nxp.com, xypron.glpk@gmx.de, randolph@andestech.com, dlan@gentoo.org, junhui.liu@pigmoral.tech, neil.armstrong@linaro.org, quentin.schulz@cherry.de, samuel@sholland.org, raymondmaoca@gmail.com, Guodong Xu Subject: [PATCH 3/8] dts: k1: add SD card support in u-boot overlay Date: Fri, 12 Jun 2026 16:18:56 -0400 Message-Id: <20260612201901.73657-4-raymondmaoca@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20260612201901.73657-1-raymondmaoca@gmail.com> References: <20260612201901.73657-1-raymondmaoca@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 From: Guodong Xu 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: Guodong Xu Signed-off-by: Raymond Mao --- 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..af61f44a1ac 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 = &sd; + mmc1 = &emmc; + }; + 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 { + sd: 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", "fast"; + 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 { /* fast */ + 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>; +}; + +&sd { + vqmmc-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..b5ba302943c 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 = &sd; + mmc1 = &emmc; }; 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 { + sd: 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", "fast"; + 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 { /* fast */ + 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>; +}; + +&sd { + vqmmc-supply = <&buck4_3v3>; +}; + &binman { u-boot-spl-ddr { type = "section"; -- 2.25.1