linux-rtc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Sergiu.Moga@microchip.com>
To: <krzysztof.kozlowski@canonical.com>, <a.zummo@towertech.it>,
	<alexandre.belloni@bootlin.com>, <robh+dt@kernel.org>,
	<Nicolas.Ferre@microchip.com>, <Ludovic.Desroches@microchip.com>
Cc: <linux-rtc@vger.kernel.org>, <devicetree@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
Date: Thu, 17 Feb 2022 12:05:15 +0000	[thread overview]
Message-ID: <ab656974-4262-0f7c-4aa1-e00b8008f888@microchip.com> (raw)
In-Reply-To: <21ce5bf5-1e69-4112-8322-e65c8bccb353@canonical.com>

Hello,

On 15.02.2022 19:23, Krzysztof Kozlowski wrote:
> On 15/02/2022 15:46, Sergiu Moga wrote:
>> Convert RTC binding for Atmel/Microchip SoCs to Device Tree Schema
>> format.
>>
>> Signed-off-by: Sergiu Moga <sergiu.moga@microchip.com>
>> ---
>>   .../bindings/rtc/atmel,at91sam9-rtc.txt       | 25 --------
>>   .../bindings/rtc/atmel,at91sam9-rtc.yaml      | 61 +++++++++++++++++++
>>   2 files changed, 61 insertions(+), 25 deletions(-)
>>   delete mode 100644 Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.txt
>>   create mode 100644 Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.txt b/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.txt
>> deleted file mode 100644
>> index 3f0e2a5950eb..000000000000
>> --- a/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.txt
>> +++ /dev/null
>> @@ -1,25 +0,0 @@
>> -Atmel AT91SAM9260 Real Time Timer
>> -
>> -Required properties:
>> -- compatible: should be one of the following:
>> -     - "atmel,at91sam9260-rtt"
>> -     - "microchip,sam9x60-rtt", "atmel,at91sam9260-rtt"
>> -- reg: should encode the memory region of the RTT controller
>> -- interrupts: rtt alarm/event interrupt
>> -- clocks: should contain the 32 KHz slow clk that will drive the RTT block.
>> -- atmel,rtt-rtc-time-reg: should encode the GPBR register used to store
>> -     the time base when the RTT is used as an RTC.
>> -     The first cell should point to the GPBR node and the second one
>> -     encode the offset within the GPBR block (or in other words, the
>> -     GPBR register used to store the time base).
>> -
>> -
>> -Example:
>> -
>> -rtt@fffffd20 {
>> -     compatible = "atmel,at91sam9260-rtt";
>> -     reg = <0xfffffd20 0x10>;
>> -     interrupts = <1 4 7>;
>> -     clocks = <&clk32k>;
>> -     atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
>> -};
>> diff --git a/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml b/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
>> new file mode 100644
>> index 000000000000..c78a8c1c9314
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
>> @@ -0,0 +1,61 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +# Copyright (C) 2022 Microchip Technology, Inc. and its subsidiaries
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/rtc/atmel,at91sam9-rtc.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Atmel AT91 RTT Device Tree Bindings
>> +
>> +allOf:
>> +  - $ref: "rtc.yaml#"
>> +
>> +maintainers:
>> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
>> +
>> +properties:
>> +  compatible:
>> +    oneOf:
>> +      - items:
>> +        - const: atmel,at91sam9260-rtt
>> +      - items:
>> +        - const: microchip,sam9x60-rtt
>> +        - const: atmel,at91sam9260-rtt
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  interrupts:
>> +    maxItems: 1
>> +
>> +  clocks:
>> +    maxItems: 1
>> +
>> +  atmel,rtt-rtc-time-reg:
>> +    $ref: /schemas/types.yaml#/definitions/uint32-array
>> +    description: |
>> +      Should encode the GPBR register used to store the time base when the
>> +      RTT is used as an RTC. The first cell should point to the GPBR node
>> +      and the second one encodes the offset within the GPBR block (or in
>> +      other words, the GPBR register used to store the time base).
> The first cell points to a phandle, so this does not look like
> uint32-array. I think this matches something like syscon. Look for
> example at samsung,sysreg:
> Documentation/devicetree/bindings/soc/samsung/exynos-usi.yaml
>
Thank you. I will correct this in the next version of the patch.

>> +    items:
>> +      maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - interrupts
>> +  - clocks
>> +  - atmel,rtt-rtc-time-reg
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    rtt@fffffd20 {
> Is it a timer or a clock? If more like a RTC, then the node name should
> be "rtc".
>
> rtc.yaml requires this, so it looks like you did not test the bindings
> at all?
>
My apologies, it seems that, by mistake, I used the wrong file for DT_SCHEMA_FILES when testing and thus I did not see any warnings or errors. I will correct this in the next patch.
In order for this to work correctly, the next patch series will also include some changes to other "dtsi" files (such as "arch/arm/boot/dts/sama7g5.dtsi" and "arch/arm/boot/dts/sam9x60.dtsi") that use "rtt" instead of "rtc" for their node names.

>> +        compatible = "atmel,at91sam9260-rtt";
>> +        reg = <0xfffffd20 0x10>;
>> +        interrupts = <1 4 7>;
>> +        clocks = <&clk32k>;
>> +        atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
>> +    };
>
> Best regards,
> Krzysztof


Thank you for the feedback.

Sergiu


  reply	other threads:[~2022-02-17 12:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-15 14:46 [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema Sergiu Moga
2022-02-15 15:27 ` Alexandre Belloni
2022-02-17 12:00   ` Sergiu.Moga
2022-02-15 17:23 ` Krzysztof Kozlowski
2022-02-17 12:05   ` Sergiu.Moga [this message]
2022-02-16 22:51 ` Rob Herring
2022-02-17 12:08   ` Sergiu.Moga

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=ab656974-4262-0f7c-4aa1-e00b8008f888@microchip.com \
    --to=sergiu.moga@microchip.com \
    --cc=Ludovic.Desroches@microchip.com \
    --cc=Nicolas.Ferre@microchip.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /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 NNTP newsgroup(s).