All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] r8a779f0: enable CMT timers
@ 2022-07-13 10:14 Wolfram Sang
  2022-07-13 10:14 ` [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks Wolfram Sang
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-07-13 10:14 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang

Here are the clk and DTS enablement patches for CMT on the r8a779f0.
Patch 3 is only for testing.

Note: Some testing I did is documented here by Niklas [1]. Once in a
while, I get an error that CMCNT could not be cleared. I observe this
behaviour only on Gen4 (V3U, S4) so far. My E3 did not show it.

I suspect the missing WRFLG support in the CMT driver but this needs
more research. I consider this orthogonal to these patches, though, and
think they can go in already.

All the best!

[1] https://elinux.org/R-Car/Tests:timers


Wolfram Sang (3):
  clk: renesas: r8a779f0: Add CMT clocks
  arm64: dts: renesas: r8a779f0: Add CMT support
  TEST: arm64: dts: renesas: spider: Enable CMT

 .../boot/dts/renesas/r8a779f0-spider-cpu.dtsi | 16 +++++
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi     | 70 +++++++++++++++++++
 drivers/clk/renesas/r8a779f0-cpg-mssr.c       |  4 ++
 3 files changed, 90 insertions(+)

-- 
2.35.1


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

* [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks
  2022-07-13 10:14 [PATCH 0/3] r8a779f0: enable CMT timers Wolfram Sang
@ 2022-07-13 10:14 ` Wolfram Sang
  2022-07-19  7:52   ` Geert Uytterhoeven
  2022-07-13 10:14 ` [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add CMT support Wolfram Sang
  2022-07-13 10:14 ` [PATCH 3/3] TEST: arm64: dts: renesas: spider: Enable CMT Wolfram Sang
  2 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2022-07-13 10:14 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/clk/renesas/r8a779f0-cpg-mssr.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/clk/renesas/r8a779f0-cpg-mssr.c b/drivers/clk/renesas/r8a779f0-cpg-mssr.c
index 0ce1ac978efd..555f747bf18d 100644
--- a/drivers/clk/renesas/r8a779f0-cpg-mssr.c
+++ b/drivers/clk/renesas/r8a779f0-cpg-mssr.c
@@ -133,6 +133,10 @@ static const struct mssr_mod_clk r8a779f0_mod_clks[] __initconst = {
 	DEF_MOD("sys-dmac0",	709,	R8A779F0_CLK_S0D3_PER),
 	DEF_MOD("sys-dmac1",	710,	R8A779F0_CLK_S0D3_PER),
 	DEF_MOD("wdt",		907,	R8A779F0_CLK_R),
+	DEF_MOD("cmt0",		910,	R8A779F0_CLK_R),
+	DEF_MOD("cmt1",		911,	R8A779F0_CLK_R),
+	DEF_MOD("cmt2",		912,	R8A779F0_CLK_R),
+	DEF_MOD("cmt3",		913,	R8A779F0_CLK_R),
 	DEF_MOD("pfc0",		915,	R8A779F0_CLK_CL16M),
 	DEF_MOD("ufs",		1514,	R8A779F0_CLK_S0D4_HSC),
 };
-- 
2.35.1


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

* [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add CMT support
  2022-07-13 10:14 [PATCH 0/3] r8a779f0: enable CMT timers Wolfram Sang
  2022-07-13 10:14 ` [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks Wolfram Sang
@ 2022-07-13 10:14 ` Wolfram Sang
  2022-07-21 10:04   ` Geert Uytterhoeven
  2022-07-13 10:14 ` [PATCH 3/3] TEST: arm64: dts: renesas: spider: Enable CMT Wolfram Sang
  2 siblings, 1 reply; 6+ messages in thread
From: Wolfram Sang @ 2022-07-13 10:14 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang

This patch adds CMT{0|1|2|3} device nodes for R-Car S4-8 (r8a779f0) SoC.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 arch/arm64/boot/dts/renesas/r8a779f0.dtsi | 70 +++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
index 68e4d835c812..af299a520a39 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779f0.dtsi
@@ -136,6 +136,76 @@ gpio3: gpio@e6051980 {
 			#interrupt-cells = <2>;
 		};
 
+		cmt0: timer@e60f0000 {
+			compatible = "renesas,r8a779f0-cmt0",
+				     "renesas,rcar-gen4-cmt0";
+			reg = <0 0xe60f0000 0 0x1004>;
+			interrupts = <GIC_SPI 448 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 449 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 910>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 910>;
+			status = "disabled";
+		};
+
+		cmt1: timer@e6130000 {
+			compatible = "renesas,r8a779f0-cmt1",
+				     "renesas,rcar-gen4-cmt1";
+			reg = <0 0xe6130000 0 0x1004>;
+			interrupts = <GIC_SPI 450 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 451 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 452 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 453 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 454 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 455 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 456 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 457 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 911>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 911>;
+			status = "disabled";
+		};
+
+		cmt2: timer@e6140000 {
+			compatible = "renesas,r8a779f0-cmt1",
+				     "renesas,rcar-gen4-cmt1";
+			reg = <0 0xe6140000 0 0x1004>;
+			interrupts = <GIC_SPI 458 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 459 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 460 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 461 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 462 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 463 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 464 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 465 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 912>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 912>;
+			status = "disabled";
+		};
+
+		cmt3: timer@e6148000 {
+			compatible = "renesas,r8a779f0-cmt1",
+				     "renesas,rcar-gen4-cmt1";
+			reg = <0 0xe6148000 0 0x1004>;
+			interrupts = <GIC_SPI 466 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 467 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 468 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 471 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 913>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779F0_PD_ALWAYS_ON>;
+			resets = <&cpg 913>;
+			status = "disabled";
+		};
+
 		cpg: clock-controller@e6150000 {
 			compatible = "renesas,r8a779f0-cpg-mssr";
 			reg = <0 0xe6150000 0 0x4000>;
-- 
2.35.1


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

* [PATCH 3/3] TEST: arm64: dts: renesas: spider: Enable CMT
  2022-07-13 10:14 [PATCH 0/3] r8a779f0: enable CMT timers Wolfram Sang
  2022-07-13 10:14 ` [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks Wolfram Sang
  2022-07-13 10:14 ` [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add CMT support Wolfram Sang
@ 2022-07-13 10:14 ` Wolfram Sang
  2 siblings, 0 replies; 6+ messages in thread
From: Wolfram Sang @ 2022-07-13 10:14 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: Wolfram Sang

This patch enables CMT{0|1|2|3} on the Spider board.

Only for testing, not for upstream!

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 .../boot/dts/renesas/r8a779f0-spider-cpu.dtsi    | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
index 7ef9f7cfe10f..51d31a62879f 100644
--- a/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a779f0-spider-cpu.dtsi
@@ -41,6 +41,22 @@ reg_3p3v: regulator-3p3v {
 	};
 };
 
+&cmt0 {
+	status = "okay";
+};
+
+&cmt1 {
+	status = "okay";
+};
+
+&cmt2 {
+	status = "okay";
+};
+
+&cmt3 {
+	status = "okay";
+};
+
 &extal_clk {
 	clock-frequency = <20000000>;
 };
-- 
2.35.1


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

* Re: [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks
  2022-07-13 10:14 ` [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks Wolfram Sang
@ 2022-07-19  7:52   ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-07-19  7:52 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Linux-Renesas

On Wed, Jul 13, 2022 at 12:15 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-clk-for-v5.21.

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] 6+ messages in thread

* Re: [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add CMT support
  2022-07-13 10:14 ` [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add CMT support Wolfram Sang
@ 2022-07-21 10:04   ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2022-07-21 10:04 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: Linux-Renesas

On Wed, Jul 13, 2022 at 12:15 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> This patch adds CMT{0|1|2|3} device nodes for R-Car S4-8 (r8a779f0) SoC.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v5.21.

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] 6+ messages in thread

end of thread, other threads:[~2022-07-21 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13 10:14 [PATCH 0/3] r8a779f0: enable CMT timers Wolfram Sang
2022-07-13 10:14 ` [PATCH 1/3] clk: renesas: r8a779f0: Add CMT clocks Wolfram Sang
2022-07-19  7:52   ` Geert Uytterhoeven
2022-07-13 10:14 ` [PATCH 2/3] arm64: dts: renesas: r8a779f0: Add CMT support Wolfram Sang
2022-07-21 10:04   ` Geert Uytterhoeven
2022-07-13 10:14 ` [PATCH 3/3] TEST: arm64: dts: renesas: spider: Enable CMT Wolfram Sang

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.