All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/4] r8a779a0: Add MSIOF support
@ 2020-11-17  9:03 Geert Uytterhoeven
  2020-11-17  9:03 ` [PATCH RFC 1/4] spi: renesas,sh-msiof: Add r8a779a0 (V3U) support Geert Uytterhoeven
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-11-17  9:03 UTC (permalink / raw)
  To: linux-renesas-soc

	Hi all,

This patch series adds support for MSIOF on R-Car V3U.

I tested it on Falcon, with MSIOF1 TXD/RXD loopback (connect pins 5/6 of
CN5), CONFIG_SPI_LOOPBACK_TEST, loopback=1, and the following appended
to arch/arm64/boot/dts/renesas/r8a779a0-falcon.dts:

    &msiof1 {
	    #address-cells = <1>;
	    #size-cells = <0>;
	    status = "okay";
     
	    loopback@0 {
		    compatible = "linux,spi-loopback-test";
		    reg = <0>;
		    spi-max-frequency = <10000000>;
	    };
    };

Although the bootloader defaults for GPSR1 (0xbff7fff) and IP1SR1
(0x00000000) should be correct to configure the pins for the MSIOF1
function, spi-loopback-test failed with:

    spi-loopback-test spi0.0:   with iteration values: len = 2, tx_off = 0, rx_off = 0
    spi-loopback-test spi0.0: loopback strangeness - transfer mismatch on byte 0001 - expected 0x01, but got 0x00
    spi-loopback-test spi0.0:   spi_msg@(____ptrval____)
    spi-loopback-test spi0.0:     frame_length:  2
    spi-loopback-test spi0.0:     actual_length: 2
    spi-loopback-test spi0.0:     spi_transfer@(____ptrval____)
    spi-loopback-test spi0.0:       len:    2
    spi-loopback-test spi0.0:       tx_buf: (____ptrval____)
	      TX: 00000000: 00 01
    spi-loopback-test spi0.0:       rx_buf: (____ptrval____)
	      RX: 00000000: 00 00
    spi-loopback-test spi0.0: test failed - test returned -22, but we expect 0
    spi-loopback-test spi0.0: Finished spi-loopback-tests with return: -22
    spi-loopback-test: probe of spi0.0 failed with error -22

Note that the tests before (len = 1) did succeed...

I will retry after we have proper pinctrl support.

Thanks for your comments!

Geert Uytterhoeven (2):
  [RFC] clk: renesas: r8a779a0: Add MSIOF clocks
  [RFC] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node

Koji Matsuoka (1):
  [RFC] arm64: dts: renesas: r8a779a0: Add MSIOF device nodes

Wolfram Sang (1):
  spi: renesas,sh-msiof: Add r8a779a0 (V3U) support

 .../bindings/spi/renesas,sh-msiof.yaml        |  1 +
 arch/arm64/boot/dts/renesas/r8a779a0.dtsi     | 96 +++++++++++++++++++
 drivers/clk/renesas/r8a779a0-cpg-mssr.c       |  6 ++
 3 files changed, 103 insertions(+)

-- 
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH RFC 1/4] spi: renesas,sh-msiof: Add r8a779a0 (V3U) support
  2020-11-17  9:03 [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
@ 2020-11-17  9:03 ` Geert Uytterhoeven
  2020-11-17  9:03 ` [PATCH RFC 2/4] clk: renesas: r8a779a0: Add MSIOF clocks Geert Uytterhoeven
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-11-17  9:03 UTC (permalink / raw)
  To: linux-renesas-soc

From: Wolfram Sang <wsa+renesas@sang-engineering.com>

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml b/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
index 44c7ddb4b1098e15..b104899205f6d2da 100644
--- a/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
+++ b/Documentation/devicetree/bindings/spi/renesas,sh-msiof.yaml
@@ -47,6 +47,7 @@ properties:
               - renesas,msiof-r8a77980      # R-Car V3H
               - renesas,msiof-r8a77990      # R-Car E3
               - renesas,msiof-r8a77995      # R-Car D3
+              - renesas,msiof-r8a779a0      # R-Car V3U
           - const: renesas,rcar-gen3-msiof  # generic R-Car Gen3 and RZ/G2
                                             # compatible device
       - items:
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RFC 2/4] clk: renesas: r8a779a0: Add MSIOF clocks
  2020-11-17  9:03 [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
  2020-11-17  9:03 ` [PATCH RFC 1/4] spi: renesas,sh-msiof: Add r8a779a0 (V3U) support Geert Uytterhoeven
@ 2020-11-17  9:03 ` Geert Uytterhoeven
  2020-11-17  9:03 ` [PATCH RFC 3/4] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node Geert Uytterhoeven
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-11-17  9:03 UTC (permalink / raw)
  To: linux-renesas-soc

Add the module clocks used by the Clock-Synchronized Serial Interface
with FIFO (MSIOF) instances on the Renesas R-Car V3U (r8a779a0) SoC.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 drivers/clk/renesas/r8a779a0-cpg-mssr.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/clk/renesas/r8a779a0-cpg-mssr.c b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
index efecb87065adeff2..c4aa561bb01152df 100644
--- a/drivers/clk/renesas/r8a779a0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779a0-cpg-mssr.c
@@ -152,6 +152,12 @@ static const struct mssr_mod_clk r8a779a0_mod_clks[] __initconst = {
 	DEF_MOD("csi41",	400,	R8A779A0_CLK_CSI0),
 	DEF_MOD("csi42",	401,	R8A779A0_CLK_CSI0),
 	DEF_MOD("csi43",	402,	R8A779A0_CLK_CSI0),
+	DEF_MOD("msi0",		618,	R8A779A0_CLK_MSO),
+	DEF_MOD("msi1",		619,	R8A779A0_CLK_MSO),
+	DEF_MOD("msi2",		620,	R8A779A0_CLK_MSO),
+	DEF_MOD("msi3",		621,	R8A779A0_CLK_MSO),
+	DEF_MOD("msi4",		622,	R8A779A0_CLK_MSO),
+	DEF_MOD("msi5",		623,	R8A779A0_CLK_MSO),
 	DEF_MOD("scif0",	702,	R8A779A0_CLK_S1D8),
 	DEF_MOD("scif1",	703,	R8A779A0_CLK_S1D8),
 	DEF_MOD("scif3",	704,	R8A779A0_CLK_S1D8),
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RFC 3/4] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node
  2020-11-17  9:03 [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
  2020-11-17  9:03 ` [PATCH RFC 1/4] spi: renesas,sh-msiof: Add r8a779a0 (V3U) support Geert Uytterhoeven
  2020-11-17  9:03 ` [PATCH RFC 2/4] clk: renesas: r8a779a0: Add MSIOF clocks Geert Uytterhoeven
@ 2020-11-17  9:03 ` Geert Uytterhoeven
  2020-12-21 16:06   ` Wolfram Sang
  2020-11-17  9:03 ` [PATCH RFC 4/4] arm64: dts: renesas: r8a779a0: Add MSIOF device nodes Geert Uytterhoeven
  2020-12-14 15:39 ` [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
  4 siblings, 1 reply; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-11-17  9:03 UTC (permalink / raw)
  To: linux-renesas-soc

Add a placeholder node for the first Direct Memory Access Controller for
System (SYS-DMAC) instance, so it can be referred to from other device
nodes.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Alternatively, we could omit the DMA properties in PATCH 4/4.

 arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
index a3b1294c73952b3c..f1533b4946f4a725 100644
--- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
@@ -245,6 +245,12 @@ scif0: serial@e6e60000 {
 			status = "disabled";
 		};
 
+		dmac1: dma-controller@e7350000 {
+			reg = <0 0xe7350000 0 0x1000>;
+			#dma-cells = <1>;
+			/* placeholder */
+		};
+
 		gic: interrupt-controller@f1000000 {
 			compatible = "arm,gic-v3";
 			#interrupt-cells = <3>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH RFC 4/4] arm64: dts: renesas: r8a779a0: Add MSIOF device nodes
  2020-11-17  9:03 [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
                   ` (2 preceding siblings ...)
  2020-11-17  9:03 ` [PATCH RFC 3/4] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node Geert Uytterhoeven
@ 2020-11-17  9:03 ` Geert Uytterhoeven
  2020-12-14 15:39 ` [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-11-17  9:03 UTC (permalink / raw)
  To: linux-renesas-soc

From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>

Add device nodes for the Clock-Synchronized Serial Interface with
FIFO (MSIOF) instances on the Renesas R-Car V3U (r8a779a0) SoC.

Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 90 +++++++++++++++++++++++
 1 file changed, 90 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
index f1533b4946f4a725..7b733e07be95913e 100644
--- a/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779a0.dtsi
@@ -245,6 +245,96 @@ scif0: serial@e6e60000 {
 			status = "disabled";
 		};
 
+		msiof0: spi@e6e90000 {
+			compatible = "renesas,msiof-r8a779a0",
+				     "renesas,rcar-gen3-msiof";
+			reg = <0 0xe6e90000 0 0x0064>;
+			interrupts = <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 618>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 618>;
+			dmas = <&dmac1 0x41>, <&dmac1 0x40>;
+			dma-names = "tx", "rx";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		msiof1: spi@e6ea0000 {
+			compatible = "renesas,msiof-r8a779a0",
+				     "renesas,rcar-gen3-msiof";
+			reg = <0 0xe6ea0000 0 0x0064>;
+			interrupts = <GIC_SPI 246 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 619>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 619>;
+			dmas = <&dmac1 0x43>, <&dmac1 0x42>;
+			dma-names = "tx", "rx";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		msiof2: spi@e6c00000 {
+			compatible = "renesas,msiof-r8a779a0",
+				     "renesas,rcar-gen3-msiof";
+			reg = <0 0xe6c00000 0 0x0064>;
+			interrupts = <GIC_SPI 247 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 620>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 620>;
+			dmas = <&dmac1 0x45>, <&dmac1 0x44>;
+			dma-names = "tx", "rx";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		msiof3: spi@e6c10000 {
+			compatible = "renesas,msiof-r8a779a0",
+				     "renesas,rcar-gen3-msiof";
+			reg = <0 0xe6c10000 0 0x0064>;
+			interrupts = <GIC_SPI 248 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 621>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 621>;
+			dmas = <&dmac1 0x47>, <&dmac1 0x46>;
+			dma-names = "tx", "rx";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		msiof4: spi@e6c20000 {
+			compatible = "renesas,msiof-r8a779a0",
+				     "renesas,rcar-gen3-msiof";
+			reg = <0 0xe6c20000 0 0x0064>;
+			interrupts = <GIC_SPI 249 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 622>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 622>;
+			dmas = <&dmac1 0x49>, <&dmac1 0x48>;
+			dma-names = "tx", "rx";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
+		msiof5: spi@e6c28000 {
+			compatible = "renesas,msiof-r8a779a0",
+				     "renesas,rcar-gen3-msiof";
+			reg = <0 0xe6c28000 0 0x0064>;
+			interrupts = <GIC_SPI 250 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 623>;
+			power-domains = <&sysc R8A779A0_PD_ALWAYS_ON>;
+			resets = <&cpg 623>;
+			dmas = <&dmac1 0x4b>, <&dmac1 0x4a>;
+			dma-names = "tx", "rx";
+			#address-cells = <1>;
+			#size-cells = <0>;
+			status = "disabled";
+		};
+
 		dmac1: dma-controller@e7350000 {
 			reg = <0 0xe7350000 0 0x1000>;
 			#dma-cells = <1>;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC 0/4] r8a779a0: Add MSIOF support
  2020-11-17  9:03 [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
                   ` (3 preceding siblings ...)
  2020-11-17  9:03 ` [PATCH RFC 4/4] arm64: dts: renesas: r8a779a0: Add MSIOF device nodes Geert Uytterhoeven
@ 2020-12-14 15:39 ` Geert Uytterhoeven
  4 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2020-12-14 15:39 UTC (permalink / raw)
  To: Linux-Renesas

On Tue, Nov 17, 2020 at 10:04 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
> This patch series adds support for MSIOF on R-Car V3U.
>
> I tested it on Falcon, with MSIOF1 TXD/RXD loopback (connect pins 5/6 of
> CN5), CONFIG_SPI_LOOPBACK_TEST, loopback=1, and the following appended
> to arch/arm64/boot/dts/renesas/r8a779a0-falcon.dts:
>
>     &msiof1 {
>             #address-cells = <1>;
>             #size-cells = <0>;
>             status = "okay";
>
>             loopback@0 {
>                     compatible = "linux,spi-loopback-test";
>                     reg = <0>;
>                     spi-max-frequency = <10000000>;

This turned out to be way too high: reducing to 200000 makes
spi-loopback-test succeed.

>             };
>     };

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH RFC 3/4] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node
  2020-11-17  9:03 ` [PATCH RFC 3/4] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node Geert Uytterhoeven
@ 2020-12-21 16:06   ` Wolfram Sang
  0 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2020-12-21 16:06 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

On Tue, Nov 17, 2020 at 10:03:28AM +0100, Geert Uytterhoeven wrote:
> Add a placeholder node for the first Direct Memory Access Controller for
> System (SYS-DMAC) instance, so it can be referred to from other device
> nodes.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> Alternatively, we could omit the DMA properties in PATCH 4/4.

I'll add quite some devices in the near future and I like this
placeholder a lot better!

Acked-by: Wolfram Sang <wsa+renesas@sang-engineering.com>


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-12-21 16:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-17  9:03 [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven
2020-11-17  9:03 ` [PATCH RFC 1/4] spi: renesas,sh-msiof: Add r8a779a0 (V3U) support Geert Uytterhoeven
2020-11-17  9:03 ` [PATCH RFC 2/4] clk: renesas: r8a779a0: Add MSIOF clocks Geert Uytterhoeven
2020-11-17  9:03 ` [PATCH RFC 3/4] arm64: dts: renesas: r8a779a0: Add dmac1 placeholder node Geert Uytterhoeven
2020-12-21 16:06   ` Wolfram Sang
2020-11-17  9:03 ` [PATCH RFC 4/4] arm64: dts: renesas: r8a779a0: Add MSIOF device nodes Geert Uytterhoeven
2020-12-14 15:39 ` [PATCH RFC 0/4] r8a779a0: Add MSIOF support Geert Uytterhoeven

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.