Linux-RTC Archive mirror
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Cc: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	Vladimir Zapolskiy <vz@mleia.com>, Joel Stanley <joel@jms.id.au>,
	Andrew Jeffery <andrew@codeconstruct.com.au>,
	Maxime Coquelin <mcoquelin.stm32@gmail.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-aspeed@lists.ozlabs.org,
	linux-stm32@st-md-mailman.stormreply.com
Subject: Re: [PATCH v2 2/4] dt-bindings: rtc: lpc32xx-rtc: convert to dtschema
Date: Fri, 12 Apr 2024 23:43:00 +0200	[thread overview]
Message-ID: <20240412214300a31799c2@mail.local> (raw)
In-Reply-To: <130d47d8-3294-44be-9a8c-8474d342cb12@linaro.org>

On 11/04/2024 08:17:55+0200, Krzysztof Kozlowski wrote:
> On 10/04/2024 22:43, Alexandre Belloni wrote:
> > On 10/04/2024 17:55:34+0200, Javier Carrasco wrote:
> >> Convert existing binding to dtschema to support validation.
> >>
> >> Add the undocumented 'clocks' property.
> >>
> >> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> >> ---
> >>  .../devicetree/bindings/rtc/lpc32xx-rtc.txt        | 15 --------
> >>  .../devicetree/bindings/rtc/nxp,lpc32xx-rtc.yaml   | 41 ++++++++++++++++++++++
> >>  2 files changed, 41 insertions(+), 15 deletions(-)
> >>
> >> diff --git a/Documentation/devicetree/bindings/rtc/lpc32xx-rtc.txt b/Documentation/devicetree/bindings/rtc/lpc32xx-rtc.txt
> >> deleted file mode 100644
> >> index a87a1e9bc060..000000000000
> >> --- a/Documentation/devicetree/bindings/rtc/lpc32xx-rtc.txt
> >> +++ /dev/null
> >> @@ -1,15 +0,0 @@
> >> -* NXP LPC32xx SoC Real Time Clock controller
> >> -
> >> -Required properties:
> >> -- compatible: must be "nxp,lpc3220-rtc"
> >> -- reg: physical base address of the controller and length of memory mapped
> >> -  region.
> >> -- interrupts: The RTC interrupt
> >> -
> >> -Example:
> >> -
> >> -	rtc@40024000 {
> >> -		compatible = "nxp,lpc3220-rtc";
> >> -		reg = <0x40024000 0x1000>;
> >> -		interrupts = <52 0>;
> >> -	};
> >> diff --git a/Documentation/devicetree/bindings/rtc/nxp,lpc32xx-rtc.yaml b/Documentation/devicetree/bindings/rtc/nxp,lpc32xx-rtc.yaml
> >> new file mode 100644
> >> index 000000000000..62ddeef961e9
> >> --- /dev/null
> >> +++ b/Documentation/devicetree/bindings/rtc/nxp,lpc32xx-rtc.yaml
> >> @@ -0,0 +1,41 @@
> >> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >> +%YAML 1.2
> >> +---
> >> +$id: http://devicetree.org/schemas/rtc/nxp,lpc32xx-rtc.yaml#
> >> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> >> +
> >> +title: NXP LPC32xx SoC Real Time Clock
> >> +
> >> +maintainers:
> >> +  - Javier Carrasco <javier.carrasco.cruz@gmail.com>
> >> +
> >> +allOf:
> >> +  - $ref: rtc.yaml#
> >> +
> >> +properties:
> >> +  compatible:
> >> +    const: nxp,lpc3220-rtc
> >> +
> >> +  reg:
> >> +    maxItems: 1
> >> +
> >> +  interrupts:
> >> +    maxItems: 1
> >> +
> >> +  clocks:
> >> +    maxItems: 1
> > 
> > As I explained the clock doesn't really exist, there is no control over
> > it, it is a fixed 32768 Hz crystal, there is no point in describing it
> > as this is already the input clock of the SoC.
> 
> That's common for many SoCs but it is still (at least for them) input to
> the RTC. On some SoC boards 32 kHz is controllable.
> 

There is n way this can be controlled at the board level as the soc
mandates a crystal. There is a control for the oscillator but it is not
functional. This would be bit 5 of RTC_CTRL which is documented as such:

"5 Not used. Write is don’t care, Read returns random value."

Even so, the clock wouldn't be an input to the RTC but it is provided by
the RTC.

I guess because it was easer to d so, the clock is defined in the clock
controller driver:
https://elixir.bootlin.com/linux/latest/source/drivers/clk/nxp/clk-lpc32xx.c#L1222

but, from an HW point of view, this is not correct.


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

  reply	other threads:[~2024-04-12 21:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-10 15:55 [PATCH v2 0/4] rtc: convert multiple bindings into dtschema Javier Carrasco
2024-04-10 15:55 ` [PATCH v2 1/4] dt-bindings: rtc: convert trivial devices " Javier Carrasco
2024-04-10 23:55   ` Andrew Jeffery
2024-04-10 15:55 ` [PATCH v2 2/4] dt-bindings: rtc: lpc32xx-rtc: convert to dtschema Javier Carrasco
2024-04-10 15:57   ` Krzysztof Kozlowski
2024-04-10 20:43   ` Alexandre Belloni
2024-04-10 20:56     ` Javier Carrasco
2024-04-11  6:17     ` Krzysztof Kozlowski
2024-04-12 21:43       ` Alexandre Belloni [this message]
2024-04-10 15:55 ` [PATCH v2 3/4] dt-bindings: rtc: pxa-rtc: " Javier Carrasco
2024-04-10 15:55 ` [PATCH v2 4/4] dt-bindings: rtc: stmp3xxx-rtc: " Javier Carrasco
2024-04-10 15:58   ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240412214300a31799c2@mail.local \
    --to=alexandre.belloni@bootlin.com \
    --cc=alexandre.torgue@foss.st.com \
    --cc=andrew@codeconstruct.com.au \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=joel@jms.id.au \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=krzysztof.kozlowski@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-aspeed@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=robh@kernel.org \
    --cc=vz@mleia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 read-only IMAP folder(s) and NNTP newsgroup(s).