devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/4] Add RTC support for the Renesas RZ/V2H SoC
@ 2025-11-07 21:07 Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 1/4] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support Ovidiu Panait
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Ovidiu Panait @ 2025-11-07 21:07 UTC (permalink / raw)
  To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
	geert+renesas, magnus.damm, p.zabel
  Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel

Hi,

This series adds RTC support for the Renesas RZ/V2H SoC.

The Renesas RZ/V2H RTC IP is based on the same RTCA3 IP as RZ/G3S
(r9a08g045), with the following differences:
- it lacks the time capture functionality
- the maximum supported periodic interrupt frequency is 128Hz instead
  of 256Hz
- it requires two reset lines instead of one

Best regards,
Ovidiu

v4:
- Renamed reset "rtc_rtest" -> "rtest".
- Added "vbattb" reset name to example node.

v3:
- Dropped all changes related to "max_user_freq", as it was removed from
  all drivers by:
  https://lore.kernel.org/all/20251101-max_user_freq-v1-0-c9a274fd6883@bootlin.com/

v2:
- Updated bindings and RTC dts node with "reset-names" property.

Ovidiu Panait (4):
  dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support
  rtc: renesas-rtca3: Add support for multiple reset lines
  arm64: dts: renesas: r9a09g057: Add RTC node
  arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC

 .../bindings/rtc/renesas,rz-rtca3.yaml        | 46 +++++++++++++++++--
 arch/arm64/boot/dts/renesas/r9a09g057.dtsi    | 15 ++++++
 .../dts/renesas/r9a09g057h44-rzv2h-evk.dts    |  4 ++
 drivers/rtc/rtc-renesas-rtca3.c               |  2 +-
 4 files changed, 61 insertions(+), 6 deletions(-)

-- 
2.51.0


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

* [PATCH v4 1/4] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support
  2025-11-07 21:07 [PATCH v4 0/4] Add RTC support for the Renesas RZ/V2H SoC Ovidiu Panait
@ 2025-11-07 21:07 ` Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 2/4] rtc: renesas-rtca3: Add support for multiple reset lines Ovidiu Panait
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Ovidiu Panait @ 2025-11-07 21:07 UTC (permalink / raw)
  To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
	geert+renesas, magnus.damm, p.zabel
  Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel

The Renesas RZ/V2H RTC IP is based on the same RTCA3 IP as RZ/G3S
(r9a08g045), with the following differences:
- It lacks the time capture functionality
- The maximum supported periodic interrupt frequency is 128Hz instead
  of 256Hz
- It requires two reset lines instead of one

Add new compatible string "renesas,r9a09g057-rtca3" for RZ/V2H and update
the binding accordingly:
- Allow "resets" to contain one or two entries depending on the SoC.
- Add "reset-names" property, but make it required only for RZ/V2H.

Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
 .../bindings/rtc/renesas,rz-rtca3.yaml        | 46 +++++++++++++++++--
 1 file changed, 41 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml b/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
index e70eeb66aa64..ccb1638c35b9 100644
--- a/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
+++ b/Documentation/devicetree/bindings/rtc/renesas,rz-rtca3.yaml
@@ -9,14 +9,12 @@ title: Renesas RTCA-3 Real Time Clock
 maintainers:
   - Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
 
-allOf:
-  - $ref: rtc.yaml#
-
 properties:
   compatible:
     items:
       - enum:
           - renesas,r9a08g045-rtca3 # RZ/G3S
+          - renesas,r9a09g057-rtca3 # RZ/V2H
       - const: renesas,rz-rtca3
 
   reg:
@@ -48,8 +46,12 @@ properties:
     maxItems: 1
 
   resets:
-    items:
-      - description: VBATTB module reset
+    minItems: 1
+    maxItems: 2
+
+  reset-names:
+    minItems: 1
+    maxItems: 2
 
 required:
   - compatible
@@ -61,6 +63,39 @@ required:
   - power-domains
   - resets
 
+allOf:
+  - $ref: rtc.yaml#
+
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a08g045-rtca3
+    then:
+      properties:
+        resets:
+          items:
+            - description: VBATTB module reset
+        reset-names:
+          const: vbattb
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r9a09g057-rtca3
+    then:
+      properties:
+        resets:
+          items:
+            - description: RTC reset
+            - description: Reset for the RTEST registers
+        reset-names:
+          items:
+            - const: rtc
+            - const: rtest
+      required:
+        - reset-names
+
 additionalProperties: false
 
 examples:
@@ -81,4 +116,5 @@ examples:
         clock-names = "bus", "counter";
         power-domains = <&cpg>;
         resets = <&cpg R9A08G045_VBAT_BRESETN>;
+        reset-names = "vbattb";
     };
-- 
2.51.0


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

* [PATCH v4 2/4] rtc: renesas-rtca3: Add support for multiple reset lines
  2025-11-07 21:07 [PATCH v4 0/4] Add RTC support for the Renesas RZ/V2H SoC Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 1/4] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support Ovidiu Panait
@ 2025-11-07 21:07 ` Ovidiu Panait
  2025-11-08  9:46   ` Claudiu Beznea
  2025-11-07 21:07 ` [PATCH v4 3/4] arm64: dts: renesas: r9a09g057: Add RTC node Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 4/4] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC Ovidiu Panait
  3 siblings, 1 reply; 6+ messages in thread
From: Ovidiu Panait @ 2025-11-07 21:07 UTC (permalink / raw)
  To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
	geert+renesas, magnus.damm, p.zabel
  Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel

Switch from devm_reset_control_get_shared() to
devm_reset_control_array_get_shared() when retrieving resets.

The RZ/V2H SoC requires two resets for the RTC block instead of one,
so this will allow to handle multiple resets without additional changes.

Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
 drivers/rtc/rtc-renesas-rtca3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/rtc/rtc-renesas-rtca3.c b/drivers/rtc/rtc-renesas-rtca3.c
index ab816bdf0d77..3524053269ef 100644
--- a/drivers/rtc/rtc-renesas-rtca3.c
+++ b/drivers/rtc/rtc-renesas-rtca3.c
@@ -726,7 +726,7 @@ static int rtca3_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	priv->rstc = devm_reset_control_get_shared(dev, NULL);
+	priv->rstc = devm_reset_control_array_get_shared(dev);
 	if (IS_ERR(priv->rstc))
 		return PTR_ERR(priv->rstc);
 
-- 
2.51.0


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

* [PATCH v4 3/4] arm64: dts: renesas: r9a09g057: Add RTC node
  2025-11-07 21:07 [PATCH v4 0/4] Add RTC support for the Renesas RZ/V2H SoC Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 1/4] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 2/4] rtc: renesas-rtca3: Add support for multiple reset lines Ovidiu Panait
@ 2025-11-07 21:07 ` Ovidiu Panait
  2025-11-07 21:07 ` [PATCH v4 4/4] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC Ovidiu Panait
  3 siblings, 0 replies; 6+ messages in thread
From: Ovidiu Panait @ 2025-11-07 21:07 UTC (permalink / raw)
  To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
	geert+renesas, magnus.damm, p.zabel
  Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel

Add RTC node to Renesas RZ/V2H ("R9A09G057") SoC DTSI.

Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
 arch/arm64/boot/dts/renesas/r9a09g057.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
index 40b15f1db930..8aad46c367ae 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
+++ b/arch/arm64/boot/dts/renesas/r9a09g057.dtsi
@@ -591,6 +591,21 @@ wdt3: watchdog@13000400 {
 			status = "disabled";
 		};
 
+		rtc: rtc@11c00800 {
+			compatible = "renesas,r9a09g057-rtca3", "renesas,rz-rtca3";
+			reg = <0 0x11c00800 0 0x400>;
+			interrupts = <GIC_SPI 524 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 525 IRQ_TYPE_EDGE_RISING>,
+				     <GIC_SPI 526 IRQ_TYPE_EDGE_RISING>;
+			interrupt-names = "alarm", "period", "carry";
+			clocks = <&cpg CPG_MOD 0x53>, <&rtxin_clk>;
+			clock-names = "bus", "counter";
+			power-domains = <&cpg>;
+			resets = <&cpg 0x79>, <&cpg 0x7a>;
+			reset-names = "rtc", "rtest";
+			status = "disabled";
+		};
+
 		scif: serial@11c01400 {
 			compatible = "renesas,scif-r9a09g057";
 			reg = <0 0x11c01400 0 0x400>;
-- 
2.51.0


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

* [PATCH v4 4/4] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC
  2025-11-07 21:07 [PATCH v4 0/4] Add RTC support for the Renesas RZ/V2H SoC Ovidiu Panait
                   ` (2 preceding siblings ...)
  2025-11-07 21:07 ` [PATCH v4 3/4] arm64: dts: renesas: r9a09g057: Add RTC node Ovidiu Panait
@ 2025-11-07 21:07 ` Ovidiu Panait
  3 siblings, 0 replies; 6+ messages in thread
From: Ovidiu Panait @ 2025-11-07 21:07 UTC (permalink / raw)
  To: claudiu.beznea.uj, alexandre.belloni, robh, krzk+dt, conor+dt,
	geert+renesas, magnus.damm, p.zabel
  Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel

Enable RTC.

Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>
---
 arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts b/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts
index 7fff8bea9494..99dfb40b6ea8 100644
--- a/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts
+++ b/arch/arm64/boot/dts/renesas/r9a09g057h44-rzv2h-evk.dts
@@ -407,6 +407,10 @@ &qextal_clk {
 	clock-frequency = <24000000>;
 };
 
+&rtc {
+	status = "okay";
+};
+
 &rtxin_clk {
 	clock-frequency = <32768>;
 };
-- 
2.51.0


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

* Re: [PATCH v4 2/4] rtc: renesas-rtca3: Add support for multiple reset lines
  2025-11-07 21:07 ` [PATCH v4 2/4] rtc: renesas-rtca3: Add support for multiple reset lines Ovidiu Panait
@ 2025-11-08  9:46   ` Claudiu Beznea
  0 siblings, 0 replies; 6+ messages in thread
From: Claudiu Beznea @ 2025-11-08  9:46 UTC (permalink / raw)
  To: Ovidiu Panait, claudiu.beznea.uj, alexandre.belloni, robh,
	krzk+dt, conor+dt, geert+renesas, magnus.damm, p.zabel
  Cc: linux-rtc, linux-renesas-soc, devicetree, linux-kernel



On 11/7/25 23:07, Ovidiu Panait wrote:
> Switch from devm_reset_control_get_shared() to
> devm_reset_control_array_get_shared() when retrieving resets.
> 
> The RZ/V2H SoC requires two resets for the RTC block instead of one,
> so this will allow to handle multiple resets without additional changes.
> 
> Signed-off-by: Ovidiu Panait <ovidiu.panait.rb@renesas.com>

Reviewed-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>

> ---
>  drivers/rtc/rtc-renesas-rtca3.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/rtc/rtc-renesas-rtca3.c b/drivers/rtc/rtc-renesas-rtca3.c
> index ab816bdf0d77..3524053269ef 100644
> --- a/drivers/rtc/rtc-renesas-rtca3.c
> +++ b/drivers/rtc/rtc-renesas-rtca3.c
> @@ -726,7 +726,7 @@ static int rtca3_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	priv->rstc = devm_reset_control_get_shared(dev, NULL);
> +	priv->rstc = devm_reset_control_array_get_shared(dev);
>  	if (IS_ERR(priv->rstc))
>  		return PTR_ERR(priv->rstc);
>  


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

end of thread, other threads:[~2025-11-08  9:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-07 21:07 [PATCH v4 0/4] Add RTC support for the Renesas RZ/V2H SoC Ovidiu Panait
2025-11-07 21:07 ` [PATCH v4 1/4] dt-bindings: rtc: renesas,rz-rtca3: Add RZ/V2H support Ovidiu Panait
2025-11-07 21:07 ` [PATCH v4 2/4] rtc: renesas-rtca3: Add support for multiple reset lines Ovidiu Panait
2025-11-08  9:46   ` Claudiu Beznea
2025-11-07 21:07 ` [PATCH v4 3/4] arm64: dts: renesas: r9a09g057: Add RTC node Ovidiu Panait
2025-11-07 21:07 ` [PATCH v4 4/4] arm64: dts: renesas: r9a09g057h44-rzv2h-evk: Enable RTC Ovidiu Panait

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).