ti: davinci, keystone: txt to yaml
Subsystems (5)
cover ti: davinci, keystone: txt to yaml
Convert txt bindings of DaVinci Timer and DaVinci/Keystone WDT Controller to dtschema.
Some comments in-patch.
Kousik Sanagavarapu (3):
dt-bindings: timer: ti,davinci-timer: convert to dtschema
dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
ARM: dts: davinci, keystone: correct watchdog nodenames
.../bindings/timer/ti,davinci-timer.txt | 37 ---------- .../bindings/timer/ti,davinci-timer.yaml | 68 +++++++++++++++++++ .../bindings/watchdog/davinci-wdt.txt | 24 ------- .../bindings/watchdog/ti,davinci-wdt.yaml | 52 ++++++++++++++ arch/arm/boot/dts/ti/davinci/da850.dtsi | 2 +- .../boot/dts/ti/keystone/keystone-k2g.dtsi | 4 +- arch/arm/boot/dts/ti/keystone/keystone.dtsi | 4 +- 7 files changed, 125 insertions(+), 66 deletions(-) delete mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.txt create mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml delete mode 100644 Documentation/devicetree/bindings/watchdog/davinci-wdt.txt create mode 100644 Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml
Signature · 1 line
2.45.2.827.g557ae147e6.dirty
PATCH 1/3 dt-bindings: timer: ti,davinci-timer: convert to dtschema
Convert txt binding of TI's DaVinci timer to dtschema to allow for validation.
--- .../bindings/timer/ti,davinci-timer.txt | 37 ---------- .../bindings/timer/ti,davinci-timer.yaml | 68 +++++++++++++++++++ 2 files changed, 68 insertions(+), 37 deletions(-) delete mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.txt create mode 100644 Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml
Documentation/devicetree/bindings/timer/ti,davinci-timer.txt deleted +0 -37
@@ -1,37 +0,0 @@ -* Device tree bindings for Texas Instruments DaVinci timer - -This document provides bindings for the 64-bit timer in the DaVinci -architecture devices. The timer can be configured as a general-purpose 64-bit -timer, dual general-purpose 32-bit timers. When configured as dual 32-bit -timers, each half can operate in conjunction (chain mode) or independently -(unchained mode) of each other. - -The timer is a free running up-counter and can generate interrupts when the -counter reaches preset counter values. - -Also see ../watchdog/davinci-wdt.txt for timers that are configurable as -watchdog timers. - -Required properties: - -- compatible : should be "ti,da830-timer". -- reg : specifies base physical address and count of the registers. -- interrupts : interrupts generated by the timer. -- interrupt-names: should be "tint12", "tint34", "cmpint0", "cmpint1", - "cmpint2", "cmpint3", "cmpint4", "cmpint5", "cmpint6", - "cmpint7" ("cmpintX" may be omitted if not present in the - hardware). -- clocks : the clock feeding the timer clock. - -Example: - - clocksource: timer@20000 { - compatible = "ti,da830-timer"; - reg = <0x20000 0x1000>; - interrupts = <21>, <22>, <74>, <75>, <76>, <77>, <78>, <79>, - <80>, <81>; - interrupt-names = "tint12", "tint34", "cmpint0", "cmpint1", - "cmpint2", "cmpint3", "cmpint4", "cmpint5", - "cmpint6", "cmpint7"; - clocks = <&pll0_auxclk>; - };
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +68 -0
68 lines not on this page · raw message
Signature · 1 line
2.45.2.827.g557ae147e6.dirty
RFC PATCH 2/3 dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
In reply to Kousik SanagavarapuConvert txt bindings of TI's DaVinci/Keystone Watchdog Timer Controller to dtschema to allow for validation.
---
This patch was submitted to the lists before by Nik
https://lore.kernel.org/linux-devicetree/[email protected]/
Although it seems that the right way include the "power-domians" property was not decided upon (read through the thread).
I grepped for instances of "power-domains" in ti related SoCs and other subsystems and it seems that there is always only 1 such "power-domains" phandle
Documentation/devicetree/bindings/display/ti/ti,k2g-dss.yaml
The existing dts code also confirms this
arch/arm/boot/dts/ti/keystone/keystone-k2g.dtsi
Again, I guess it would be great if someone could point out if this is right - so RFC.
Also, shouldn't "clocks" be "required"? - RFC.
.../bindings/watchdog/davinci-wdt.txt | 24 --------- .../bindings/watchdog/ti,davinci-wdt.yaml | 52 +++++++++++++++++++ 2 files changed, 52 insertions(+), 24 deletions(-) delete mode 100644 Documentation/devicetree/bindings/watchdog/davinci-wdt.txt create mode 100644 Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml
Documentation/devicetree/bindings/watchdog/davinci-wdt.txt deleted +0 -24
@@ -1,24 +0,0 @@ -Texas Instruments DaVinci/Keystone Watchdog Timer (WDT) Controller - -Required properties: -- compatible : Should be "ti,davinci-wdt", "ti,keystone-wdt" -- reg : Should contain WDT registers location and length - -Optional properties: -- timeout-sec : Contains the watchdog timeout in seconds -- clocks : the clock feeding the watchdog timer. - Needed if platform uses clocks. - See clock-bindings.txt - -Documentation: -Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf -Keystone - https://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf - -Examples: - -wdt: wdt@2320000 { - compatible = "ti,davinci-wdt"; - reg = <0x02320000 0x80>; - timeout-sec = <30>; - clocks = <&clkwdtimer0>; -};
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +52 -0
52 lines not on this page · raw message
Signature · 1 line
2.45.2.827.g557ae147e6.dirty
RFC PATCH 3/3 ARM: dts: davinci, keystone: correct watchdog nodenames
In reply to Kousik SanagavarapuUsing "wdt" instead of "watchdog" for watchdog timer nodes doesn't allow for validation with the corresponding dtschema and gives errors
$ make CHECK_DTBS=y DT_SCHEMA_FILES=ti,davinci-wdt.yaml \ ti/keystone/keystone-k2g-ice.dtb
DTC_CHK arch/arm/boot/dts/ti/keystone/keystone-k2g-ice.dtb arch/arm/boot/dts/ti/keystone/keystone-k2g-ice.dtb: wdt@02250000: $nodename:0: 'wdt@02250000' does not match '^(timer|watchdog)(@.*|-([0-9]|[1-9][0-9]+))?$' from schema $id: http://devicetree.org/schemas/watchdog/ti,davinci-wdt.yaml#
Therefore change "wdt@" to "watchdog@".
While at it, remove "ti,davinci-wdt" compatible from the keystone dts code.
---
Question: Should "wdt@" be changed everywhere in the dts code or is it only a requirement of validation against dtschema?
Also, I'm not sure about removing "ti,davinci-wdt" from the keystone dts code. I'm thinking it is only there so that the driver code can get information from keystone nodes too, because it seems that there is no code for ti,keystone-wdt.
So question,
- Is WDT Controller driver for keystone not written yet?
Or
- Does the WDT Controller driver for keystone have the same functionality as one on davinci - hence leading us to simply do
.compatible = "ti,keystone-wdt"
?
arch/arm/boot/dts/ti/davinci/da850.dtsi | 2 +- arch/arm/boot/dts/ti/keystone/keystone-k2g.dtsi | 4 ++-- arch/arm/boot/dts/ti/keystone/keystone.dtsi | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/ti/davinci/da850.dtsi +1 -1
@@ -525,7 +525,7 @@ clocksource: timer@20000 { interrupt-names = "tint12", "tint34"; clocks = <&pll0_auxclk>; }; - wdt: wdt@21000 { + wdt: watchdog@21000 { compatible = "ti,davinci-wdt"; reg = <0x21000 0x1000>; clocks = <&pll0_auxclk>;
arch/arm/boot/dts/ti/keystone/keystone-k2g.dtsi +2 -2
@@ -610,8 +610,8 @@ spi3: spi@21806000 { clocks = <&k2g_clks 0x0013 0>; }; - wdt: wdt@02250000 { - compatible = "ti,keystone-wdt", "ti,davinci-wdt"; + wdt: watchdog@02250000 { + compatible = "ti,keystone-wdt"; reg = <0x02250000 0x80>; power-domains = <&k2g_pds 0x22>; clocks = <&k2g_clks 0x22 0>;
arch/arm/boot/dts/ti/keystone/keystone.dtsi +2 -2
@@ -225,8 +225,8 @@ usb0: usb@2690000 { }; }; - wdt: wdt@22f0080 { - compatible = "ti,keystone-wdt","ti,davinci-wdt"; + wdt: watchdog@22f0080 { + compatible = "ti,keystone-wdt"; reg = <0x022f0080 0x80>; clocks = <&clkwdtimer0>; };
Signature · 1 line
2.45.2.827.g557ae147e6.dirty
Re: [PATCH 1/3] dt-bindings: timer: ti,davinci-timer: convert to dtschema
In reply to Kousik SanagavarapuDocumentation/devicetree/bindings/timer/ti,davinci-timer.yaml
Quoted 10 lines · Kousik Sanagavarapu
Convert txt binding of TI's DaVinci timer to dtschema to allow for validation.
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +0
-0
Use compatible as filename.
Quoted 4 lines
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +3
-0@@ -0,0 +1,68 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +---
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml line 13
Quoted 10 lines
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +10
-0+$id: http://devicetree.org/schemas/timer/ti,davinci-timer.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI DaVinci Timer + +maintainers: + - Kousik Sanagavarapu <[email protected]> + +description: | +
Drop blank line
Quoted 7 lines
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +7
-0+ This is a 64-bit timer found on TI's DaVinci architecture devices. The timer + can be configured as a general-purpose 64-bit timer, dual general-purpose + 32-bit timers. When configured as dual 32-bit timers, each half can operate + in conjunction (chain mode) or independently (unchained mode) of each other. + + The timer is a free running up-counter and can generate interrupts when the + counter reaches preset counter values.
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml line 30
Quoted 10 lines
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +10
-0+ +properties: + compatible: + const: ti,da830-timer + + reg: + maxItems: 1 + + interrupts: + minItems: 2
Missing maxItems
Quoted 4 lines
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +4
-0+ + interrupt-names: + minItems: 2 + items:
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml line 44
Quoted 10 lines
Documentation/devicetree/bindings/timer/ti,davinci-timer.yaml new file +10
-0+ - const: tint12 + - const: tint34 + - const: cmpint0 + - const: cmpint1 + - const: cmpint2 + - const: cmpint3 + - const: cmpint4 + - const: cmpint5 + - const: cmpint6 + - const: cmpint7
Best regards,
Krzysztof
Re: [RFC PATCH 3/3] ARM: dts: davinci, keystone: correct watchdog nodenames
In reply to Kousik SanagavarapuQuoted 13 lines · Kousik Sanagavarapu
Using "wdt" instead of "watchdog" for watchdog timer nodes doesn't allow for validation with the corresponding dtschema and gives errors
$ make CHECK_DTBS=y DT_SCHEMA_FILES=ti,davinci-wdt.yaml \ ti/keystone/keystone-k2g-ice.dtbDTC_CHK arch/arm/boot/dts/ti/keystone/keystone-k2g-ice.dtb arch/arm/boot/dts/ti/keystone/keystone-k2g-ice.dtb: wdt@02250000: $nodename:0: 'wdt@02250000' does not match '^(timer|watchdog)(@.*|-([0-9]|[1-9][0-9]+))?$' from schema $id: http://devicetree.org/schemas/watchdog/ti,davinci-wdt.yaml#
Quoted 4 lines
Therefore change "wdt@" to "watchdog@".
While at it, remove "ti,davinci-wdt" compatible from the keystone dts code.
That's entirely unrelated patch. Don't mix simple cleanups with patches affecting ABI and users. Also, explain why.
Quoted 3 lines
Signed-off-by Kousik Sanagavarapu <[email protected]>---
Best regards,
Krzysztof
Re: [RFC PATCH 2/3] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
In reply to Kousik SanagavarapuDocumentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml
Quoted 5 lines · Kousik Sanagavarapu
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +0
-0
Use fallback as filename, so ti,keystone-wdt.yaml
Quoted 18 lines
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +17
-0@@ -0,0 +1,52 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/watchdog/ti,davinci-wdt.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TI DaVinci/Keystone Watchdog Timer Controller + +maintainers: + - Kousik Sanagavarapu <[email protected]> + +description: | + TI's Watchdog Timer Controller for DaVinci and Keystone Processors. + + Datasheets + + Davinci DM646x - https://www.ti.com/lit/ug/spruer5b/spruer5b.pdf
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml line 27
Quoted 10 lines
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +10
-0+ Keystone - https://www.ti.com/lit/ug/sprugv5a/sprugv5a.pdf + +allOf: + - $ref: watchdog.yaml# + +properties: + compatible: + enum: + - ti,davinci-wdt + - ti,keystone-wdt
This does not match the original binding and commit msg did not explain why such change is necessary.
This also does not match DTS.
Best regards,
Krzysztof
Re: [PATCH 1/3] dt-bindings: timer: ti,davinci-timer: convert to dtschema
In reply to Krzysztof KozlowskiQuoted 10 lines · Krzysztof Kozlowski
Quoted 1 line · Kousik Sanagavarapu
+++
b/Documentation/devicetree/bindings/timer/ti,davinci-timer.yamlUse compatible as filename.
Review
Quoted 2 lines
(quoted diff) +2
-0+description: | +Drop blank line
Quoted 4 lines
Review
Quoted 2 lines
(quoted diff) +2
-0+ interrupts: + minItems: 2Missing maxItems
Thanks for pointing out. Will fix in v2.
Re: [RFC PATCH 2/3] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
In reply to Krzysztof KozlowskiQuoted 9 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml line 27
Quoted 5 lines · Kousik Sanagavarapu
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +5
-0+properties: + compatible: + enum: + - ti,davinci-wdt + - ti,keystone-wdtThis does not match the original binding and commit msg did not explain why such change is necessary.
I don't understand. Do you mean both the compatibles are always compulsory? Meaning
compatible:
items:
- const: ti,davinci-wdt
- const: ti,keystone-wdt
It is enum because I intended it to align with the subsequent patch which changes DTS.
Quoted 1 line
This also does not match DTS.
Yes. I've asked about changing the DTS in the subsequent patch.
Thanks for the review
Re: [RFC PATCH 3/3] ARM: dts: davinci, keystone: correct watchdog nodenames
In reply to Krzysztof KozlowskiQuoted 8 lines · Krzysztof Kozlowski
Quoted 5 lines · Kousik Sanagavarapu
Using "wdt" instead of "watchdog" for watchdog timer nodes doesn't allow for validation with the corresponding dtschema and gives errors
[...]
That's entirely unrelated patch. Don't mix simple cleanups with patches affecting ABI and users. Also, explain why.
Got it. Will submit v2 as a seperate patch, outside of this series.
Thanks
Re: [RFC PATCH 2/3] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
In reply to Kousik SanagavarapuQuoted 11 lines · Kousik Sanagavarapu
Quoted 9 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml line 27
Quoted 5 lines · Kousik Sanagavarapu
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +5
-0+properties: + compatible: + enum: + - ti,davinci-wdt + - ti,keystone-wdtThis does not match the original binding and commit msg did not explain why such change is necessary.
Quoted 7 lines
I don't understand. Do you mean both the compatibles are always compulsory? Meaning
compatible:
items:
- const: ti,davinci-wdt
- const: ti,keystone-wdt
Yes, this is what old binding said.
Quoted 8 lines
It is enum because I intended it to align with the subsequent patch which changes DTS.
Quoted 1 line
This also does not match DTS.
Yes. I've asked about changing the DTS in the subsequent patch.
Changing the DTS cannot be the reason to affect users and DTS... It's tautology. You change DTS because you intent to change DTS?
Best regards,
Krzysztof
Re: [RFC PATCH 2/3] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
Quoted 15 lines · Krzysztof Kozlowski
Quoted 14 lines · Kousik Sanagavarapu
Quoted 9 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml line 27
Quoted 5 lines · Kousik Sanagavarapu
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +5
-0+properties: + compatible: + enum: + - ti,davinci-wdt + - ti,keystone-wdtThis does not match the original binding and commit msg did not explain why such change is necessary.
I don't understand. Do you mean both the compatibles are always compulsory? Meaning
Quoted 6 lines
Quoted 4 lines
compatible:
items:
- const: ti,davinci-wdt
- const: ti,keystone-wdtYes, this is what old binding said.
That was what I thought initially too, but the example in the old binding says otherwise and also the DTS from ti/davinci/da850.dtsi says
wdt: watchdog@21000 {
compatible = "ti,davinci-wdt";
reg = <0x21000 0x1000>;
clocks = <&pll0_auxclk>;
status = "disabled";
};Or am I seeing it the wrong way?
Quoted 11 lines
Quoted 8 lines
It is enum because I intended it to align with the subsequent patch which changes DTS.
Quoted 1 line
This also does not match DTS.
Yes. I've asked about changing the DTS in the subsequent patch.
Changing the DTS cannot be the reason to affect users and DTS... It's tautology. You change DTS because you intent to change DTS?
Not exactly. I thought that the DTS was wrong when it said
compatible = "ti,keystone-wdt", "ti,davinci-wdt";
while it should have been
compatible = "ti,keystone-wdt";
I was not sure about this though and hence marked both the patches as RFC, in case I was interpretting them the wrong way.
Thanks
Re: [RFC PATCH 3/3] ARM: dts: davinci, keystone: correct watchdog nodenames
In reply to Kousik SanagavarapuQuoted 11 lines · Kousik Sanagavarapu
Quoted 8 lines · Krzysztof Kozlowski
Quoted 5 lines · Kousik Sanagavarapu
Using "wdt" instead of "watchdog" for watchdog timer nodes doesn't allow for validation with the corresponding dtschema and gives errors
[...]
That's entirely unrelated patch. Don't mix simple cleanups with patches affecting ABI and users. Also, explain why.
Got it. Will submit v2 as a seperate patch, outside of this series.
... and carefully re-think why. I am 99% sure your patch breaks the users. Better if you test your changes.
Conversion of the bindings is a task which requires to know how DTS works.
Best regards,
Krzysztof
Re: [RFC PATCH 2/3] dt-bindings: watchdog: ti,davinci-wdt: convert to dtschema
In reply to Kousik SanagavarapuQuoted 50 lines · Kousik Sanagavarapu
Quoted 15 lines · Krzysztof Kozlowski
Quoted 14 lines · Kousik Sanagavarapu
Quoted 9 lines · Krzysztof Kozlowski
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml line 27
Quoted 5 lines · Kousik Sanagavarapu
Documentation/devicetree/bindings/watchdog/ti,davinci-wdt.yaml new file +5
-0+properties: + compatible: + enum: + - ti,davinci-wdt + - ti,keystone-wdtThis does not match the original binding and commit msg did not explain why such change is necessary.
I don't understand. Do you mean both the compatibles are always compulsory? Meaning
Quoted 6 lines
Quoted 4 lines
compatible:
items:
- const: ti,davinci-wdt
- const: ti,keystone-wdtYes, this is what old binding said.
That was what I thought initially too, but the example in the old binding says otherwise and also the DTS from
ti/davinci/da850.dtsisayswdt: watchdog@21000 { compatible = "ti,davinci-wdt"; reg = <0x21000 0x1000>; clocks = <&pll0_auxclk>; status = "disabled"; };Or am I seeing it the wrong way?
Quoted 11 lines
Quoted 8 lines
It is enum because I intended it to align with the subsequent patch which changes DTS.
Quoted 1 line
This also does not match DTS.
Yes. I've asked about changing the DTS in the subsequent patch.
Changing the DTS cannot be the reason to affect users and DTS... It's tautology. You change DTS because you intent to change DTS?
Not exactly. I thought that the DTS was wrong when it said
Quoted 8 lines
compatible = "ti,keystone-wdt", "ti,davinci-wdt";while it should have been
compatible = "ti,keystone-wdt";I was not sure about this though and hence marked both the patches as RFC, in case I was interpretting them the wrong way.
Ah, right, the DTS says keystone+davinci while old binding suggested davinci+keystone. Considering there is no driver binding to keystone, I think the answer is obvious - intention was keystone+davinci. Anyway, commit msg should mention why you are doing something else than pure conversion.
Best regards,
Krzysztof