Linux Renesas SOC kernel development
 help / color / mirror / Atom feed
* [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement
@ 2026-09-16 10:25 Wolfram Sang
  2026-09-16 10:25 ` [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 10:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Lad Prabhakar, Wolfram Sang, Alexandre Belloni, Conor Dooley,
	devicetree, Geert Uytterhoeven, Krzysztof Kozlowski, linux-rtc,
	Magnus Damm, Miquel Raynal, Rob Herring

This series adds RTC support for the Renesas R-Car Gen5 SoCs.

Changes since v1:
* don't support non-interrupt mode in general, but implement it only for
  X5H while still requiring irqs for all other SoCs
* add tags to cleanup patches

Thanks for all the reviews of v1!

These patches have been tested on the original RZ/N1D board and the new
X5H Ironhide board. 'rtctest' passed on both SoCs. On X5H, some tests
are skipped, of course, because no alarms are supported.

'dt_binding_check' and 'dtbs_check' did not find any issues, for both,
RZ/N1D and R-Car X5H. I also verified for both that it rightfully
complains when irqs are different from what is expected.

A branch can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/x5h/rtc-experimental

Looking forward to comments.


Wolfram Sang (4):
  dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example
  dt-bindings: rtc: rzn1: add SoC names next to their IDs
  dt-bindings: rtc: rzn1: add R-Car Gen5 support
  rtc: rzn1: add R-Car Gen5 support

 .../bindings/rtc/renesas,rzn1-rtc.yaml        | 33 +++++++++---
 drivers/rtc/rtc-rzn1.c                        | 54 ++++++++++++-------
 2 files changed, 61 insertions(+), 26 deletions(-)

-- 
2.53.0


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

* [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example
  2026-09-16 10:25 [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
@ 2026-09-16 10:25 ` Wolfram Sang
  2026-09-16 13:23   ` Geert Uytterhoeven
  2026-09-16 10:25 ` [PATCH v2 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs Wolfram Sang
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 10:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Lad Prabhakar, Wolfram Sang, Lad Prabhakar, Conor Dooley,
	Miquel Raynal, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, linux-rtc, devicetree

We don't use 'start-year' in upstream DTs because the driver does the
right thing by default, ranging from 2000 to 2099. So, drop it from the
example, too.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
 Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
index ea7b039a91e7..e96007981c34 100644
--- a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
@@ -91,5 +91,4 @@ examples:
         clocks = <&sysctrl R9A06G032_HCLK_RTC>;
         clock-names = "hclk";
         power-domains = <&sysctrl>;
-        start-year = <2000>;
     };
-- 
2.53.0


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

* [PATCH v2 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs
  2026-09-16 10:25 [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
  2026-09-16 10:25 ` [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
@ 2026-09-16 10:25 ` Wolfram Sang
  2026-09-16 13:24   ` Geert Uytterhoeven
  2026-09-16 10:25 ` [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support Wolfram Sang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 10:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Lad Prabhakar, Wolfram Sang, Lad Prabhakar, Conor Dooley,
	Miquel Raynal, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, linux-rtc, devicetree

This helps maintaining because the numbers are easy to confuse.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
---
 .../devicetree/bindings/rtc/renesas,rzn1-rtc.yaml      | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
index e96007981c34..7ea77cd0bee1 100644
--- a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
@@ -14,14 +14,14 @@ properties:
     oneOf:
       - items:
           - enum:
-              - renesas,r9a06g032-rtc
-          - const: renesas,rzn1-rtc
+              - renesas,r9a06g032-rtc # RZ/N1D
+          - const: renesas,rzn1-rtc   # RZ/N1
 
-      - const: renesas,r9a09g077-rtc
+      - const: renesas,r9a09g077-rtc  # RZ/T2H
 
       - items:
-          - const: renesas,r9a09g087-rtc
-          - const: renesas,r9a09g077-rtc
+          - const: renesas,r9a09g087-rtc  # RZ/N2H
+          - const: renesas,r9a09g077-rtc  # RZ/T2H
 
   reg:
     maxItems: 1
-- 
2.53.0


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

* [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
  2026-09-16 10:25 ` [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
  2026-09-16 10:25 ` [PATCH v2 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs Wolfram Sang
@ 2026-09-16 10:25 ` Wolfram Sang
  2026-09-16 12:13   ` Lad, Prabhakar
                     ` (2 more replies)
  2026-09-16 10:25 ` [PATCH v2 4/4] " Wolfram Sang
  2026-09-16 11:45 ` [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
  4 siblings, 3 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 10:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Lad Prabhakar, Wolfram Sang, Miquel Raynal, Alexandre Belloni,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Geert Uytterhoeven, Magnus Damm, linux-rtc, devicetree

In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
exception, though, because interrupts are not wired. X5H2 will have them
wired again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 .../bindings/rtc/renesas,rzn1-rtc.yaml        | 22 +++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
index 7ea77cd0bee1..186d0076590c 100644
--- a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
@@ -23,6 +23,11 @@ properties:
           - const: renesas,r9a09g087-rtc  # RZ/N2H
           - const: renesas,r9a09g077-rtc  # RZ/T2H
 
+      - items:
+          - enum:
+              - renesas,r8a78000-rtc      # R-Car X5H
+          - const: renesas,rcar-gen5-rtc  # R-Car Gen5
+
   reg:
     maxItems: 1
 
@@ -52,8 +57,6 @@ properties:
 required:
   - compatible
   - reg
-  - interrupts
-  - interrupt-names
   - clocks
   - clock-names
   - power-domains
@@ -68,6 +71,7 @@ allOf:
             enum:
               - renesas,r9a09g077-rtc
               - renesas,r9a09g087-rtc
+              - renesas,rcar-gen5-rtc
     then:
       properties:
         clocks:
@@ -75,6 +79,20 @@ allOf:
         clock-names:
           minItems: 2
 
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: renesas,r8a78000-rtc
+    then:
+      properties:
+        interrupts: false
+        interrupt-names: false
+    else:
+      required:
+        - interrupts
+        - interrupt-names
+
 unevaluatedProperties: false
 
 examples:
-- 
2.53.0


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

* [PATCH v2 4/4] rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
                   ` (2 preceding siblings ...)
  2026-09-16 10:25 ` [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support Wolfram Sang
@ 2026-09-16 10:25 ` Wolfram Sang
  2026-09-16 12:19   ` Lad, Prabhakar
  2026-09-16 13:33   ` Geert Uytterhoeven
  2026-09-16 11:45 ` [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
  4 siblings, 2 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 10:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Lad Prabhakar, Wolfram Sang, Miquel Raynal, Alexandre Belloni,
	Geert Uytterhoeven, Magnus Damm, linux-rtc

In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
exception, though, because interrupts are not wired. X5H2 will have them
wired again. So, skip alarm setup for the X5H case.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 drivers/rtc/rtc-rzn1.c | 54 ++++++++++++++++++++++++++++--------------
 1 file changed, 36 insertions(+), 18 deletions(-)

diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
index b9d69ebdd224..349288a07632 100644
--- a/drivers/rtc/rtc-rzn1.c
+++ b/drivers/rtc/rtc-rzn1.c
@@ -68,6 +68,7 @@
 
 struct rzn1_rtc_data {
 	bool has_subu;
+	bool broken_irqs;
 };
 
 struct rzn1_rtc {
@@ -396,6 +397,11 @@ static const struct rtc_class_ops rzn1_rtc_ops_scmp = {
 	.alarm_irq_enable = rzn1_rtc_alarm_irq_enable,
 };
 
+static const struct rtc_class_ops rzn1_rtc_ops_scmp_no_alarm = {
+	.read_time = rzn1_rtc_read_time,
+	.set_time = rzn1_rtc_set_time,
+};
+
 static void rzn1_rtc_disable_hardware(void *data)
 {
 	struct device *dev = data;
@@ -431,10 +437,6 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
 	if (IS_ERR(rtc->base))
 		return dev_err_probe(dev, PTR_ERR(rtc->base), "Missing reg\n");
 
-	irq = platform_get_irq_byname(pdev, "alarm");
-	if (irq < 0)
-		return irq;
-
 	rtc->rtcdev = devm_rtc_allocate_device(dev);
 	if (IS_ERR(rtc->rtcdev))
 		return PTR_ERR(rtc->rtcdev);
@@ -503,25 +505,39 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
 
 	spin_lock_init(&rtc->ctl1_access_lock);
 
-	ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
-	if (ret)
-		return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
-
-	irq = platform_get_irq_byname_optional(pdev, "pps");
-	if (irq == -EPROBE_DEFER)
-		return irq;
-	if (irq >= 0)
-		ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
-
-	if (irq < 0 || ret) {
-		set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
-		clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
-		dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
+	if (data->broken_irqs) {
+		/* All known broken irqs are on SCMP only variants */
+		rtc->rtcdev->ops = &rzn1_rtc_ops_scmp_no_alarm;
+	} else {
+		irq = platform_get_irq_byname(pdev, "alarm");
+		if (irq < 0)
+			return irq;
+
+		ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
+		if (ret)
+			return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
+
+		irq = platform_get_irq_byname_optional(pdev, "pps");
+		if (irq == -EPROBE_DEFER)
+			return irq;
+		if (irq >= 0)
+			ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
+
+		if (irq < 0 || ret) {
+			set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
+			clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
+			dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
+		}
 	}
 
 	return devm_rtc_register_device(rtc->rtcdev);
 }
 
+static const struct rzn1_rtc_data rzn1_rtc_r8a78000_data = {
+	.has_subu = false,
+	.broken_irqs = true,
+};
+
 static const struct rzn1_rtc_data rzn1_rtc_rzt2h_data = {
 	.has_subu = false,
 };
@@ -531,7 +547,9 @@ static const struct rzn1_rtc_data rzn1_rtc_rzn1_data = {
 };
 
 static const struct of_device_id rzn1_rtc_of_match[] = {
+	{ .compatible	= "renesas,r8a78000-rtc", .data = &rzn1_rtc_r8a78000_data },
 	{ .compatible	= "renesas,r9a09g077-rtc", .data = &rzn1_rtc_rzt2h_data },
+	{ .compatible	= "renesas,rcar-gen5-rtc", .data = &rzn1_rtc_rzt2h_data },
 	{ .compatible	= "renesas,rzn1-rtc", .data = &rzn1_rtc_rzn1_data },
 	{ /* sentinel */ }
 };
-- 
2.53.0


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

* Re: [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement
  2026-09-16 10:25 [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
                   ` (3 preceding siblings ...)
  2026-09-16 10:25 ` [PATCH v2 4/4] " Wolfram Sang
@ 2026-09-16 11:45 ` Wolfram Sang
  4 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 11:45 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Lad Prabhakar, Alexandre Belloni, Conor Dooley, devicetree,
	Geert Uytterhoeven, Krzysztof Kozlowski, linux-rtc, Magnus Damm,
	Miquel Raynal, Rob Herring

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

> Looking forward to comments.

Wow, Sashiko is happy and did not find any pre-existing issues? I am
amazed...

Anyhow, I wanted to repeat my thanks to previous reviewers. I think this
outcome is in deed cleaner and easier to understand / maintain.


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

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

* Re: [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 ` [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support Wolfram Sang
@ 2026-09-16 12:13   ` Lad, Prabhakar
  2026-09-16 13:25   ` Geert Uytterhoeven
  2026-09-24 21:51   ` Rob Herring (Arm)
  2 siblings, 0 replies; 14+ messages in thread
From: Lad, Prabhakar @ 2026-09-16 12:13 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Miquel Raynal, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Magnus Damm, linux-rtc, devicetree

On Wed, Sep 16, 2026 at 11:25 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
> exception, though, because interrupts are not wired. X5H2 will have them
> wired again.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  .../bindings/rtc/renesas,rzn1-rtc.yaml        | 22 +++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> diff --git a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
> index 7ea77cd0bee1..186d0076590c 100644
> --- a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
> +++ b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
> @@ -23,6 +23,11 @@ properties:
>            - const: renesas,r9a09g087-rtc  # RZ/N2H
>            - const: renesas,r9a09g077-rtc  # RZ/T2H
>
> +      - items:
> +          - enum:
> +              - renesas,r8a78000-rtc      # R-Car X5H
> +          - const: renesas,rcar-gen5-rtc  # R-Car Gen5
> +
>    reg:
>      maxItems: 1
>
> @@ -52,8 +57,6 @@ properties:
>  required:
>    - compatible
>    - reg
> -  - interrupts
> -  - interrupt-names
>    - clocks
>    - clock-names
>    - power-domains
> @@ -68,6 +71,7 @@ allOf:
>              enum:
>                - renesas,r9a09g077-rtc
>                - renesas,r9a09g087-rtc
> +              - renesas,rcar-gen5-rtc
>      then:
>        properties:
>          clocks:
> @@ -75,6 +79,20 @@ allOf:
>          clock-names:
>            minItems: 2
>
> +  - if:
> +      properties:
> +        compatible:
> +          contains:
> +            const: renesas,r8a78000-rtc
> +    then:
> +      properties:
> +        interrupts: false
> +        interrupt-names: false
> +    else:
> +      required:
> +        - interrupts
> +        - interrupt-names
> +
>  unevaluatedProperties: false
>
>  examples:
> --
> 2.53.0
>

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

* Re: [PATCH v2 4/4] rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 ` [PATCH v2 4/4] " Wolfram Sang
@ 2026-09-16 12:19   ` Lad, Prabhakar
  2026-09-16 13:33   ` Geert Uytterhoeven
  1 sibling, 0 replies; 14+ messages in thread
From: Lad, Prabhakar @ 2026-09-16 12:19 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Miquel Raynal, Alexandre Belloni,
	Geert Uytterhoeven, Magnus Damm, linux-rtc

On Wed, Sep 16, 2026 at 11:25 AM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
>
> In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
> exception, though, because interrupts are not wired. X5H2 will have them
> wired again. So, skip alarm setup for the X5H case.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  drivers/rtc/rtc-rzn1.c | 54 ++++++++++++++++++++++++++++--------------
>  1 file changed, 36 insertions(+), 18 deletions(-)
>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Cheers,
Prabhakar

> diff --git a/drivers/rtc/rtc-rzn1.c b/drivers/rtc/rtc-rzn1.c
> index b9d69ebdd224..349288a07632 100644
> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c
> @@ -68,6 +68,7 @@
>
>  struct rzn1_rtc_data {
>         bool has_subu;
> +       bool broken_irqs;
>  };
>
>  struct rzn1_rtc {
> @@ -396,6 +397,11 @@ static const struct rtc_class_ops rzn1_rtc_ops_scmp = {
>         .alarm_irq_enable = rzn1_rtc_alarm_irq_enable,
>  };
>
> +static const struct rtc_class_ops rzn1_rtc_ops_scmp_no_alarm = {
> +       .read_time = rzn1_rtc_read_time,
> +       .set_time = rzn1_rtc_set_time,
> +};
> +
>  static void rzn1_rtc_disable_hardware(void *data)
>  {
>         struct device *dev = data;
> @@ -431,10 +437,6 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>         if (IS_ERR(rtc->base))
>                 return dev_err_probe(dev, PTR_ERR(rtc->base), "Missing reg\n");
>
> -       irq = platform_get_irq_byname(pdev, "alarm");
> -       if (irq < 0)
> -               return irq;
> -
>         rtc->rtcdev = devm_rtc_allocate_device(dev);
>         if (IS_ERR(rtc->rtcdev))
>                 return PTR_ERR(rtc->rtcdev);
> @@ -503,25 +505,39 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>
>         spin_lock_init(&rtc->ctl1_access_lock);
>
> -       ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
> -       if (ret)
> -               return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
> -
> -       irq = platform_get_irq_byname_optional(pdev, "pps");
> -       if (irq == -EPROBE_DEFER)
> -               return irq;
> -       if (irq >= 0)
> -               ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
> -
> -       if (irq < 0 || ret) {
> -               set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> -               clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
> -               dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
> +       if (data->broken_irqs) {
> +               /* All known broken irqs are on SCMP only variants */
> +               rtc->rtcdev->ops = &rzn1_rtc_ops_scmp_no_alarm;
> +       } else {
> +               irq = platform_get_irq_byname(pdev, "alarm");
> +               if (irq < 0)
> +                       return irq;
> +
> +               ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
> +               if (ret)
> +                       return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
> +
> +               irq = platform_get_irq_byname_optional(pdev, "pps");
> +               if (irq == -EPROBE_DEFER)
> +                       return irq;
> +               if (irq >= 0)
> +                       ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
> +
> +               if (irq < 0 || ret) {
> +                       set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> +                       clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
> +                       dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
> +               }
>         }
>
>         return devm_rtc_register_device(rtc->rtcdev);
>  }
>
> +static const struct rzn1_rtc_data rzn1_rtc_r8a78000_data = {
> +       .has_subu = false,
> +       .broken_irqs = true,
> +};
> +
>  static const struct rzn1_rtc_data rzn1_rtc_rzt2h_data = {
>         .has_subu = false,
>  };
> @@ -531,7 +547,9 @@ static const struct rzn1_rtc_data rzn1_rtc_rzn1_data = {
>  };
>
>  static const struct of_device_id rzn1_rtc_of_match[] = {
> +       { .compatible   = "renesas,r8a78000-rtc", .data = &rzn1_rtc_r8a78000_data },
>         { .compatible   = "renesas,r9a09g077-rtc", .data = &rzn1_rtc_rzt2h_data },
> +       { .compatible   = "renesas,rcar-gen5-rtc", .data = &rzn1_rtc_rzt2h_data },
>         { .compatible   = "renesas,rzn1-rtc", .data = &rzn1_rtc_rzn1_data },
>         { /* sentinel */ }
>  };
> --
> 2.53.0
>

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

* Re: [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example
  2026-09-16 10:25 ` [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
@ 2026-09-16 13:23   ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2026-09-16 13:23 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Lad Prabhakar, Lad Prabhakar, Conor Dooley,
	Miquel Raynal, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-rtc,
	devicetree

On Wed, 16 Sept 2026 at 12:25, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> We don't use 'start-year' in upstream DTs because the driver does the
> right thing by default, ranging from 2000 to 2099. So, drop it from the
> example, too.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

* Re: [PATCH v2 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs
  2026-09-16 10:25 ` [PATCH v2 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs Wolfram Sang
@ 2026-09-16 13:24   ` Geert Uytterhoeven
  0 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2026-09-16 13:24 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Lad Prabhakar, Lad Prabhakar, Conor Dooley,
	Miquel Raynal, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-rtc,
	devicetree

On Wed, 16 Sept 2026 at 12:25, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> This helps maintaining because the numbers are easy to confuse.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Acked-by: Conor Dooley <conor.dooley@microchip.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

* Re: [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 ` [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support Wolfram Sang
  2026-09-16 12:13   ` Lad, Prabhakar
@ 2026-09-16 13:25   ` Geert Uytterhoeven
  2026-09-24 21:51   ` Rob Herring (Arm)
  2 siblings, 0 replies; 14+ messages in thread
From: Geert Uytterhoeven @ 2026-09-16 13:25 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Lad Prabhakar, Miquel Raynal,
	Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Magnus Damm, linux-rtc, devicetree

On Wed, 16 Sept 2026 at 12:25, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
> exception, though, because interrupts are not wired. X5H2 will have them
> wired again.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

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

* Re: [PATCH v2 4/4] rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 ` [PATCH v2 4/4] " Wolfram Sang
  2026-09-16 12:19   ` Lad, Prabhakar
@ 2026-09-16 13:33   ` Geert Uytterhoeven
  2026-09-16 21:36     ` Wolfram Sang
  1 sibling, 1 reply; 14+ messages in thread
From: Geert Uytterhoeven @ 2026-09-16 13:33 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-renesas-soc, Lad Prabhakar, Miquel Raynal,
	Alexandre Belloni, Magnus Damm, linux-rtc

Hi Wolfram,

On Wed, 16 Sept 2026 at 12:25, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
> exception, though, because interrupts are not wired. X5H2 will have them
> wired again. So, skip alarm setup for the X5H case.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Thanks for your patch!

> --- a/drivers/rtc/rtc-rzn1.c
> +++ b/drivers/rtc/rtc-rzn1.c

> @@ -503,25 +505,39 @@ static int rzn1_rtc_probe(struct platform_device *pdev)
>
>         spin_lock_init(&rtc->ctl1_access_lock);
>
> -       ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
> -       if (ret)
> -               return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
> -
> -       irq = platform_get_irq_byname_optional(pdev, "pps");
> -       if (irq == -EPROBE_DEFER)
> -               return irq;
> -       if (irq >= 0)
> -               ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
> -
> -       if (irq < 0 || ret) {
> -               set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> -               clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
> -               dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
> +       if (data->broken_irqs) {
> +               /* All known broken irqs are on SCMP only variants */
> +               rtc->rtcdev->ops = &rzn1_rtc_ops_scmp_no_alarm;
> +       } else {
> +               irq = platform_get_irq_byname(pdev, "alarm");
> +               if (irq < 0)
> +                       return irq;

As the DT bindings declare "renesas,r8a78000-rtc" to be compatible with
"renesas,rcar-gen5-rtc" (which does not set the broken_irqs flag),
a missing interrupt must not be fatal?

> +
> +               ret = devm_request_irq(dev, irq, rzn1_rtc_alarm_irq, 0, "RZN1 RTC Alarm", rtc);
> +               if (ret)
> +                       return dev_err_probe(dev, ret, "RTC alarm interrupt not available\n");
> +
> +               irq = platform_get_irq_byname_optional(pdev, "pps");
> +               if (irq == -EPROBE_DEFER)
> +                       return irq;
> +               if (irq >= 0)
> +                       ret = devm_request_irq(dev, irq, rzn1_rtc_1s_irq, 0, "RZN1 RTC 1s", rtc);
> +
> +               if (irq < 0 || ret) {
> +                       set_bit(RTC_FEATURE_ALARM_RES_MINUTE, rtc->rtcdev->features);
> +                       clear_bit(RTC_FEATURE_UPDATE_INTERRUPT, rtc->rtcdev->features);
> +                       dev_warn(dev, "RTC pps interrupt not available. Alarm has only minute accuracy\n");
> +               }
>         }
>
>         return devm_rtc_register_device(rtc->rtcdev);
>  }
>
> +static const struct rzn1_rtc_data rzn1_rtc_r8a78000_data = {
> +       .has_subu = false,
> +       .broken_irqs = true,
> +};
> +
>  static const struct rzn1_rtc_data rzn1_rtc_rzt2h_data = {
>         .has_subu = false,
>  };
> @@ -531,7 +547,9 @@ static const struct rzn1_rtc_data rzn1_rtc_rzn1_data = {
>  };
>
>  static const struct of_device_id rzn1_rtc_of_match[] = {
> +       { .compatible   = "renesas,r8a78000-rtc", .data = &rzn1_rtc_r8a78000_data },
>         { .compatible   = "renesas,r9a09g077-rtc", .data = &rzn1_rtc_rzt2h_data },
> +       { .compatible   = "renesas,rcar-gen5-rtc", .data = &rzn1_rtc_rzt2h_data },
>         { .compatible   = "renesas,rzn1-rtc", .data = &rzn1_rtc_rzn1_data },
>         { /* sentinel */ }
>  };

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

* Re: [PATCH v2 4/4] rtc: rzn1: add R-Car Gen5 support
  2026-09-16 13:33   ` Geert Uytterhoeven
@ 2026-09-16 21:36     ` Wolfram Sang
  0 siblings, 0 replies; 14+ messages in thread
From: Wolfram Sang @ 2026-09-16 21:36 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-renesas-soc, Lad Prabhakar, Miquel Raynal,
	Alexandre Belloni, Magnus Damm, linux-rtc

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


> As the DT bindings declare "renesas,r8a78000-rtc" to be compatible with
> "renesas,rcar-gen5-rtc" (which does not set the broken_irqs flag),
> a missing interrupt must not be fatal?

Okay, I'll remove compatibility of r8a78000 with generic Gen5 then.


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

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

* Re: [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support
  2026-09-16 10:25 ` [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support Wolfram Sang
  2026-09-16 12:13   ` Lad, Prabhakar
  2026-09-16 13:25   ` Geert Uytterhoeven
@ 2026-09-24 21:51   ` Rob Herring (Arm)
  2 siblings, 0 replies; 14+ messages in thread
From: Rob Herring (Arm) @ 2026-09-24 21:51 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: Magnus Damm, Krzysztof Kozlowski, Miquel Raynal,
	Geert Uytterhoeven, linux-rtc, Conor Dooley, devicetree,
	Alexandre Belloni, Lad Prabhakar, linux-renesas-soc


On Wed, 16 Sep 2026 12:25:18 +0200, Wolfram Sang wrote:
> In general, the RTC on R-Car Gen5 is identical to RZ/T2H. X5H is an
> exception, though, because interrupts are not wired. X5H2 will have them
> wired again.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>  .../bindings/rtc/renesas,rzn1-rtc.yaml        | 22 +++++++++++++++++--
>  1 file changed, 20 insertions(+), 2 deletions(-)
> 

Acked-by: Rob Herring (Arm) <robh@kernel.org>


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

end of thread, other threads:[~2026-09-24 21:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-16 10:25 [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang
2026-09-16 10:25 ` [PATCH v2 1/4] dt-bindings: rtc: rzn1: drop unneeded 'start-year' from example Wolfram Sang
2026-09-16 13:23   ` Geert Uytterhoeven
2026-09-16 10:25 ` [PATCH v2 2/4] dt-bindings: rtc: rzn1: add SoC names next to their IDs Wolfram Sang
2026-09-16 13:24   ` Geert Uytterhoeven
2026-09-16 10:25 ` [PATCH v2 3/4] dt-bindings: rtc: rzn1: add R-Car Gen5 support Wolfram Sang
2026-09-16 12:13   ` Lad, Prabhakar
2026-09-16 13:25   ` Geert Uytterhoeven
2026-09-24 21:51   ` Rob Herring (Arm)
2026-09-16 10:25 ` [PATCH v2 4/4] " Wolfram Sang
2026-09-16 12:19   ` Lad, Prabhakar
2026-09-16 13:33   ` Geert Uytterhoeven
2026-09-16 21:36     ` Wolfram Sang
2026-09-16 11:45 ` [PATCH v2 0/4] rtc: rzn1: cleanups, R-Car Gen5 enablement Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox