devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method
@ 2025-05-26  9:58 Wolfram Sang
  2025-05-26  9:58 ` [PATCH v3 1/3] dt-bindings: rtc: rzn1: add optional second clock Wolfram Sang
  2025-06-01 21:59 ` [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2025-05-26  9:58 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Alexandre Belloni, Conor Dooley, devicetree,
	Geert Uytterhoeven, Krzysztof Kozlowski, linux-rtc, Magnus Damm,
	Miquel Raynal, Rob Herring

So far, the code and the binding for the RZ/N1D RTC assumed an input
clock of 32768Hz, so it was not explicitly described. It makes sense to
do this, though. For one reason, clocks with other frequencies might be
used. This RTC supports that via the SCMP counting method. The other
reason is, upcoming SoCs may have only the SCMP method described, so we
need to use it there later.

This series lets the driver handle the optional "xtal" clock and switch
to the SCMP method if suitable. It has been tested on a Renesas RZ/N1D
board with hacked devicetree values.

A branch with updated DTs can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/n1d/enablement

Looking forward to comments!

Changes since v2:
* don't modify the rtc_ops struct, but have two distinct ones which can
  now be const again (Thanks Miquel, I like it better, too)
* added tag from Miquel (Thanks again)


Wolfram Sang (3):
  dt-bindings: rtc: rzn1: add optional second clock
  rtc: rzn1: Disable controller before initialization
  rtc: rzn1: support input frequencies other than 32768Hz

 .../bindings/rtc/renesas,rzn1-rtc.yaml        |  8 ++-
 drivers/rtc/rtc-rzn1.c                        | 66 +++++++++++++++----
 2 files changed, 61 insertions(+), 13 deletions(-)

-- 
2.47.2


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

* [PATCH v3 1/3] dt-bindings: rtc: rzn1: add optional second clock
  2025-05-26  9:58 [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method Wolfram Sang
@ 2025-05-26  9:58 ` Wolfram Sang
  2025-06-01 21:59 ` [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Wolfram Sang @ 2025-05-26  9:58 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: Wolfram Sang, Krzysztof Kozlowski, Geert Uytterhoeven,
	Miquel Raynal, Alexandre Belloni, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Magnus Damm, linux-rtc,
	devicetree

The external crystal can be a second clock input. It is needed for the
SCMP counting method which allows using crystals different than 32768Hz.
It is also needed for an upcoming SoC which only supports the SCMP
method.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 .../devicetree/bindings/rtc/renesas,rzn1-rtc.yaml         | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
index f6e0c613af67..f6fdcc7090b6 100644
--- a/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
+++ b/Documentation/devicetree/bindings/rtc/renesas,rzn1-rtc.yaml
@@ -33,10 +33,14 @@ properties:
       - const: pps
 
   clocks:
-    maxItems: 1
+    minItems: 1
+    maxItems: 2
 
   clock-names:
-    const: hclk
+    minItems: 1
+    items:
+      - const: hclk
+      - const: xtal
 
   power-domains:
     maxItems: 1
-- 
2.47.2


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

* Re: [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method
  2025-05-26  9:58 [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method Wolfram Sang
  2025-05-26  9:58 ` [PATCH v3 1/3] dt-bindings: rtc: rzn1: add optional second clock Wolfram Sang
@ 2025-06-01 21:59 ` Alexandre Belloni
  1 sibling, 0 replies; 3+ messages in thread
From: Alexandre Belloni @ 2025-06-01 21:59 UTC (permalink / raw)
  To: linux-renesas-soc, Wolfram Sang
  Cc: Conor Dooley, devicetree, Geert Uytterhoeven, Krzysztof Kozlowski,
	linux-rtc, Magnus Damm, Miquel Raynal, Rob Herring

On Mon, 26 May 2025 11:58:01 +0200, Wolfram Sang wrote:
> So far, the code and the binding for the RZ/N1D RTC assumed an input
> clock of 32768Hz, so it was not explicitly described. It makes sense to
> do this, though. For one reason, clocks with other frequencies might be
> used. This RTC supports that via the SCMP counting method. The other
> reason is, upcoming SoCs may have only the SCMP method described, so we
> need to use it there later.
> 
> [...]

Applied, thanks!

[1/3] dt-bindings: rtc: rzn1: add optional second clock
      https://git.kernel.org/abelloni/c/ae95a7e32140
[2/3] rtc: rzn1: Disable controller before initialization
      https://git.kernel.org/abelloni/c/a50f00cb87b1
[3/3] rtc: rzn1: support input frequencies other than 32768Hz
      https://git.kernel.org/abelloni/c/f096bdbf08c9

Best regards,

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2025-06-01 21:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-26  9:58 [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method Wolfram Sang
2025-05-26  9:58 ` [PATCH v3 1/3] dt-bindings: rtc: rzn1: add optional second clock Wolfram Sang
2025-06-01 21:59 ` [PATCH v3 0/3] rtc: rzn1: support XTAL clk and SCMP method Alexandre Belloni

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).