Skip to contentSkip to conversation

r8a779g0: add TMU support

PATCH In review Wolfram Sang 2 participants 6 messages Nov 4, 2022 – Nov 7, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover r8a779g0: add TMU support

Here are the clk and DTS changes to enable CMT timers on the R-Car V4H based WhiteHawk board. Tested with the 'clocksource-switch' selftest. Nothing special, very similar to S4-8. That means the "cannot clear CMCNT" error is also present like on every Gen4 SoC so far. Fixing this is a seperate thing and the next step for CMT. Thanks and happy hacking!

Thanh Quan (1):
arm64: dts: renesas: r8a779g0: Add CMT node

Wolfram Sang (2):
clk: renesas: r8a779g0: Add CMT clocks
TEST: arm64: dts: renesas: white-hawk-cpu: Enable CMT

 .../dts/renesas/r8a779g0-white-hawk-cpu.dtsi  | 16 +++++
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi     | 70 +++++++++++++++++++
 drivers/clk/renesas/r8a779g0-cpg-mssr.c       |  4 ++
 3 files changed, 90 insertions(+)
Signature · 1 line
2.35.1
#1 lore raw

PATCH 1/3 clk: renesas: r8a779g0: Add CMT clocks

---
 drivers/clk/renesas/r8a779g0-cpg-mssr.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/clk/renesas/r8a779g0-cpg-mssr.c +4 -0
index 7f0b4f75ff4d..1da48c81d3dd 100644
@@ -193,6 +193,10 @@ static const struct mssr_mod_clk r8a779g0_mod_clks[] __initconst = {
 	DEF_MOD("tmu4",		717,	R8A779G0_CLK_SASYNCPERD2),
 	DEF_MOD("tpu0",		718,	R8A779G0_CLK_SASYNCPERD4),
 	DEF_MOD("wdt1:wdt0",	907,	R8A779G0_CLK_R),
+	DEF_MOD("cmt0",		910,	R8A779G0_CLK_R),
+	DEF_MOD("cmt1",		911,	R8A779G0_CLK_R),
+	DEF_MOD("cmt2",		912,	R8A779G0_CLK_R),
+	DEF_MOD("cmt3",		913,	R8A779G0_CLK_R),
 	DEF_MOD("pfc0",		915,	R8A779G0_CLK_CL16M),
 	DEF_MOD("pfc1",		916,	R8A779G0_CLK_CL16M),
 	DEF_MOD("pfc2",		917,	R8A779G0_CLK_CL16M),
Signature · 1 line
2.35.1
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] clk: renesas: r8a779g0: Add CMT clocks

Quoted 1 line · Wolfram Sang

i.e. will queue in renesas-clk-for-v6.2.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#3 lore raw

PATCH 2/3 arm64: dts: renesas: r8a779g0: Add CMT node

In reply to Wolfram Sang

From: Thanh Quan <[email protected]>

[wsa: merged the fixes into this one and rebased]
---
 arch/arm64/boot/dts/renesas/r8a779g0.dtsi | 70 +++++++++++++++++++++++
 1 file changed, 70 insertions(+)
arch/arm64/boot/dts/renesas/r8a779g0.dtsi +70 -0
index fbab9817cc8c..0ea48fa18df3 100644
@@ -214,6 +214,76 @@ gpio8: gpio@e6068180 {
 			#interrupt-cells = <2>;
 		};
 
+		cmt0: timer@e60f0000 {
+			compatible = "renesas,r8a779g0-cmt0",
+				     "renesas,rcar-gen4-cmt0";
+			reg = <0 0xe60f0000 0 0x1004>;
+			interrupts = <GIC_SPI 260 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 910>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 910>;
+			status = "disabled";
+		};
+
+		cmt1: timer@e6130000 {
+			compatible = "renesas,r8a779g0-cmt1",
+				     "renesas,rcar-gen4-cmt1";
+			reg = <0 0xe6130000 0 0x1004>;
+			interrupts = <GIC_SPI 262 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 263 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 264 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 267 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 268 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 269 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 911>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 911>;
+			status = "disabled";
+		};
+
+		cmt2: timer@e6140000 {
+			compatible = "renesas,r8a779g0-cmt1",
+				     "renesas,rcar-gen4-cmt1";
+			reg = <0 0xe6140000 0 0x1004>;
+			interrupts = <GIC_SPI 270 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 272 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 273 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 274 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 275 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 276 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 277 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 912>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 912>;
+			status = "disabled";
+		};
+
+		cmt3: timer@e6148000 {
+			compatible = "renesas,r8a779g0-cmt1",
+				     "renesas,rcar-gen4-cmt1";
+			reg = <0 0xe6148000 0 0x1004>;
+			interrupts = <GIC_SPI 278 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 281 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 282 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 283 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 284 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 285 IRQ_TYPE_LEVEL_HIGH>;
+			clocks = <&cpg CPG_MOD 913>;
+			clock-names = "fck";
+			power-domains = <&sysc R8A779G0_PD_ALWAYS_ON>;
+			resets = <&cpg 913>;
+			status = "disabled";
+		};
+
 		cpg: clock-controller@e6150000 {
 			compatible = "renesas,r8a779g0-cpg-mssr";
 			reg = <0 0xe6150000 0 0x4000>;
Signature · 1 line
2.35.1
Reviewed-by on v1 2/3
#4 lore raw

Re: [PATCH 2/3] arm64: dts: renesas: r8a779g0: Add CMT node

Quoted 5 lines · Wolfram Sang

From: Thanh Quan <[email protected]>

[wsa: merged the fixes into this one and rebased]

i.e. will queue in renesas-devel for v6.2.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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

#5 lore raw

PATCH 3/3 TEST: arm64: dts: renesas: white-hawk-cpu: Enable CMT

In reply to Wolfram Sang

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

Only for testing, not for upstream!

---
 .../dts/renesas/r8a779g0-white-hawk-cpu.dtsi     | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/renesas/r8a779g0-white-hawk-cpu.dtsi +16 -0
index c10740aee9f6..7f565e161662 100644
@@ -279,3 +279,19 @@ &rwdt {
 &scif_clk {
 	clock-frequency = <24000000>;
 };
+
+&cmt0 {
+	status = "okay";
+};
+
+&cmt1 {
+	status = "okay";
+};
+
+&cmt2 {
+	status = "okay";
+};
+
+&cmt3 {
+	status = "okay";
+};
Signature · 1 line
2.35.1