* [PATCH v7 1/4] riscv: defconfig: Enable mmc and dma drivers for T-Head TH1520
2023-11-30 1:48 [PATCH v7 0/4] RISC-V: Add MMC support for TH1520 boards Drew Fustini
@ 2023-11-30 1:48 ` Drew Fustini
2023-12-30 2:42 ` Palmer Dabbelt
2023-11-30 1:48 ` [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock Drew Fustini
` (2 subsequent siblings)
3 siblings, 1 reply; 11+ messages in thread
From: Drew Fustini @ 2023-11-30 1:48 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Jisheng Zhang, Guo Ren,
Fu Wei, Conor Dooley, Rob Herring, Krzysztof Kozlowski
Cc: Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree, Drew Fustini
Enable the mmc controller driver and dma controller driver needed for
T-Head TH1520 based boards, like the LicheePi 4A and BeagleV-Ahead, to
boot from eMMC storage.
Reviewed-by: Guo Ren <guoren@kernel.org>
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
arch/riscv/configs/defconfig | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
index 905881282a7c..e635dc9d1997 100644
--- a/arch/riscv/configs/defconfig
+++ b/arch/riscv/configs/defconfig
@@ -214,6 +214,7 @@ CONFIG_MMC=y
CONFIG_MMC_SDHCI=y
CONFIG_MMC_SDHCI_PLTFM=y
CONFIG_MMC_SDHCI_CADENCE=y
+CONFIG_MMC_SDHCI_OF_DWCMSHC=y
CONFIG_MMC_SPI=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_STARFIVE=y
@@ -223,6 +224,7 @@ CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_SUN6I=y
CONFIG_DMADEVICES=y
CONFIG_DMA_SUN6I=m
+CONFIG_DW_AXI_DMAC=y
CONFIG_RZ_DMAC=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v7 1/4] riscv: defconfig: Enable mmc and dma drivers for T-Head TH1520
2023-11-30 1:48 ` [PATCH v7 1/4] riscv: defconfig: Enable mmc and dma drivers for T-Head TH1520 Drew Fustini
@ 2023-12-30 2:42 ` Palmer Dabbelt
2023-12-30 11:26 ` Conor Dooley
0 siblings, 1 reply; 11+ messages in thread
From: Palmer Dabbelt @ 2023-12-30 2:42 UTC (permalink / raw)
To: dfustini
Cc: Paul Walmsley, aou, jszhang, guoren, wefu, Conor Dooley, robh+dt,
krzysztof.kozlowski+dt, jkridner, robertcnelson, linux-riscv,
linux-kernel, devicetree, dfustini
On Wed, 29 Nov 2023 17:48:47 PST (-0800), dfustini@baylibre.com wrote:
> Enable the mmc controller driver and dma controller driver needed for
> T-Head TH1520 based boards, like the LicheePi 4A and BeagleV-Ahead, to
> boot from eMMC storage.
>
> Reviewed-by: Guo Ren <guoren@kernel.org>
> Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> ---
> arch/riscv/configs/defconfig | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> index 905881282a7c..e635dc9d1997 100644
> --- a/arch/riscv/configs/defconfig
> +++ b/arch/riscv/configs/defconfig
> @@ -214,6 +214,7 @@ CONFIG_MMC=y
> CONFIG_MMC_SDHCI=y
> CONFIG_MMC_SDHCI_PLTFM=y
> CONFIG_MMC_SDHCI_CADENCE=y
> +CONFIG_MMC_SDHCI_OF_DWCMSHC=y
> CONFIG_MMC_SPI=y
> CONFIG_MMC_DW=y
> CONFIG_MMC_DW_STARFIVE=y
> @@ -223,6 +224,7 @@ CONFIG_RTC_CLASS=y
> CONFIG_RTC_DRV_SUN6I=y
> CONFIG_DMADEVICES=y
> CONFIG_DMA_SUN6I=m
> +CONFIG_DW_AXI_DMAC=y
> CONFIG_RZ_DMAC=y
> CONFIG_VIRTIO_PCI=y
> CONFIG_VIRTIO_BALLOON=y
Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
in case folks want to keep this with the DTS updates. Thanks!
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v7 1/4] riscv: defconfig: Enable mmc and dma drivers for T-Head TH1520
2023-12-30 2:42 ` Palmer Dabbelt
@ 2023-12-30 11:26 ` Conor Dooley
0 siblings, 0 replies; 11+ messages in thread
From: Conor Dooley @ 2023-12-30 11:26 UTC (permalink / raw)
To: Palmer Dabbelt
Cc: dfustini, Paul Walmsley, aou, jszhang, guoren, wefu, robh+dt,
krzysztof.kozlowski+dt, jkridner, robertcnelson, linux-riscv,
linux-kernel, devicetree
[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]
On Fri, Dec 29, 2023 at 06:42:01PM -0800, Palmer Dabbelt wrote:
> On Wed, 29 Nov 2023 17:48:47 PST (-0800), dfustini@baylibre.com wrote:
> > Enable the mmc controller driver and dma controller driver needed for
> > T-Head TH1520 based boards, like the LicheePi 4A and BeagleV-Ahead, to
> > boot from eMMC storage.
> >
> > Reviewed-by: Guo Ren <guoren@kernel.org>
> > Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> > ---
> > arch/riscv/configs/defconfig | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/arch/riscv/configs/defconfig b/arch/riscv/configs/defconfig
> > index 905881282a7c..e635dc9d1997 100644
> > --- a/arch/riscv/configs/defconfig
> > +++ b/arch/riscv/configs/defconfig
> > @@ -214,6 +214,7 @@ CONFIG_MMC=y
> > CONFIG_MMC_SDHCI=y
> > CONFIG_MMC_SDHCI_PLTFM=y
> > CONFIG_MMC_SDHCI_CADENCE=y
> > +CONFIG_MMC_SDHCI_OF_DWCMSHC=y
> > CONFIG_MMC_SPI=y
> > CONFIG_MMC_DW=y
> > CONFIG_MMC_DW_STARFIVE=y
> > @@ -223,6 +224,7 @@ CONFIG_RTC_CLASS=y
> > CONFIG_RTC_DRV_SUN6I=y
> > CONFIG_DMADEVICES=y
> > CONFIG_DMA_SUN6I=m
> > +CONFIG_DW_AXI_DMAC=y
> > CONFIG_RZ_DMAC=y
> > CONFIG_VIRTIO_PCI=y
> > CONFIG_VIRTIO_BALLOON=y
>
> Acked-by: Palmer Dabbelt <palmer@rivosinc.com>
>
> in case folks want to keep this with the DTS updates. Thanks!
Just echoing what I said on irc, I already send the subsequent version
of the series to Arnd, minus the defconfig patch, so if you could take
this yourself Palmer, that'd be great.
Cheers,
Conor.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock
2023-11-30 1:48 [PATCH v7 0/4] RISC-V: Add MMC support for TH1520 boards Drew Fustini
2023-11-30 1:48 ` [PATCH v7 1/4] riscv: defconfig: Enable mmc and dma drivers for T-Head TH1520 Drew Fustini
@ 2023-11-30 1:48 ` Drew Fustini
2023-12-04 9:47 ` Emil Renner Berthing
2023-11-30 1:48 ` [PATCH v7 3/4] riscv: dts: thead: Enable BeagleV Ahead eMMC and microSD Drew Fustini
2023-11-30 1:48 ` [PATCH v7 4/4] riscv: dts: thead: Enable LicheePi 4A " Drew Fustini
3 siblings, 1 reply; 11+ messages in thread
From: Drew Fustini @ 2023-11-30 1:48 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Jisheng Zhang, Guo Ren,
Fu Wei, Conor Dooley, Rob Herring, Krzysztof Kozlowski
Cc: Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree, Drew Fustini
Add node for the SDHCI fixed clock. Add mmc0 node for the first mmc
controller instance which is typically connected to the eMMC device.
Add mmc1 node for the second mmc controller instance which is typically
connected to microSD slot.
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
arch/riscv/boot/dts/thead/th1520.dtsi | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
index ba4d2c673ac8..af4fdcd82e0b 100644
--- a/arch/riscv/boot/dts/thead/th1520.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520.dtsi
@@ -146,6 +146,13 @@ uart_sclk: uart-sclk-clock {
#clock-cells = <0>;
};
+ sdhci_clk: sdhci-clock {
+ compatible = "fixed-clock";
+ clock-frequency = <198000000>;
+ clock-output-names = "sdhci_clk";
+ #clock-cells = <0>;
+ };
+
soc {
compatible = "simple-bus";
interrupt-parent = <&plic>;
@@ -304,6 +311,24 @@ dmac0: dma-controller@ffefc00000 {
status = "disabled";
};
+ mmc0: mmc@ffe7080000 {
+ compatible = "thead,th1520-dwcmshc";
+ reg = <0xff 0xe7080000 0x0 0x10000>;
+ interrupts = <62 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sdhci_clk>;
+ clock-names = "core";
+ status = "disabled";
+ };
+
+ mmc1: mmc@ffe7090000 {
+ compatible = "thead,th1520-dwcmshc";
+ reg = <0xff 0xe7090000 0x0 0x10000>;
+ interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&sdhci_clk>;
+ clock-names = "core";
+ status = "disabled";
+ };
+
timer0: timer@ffefc32000 {
compatible = "snps,dw-apb-timer";
reg = <0xff 0xefc32000 0x0 0x14>;
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* Re: [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock
2023-11-30 1:48 ` [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock Drew Fustini
@ 2023-12-04 9:47 ` Emil Renner Berthing
2023-12-05 14:26 ` Jisheng Zhang
0 siblings, 1 reply; 11+ messages in thread
From: Emil Renner Berthing @ 2023-12-04 9:47 UTC (permalink / raw)
To: Drew Fustini, Paul Walmsley, Palmer Dabbelt, Albert Ou,
Jisheng Zhang, Guo Ren, Fu Wei, Conor Dooley, Rob Herring,
Krzysztof Kozlowski
Cc: Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree
Drew Fustini wrote:
> Add node for the SDHCI fixed clock. Add mmc0 node for the first mmc
> controller instance which is typically connected to the eMMC device.
> Add mmc1 node for the second mmc controller instance which is typically
> connected to microSD slot.
>
> Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> ---
> arch/riscv/boot/dts/thead/th1520.dtsi | 25 +++++++++++++++++++++++++
> 1 file changed, 25 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
> index ba4d2c673ac8..af4fdcd82e0b 100644
> --- a/arch/riscv/boot/dts/thead/th1520.dtsi
> +++ b/arch/riscv/boot/dts/thead/th1520.dtsi
> @@ -146,6 +146,13 @@ uart_sclk: uart-sclk-clock {
> #clock-cells = <0>;
> };
>
> + sdhci_clk: sdhci-clock {
> + compatible = "fixed-clock";
> + clock-frequency = <198000000>;
> + clock-output-names = "sdhci_clk";
> + #clock-cells = <0>;
> + };
> +
> soc {
> compatible = "simple-bus";
> interrupt-parent = <&plic>;
> @@ -304,6 +311,24 @@ dmac0: dma-controller@ffefc00000 {
> status = "disabled";
> };
>
> + mmc0: mmc@ffe7080000 {
> + compatible = "thead,th1520-dwcmshc";
> + reg = <0xff 0xe7080000 0x0 0x10000>;
> + interrupts = <62 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sdhci_clk>;
> + clock-names = "core";
> + status = "disabled";
> + };
> +
> + mmc1: mmc@ffe7090000 {
> + compatible = "thead,th1520-dwcmshc";
> + reg = <0xff 0xe7090000 0x0 0x10000>;
> + interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&sdhci_clk>;
> + clock-names = "core";
> + status = "disabled";
> + };
> +
Hi Drew,
This doesn't seem to match the documentation shared here:
https://lore.kernel.org/linux-riscv/5f437109d2be2b8843f549a661054a2e3ec0d66e.camel@xry111.site/
From the TH1520 System User Manual.pdf in there, I'd expect something like
emmc: mmc@ffe7080000 {
compatible = "thead,th1520-dwcmshc";
reg = <0xff 0xe7080000 0x0 0x10000>;
...
};
sdio0: mmc@ffe7090000 {
compatible = "thead,th1520-dwcmshc";
reg = <0xff 0xe7090000 0x0 0x10000>;
...
};
sdio1: mmc@ffe70a0000 {
compatible = "thead,th1520-dwcmshc";
reg = <0xff 0xe70a0000 0x0 0x10000>;
...
};
/Emil
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock
2023-12-04 9:47 ` Emil Renner Berthing
@ 2023-12-05 14:26 ` Jisheng Zhang
2023-12-05 14:48 ` Emil Renner Berthing
0 siblings, 1 reply; 11+ messages in thread
From: Jisheng Zhang @ 2023-12-05 14:26 UTC (permalink / raw)
To: Emil Renner Berthing
Cc: Drew Fustini, Paul Walmsley, Palmer Dabbelt, Albert Ou, Guo Ren,
Fu Wei, Conor Dooley, Rob Herring, Krzysztof Kozlowski,
Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree
On Mon, Dec 04, 2023 at 01:47:45AM -0800, Emil Renner Berthing wrote:
> Drew Fustini wrote:
> > Add node for the SDHCI fixed clock. Add mmc0 node for the first mmc
> > controller instance which is typically connected to the eMMC device.
> > Add mmc1 node for the second mmc controller instance which is typically
> > connected to microSD slot.
> >
> > Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> > ---
> > arch/riscv/boot/dts/thead/th1520.dtsi | 25 +++++++++++++++++++++++++
> > 1 file changed, 25 insertions(+)
> >
> > diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
> > index ba4d2c673ac8..af4fdcd82e0b 100644
> > --- a/arch/riscv/boot/dts/thead/th1520.dtsi
> > +++ b/arch/riscv/boot/dts/thead/th1520.dtsi
> > @@ -146,6 +146,13 @@ uart_sclk: uart-sclk-clock {
> > #clock-cells = <0>;
> > };
> >
> > + sdhci_clk: sdhci-clock {
> > + compatible = "fixed-clock";
> > + clock-frequency = <198000000>;
> > + clock-output-names = "sdhci_clk";
> > + #clock-cells = <0>;
> > + };
> > +
> > soc {
> > compatible = "simple-bus";
> > interrupt-parent = <&plic>;
> > @@ -304,6 +311,24 @@ dmac0: dma-controller@ffefc00000 {
> > status = "disabled";
> > };
> >
> > + mmc0: mmc@ffe7080000 {
> > + compatible = "thead,th1520-dwcmshc";
> > + reg = <0xff 0xe7080000 0x0 0x10000>;
> > + interrupts = <62 IRQ_TYPE_LEVEL_HIGH>;
> > + clocks = <&sdhci_clk>;
> > + clock-names = "core";
> > + status = "disabled";
> > + };
> > +
> > + mmc1: mmc@ffe7090000 {
> > + compatible = "thead,th1520-dwcmshc";
> > + reg = <0xff 0xe7090000 0x0 0x10000>;
> > + interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
> > + clocks = <&sdhci_clk>;
> > + clock-names = "core";
> > + status = "disabled";
> > + };
> > +
>
> Hi Drew,
>
> This doesn't seem to match the documentation shared here:
> https://lore.kernel.org/linux-riscv/5f437109d2be2b8843f549a661054a2e3ec0d66e.camel@xry111.site/
> From the TH1520 System User Manual.pdf in there, I'd expect something like
>
> emmc: mmc@ffe7080000 {
> compatible = "thead,th1520-dwcmshc";
> reg = <0xff 0xe7080000 0x0 0x10000>;
> ...
> };
Hi Emil,
I think this isn't necessary. From other soc dts files, I see such
naming, but lots socs just use mmc0, mmc1, and so on.
And IIRC, the host for sd and sdio can support both, IOW, below
sdio0/sdio1 may be used for sdcard.
Thanks
>
> sdio0: mmc@ffe7090000 {
> compatible = "thead,th1520-dwcmshc";
> reg = <0xff 0xe7090000 0x0 0x10000>;
> ...
> };
>
> sdio1: mmc@ffe70a0000 {
> compatible = "thead,th1520-dwcmshc";
> reg = <0xff 0xe70a0000 0x0 0x10000>;
> ...
> };
>
> /Emil
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock
2023-12-05 14:26 ` Jisheng Zhang
@ 2023-12-05 14:48 ` Emil Renner Berthing
2023-12-05 15:52 ` Damian Tometzki
0 siblings, 1 reply; 11+ messages in thread
From: Emil Renner Berthing @ 2023-12-05 14:48 UTC (permalink / raw)
To: Jisheng Zhang, Emil Renner Berthing
Cc: Drew Fustini, Paul Walmsley, Palmer Dabbelt, Albert Ou, Guo Ren,
Fu Wei, Conor Dooley, Rob Herring, Krzysztof Kozlowski,
Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree
Jisheng Zhang wrote:
> On Mon, Dec 04, 2023 at 01:47:45AM -0800, Emil Renner Berthing wrote:
> > Drew Fustini wrote:
> > > Add node for the SDHCI fixed clock. Add mmc0 node for the first mmc
> > > controller instance which is typically connected to the eMMC device.
> > > Add mmc1 node for the second mmc controller instance which is typically
> > > connected to microSD slot.
> > >
> > > Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> > > ---
> > > arch/riscv/boot/dts/thead/th1520.dtsi | 25 +++++++++++++++++++++++++
> > > 1 file changed, 25 insertions(+)
> > >
> > > diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
> > > index ba4d2c673ac8..af4fdcd82e0b 100644
> > > --- a/arch/riscv/boot/dts/thead/th1520.dtsi
> > > +++ b/arch/riscv/boot/dts/thead/th1520.dtsi
> > > @@ -146,6 +146,13 @@ uart_sclk: uart-sclk-clock {
> > > #clock-cells = <0>;
> > > };
> > >
> > > + sdhci_clk: sdhci-clock {
> > > + compatible = "fixed-clock";
> > > + clock-frequency = <198000000>;
> > > + clock-output-names = "sdhci_clk";
> > > + #clock-cells = <0>;
> > > + };
> > > +
> > > soc {
> > > compatible = "simple-bus";
> > > interrupt-parent = <&plic>;
> > > @@ -304,6 +311,24 @@ dmac0: dma-controller@ffefc00000 {
> > > status = "disabled";
> > > };
> > >
> > > + mmc0: mmc@ffe7080000 {
> > > + compatible = "thead,th1520-dwcmshc";
> > > + reg = <0xff 0xe7080000 0x0 0x10000>;
> > > + interrupts = <62 IRQ_TYPE_LEVEL_HIGH>;
> > > + clocks = <&sdhci_clk>;
> > > + clock-names = "core";
> > > + status = "disabled";
> > > + };
> > > +
> > > + mmc1: mmc@ffe7090000 {
> > > + compatible = "thead,th1520-dwcmshc";
> > > + reg = <0xff 0xe7090000 0x0 0x10000>;
> > > + interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
> > > + clocks = <&sdhci_clk>;
> > > + clock-names = "core";
> > > + status = "disabled";
> > > + };
> > > +
> >
> > Hi Drew,
> >
> > This doesn't seem to match the documentation shared here:
> > https://lore.kernel.org/linux-riscv/5f437109d2be2b8843f549a661054a2e3ec0d66e.camel@xry111.site/
> > From the TH1520 System User Manual.pdf in there, I'd expect something like
>
> >
> > emmc: mmc@ffe7080000 {
> > compatible = "thead,th1520-dwcmshc";
> > reg = <0xff 0xe7080000 0x0 0x10000>;
> > ...
> > };
>
> Hi Emil,
>
> I think this isn't necessary. From other soc dts files, I see such
> naming, but lots socs just use mmc0, mmc1, and so on.
No it certainly isn't necessary. Those labels are purely for us humans to read
and are not present in the dtb. But that's exactly why I think it'd be a good
idea match the labels with the documentation, so it will easier for us humans
to match up the device tree source to documentation.
> And IIRC, the host for sd and sdio can support both, IOW, below
> sdio0/sdio1 may be used for sdcard.
Yes, all of the EMMC, SDIO0 and SDIO1 seem to be instances of the same IP.
/Emil
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock
2023-12-05 14:48 ` Emil Renner Berthing
@ 2023-12-05 15:52 ` Damian Tometzki
0 siblings, 0 replies; 11+ messages in thread
From: Damian Tometzki @ 2023-12-05 15:52 UTC (permalink / raw)
To: Emil Renner Berthing
Cc: Jisheng Zhang, Drew Fustini, Paul Walmsley, Palmer Dabbelt,
Albert Ou, Guo Ren, Fu Wei, Conor Dooley, Rob Herring,
Krzysztof Kozlowski, Jason Kridner, Robert Nelson, linux-riscv,
linux-kernel, devicetree
On Tue, 05. Dec 06:48, Emil Renner Berthing wrote:
> Jisheng Zhang wrote:
> > On Mon, Dec 04, 2023 at 01:47:45AM -0800, Emil Renner Berthing wrote:
> > > Drew Fustini wrote:
> > > > Add node for the SDHCI fixed clock. Add mmc0 node for the first mmc
> > > > controller instance which is typically connected to the eMMC device.
> > > > Add mmc1 node for the second mmc controller instance which is typically
> > > > connected to microSD slot.
> > > >
> > > > Signed-off-by: Drew Fustini <dfustini@baylibre.com>
> > > > ---
> > > > arch/riscv/boot/dts/thead/th1520.dtsi | 25 +++++++++++++++++++++++++
> > > > 1 file changed, 25 insertions(+)
> > > >
> > > > diff --git a/arch/riscv/boot/dts/thead/th1520.dtsi b/arch/riscv/boot/dts/thead/th1520.dtsi
> > > > index ba4d2c673ac8..af4fdcd82e0b 100644
> > > > --- a/arch/riscv/boot/dts/thead/th1520.dtsi
> > > > +++ b/arch/riscv/boot/dts/thead/th1520.dtsi
> > > > @@ -146,6 +146,13 @@ uart_sclk: uart-sclk-clock {
> > > > #clock-cells = <0>;
> > > > };
> > > >
> > > > + sdhci_clk: sdhci-clock {
> > > > + compatible = "fixed-clock";
> > > > + clock-frequency = <198000000>;
> > > > + clock-output-names = "sdhci_clk";
> > > > + #clock-cells = <0>;
> > > > + };
> > > > +
> > > > soc {
> > > > compatible = "simple-bus";
> > > > interrupt-parent = <&plic>;
> > > > @@ -304,6 +311,24 @@ dmac0: dma-controller@ffefc00000 {
> > > > status = "disabled";
> > > > };
> > > >
> > > > + mmc0: mmc@ffe7080000 {
> > > > + compatible = "thead,th1520-dwcmshc";
> > > > + reg = <0xff 0xe7080000 0x0 0x10000>;
> > > > + interrupts = <62 IRQ_TYPE_LEVEL_HIGH>;
> > > > + clocks = <&sdhci_clk>;
> > > > + clock-names = "core";
> > > > + status = "disabled";
> > > > + };
> > > > +
> > > > + mmc1: mmc@ffe7090000 {
> > > > + compatible = "thead,th1520-dwcmshc";
> > > > + reg = <0xff 0xe7090000 0x0 0x10000>;
> > > > + interrupts = <64 IRQ_TYPE_LEVEL_HIGH>;
> > > > + clocks = <&sdhci_clk>;
> > > > + clock-names = "core";
> > > > + status = "disabled";
> > > > + };
> > > > +
> > >
> > > Hi Drew,
> > >
> > > This doesn't seem to match the documentation shared here:
> > > https://lore.kernel.org/linux-riscv/5f437109d2be2b8843f549a661054a2e3ec0d66e.camel@xry111.site/
> > > From the TH1520 System User Manual.pdf in there, I'd expect something like
> >
> > >
> > > emmc: mmc@ffe7080000 {
> > > compatible = "thead,th1520-dwcmshc";
> > > reg = <0xff 0xe7080000 0x0 0x10000>;
> > > ...
> > > };
> >
> > Hi Emil,
> >
> > I think this isn't necessary. From other soc dts files, I see such
> > naming, but lots socs just use mmc0, mmc1, and so on.
>
> No it certainly isn't necessary. Those labels are purely for us humans to read
> and are not present in the dtb. But that's exactly why I think it'd be a good
> idea match the labels with the documentation, so it will easier for us humans
> to match up the device tree source to documentation.
Hello together,
yes i agree to this too. It is easier for troubleshooting etc.
Damian
>
> > And IIRC, the host for sd and sdio can support both, IOW, below
> > sdio0/sdio1 may be used for sdcard.
>
> Yes, all of the EMMC, SDIO0 and SDIO1 seem to be instances of the same IP.
>
> /Emil
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v7 3/4] riscv: dts: thead: Enable BeagleV Ahead eMMC and microSD
2023-11-30 1:48 [PATCH v7 0/4] RISC-V: Add MMC support for TH1520 boards Drew Fustini
2023-11-30 1:48 ` [PATCH v7 1/4] riscv: defconfig: Enable mmc and dma drivers for T-Head TH1520 Drew Fustini
2023-11-30 1:48 ` [PATCH v7 2/4] riscv: dts: thead: Add TH1520 mmc controllers and sdhci clock Drew Fustini
@ 2023-11-30 1:48 ` Drew Fustini
2023-11-30 1:48 ` [PATCH v7 4/4] riscv: dts: thead: Enable LicheePi 4A " Drew Fustini
3 siblings, 0 replies; 11+ messages in thread
From: Drew Fustini @ 2023-11-30 1:48 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Jisheng Zhang, Guo Ren,
Fu Wei, Conor Dooley, Rob Herring, Krzysztof Kozlowski
Cc: Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree, Drew Fustini
Add mmc0 properties for the eMMC device and add mmc1 properties for
the microSD slot. Set the frequency for the sdhci clock.
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts
index 70e8042c8304..b767d3f078d7 100644
--- a/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts
+++ b/arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts
@@ -48,6 +48,10 @@ &apb_clk {
clock-frequency = <62500000>;
};
+&sdhci_clk {
+ clock-frequency = <198000000>;
+};
+
&uart_sclk {
clock-frequency = <100000000>;
};
@@ -56,6 +60,22 @@ &dmac0 {
status = "okay";
};
+&mmc0 {
+ bus-width = <8>;
+ max-frequency = <198000000>;
+ mmc-hs400-1_8v;
+ non-removable;
+ no-sdio;
+ no-sd;
+ status = "okay";
+};
+
+&mmc1 {
+ bus-width = <4>;
+ max-frequency = <198000000>;
+ status = "okay";
+};
+
&uart0 {
status = "okay";
};
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread* [PATCH v7 4/4] riscv: dts: thead: Enable LicheePi 4A eMMC and microSD
2023-11-30 1:48 [PATCH v7 0/4] RISC-V: Add MMC support for TH1520 boards Drew Fustini
` (2 preceding siblings ...)
2023-11-30 1:48 ` [PATCH v7 3/4] riscv: dts: thead: Enable BeagleV Ahead eMMC and microSD Drew Fustini
@ 2023-11-30 1:48 ` Drew Fustini
3 siblings, 0 replies; 11+ messages in thread
From: Drew Fustini @ 2023-11-30 1:48 UTC (permalink / raw)
To: Paul Walmsley, Palmer Dabbelt, Albert Ou, Jisheng Zhang, Guo Ren,
Fu Wei, Conor Dooley, Rob Herring, Krzysztof Kozlowski
Cc: Jason Kridner, Robert Nelson, linux-riscv, linux-kernel,
devicetree, Drew Fustini
Add mmc0 properties for the eMMC device and add mmc1 properties for
the microSD slot. Set the frequency for the sdhci clock.
Signed-off-by: Drew Fustini <dfustini@baylibre.com>
---
.../boot/dts/thead/th1520-lichee-module-4a.dtsi | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
index a802ab110429..0818bd3c1f84 100644
--- a/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
+++ b/arch/riscv/boot/dts/thead/th1520-lichee-module-4a.dtsi
@@ -29,6 +29,10 @@ &apb_clk {
clock-frequency = <62500000>;
};
+&sdhci_clk {
+ clock-frequency = <198000000>;
+};
+
&uart_sclk {
clock-frequency = <100000000>;
};
@@ -36,3 +40,19 @@ &uart_sclk {
&dmac0 {
status = "okay";
};
+
+&mmc0 {
+ bus-width = <8>;
+ max-frequency = <198000000>;
+ mmc-hs400-1_8v;
+ non-removable;
+ no-sdio;
+ no-sd;
+ status = "okay";
+};
+
+&mmc1 {
+ bus-width = <4>;
+ max-frequency = <198000000>;
+ status = "okay";
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 11+ messages in thread