* [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
@ 2022-02-15 14:46 Sergiu Moga
2022-02-15 15:27 ` Alexandre Belloni
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Sergiu Moga @ 2022-02-15 14:46 UTC (permalink / raw)
To: a.zummo, alexandre.belloni, robh+dt, nicolas.ferre, ludovic.desroches
Cc: linux-rtc, devicetree, linux-arm-kernel, linux-kernel, Sergiu Moga
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).
+ items:
+ maxItems: 1
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - clocks
+ - atmel,rtt-rtc-time-reg
+
+additionalProperties: false
+
+examples:
+ - |
+ rtt@fffffd20 {
+ compatible = "atmel,at91sam9260-rtt";
+ reg = <0xfffffd20 0x10>;
+ interrupts = <1 4 7>;
+ clocks = <&clk32k>;
+ atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
+ };
--
2.25.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
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-16 22:51 ` Rob Herring
2 siblings, 1 reply; 7+ messages in thread
From: Alexandre Belloni @ 2022-02-15 15:27 UTC (permalink / raw)
To: Sergiu Moga
Cc: a.zummo, robh+dt, nicolas.ferre, ludovic.desroches, linux-rtc,
devicetree, linux-arm-kernel, linux-kernel
Hello,
On 15/02/2022 16:46:49+0200, 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).
> + items:
> + maxItems: 1
> +
This is missing start-year which is supported by the driver
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - clocks
> + - atmel,rtt-rtc-time-reg
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + rtt@fffffd20 {
> + compatible = "atmel,at91sam9260-rtt";
> + reg = <0xfffffd20 0x10>;
> + interrupts = <1 4 7>;
> + clocks = <&clk32k>;
> + atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
> + };
> --
> 2.25.1
>
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
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-15 17:23 ` Krzysztof Kozlowski
2022-02-17 12:05 ` Sergiu.Moga
2022-02-16 22:51 ` Rob Herring
2 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-02-15 17:23 UTC (permalink / raw)
To: Sergiu Moga, a.zummo, alexandre.belloni, robh+dt, nicolas.ferre,
ludovic.desroches
Cc: linux-rtc, devicetree, linux-arm-kernel, linux-kernel
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
> + 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?
> + compatible = "atmel,at91sam9260-rtt";
> + reg = <0xfffffd20 0x10>;
> + interrupts = <1 4 7>;
> + clocks = <&clk32k>;
> + atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
> + };
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
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-15 17:23 ` Krzysztof Kozlowski
@ 2022-02-16 22:51 ` Rob Herring
2022-02-17 12:08 ` Sergiu.Moga
2 siblings, 1 reply; 7+ messages in thread
From: Rob Herring @ 2022-02-16 22:51 UTC (permalink / raw)
To: Sergiu Moga
Cc: linux-kernel, linux-arm-kernel, ludovic.desroches, linux-rtc,
a.zummo, robh+dt, nicolas.ferre, devicetree, alexandre.belloni
On Tue, 15 Feb 2022 16:46:49 +0200, 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
>
My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):
yamllint warnings/errors:
./Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml:20:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
./Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml:22:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
dtschema/dtc warnings/errors:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.example.dt.yaml: rtt@fffffd20: $nodename:0: 'rtt@fffffd20' does not match '^rtc(@.*|-[0-9a-f])*$'
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.example.dt.yaml: rtt@fffffd20: atmel,rtt-rtc-time-reg:0: [4294967295, 0] is too long
From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
doc reference errors (make refcheckdocs):
See https://patchwork.ozlabs.org/patch/1593106
This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.
If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:
pip3 install dtschema --upgrade
Please check and re-submit.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
2022-02-15 15:27 ` Alexandre Belloni
@ 2022-02-17 12:00 ` Sergiu.Moga
0 siblings, 0 replies; 7+ messages in thread
From: Sergiu.Moga @ 2022-02-17 12:00 UTC (permalink / raw)
To: alexandre.belloni
Cc: a.zummo, robh+dt, Nicolas.Ferre, Ludovic.Desroches, linux-rtc,
devicetree, linux-arm-kernel, linux-kernel
Hello,
On 15.02.2022 17:27, Alexandre Belloni wrote:
> Hello,
>
> On 15/02/2022 16:46:49+0200, 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).
>> + items:
>> + maxItems: 1
>> +
> This is missing start-year which is supported by the driver
>
Noted. Will add the change in the next version of the patch.
>> +required:
>> + - compatible
>> + - reg
>> + - interrupts
>> + - clocks
>> + - atmel,rtt-rtc-time-reg
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> + - |
>> + rtt@fffffd20 {
>> + compatible = "atmel,at91sam9260-rtt";
>> + reg = <0xfffffd20 0x10>;
>> + interrupts = <1 4 7>;
>> + clocks = <&clk32k>;
>> + atmel,rtt-rtc-time-reg = <&gpbr 0x0>;
>> + };
>> --
>> 2.25.1
>>
> --
> Alexandre Belloni, co-owner and COO, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com
Thank you for the feedback.
Sergiu
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
2022-02-15 17:23 ` Krzysztof Kozlowski
@ 2022-02-17 12:05 ` Sergiu.Moga
0 siblings, 0 replies; 7+ messages in thread
From: Sergiu.Moga @ 2022-02-17 12:05 UTC (permalink / raw)
To: krzysztof.kozlowski, a.zummo, alexandre.belloni, robh+dt,
Nicolas.Ferre, Ludovic.Desroches
Cc: linux-rtc, devicetree, linux-arm-kernel, linux-kernel
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] dt-bindings: rtc: convert at91sam9 bindings to json-schema
2022-02-16 22:51 ` Rob Herring
@ 2022-02-17 12:08 ` Sergiu.Moga
0 siblings, 0 replies; 7+ messages in thread
From: Sergiu.Moga @ 2022-02-17 12:08 UTC (permalink / raw)
To: robh
Cc: linux-kernel, linux-arm-kernel, Ludovic.Desroches, linux-rtc,
a.zummo, robh+dt, Nicolas.Ferre, devicetree, alexandre.belloni
Hello,
On 17.02.2022 00:51, Rob Herring wrote:
> On Tue, 15 Feb 2022 16:46:49 +0200, 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
>>
> My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
> on your patch (DT_CHECKER_FLAGS is new in v5.13):
>
> yamllint warnings/errors:
> ./Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml:20:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
> ./Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml:22:9: [warning] wrong indentation: expected 10 but found 8 (indentation)
>
> dtschema/dtc warnings/errors:
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.example.dt.yaml: rtt@fffffd20: $nodename:0: 'rtt@fffffd20' does not match '^rtc(@.*|-[0-9a-f])*$'
> From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
> /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.example.dt.yaml: rtt@fffffd20: atmel,rtt-rtc-time-reg:0: [4294967295, 0] is too long
> From schema: /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/rtc/atmel,at91sam9-rtc.yaml
>
> doc reference errors (make refcheckdocs):
>
> See https://patchwork.ozlabs.org/patch/1593106
>
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
>
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:
>
> pip3 install dtschema --upgrade
>
> Please check and re-submit.
>
My apologies, it seems that, by mistake, I used the wrong file for
DT_SCHEMA_FILES and thus I did not see any warnings or errors. I will
correct this in the next version.
Thank you for the feedback.
Sergiu
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2022-02-17 12:08 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2022-02-16 22:51 ` Rob Herring
2022-02-17 12:08 ` Sergiu.Moga
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).