Message ID | 20221227122227.460921-4-william.qiu@starfivetech.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1367196wrt; Tue, 27 Dec 2022 04:32:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXufJLVZmkwQ4IRu/qyvsAvYRStuDJck7jO/SSU57cIVa0JJ/xRGYlRG+3jQvmbPAMzsGyna X-Received: by 2002:a17:906:ae94:b0:7c0:dcc5:756c with SMTP id md20-20020a170906ae9400b007c0dcc5756cmr17730711ejb.71.1672144342725; Tue, 27 Dec 2022 04:32:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672144342; cv=none; d=google.com; s=arc-20160816; b=tXc7H4MorKd+NIzcvMXI8CkgQ5iIEX1zuNguKKRxhbGTuuB0ll869oocoidAXljf9c NrYn5Kp+5hZU5Mf5UnpbnfE6GEhjU8UD1DtXnISwn8JP9v7d8XmVxO4WJaQqlpPe80/7 4kEAZHsqXdkfZPEU161bB6WAxGxtVbj0r1unmVpCxwLxI2bvmMkEOzjhdJqJFUejHyqD dk/4V75/vRbHYLAeU0by4i7Amk9IKiKV9aMDCZvQTTe94eVihIY9AEcTrUJqsQ3DdLdb dv1oT3xCDW6YDH8N+Uf0+AyixCG1xlWimMswhntMfE5nR7P6sLx3uiqf1OAXuOtJNFy9 tOMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kOds+8Xx9Q1qAChTnXHFHGSRZoeIGtv9K/JQvlpZY7o=; b=AArVdj5HP9/fYMQbKp0M6IXHgOYfjw7gh5knzJ2VSe1prha+CMcKaKkUIxYqZC1PT8 1uPlbK8RGMannmvNPbH8qIfmJtBnLr/cRYRSPbBQdvKkw1EynZBk/LkQngtDt+A7xDzH Ba8zNPdtWuUYM2Hr7c1G0NHWC/4TI9qJOf8zSCjfQAGOAsvJuwZc9uELkB6XgEeSc5vj WqjTG/so7ZEi4Egb4ePdN1KH2Tp2tjh4k0FsuTJszg4ZcHFvfGB7rCNKy8L5fzk3bkPj YCpfvBtvmq8CpBq0aRZuTedfVxT2nFdt2J4qbzSAcac3S0aYUtLsZ/LvgOmoNRDxM2CD XR9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a056402359100b00461dc830100si11829590edc.452.2022.12.27.04.31.57; Tue, 27 Dec 2022 04:32:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232420AbiL0MZY convert rfc822-to-8bit (ORCPT <rfc822;eddaouddi.ayoub@gmail.com> + 99 others); Tue, 27 Dec 2022 07:25:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232380AbiL0MYV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 27 Dec 2022 07:24:21 -0500 Received: from fd01.gateway.ufhost.com (fd01.gateway.ufhost.com [61.152.239.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DE83112D; Tue, 27 Dec 2022 04:22:33 -0800 (PST) Received: from EXMBX165.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX165", Issuer "EXMBX165" (not verified)) by fd01.gateway.ufhost.com (Postfix) with ESMTP id 5AB9724E00A; Tue, 27 Dec 2022 20:22:31 +0800 (CST) Received: from EXMBX168.cuchost.com (172.16.6.78) by EXMBX165.cuchost.com (172.16.6.75) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 27 Dec 2022 20:22:31 +0800 Received: from williamqiu-virtual-machine.starfivetech.com (171.223.208.138) by EXMBX168.cuchost.com (172.16.6.78) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Tue, 27 Dec 2022 20:22:30 +0800 From: William Qiu <william.qiu@starfivetech.com> To: <linux-riscv@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-mmc@vger.kernel.org> CC: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Jaehoon Chung <jh80.chung@samsung.com>, Ulf Hansson <ulf.hansson@linaro.org>, William Qiu <william.qiu@starfivetech.com>, <linux-kernel@vger.kernel.org> Subject: [PATCH v2 3/3] riscv: dts: starfive: Add mmc node Date: Tue, 27 Dec 2022 20:22:27 +0800 Message-ID: <20221227122227.460921-4-william.qiu@starfivetech.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221227122227.460921-1-william.qiu@starfivetech.com> References: <20221227122227.460921-1-william.qiu@starfivetech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [171.223.208.138] X-ClientProxiedBy: EXCAS066.cuchost.com (172.16.6.26) To EXMBX168.cuchost.com (172.16.6.78) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1753370426463360647?= X-GMAIL-MSGID: =?utf-8?q?1753370426463360647?= |
Series |
StarFive's SDIO/eMMC driver support
|
|
Commit Message
William Qiu
Dec. 27, 2022, 12:22 p.m. UTC
This adds the mmc node for the StarFive JH7110 SoC.
Set sdioo node to emmc and set sdio1 node to sd.
Signed-off-by: William Qiu <william.qiu@starfivetech.com>
---
.../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++
arch/riscv/boot/dts/starfive/jh7110.dtsi | 38 +++++++++++++++++++
2 files changed, 63 insertions(+)
Comments
On Tue, 27 Dec 2022 at 13:22, William Qiu <william.qiu@starfivetech.com> wrote: > > This adds the mmc node for the StarFive JH7110 SoC. > Set sdioo node to emmc and set sdio1 node to sd. > > Signed-off-by: William Qiu <william.qiu@starfivetech.com> > --- > .../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++ > arch/riscv/boot/dts/starfive/jh7110.dtsi | 38 +++++++++++++++++++ > 2 files changed, 63 insertions(+) > > diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts > index c8946cf3a268..d8244fd1f5a0 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts > +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts > @@ -47,6 +47,31 @@ &clk_rtc { > clock-frequency = <32768>; > }; > > +&mmc0 { > + max-frequency = <100000000>; > + card-detect-delay = <300>; Nitpick: This seems redundant for a non-removable card!? > + bus-width = <8>; > + cap-mmc-highspeed; > + mmc-ddr-1_8v; > + mmc-hs200-1_8v; > + non-removable; > + cap-mmc-hw-reset; > + post-power-on-delay-ms = <200>; > + status = "okay"; > +}; > + > +&mmc1 { > + max-frequency = <100000000>; > + card-detect-delay = <300>; Nitpick: This looks redundant for polling based card detection (broken-cd is set a few lines below). > + bus-width = <4>; > + no-sdio; > + no-mmc; > + broken-cd; > + cap-sd-highspeed; > + post-power-on-delay-ms = <200>; > + status = "okay"; > +}; > + > &gmac0_rmii_refin { > clock-frequency = <50000000>; > }; > diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi > index c22e8f1d2640..08a780d2c0f4 100644 > --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi > +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi > @@ -331,6 +331,11 @@ aoncrg: clock-controller@17000000 { > #reset-cells = <1>; > }; > > + syscon: syscon@13030000 { > + compatible = "starfive,syscon", "syscon"; > + reg = <0x0 0x13030000 0x0 0x1000>; > + }; > + > gpio: gpio@13040000 { > compatible = "starfive,jh7110-sys-pinctrl"; > reg = <0x0 0x13040000 0x0 0x10000>; > @@ -433,5 +438,38 @@ uart5: serial@12020000 { > reg-shift = <2>; > status = "disabled"; > }; > + > + /* unremovable emmc as mmcblk0 */ Don't confuse the mmc0 node name with mmcblk0. There is no guarantee that this is true, unless you also specify an alias. > + mmc0: mmc@16010000 { > + compatible = "starfive,jh7110-mmc"; > + reg = <0x0 0x16010000 0x0 0x10000>; > + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, > + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; > + clock-names = "biu","ciu"; > + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; > + reset-names = "reset"; > + interrupts = <74>; > + fifo-depth = <32>; > + fifo-watermark-aligned; > + data-addr = <0>; > + starfive,syscon = <&syscon 0x14 0x1a 0x7c000000>; > + status = "disabled"; > + }; > + > + mmc1: mmc@16020000 { > + compatible = "starfive,jh7110-mmc"; > + reg = <0x0 0x16020000 0x0 0x10000>; > + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, > + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>; > + clock-names = "biu","ciu"; > + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; > + reset-names = "reset"; > + interrupts = <75>; > + fifo-depth = <32>; > + fifo-watermark-aligned; > + data-addr = <0>; > + starfive,syscon = <&syscon 0x9c 0x1 0x3e>; > + status = "disabled"; > + }; > }; > }; Kind regards Uffe
On 2023/1/2 22:03, Ulf Hansson wrote: > On Tue, 27 Dec 2022 at 13:22, William Qiu <william.qiu@starfivetech.com> wrote: >> >> This adds the mmc node for the StarFive JH7110 SoC. >> Set sdioo node to emmc and set sdio1 node to sd. >> >> Signed-off-by: William Qiu <william.qiu@starfivetech.com> >> --- >> .../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++ >> arch/riscv/boot/dts/starfive/jh7110.dtsi | 38 +++++++++++++++++++ >> 2 files changed, 63 insertions(+) >> >> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts >> index c8946cf3a268..d8244fd1f5a0 100644 >> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts >> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts >> @@ -47,6 +47,31 @@ &clk_rtc { >> clock-frequency = <32768>; >> }; >> >> +&mmc0 { >> + max-frequency = <100000000>; >> + card-detect-delay = <300>; > > Nitpick: This seems redundant for a non-removable card!? > Will drop >> + bus-width = <8>; >> + cap-mmc-highspeed; >> + mmc-ddr-1_8v; >> + mmc-hs200-1_8v; >> + non-removable; >> + cap-mmc-hw-reset; >> + post-power-on-delay-ms = <200>; >> + status = "okay"; >> +}; >> + >> +&mmc1 { >> + max-frequency = <100000000>; >> + card-detect-delay = <300>; > > Nitpick: This looks redundant for polling based card detection > (broken-cd is set a few lines below). > Will drop >> + bus-width = <4>; >> + no-sdio; >> + no-mmc; >> + broken-cd; >> + cap-sd-highspeed; >> + post-power-on-delay-ms = <200>; >> + status = "okay"; >> +}; >> + >> &gmac0_rmii_refin { >> clock-frequency = <50000000>; >> }; >> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi >> index c22e8f1d2640..08a780d2c0f4 100644 >> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi >> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi >> @@ -331,6 +331,11 @@ aoncrg: clock-controller@17000000 { >> #reset-cells = <1>; >> }; >> >> + syscon: syscon@13030000 { >> + compatible = "starfive,syscon", "syscon"; >> + reg = <0x0 0x13030000 0x0 0x1000>; >> + }; >> + >> gpio: gpio@13040000 { >> compatible = "starfive,jh7110-sys-pinctrl"; >> reg = <0x0 0x13040000 0x0 0x10000>; >> @@ -433,5 +438,38 @@ uart5: serial@12020000 { >> reg-shift = <2>; >> status = "disabled"; >> }; >> + >> + /* unremovable emmc as mmcblk0 */ > > Don't confuse the mmc0 node name with mmcblk0. There is no guarantee > that this is true, unless you also specify an alias. > Hi Ulf, Thank you for taking time to review and provide helpful comments for this patch. Actually we define mmc0 as eMMC, which is mmcblk0 in the kernel, and define mmc1 as SDIO, which is mmcblk1 in the kernel, so it's not confuse. Best Regards William Qiu >> + mmc0: mmc@16010000 { >> + compatible = "starfive,jh7110-mmc"; >> + reg = <0x0 0x16010000 0x0 0x10000>; >> + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, >> + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; >> + clock-names = "biu","ciu"; >> + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; >> + reset-names = "reset"; >> + interrupts = <74>; >> + fifo-depth = <32>; >> + fifo-watermark-aligned; >> + data-addr = <0>; >> + starfive,syscon = <&syscon 0x14 0x1a 0x7c000000>; >> + status = "disabled"; >> + }; >> + >> + mmc1: mmc@16020000 { >> + compatible = "starfive,jh7110-mmc"; >> + reg = <0x0 0x16020000 0x0 0x10000>; >> + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, >> + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>; >> + clock-names = "biu","ciu"; >> + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; >> + reset-names = "reset"; >> + interrupts = <75>; >> + fifo-depth = <32>; >> + fifo-watermark-aligned; >> + data-addr = <0>; >> + starfive,syscon = <&syscon 0x9c 0x1 0x3e>; >> + status = "disabled"; >> + }; >> }; >> }; > > Kind regards > Uffe
On Wed, 4 Jan 2023 at 07:08, William Qiu <william.qiu@starfivetech.com> wrote: > > > > On 2023/1/2 22:03, Ulf Hansson wrote: > > On Tue, 27 Dec 2022 at 13:22, William Qiu <william.qiu@starfivetech.com> wrote: > >> > >> This adds the mmc node for the StarFive JH7110 SoC. > >> Set sdioo node to emmc and set sdio1 node to sd. > >> > >> Signed-off-by: William Qiu <william.qiu@starfivetech.com> > >> --- > >> .../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++ > >> arch/riscv/boot/dts/starfive/jh7110.dtsi | 38 +++++++++++++++++++ > >> 2 files changed, 63 insertions(+) > >> > >> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts > >> index c8946cf3a268..d8244fd1f5a0 100644 > >> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts > >> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts > >> @@ -47,6 +47,31 @@ &clk_rtc { > >> clock-frequency = <32768>; > >> }; > >> > >> +&mmc0 { > >> + max-frequency = <100000000>; > >> + card-detect-delay = <300>; > > > > Nitpick: This seems redundant for a non-removable card!? > > > > Will drop > > >> + bus-width = <8>; > >> + cap-mmc-highspeed; > >> + mmc-ddr-1_8v; > >> + mmc-hs200-1_8v; > >> + non-removable; > >> + cap-mmc-hw-reset; > >> + post-power-on-delay-ms = <200>; > >> + status = "okay"; > >> +}; > >> + > >> +&mmc1 { > >> + max-frequency = <100000000>; > >> + card-detect-delay = <300>; > > > > Nitpick: This looks redundant for polling based card detection > > (broken-cd is set a few lines below). > > > > Will drop > > >> + bus-width = <4>; > >> + no-sdio; > >> + no-mmc; > >> + broken-cd; > >> + cap-sd-highspeed; > >> + post-power-on-delay-ms = <200>; > >> + status = "okay"; > >> +}; > >> + > >> &gmac0_rmii_refin { > >> clock-frequency = <50000000>; > >> }; > >> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi > >> index c22e8f1d2640..08a780d2c0f4 100644 > >> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi > >> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi > >> @@ -331,6 +331,11 @@ aoncrg: clock-controller@17000000 { > >> #reset-cells = <1>; > >> }; > >> > >> + syscon: syscon@13030000 { > >> + compatible = "starfive,syscon", "syscon"; > >> + reg = <0x0 0x13030000 0x0 0x1000>; > >> + }; > >> + > >> gpio: gpio@13040000 { > >> compatible = "starfive,jh7110-sys-pinctrl"; > >> reg = <0x0 0x13040000 0x0 0x10000>; > >> @@ -433,5 +438,38 @@ uart5: serial@12020000 { > >> reg-shift = <2>; > >> status = "disabled"; > >> }; > >> + > >> + /* unremovable emmc as mmcblk0 */ > > > > Don't confuse the mmc0 node name with mmcblk0. There is no guarantee > > that this is true, unless you also specify an alias. > > > > Hi Ulf, > > Thank you for taking time to review and provide helpful comments for this patch. > Actually we define mmc0 as eMMC, which is mmcblk0 in the kernel, and define mmc1 as SDIO, > which is mmcblk1 in the kernel, so it's not confuse. > My point is, mmc0 from DT node perspective doesn't necessarily need to map to mmc0, as that depends on the "probe" order of the devices. At least for the Linux kernel, mmc0 from DT point of view, could end up being mmc1. To avoid confusion, please drop the "mmcblk*" here. It's anyway a Linux specific thing. Don't get me wrong, feel free to keep the information about eMMC and SDIO for the corresponding mmc controller node. Moreover, if you can't use PARTID/UUID to find the rootfs device - then you may use an aliases node, to let mmc0 to be enumerated as mmc0, for example. See below. aliases { mmc0 = &mmc0; } Kind regards Uffe
On 2023/1/5 0:05, Ulf Hansson wrote: > On Wed, 4 Jan 2023 at 07:08, William Qiu <william.qiu@starfivetech.com> wrote: >> >> >> >> On 2023/1/2 22:03, Ulf Hansson wrote: >> > On Tue, 27 Dec 2022 at 13:22, William Qiu <william.qiu@starfivetech.com> wrote: >> >> >> >> This adds the mmc node for the StarFive JH7110 SoC. >> >> Set sdioo node to emmc and set sdio1 node to sd. >> >> >> >> Signed-off-by: William Qiu <william.qiu@starfivetech.com> >> >> --- >> >> .../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++ >> >> arch/riscv/boot/dts/starfive/jh7110.dtsi | 38 +++++++++++++++++++ >> >> 2 files changed, 63 insertions(+) >> >> >> >> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts >> >> index c8946cf3a268..d8244fd1f5a0 100644 >> >> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts >> >> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts >> >> @@ -47,6 +47,31 @@ &clk_rtc { >> >> clock-frequency = <32768>; >> >> }; >> >> >> >> +&mmc0 { >> >> + max-frequency = <100000000>; >> >> + card-detect-delay = <300>; >> > >> > Nitpick: This seems redundant for a non-removable card!? >> > >> >> Will drop >> >> >> + bus-width = <8>; >> >> + cap-mmc-highspeed; >> >> + mmc-ddr-1_8v; >> >> + mmc-hs200-1_8v; >> >> + non-removable; >> >> + cap-mmc-hw-reset; >> >> + post-power-on-delay-ms = <200>; >> >> + status = "okay"; >> >> +}; >> >> + >> >> +&mmc1 { >> >> + max-frequency = <100000000>; >> >> + card-detect-delay = <300>; >> > >> > Nitpick: This looks redundant for polling based card detection >> > (broken-cd is set a few lines below). >> > >> >> Will drop >> >> >> + bus-width = <4>; >> >> + no-sdio; >> >> + no-mmc; >> >> + broken-cd; >> >> + cap-sd-highspeed; >> >> + post-power-on-delay-ms = <200>; >> >> + status = "okay"; >> >> +}; >> >> + >> >> &gmac0_rmii_refin { >> >> clock-frequency = <50000000>; >> >> }; >> >> diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi >> >> index c22e8f1d2640..08a780d2c0f4 100644 >> >> --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi >> >> +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi >> >> @@ -331,6 +331,11 @@ aoncrg: clock-controller@17000000 { >> >> #reset-cells = <1>; >> >> }; >> >> >> >> + syscon: syscon@13030000 { >> >> + compatible = "starfive,syscon", "syscon"; >> >> + reg = <0x0 0x13030000 0x0 0x1000>; >> >> + }; >> >> + >> >> gpio: gpio@13040000 { >> >> compatible = "starfive,jh7110-sys-pinctrl"; >> >> reg = <0x0 0x13040000 0x0 0x10000>; >> >> @@ -433,5 +438,38 @@ uart5: serial@12020000 { >> >> reg-shift = <2>; >> >> status = "disabled"; >> >> }; >> >> + >> >> + /* unremovable emmc as mmcblk0 */ >> > >> > Don't confuse the mmc0 node name with mmcblk0. There is no guarantee >> > that this is true, unless you also specify an alias. >> > >> >> Hi Ulf, >> >> Thank you for taking time to review and provide helpful comments for this patch. >> Actually we define mmc0 as eMMC, which is mmcblk0 in the kernel, and define mmc1 as SDIO, >> which is mmcblk1 in the kernel, so it's not confuse. >> > > My point is, mmc0 from DT node perspective doesn't necessarily need to > map to mmc0, as that depends on the "probe" order of the devices. At > least for the Linux kernel, mmc0 from DT point of view, could end up > being mmc1. > > To avoid confusion, please drop the "mmcblk*" here. It's anyway a > Linux specific thing. Don't get me wrong, feel free to keep the > information about eMMC and SDIO for the corresponding mmc controller > node. > > Moreover, if you can't use PARTID/UUID to find the rootfs device - > then you may use an aliases node, to let mmc0 to be enumerated as > mmc0, for example. See below. > > aliases { > mmc0 = &mmc0; > } > > Kind regards > Uffe Hi Uffe, Thank you for taking time to review. I'll take your suggestion into consideration and drop the "mmcblk*". Best Regards William Qiu
Hey William, On Tue, Dec 27, 2022 at 08:22:27PM +0800, William Qiu wrote: > This adds the mmc node for the StarFive JH7110 SoC. > Set sdioo node to emmc and set sdio1 node to sd. > > Signed-off-by: William Qiu <william.qiu@starfivetech.com> > --- > .../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++ FYI, this file does not exist in the v3 Devicetree patchset sent by Hal Feng: https://lore.kernel.org/linux-riscv/20221220011247.35560-1-hal.feng@starfivetech.com Would you make sure that future revisions take into account that there is now a jh7110-starfive-visionfive-2.dtsi file instead? Thanks, Conor.
On 2023/1/20 2:43, Conor Dooley wrote: > Hey William, > > On Tue, Dec 27, 2022 at 08:22:27PM +0800, William Qiu wrote: >> This adds the mmc node for the StarFive JH7110 SoC. >> Set sdioo node to emmc and set sdio1 node to sd. >> >> Signed-off-by: William Qiu <william.qiu@starfivetech.com> >> --- >> .../jh7110-starfive-visionfive-v2.dts | 25 ++++++++++++ > > FYI, this file does not exist in the v3 Devicetree patchset sent by Hal > Feng: > https://lore.kernel.org/linux-riscv/20221220011247.35560-1-hal.feng@starfivetech.com > > Would you make sure that future revisions take into account that there > is now a jh7110-starfive-visionfive-2.dtsi file instead? > > Thanks, > Conor. > Hi Conor, I did it based on v2 and will rebase to v3 in the next version. Best Regards William Qiu
diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts index c8946cf3a268..d8244fd1f5a0 100644 --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-v2.dts @@ -47,6 +47,31 @@ &clk_rtc { clock-frequency = <32768>; }; +&mmc0 { + max-frequency = <100000000>; + card-detect-delay = <300>; + bus-width = <8>; + cap-mmc-highspeed; + mmc-ddr-1_8v; + mmc-hs200-1_8v; + non-removable; + cap-mmc-hw-reset; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + +&mmc1 { + max-frequency = <100000000>; + card-detect-delay = <300>; + bus-width = <4>; + no-sdio; + no-mmc; + broken-cd; + cap-sd-highspeed; + post-power-on-delay-ms = <200>; + status = "okay"; +}; + &gmac0_rmii_refin { clock-frequency = <50000000>; }; diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi index c22e8f1d2640..08a780d2c0f4 100644 --- a/arch/riscv/boot/dts/starfive/jh7110.dtsi +++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi @@ -331,6 +331,11 @@ aoncrg: clock-controller@17000000 { #reset-cells = <1>; }; + syscon: syscon@13030000 { + compatible = "starfive,syscon", "syscon"; + reg = <0x0 0x13030000 0x0 0x1000>; + }; + gpio: gpio@13040000 { compatible = "starfive,jh7110-sys-pinctrl"; reg = <0x0 0x13040000 0x0 0x10000>; @@ -433,5 +438,38 @@ uart5: serial@12020000 { reg-shift = <2>; status = "disabled"; }; + + /* unremovable emmc as mmcblk0 */ + mmc0: mmc@16010000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16010000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>, + <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>; + reset-names = "reset"; + interrupts = <74>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,syscon = <&syscon 0x14 0x1a 0x7c000000>; + status = "disabled"; + }; + + mmc1: mmc@16020000 { + compatible = "starfive,jh7110-mmc"; + reg = <0x0 0x16020000 0x0 0x10000>; + clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>, + <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>; + clock-names = "biu","ciu"; + resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>; + reset-names = "reset"; + interrupts = <75>; + fifo-depth = <32>; + fifo-watermark-aligned; + data-addr = <0>; + starfive,syscon = <&syscon 0x9c 0x1 0x3e>; + status = "disabled"; + }; }; };