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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 DF8D21077617 for ; Wed, 18 Mar 2026 20:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3jjJiJZnOmSjY7FikpvfU5oWtpTfI9zpIFj41hVC5Bc=; b=isBPeFgZM98eJK UzjjelRwfOMA9ecvnfgUK3heXmPdRMj/E+72KxyRgG6iqvKvqdyZZUopQPm+5dywLVWHDTha0dmV/ FKHimFgQVUVWbXbZAEy5xrIfRHcliLRgY0fZBXYePYFvOpQlI3XRbRDTqosQb1kBMUnELAsaPBXir neViBFu6P3XS/LWATaKBESt+JBQGM57tHTfu2pRzfC8PwtaR0tS5pKfl5omvSWkoFi50nLC3cJZ8X m0W7dS/EqK/5bfwt2IQoeAnpvzFas0DvtgDK3J+HPNfN3teZeU0SYmwnw6Ew8uvrqpftiFEQWn2Mq eLBatFQXXO9yx1qDKlnQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2xRm-00000009INa-0BKO; Wed, 18 Mar 2026 20:24:54 +0000 Received: from hall.aurel32.net ([2001:bc8:30d7:100::1]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2xRk-00000009INF-0mba for linux-riscv@lists.infradead.org; Wed, 18 Mar 2026 20:24:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=aurel32.net ; s=202004.hall; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Content-Transfer-Encoding:From:Reply-To: Subject:Content-ID:Content-Description:X-Debbugs-Cc; bh=DxuFz52fFq6pkfpxsifbWk1sah6P9t7hQOOOvkqb+BE=; b=C2or/c1nfGppJw2wonUiXwDl8M U0MXuq4A+MilzgT1hA08TOf46BxtiuYqfLiIPH+8hF5Mx3Mq82OoHLIQgCnBnXE+DbG2PUpwwtzXx Wgd73hUpBxRHZozfD1B2qsd//sDDigr4PnrgJa007CJpa8qPQcky64PQsKRkVM44LwPWRffjOI1GY eWiNlGcUR6nFuB+qosOuEe71UK+34L3JJj9CheBs15AupuxmUYUL5ZI8bLq+VNMmouZM0YyNT6NDw S6f2qE3u5r0qETOPWE7BaaPzh95TWUJ9gHgmw8iRqs/uDGeCaUZoHxbczSRLA095hJqUolwez8gWe szD3vDRA==; Received: from authenticated user by hall.aurel32.net with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w2xRd-00000005fXL-1dM1; Wed, 18 Mar 2026 21:24:45 +0100 Date: Wed, 18 Mar 2026 21:24:44 +0100 From: Aurelien Jarno To: Iker Pedrosa Cc: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Michael Opdenacker , Javier Martinez Canillas , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org, Anand Moon Subject: Re: [PATCH v3 7/7] riscv: dts: spacemit: k1-bananapi-f3: add SD card support with UHS modes Message-ID: Mail-Followup-To: Iker Pedrosa , Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Adrian Hunter , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yixun Lan , Michael Opdenacker , Javier Martinez Canillas , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-kernel@vger.kernel.org, Anand Moon References: <20260316-orangepi-sd-card-uhs-v3-0-aefd3b7832df@gmail.com> <20260316-orangepi-sd-card-uhs-v3-7-aefd3b7832df@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20260316-orangepi-sd-card-uhs-v3-7-aefd3b7832df@gmail.com> User-Agent: Mutt/2.2.13 (2024-03-09) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260318_132452_250316_852D209F X-CRM114-Status: GOOD ( 18.45 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Hi, On 2026-03-16 15:03, Iker Pedrosa 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 > Signed-off-by: Iker Pedrosa > --- > arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts | 23 +++++++++++++++++++++-- > 1 file changed, 21 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 404b69c47b91f8c37d74a3031dbad0d94a28d1b4..a7d480d01ccc0439dbf456ed5a81f467af68056a 100644 > --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts > +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts > @@ -222,7 +222,7 @@ buck3_1v8: buck3 { > regulator-always-on; > }; > > - buck4 { > + buck4: buck4 { > regulator-min-microvolt = <500000>; > regulator-max-microvolt = <3300000>; > regulator-ramp-delay = <5000>; > @@ -243,7 +243,7 @@ buck6 { > regulator-always-on; > }; > > - aldo1 { > + aldo1: aldo1 { > regulator-min-microvolt = <500000>; > regulator-max-microvolt = <3400000>; > regulator-boot-on; > @@ -369,3 +369,22 @@ hub_3_0: hub@2 { > reset-gpios = <&gpio K1_GPIO(124) GPIO_ACTIVE_LOW>; > }; > }; > + > +&sdhci0 { > + pinctrl-names = "default", "state_uhs"; > + pinctrl-0 = <&mmc1_cfg>; > + pinctrl-1 = <&mmc1_uhs_cfg>; > + bus-width = <4>; > + cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; > + cd-inverted; Thanks for this driver. Unfortunately, this is not correct for the Banana PI F3. The OrangePi RV2 buffers the signal from the SD card connector through a transistor, inverting the signal. On the Banana PI F3, the signal goes directly to the GPIO, and does not even have a pull-up. With the following change, I have been able to get the patchset working as expected: diff --git a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts index a7d480d01ccc0..72b0f75f936aa 100644 --- a/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts +++ b/arch/riscv/boot/dts/spacemit/k1-bananapi-f3.dts @@ -375,8 +375,7 @@ &sdhci0 { pinctrl-0 = <&mmc1_cfg>; pinctrl-1 = <&mmc1_uhs_cfg>; bus-width = <4>; - cd-gpios = <&gpio K1_GPIO(80) GPIO_ACTIVE_HIGH>; - cd-inverted; + cd-gpios = <&gpio K1_GPIO(80) (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; no-mmc; no-sdio; disable-wp; Regards Aurelien -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://aurel32.net _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv