Skip to contentSkip to conversation

dt-bindings: rtc: m41t80: Convert text schema to YAML one

PATCH Applied Marek Vasut 4 participants 11 messages Dec 11, 2022 – Dec 16, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dt-bindings: rtc: m41t80: Convert text schema to YAML one

Convert the m41t80 text schema to YAML schema.

Add "#clock-cells" requirement, which is required by clock-output-names.

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add maxItems:1 to clock-output-names
- Skip wakeup-source property, comes from rtc.yaml
- Mention the new clock-cells requirement coming from clock-output-names property.
- Rename rtc-m41t80.txt to st,m41t80.yaml
V3: - Update license to (GPL-2.0-only OR BSD-2-Clause)

---
 .../devicetree/bindings/rtc/rtc-m41t80.txt    | 39 ----------
 .../devicetree/bindings/rtc/st,m41t80.yaml    | 73 +++++++++++++++++++
 2 files changed, 73 insertions(+), 39 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/rtc/rtc-m41t80.txt
 create mode 100644 Documentation/devicetree/bindings/rtc/st,m41t80.yaml
Documentation/devicetree/bindings/rtc/rtc-m41t80.txt deleted +0 -39
deleted file mode 100644
index cdd196b1e9bdb..0000000000000
@@ -1,39 +0,0 @@
-ST M41T80 family of RTC and compatible
-
-Required properties:
-- compatible: should be one of:
-	"st,m41t62",
-	"st,m41t65",
-	"st,m41t80",
-	"st,m41t81",
-	"st,m41t81s",
-	"st,m41t82",
-	"st,m41t83",
-	"st,m41t84",
-	"st,m41t85",
-	"st,m41t87",
-	"microcrystal,rv4162",
-- reg: I2C bus address of the device
-
-Optional properties:
-- interrupts: rtc alarm interrupt.
-- clock-output-names: From common clock binding to override the default output
-                      clock name
-- wakeup-source: Enables wake up of host system on alarm
-
-Optional child node:
-- clock: Provide this if the square wave pin is used as boot-enabled fixed clock.
-
-Example:
-	rtc@68 {
-		compatible = "st,m41t80";
-		reg = <0x68>;
-		interrupt-parent = <&UIC0>;
-		interrupts = <0x9 0x8>;
-
-		clock {
-			compatible = "fixed-clock";
-			#clock-cells = <0>;
-			clock-frequency = <32768>;
-		};
-	};
Documentation/devicetree/bindings/rtc/st,m41t80.yaml new file +73 -0

73 lines not on this page · raw message

Signature · 1 line
2.35.1
#1 lore raw

PATCH v3 2/2 dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

The clock {} subnode seems like it is describing an always-on clock generated by the PMIC. This should rather be modeled by consumer of the clock taking phandle to the RTC node itself, since it already does have clock-cells and all. Since there are no users of the clock subnode in tree anyway, mark it as deprecated to avoid proliferation of this approach.

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add AB from Krzysztof
V3: - No change

---
 Documentation/devicetree/bindings/rtc/st,m41t80.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/rtc/st,m41t80.yaml +1 -0
index fc9c6da6483f5..03ff833f5fe9d 100644
@@ -40,6 +40,7 @@ properties:
   clock:
     type: object
     $ref: /schemas/clock/fixed-clock.yaml#
+    deprecated: true
     properties:
       clock-frequency:
         const: 32768
Signature · 1 line
2.35.1
#2 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Hi,

Quoted 9 lines · Marek Vasut

The clock {} subnode seems like it is describing an always-on clock generated by the PMIC. This should rather be modeled by consumer of the clock taking phandle to the RTC node itself, since it already does have clock-cells and all. Since there are no users of the clock subnode in tree anyway, mark it as deprecated to avoid proliferation of this approach.

Quoted 11 lines

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add AB from Krzysztof
V3: - No change
---

I just noticed this by accident. Basically everything in the patch description is wrong:

1. There is a in-tree user: arch/arm/boot/dts/imx6dl-qmx6.dtsi
2. The PMIC has nothing to do with this
3. Directly referencing the RTC does not work, since that introduces an unsolvable dependency loop on QMX6. This was the solution accepted by Rob and Saravana:

[v1] https://lore.kernel.org/lkml/[email protected]/
[v2] https://lore.kernel.org/all/[email protected]/

-- Sebastian

Quoted 18 lines
 Documentation/devicetree/bindings/rtc/st,m41t80.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/rtc/st,m41t80.yaml +1 -0
index fc9c6da6483f5..03ff833f5fe9d 100644
@@ -40,6 +40,7 @@ properties:
   clock:
     type: object
     $ref: /schemas/clock/fixed-clock.yaml#
+    deprecated: true
     properties:
       clock-frequency:
         const: 32768
Signature · 1 line
2.35.1
#3 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Quoted 1 line · Sebastian Reichel

Hi,

Hi,

Quoted 22 lines · Marek Vasut
Quoted 9 lines

The clock {} subnode seems like it is describing an always-on clock generated by the PMIC. This should rather be modeled by consumer of the clock taking phandle to the RTC node itself, since it already does have clock-cells and all. Since there are no users of the clock subnode in tree anyway, mark it as deprecated to avoid proliferation of this approach.

Quoted 11 lines

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add AB from Krzysztof
V3: - No change
---

Quoted 4 lines

I just noticed this by accident. Basically everything in the patch description is wrong:

1. There is a in-tree user: arch/arm/boot/dts/imx6dl-qmx6.dtsi

Sorry, I missed this one.

Quoted 1 line

2. The PMIC has nothing to do with this

In [3] the commit message claims the PMIC supplies 32kHz clock to i.MX6 CKIL , which per IMX6DQRM rev.6 Table 18-3 row SNVS indirectly supplies SNVS RTC . This reminded me of commit:

9509593f327ac ("arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC")

which solves exactly the same problem, system hangs when 32 kHz clock are stopped, except this time on i.MX8MM, clock are generated by PMIC on I2C (notice how the PMIC is referenced directly) and the clock are supplied to the SVNS RTC XTal terminals.

I wonder if this could be reused on the QMX6 board too ?

Quoted 6 lines

3. Directly referencing the RTC does not work, since that introduces an unsolvable dependency loop on QMX6. This was the solution accepted by Rob and Saravana:

[v1] https://lore.kernel.org/lkml/[email protected]/
[v2] https://lore.kernel.org/all/[email protected]/

[3] https://lore.kernel.org/linux-clk/[email protected]/

#4 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Hi,

Quoted 28 lines · Marek Vasut
Quoted 22 lines · Sebastian Reichel
Quoted 9 lines · Marek Vasut

The clock {} subnode seems like it is describing an always-on clock generated by the PMIC. This should rather be modeled by consumer of the clock taking phandle to the RTC node itself, since it already does have clock-cells and all. Since there are no users of the clock subnode in tree anyway, mark it as deprecated to avoid proliferation of this approach.

Quoted 11 lines

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add AB from Krzysztof
V3: - No change
---

Quoted 4 lines

I just noticed this by accident. Basically everything in the patch description is wrong:

1. There is a in-tree user: arch/arm/boot/dts/imx6dl-qmx6.dtsi

Quoted 7 lines

Sorry, I missed this one.

Quoted 1 line

2. The PMIC has nothing to do with this

In [3] the commit message claims the PMIC supplies 32kHz clock to i.MX6 CKIL, which per IMX6DQRM rev.6 Table 18-3 row SNVS indirectly supplies SNVS RTC. This reminded me of commit:

The word PMIC is not mentioned once in [3]. PMIC is not involved. The QMX6 32khz chain is like this:

32kHz crystal -> m41t62 crystal input
m41t62 clock output -> i.MX6 CKIL

Quoted 9 lines

9509593f327ac ("arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC")

which solves exactly the same problem, system hangs when 32 kHz clock are stopped, except this time on i.MX8MM, clock are generated by PMIC on I2C (notice how the PMIC is referenced directly) and the clock are supplied to the SVNS RTC XTal terminals.

I wonder if this could be reused on the QMX6 board too?

IIRC On i.MX6 referencing the I2C connected RTC results in boot hanging forever when trying to get the ckil clock in imx6q_clocks_init. At least it used to be the case when I was working on this - I no longer have access to the boards. Of course properly referencing the RTC clock was the first route I tried.

-- Sebastian

Quoted 8 lines
Quoted 6 lines

3. Directly referencing the RTC does not work, since that introduces an unsolvable dependency loop on QMX6. This was the solution accepted by Rob and Saravana:

[v1] https://lore.kernel.org/lkml/[email protected]/
[v2] https://lore.kernel.org/all/[email protected]/

[3] https://lore.kernel.org/linux-clk/[email protected]/

#5 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Quoted 1 line · Sebastian Reichel

Hi,

Hi,

Quoted 31 lines · Marek Vasut
Quoted 30 lines · Sebastian Reichel
Quoted 22 lines · Marek Vasut
Quoted 9 lines

The clock {} subnode seems like it is describing an always-on clock generated by the PMIC. This should rather be modeled by consumer of the clock taking phandle to the RTC node itself, since it already does have clock-cells and all. Since there are no users of the clock subnode in tree anyway, mark it as deprecated to avoid proliferation of this approach.

Quoted 11 lines

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add AB from Krzysztof
V3: - No change
---

Quoted 4 lines

I just noticed this by accident. Basically everything in the patch description is wrong:

1. There is a in-tree user: arch/arm/boot/dts/imx6dl-qmx6.dtsi

Sorry, I missed this one.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

2. The PMIC has nothing to do with this

In [3] the commit message claims the PMIC supplies 32kHz clock to i.MX6 CKIL, which per IMX6DQRM rev.6 Table 18-3 row SNVS indirectly supplies SNVS RTC. This reminded me of commit:

The word PMIC is not mentioned once in [3].

s@PMIC@m41t62 RTC@, sorry.

Quoted 14 lines

PMIC is not involved.
The QMX6 32khz chain is like this:

32kHz crystal -> m41t62 crystal input
m41t62 clock output -> i.MX6 CKIL

Quoted 8 lines

9509593f327ac ("arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC")

which solves exactly the same problem, system hangs when 32 kHz clock are stopped, except this time on i.MX8MM, clock are generated by PMIC on I2C (notice how the PMIC is referenced directly) and the clock are supplied to the SVNS RTC XTal terminals.

Quoted 7 lines
Quoted 1 line

I wonder if this could be reused on the QMX6 board too?

IIRC On i.MX6 referencing the I2C connected RTC results in boot hanging forever when trying to get the ckil clock in imx6q_clocks_init. At least it used to be the case when I was working on this - I no longer have access to the boards. Of course properly referencing the RTC clock was the first route I tried.

Hmmmmm, what shall we do, un-deprecate the clock sub-node ?

#6 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Hi,

Quoted 58 lines · Marek Vasut
Quoted 31 lines · Sebastian Reichel
Quoted 30 lines · Marek Vasut
Quoted 22 lines · Sebastian Reichel
Quoted 9 lines · Marek Vasut

The clock {} subnode seems like it is describing an always-on clock generated by the PMIC. This should rather be modeled by consumer of the clock taking phandle to the RTC node itself, since it already does have clock-cells and all. Since there are no users of the clock subnode in tree anyway, mark it as deprecated to avoid proliferation of this approach.

Quoted 11 lines

---
Cc: Alessandro Zummo <[email protected]>
Cc: Alexandre Belloni <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: [email protected]
To: [email protected]
---
V2: - Add AB from Krzysztof
V3: - No change
---

Quoted 4 lines

I just noticed this by accident. Basically everything in the patch description is wrong:

1. There is a in-tree user: arch/arm/boot/dts/imx6dl-qmx6.dtsi

Sorry, I missed this one.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

2. The PMIC has nothing to do with this

In [3] the commit message claims the PMIC supplies 32kHz clock to i.MX6 CKIL, which per IMX6DQRM rev.6 Table 18-3 row SNVS indirectly supplies SNVS RTC. This reminded me of commit:

The word PMIC is not mentioned once in [3].

s@PMIC@m41t62 RTC@, sorry.

Quoted 16 lines

PMIC is not involved.
The QMX6 32khz chain is like this:

32kHz crystal -> m41t62 crystal input
m41t62 clock output -> i.MX6 CKIL

Quoted 9 lines

9509593f327ac ("arm64: dts: imx8mm: Model PMIC to SNVS RTC clock path on Data Modul i.MX8M Mini eDM SBC")

which solves exactly the same problem, system hangs when 32 kHz clock are stopped, except this time on i.MX8MM, clock are generated by PMIC on I2C (notice how the PMIC is referenced directly) and the clock are supplied to the SVNS RTC XTal terminals.

I wonder if this could be reused on the QMX6 board too?

Quoted 7 lines
Quoted 5 lines

IIRC On i.MX6 referencing the I2C connected RTC results in boot hanging forever when trying to get the ckil clock in imx6q_clocks_init. At least it used to be the case when I was working on this - I no longer have access to the boards. Of course properly referencing the RTC clock was the first route I tried.

Hmmmmm, what shall we do, un-deprecate the clock sub-node?

Depends on the exact meaning of "deprecate: true". I think we all agree, that it's better to avoid the sub-node and only use it when it's really required. But having a deprecation warning for an in-tree user without a clear path forward also seems to be annoying. I think it makes sense for the DT binding maintainers (Rob/Krzysztof) to comment on this.

-- Sebastian

#7 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Quoted 6 lines · Sebastian Reichel
Quoted 6 lines
Quoted 5 lines

IIRC On i.MX6 referencing the I2C connected RTC results in boot hanging forever when trying to get the ckil clock in imx6q_clocks_init. At least it used to be the case when I was working on this - I no longer have access to the boards. Of course properly referencing the RTC clock was the first route I tried.

Quoted 9 lines
Quoted 1 line

Hmmmmm, what shall we do, un-deprecate the clock sub-node?

Depends on the exact meaning of "deprecate: true". I think we all agree, that it's better to avoid the sub-node and only use it when it's really required. But having a deprecation warning for an in-tree user without a clear path forward also seems to be annoying. I think it makes sense for the DT binding maintainers (Rob/Krzysztof) to comment on this.

I dropped the commit from the PR I'm going to send Linus later today

Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw

Re: [PATCH v3 2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated

Quoted 17 lines · Alexandre Belloni
Quoted 6 lines · Sebastian Reichel
Quoted 6 lines
Quoted 5 lines

IIRC On i.MX6 referencing the I2C connected RTC results in boot hanging forever when trying to get the ckil clock in imx6q_clocks_init. At least it used to be the case when I was working on this - I no longer have access to the boards. Of course properly referencing the RTC clock was the first route I tried.

Quoted 9 lines
Quoted 1 line

Hmmmmm, what shall we do, un-deprecate the clock sub-node?

Depends on the exact meaning of "deprecate: true". I think we all agree, that it's better to avoid the sub-node and only use it when it's really required. But having a deprecation warning for an in-tree user without a clear path forward also seems to be annoying. I think it makes sense for the DT binding maintainers (Rob/Krzysztof) to comment on this.

Quoted 1 line

I dropped the commit from the PR I'm going to send Linus later today

That works, thank you !

maintainer Applied
#10 lore raw
In reply to Marek Vasut
Quoted 5 lines · Marek Vasut

Convert the m41t80 text schema to YAML schema.

Add "#clock-cells" requirement, which is required by clock-output-names.

Applied, thanks!

[1/2] dt-bindings: rtc: m41t80: Convert text schema to YAML one

      commit: 3e39f7971d75cafe1c90dec60526ad45484657c0
[2/2] dt-bindings: rtc: m41t80: Mark the clock: subnode as deprecated
      commit: b279e3276c247a060ca73784e6655472b74c3f27

Best regards,

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