Devicetree
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: rtc: Convert rtc-cmos binding to YAML
@ 2026-05-19  9:59 Teja Sai Charan B
  2026-05-19 10:09 ` sashiko-bot
  2026-05-19 16:37 ` Conor Dooley
  0 siblings, 2 replies; 3+ messages in thread
From: Teja Sai Charan B @ 2026-05-19  9:59 UTC (permalink / raw)
  To: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: linux-rtc, devicetree, linux-kernel, Teja Sai Charan Bellamkonda

From: Teja Sai Charan Bellamkonda <tejaasaye@gmail.com>

Convert the rtc-cmos devicetree bindings to dt schema.

Signed-off-by: Teja Sai Charan Bellamkonda <tejaasaye@gmail.com>
---
 .../devicetree/bindings/rtc/rtc-cmos.txt      | 27 ---------
 .../devicetree/bindings/rtc/rtc-cmos.yaml     | 55 +++++++++++++++++++
 2 files changed, 55 insertions(+), 27 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-cmos.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/rtc-cmos.yaml

diff --git a/Documentation/devicetree/bindings/rtc/rtc-cmos.txt b/Documentation/devicetree/bindings/rtc/rtc-cmos.txt
deleted file mode 100644
index 7d7b5f6bda65..000000000000
--- a/Documentation/devicetree/bindings/rtc/rtc-cmos.txt
+++ /dev/null
@@ -1,27 +0,0 @@
- Motorola mc146818 compatible RTC
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-Required properties:
-  - compatible : "motorola,mc146818"
-  - reg : should contain registers location and length.
-
-Optional properties:
-  - interrupts : should contain interrupt.
-  - ctrl-reg : Contains the initial value of the control register also
-    called "Register B".
-  - freq-reg : Contains the initial value of the frequency register also
-    called "Register A".
-
-"Register A" and "B" are usually initialized by the firmware (BIOS for
-instance). If this is not done, it can be performed by the driver.
-
-ISA Example:
-
-	rtc@70 {
-	         compatible = "motorola,mc146818";
-	         interrupts = <8 3>;
-	         interrupt-parent = <&ioapic1>;
-	         ctrl-reg = <2>;
-	         freq-reg = <0x26>;
-	         reg = <1 0x70 2>;
-	 };
diff --git a/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml b/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
new file mode 100644
index 000000000000..e368264ac483
--- /dev/null
+++ b/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
@@ -0,0 +1,55 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/rtc/rtc-cmos.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Motorola mc146818 compatible RTC
+
+maintainers:
+  - Alexandre Belloni <alexandre.belloni@bootlin.com>
+
+properties:
+  compatible:
+    const: motorola,mc146818
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  ctrl-reg:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Initial value of the control register
+      (also known as Register B).
+
+  freq-reg:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      Initial value of the frequency register
+      (also known as Register A).
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+    bus {
+        #address-cells = <2>;
+        #size-cells = <1>;
+
+        rtc@70 {
+            compatible = "motorola,mc146818";
+            reg = <1 0x70 2>;
+
+            interrupts = <8 3>;
+
+            ctrl-reg = <2>;
+            freq-reg = <0x26>;
+        };
+    };
-- 
2.43.0


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

* Re: [PATCH] dt-bindings: rtc: Convert rtc-cmos binding to YAML
  2026-05-19  9:59 [PATCH] dt-bindings: rtc: Convert rtc-cmos binding to YAML Teja Sai Charan B
@ 2026-05-19 10:09 ` sashiko-bot
  2026-05-19 16:37 ` Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-05-19 10:09 UTC (permalink / raw)
  To: Teja Sai Charan B; +Cc: conor+dt, devicetree, robh

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] The schema restricts the `compatible` property to strictly `"motorola,mc146818"`, causing `dtbs_check` validation failures for existing in-tree device trees.
--

commit 2e9837eab33637d478720ff763bc9b81afee1cf3
Author: Teja Sai Charan Bellamkonda <tejaasaye@gmail.com>

dt-bindings: rtc: Convert rtc-cmos binding to YAML

This commit converts the rtc-cmos devicetree bindings from plain text to the
dt schema format.

> diff --git a/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml b/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
[ ... ]
> +properties:
> +  compatible:
> +    const: motorola,mc146818
> +
> +  reg:

Will this strict constraint cause dtbs_check validation failures for existing
in-tree device trees?

Looking at arch/x86/platform/ce4100/falconfalls.dts, the RTC node defines a
fallback compatible array:

	rtc@70 {
		compatible = "intel,ce4100-rtc", "motorola,mc146818";
		...
	};

Since the schema uses const instead of allowing an array, it appears this
might reject configurations containing the intel,ce4100-rtc variant. Should
the compatible property use a oneOf block to permit both the exact string
and the fallback array?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260519095929.76011-1-tejaasaye@gmail.com?part=1

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

* Re: [PATCH] dt-bindings: rtc: Convert rtc-cmos binding to YAML
  2026-05-19  9:59 [PATCH] dt-bindings: rtc: Convert rtc-cmos binding to YAML Teja Sai Charan B
  2026-05-19 10:09 ` sashiko-bot
@ 2026-05-19 16:37 ` Conor Dooley
  1 sibling, 0 replies; 3+ messages in thread
From: Conor Dooley @ 2026-05-19 16:37 UTC (permalink / raw)
  To: Teja Sai Charan B
  Cc: Alexandre Belloni, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	linux-rtc, devicetree, linux-kernel

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

On Tue, May 19, 2026 at 03:29:29PM +0530, Teja Sai Charan B wrote:
> From: Teja Sai Charan Bellamkonda <tejaasaye@gmail.com>
> 
> Convert the rtc-cmos devicetree bindings to dt schema.
> 
> Signed-off-by: Teja Sai Charan Bellamkonda <tejaasaye@gmail.com>
> ---
>  .../devicetree/bindings/rtc/rtc-cmos.txt      | 27 ---------
>  .../devicetree/bindings/rtc/rtc-cmos.yaml     | 55 +++++++++++++++++++
>  2 files changed, 55 insertions(+), 27 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-cmos.txt
>  create mode 100644 Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
> 
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-cmos.txt b/Documentation/devicetree/bindings/rtc/rtc-cmos.txt
> deleted file mode 100644
> index 7d7b5f6bda65..000000000000
> --- a/Documentation/devicetree/bindings/rtc/rtc-cmos.txt
> +++ /dev/null
> @@ -1,27 +0,0 @@
> - Motorola mc146818 compatible RTC
> -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> -
> -Required properties:
> -  - compatible : "motorola,mc146818"
> -  - reg : should contain registers location and length.
> -
> -Optional properties:
> -  - interrupts : should contain interrupt.
> -  - ctrl-reg : Contains the initial value of the control register also
> -    called "Register B".
> -  - freq-reg : Contains the initial value of the frequency register also
> -    called "Register A".
> -
> -"Register A" and "B" are usually initialized by the firmware (BIOS for
> -instance). If this is not done, it can be performed by the driver.
> -
> -ISA Example:
> -
> -	rtc@70 {
> -	         compatible = "motorola,mc146818";
> -	         interrupts = <8 3>;
> -	         interrupt-parent = <&ioapic1>;
> -	         ctrl-reg = <2>;
> -	         freq-reg = <0x26>;
> -	         reg = <1 0x70 2>;
> -	 };
> diff --git a/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml b/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
> new file mode 100644
> index 000000000000..e368264ac483
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/rtc/rtc-cmos.yaml
> @@ -0,0 +1,55 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/rtc/rtc-cmos.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Motorola mc146818 compatible RTC
> +
> +maintainers:
> +  - Alexandre Belloni <alexandre.belloni@bootlin.com>
> +
> +properties:
> +  compatible:
> +    const: motorola,mc146818

It's not a problem with the conversion per se, but as sashiko pointed out,
there's an intel device with a soc-specific compatible.
Could you document that here, with a fallback to this motorola one
please?

pw-bot: changes-requested

Thanks,
Conor.

> +
> +  reg:
> +    maxItems: 1
> +
> +  interrupts:
> +    maxItems: 1
> +
> +  ctrl-reg:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Initial value of the control register
> +      (also known as Register B).
> +
> +  freq-reg:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      Initial value of the frequency register
> +      (also known as Register A).
> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    bus {
> +        #address-cells = <2>;
> +        #size-cells = <1>;
> +
> +        rtc@70 {
> +            compatible = "motorola,mc146818";
> +            reg = <1 0x70 2>;

Please be consistent here about using only hex, even if the text file
didn't do that.

> +
> +            interrupts = <8 3>;
> +
> +            ctrl-reg = <2>;
> +            freq-reg = <0x26>;
> +        };
> +    };
> -- 
> 2.43.0
> 

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

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

end of thread, other threads:[~2026-05-19 16:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19  9:59 [PATCH] dt-bindings: rtc: Convert rtc-cmos binding to YAML Teja Sai Charan B
2026-05-19 10:09 ` sashiko-bot
2026-05-19 16:37 ` Conor Dooley

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