dt-bindings: thermal: st,thermal-spear1340: convert to dtschema
Subsystems (3)
cover dt-bindings: thermal: st,thermal-spear1340: convert to dtschema
This patch series converts SPEAr Thermal Sensor bindings to DT schema and renames thermal_flags property in spear13xx.dtsi to st,thermal-flags to fix the unevaluated property warning in st/spear1340-evb.dts.
Note:
* This patch is part of the GSoC2026 application process for device tree bindings conversions
* https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-Bindings
Gopi Krishna Menon (2):
dt-bindings: thermal: st,thermal-spear1340: convert to dtschema
ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
.../bindings/thermal/spear-thermal.txt | 14 -------- .../thermal/st,thermal-spear1340.yaml | 36 +++++++++++++++++++ arch/arm/boot/dts/st/spear13xx.dtsi | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) delete mode 100644 Documentation/devicetree/bindings/thermal/spear-thermal.txt create mode 100644 Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml
Signature · 1 line
2.52.0
PATCH 1/2 dt-bindings: thermal: st,thermal-spear1340: convert to dtschema
Convert the SPEAr Thermal Sensor bindings to DT schema.
---
Note:
* This patch is part of the GSoC2026 application process for device tree bindings conversions
* https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-Bindings
.../bindings/thermal/spear-thermal.txt | 14 -------- .../thermal/st,thermal-spear1340.yaml | 36 +++++++++++++++++++ 2 files changed, 36 insertions(+), 14 deletions(-) delete mode 100644 Documentation/devicetree/bindings/thermal/spear-thermal.txt create mode 100644 Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml
Documentation/devicetree/bindings/thermal/spear-thermal.txt deleted +0 -14
@@ -1,14 +0,0 @@ -* SPEAr Thermal - -Required properties: -- compatible : "st,thermal-spear1340" -- reg : Address range of the thermal registers -- st,thermal-flags: flags used to enable thermal sensor - -Example: - - thermal@fc000000 { - compatible = "st,thermal-spear1340"; - reg = <0xfc000000 0x1000>; - st,thermal-flags = <0x7000>; - };
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml new file +36 -0
@@ -0,0 +1,36 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SPEAr Thermal Sensor + +maintainers: + - Viresh Kumar <[email protected]> + +properties: + compatible: + const: st,thermal-spear1340 + + reg: + maxItems: 1 + + st,thermal-flags: + description: flags used to enable thermal sensor + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - st,thermal-flags + +unevaluatedProperties: false + +examples: + - | + thermal@fc000000 { + compatible = "st,thermal-spear1340"; + reg = <0xfc000000 0x1000>; + st,thermal-flags = <0x7000>; + };
Signature · 1 line
2.52.0
Quoted 7 lines · Gopi Krishna Menon
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml new file +7
-0+properties: + compatible: + const: st,thermal-spear1340 + + reg: + maxItems: 1 +
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml line 28
Quoted 10 lines
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml new file +10
-0+ st,thermal-flags: + description: flags used to enable thermal sensor + $ref: /schemas/types.yaml#/definitions/uint32 + +required: + - compatible + - reg + - st,thermal-flags + +unevaluatedProperties: false
additionalProperties: true
Best regards,
Krzysztof
Quoted 12 lines · Krzysztof Kozlowski
Quoted 11 lines · Gopi Krishna Menon
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml new file +11
-0+properties: + compatible: + const: st,thermal-spear1340 + + reg: + maxItems: 1 + + st,thermal-flags: + description: flags used to enable thermal sensor + $ref: /schemas/types.yaml#/definitions/uint32 +
Quoted 8 lines
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml line 28
Quoted 6 lines
Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml new file +6
-0+required: + - compatible + - reg + - st,thermal-flags + +unevaluatedProperties: falseadditionalProperties: true
Thanks for pinging me on IRC about this - it should be:
additionalProperties: false
Best regards,
Krzysztof
PATCH 2/2 ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
In reply to Gopi Krishna MenonRunning DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yaml
Rename thermal_flags to st,thermal-flags to fix the warning.
---
Note:
* This patch is part of the GSoC2026 application process for device tree bindings conversions
* https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-Bindings
arch/arm/boot/dts/st/spear13xx.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/st/spear13xx.dtsi +1 -1
@@ -332,7 +332,7 @@ wdt@ec800620 { thermal@e07008c4 { compatible = "st,thermal-spear1340"; reg = <0xe07008c4 0x4>; - thermal_flags = <0x7000>; + st,thermal-flags = <0x7000>; }; }; };
Signature · 1 line
2.52.0
Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
Quoted 5 lines · Gopi Krishna Menon
Running DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('
thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yaml
How is it possible if there is no such file?
Did you just add new warning in patch #1 and then claim in patch #2 that you fix it?
You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.
Best regards,
Krzysztof
Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
Quoted 7 lines · Krzysztof Kozlowski
Quoted 5 lines · Gopi Krishna Menon
Running DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('
thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yaml
Quoted 8 lines
How is it possible if there is no such file?
Did you just add new warning in patch #1 and then claim in patch #2 that you fix it?
You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.
... or you would notice that code was working and this part is just redundant. Then fix would be completely different, though.
Best regards,
Krzysztof
Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
In reply to Krzysztof KozlowskiQuoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Gopi Krishna Menon
Running DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('
thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yaml
Quoted 8 lines
How is it possible if there is no such file?
Did you just add new warning in patch #1 and then claim in patch #2 that you fix it?
You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.
Correct me if I'm wrong but I think there was a hidden bug here
drivers/thermal/spear_thermal.c:spear_thermal_probe:
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return -EINVAL;
» }
So, the driver was checking for the correct property as pointed by
bindings/thermal/spear-thermal.txt but the dts was using the wrong
property name: arch/arm/boot/dts/st/spear13xx.dtsi » » » thermal@e07008c4 { » » » » compatible = "st,thermal-spear1340"; » » » » reg = <0xe07008c4 0x4>; » » » » thermal_flags = <0x7000>; » » » }; And because this check is wrong:
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
people really didn't notice it.
The check should be:
if (!np || of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return -EINVAL;
» }
So, this actual patch has uncovered a bug!
Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
Quoted 18 lines · Daniel Baluta
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Gopi Krishna Menon
Running DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('
thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yamlQuoted 8 lines
How is it possible if there is no such file?
Did you just add new warning in patch #1 and then claim in patch #2 that you fix it?
You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.
Correct me if I'm wrong but I think there was a hidden bug here
Quoted 8 lines
drivers/thermal/spear_thermal.c:spear_thermal_probe:
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return
-EINVAL;
» }So, the driver was checking for the correct property as pointed by
Yes
Quoted 2 lines
bindings/thermal/spear-thermal.txtbut the dts was using the wrong
No, DTS had two properties - correct one and incorrect.
Quoted 7 lines
property name:
arch/arm/boot/dts/st/spear13xx.dtsi» » » thermal@e07008c4 { » » » » compatible = "st,thermal-spear1340"; » » » » reg = <0xe07008c40x4>; » » » »thermal_flags= <0x7000>; » » » }; And because this check is wrong:if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
people really didn't notice it.
Quoted 8 lines
The check should be:
if (!np ||
of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return-EINVAL;
» }So, this actual patch has uncovered a bug!
Yes. Driver also has bug, so probably was never working. The point is whatever commit is doing, the dtbs_check warning is not the justification, because it was introduced by this patchset.
Best regards,
Krzysztof
Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
Quoted 26 lines · Krzysztof Kozlowski
Quoted 25 lines · Daniel Baluta
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Gopi Krishna Menon
Running DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('
thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yamlQuoted 8 lines
How is it possible if there is no such file?
Did you just add new warning in patch #1 and then claim in patch #2 that you fix it?
You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.
Correct me if I'm wrong but I think there was a hidden bug here
drivers/thermal/spear_thermal.c:spear_thermal_probe:
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return
-EINVAL;
» }
Quoted 9 lines
Quoted 1 line
So, the driver was checking for the correct property as pointed by
Yes
Quoted 2 lines
bindings/thermal/spear-thermal.txtbut the dts was using the wrongNo, DTS had two properties - correct one and incorrect.
Yup, spear13xx is included by spear1310.dtsi and spear1340.dtsi both of which have st,thermal-flags correctly defined. When working on this patch, after converting the binding, I ran dtbs check and upon seeing dtbs warning immediately fixed it thinking it was complaining because st,thermal-flags (thermal_flags) was written incorrectly. (Which is not incorrect as st,thermal-flags was there in the final node but there was one additional property named thermal_flags as well which is not allowed as UnevaluatedProperty is set to false).
Also I dont think we have to override the st,thermal-flags property in spear1310.dtsi as the flags value is same in spear13xx.dtsi and spear1310.dtsi (0x7000).
Quoted 14 lines
Quoted 14 lines
property name:
arch/arm/boot/dts/st/spear13xx.dtsi» » » thermal@e07008c4 { » » » » compatible = "st,thermal-spear1340"; » » » » reg = <0xe07008c40x4>; » » » »thermal_flags= <0x7000>; » » » }; And because this check is wrong:if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
people really didn't notice it.
The check should be:
if (!np ||
of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return-EINVAL;
» }
Quoted 6 lines
Quoted 1 line
So, this actual patch has uncovered a bug!
Yes. Driver also has bug, so probably was never working. The point is whatever commit is doing, the
dtbs_checkwarning is not the justification, because it was introduced by this patchset.
Please correct me if I am wrong Krzysztof but should i send a seperate patch fixing the thermal_flags property (Not connected to these converted bindings)?.
Also, is it necessary to set additionalProperties to true? I am not able to figure out if that is needed.
Quoted 2 lines
Best regards,
Krzysztof
Thanks,
Gopi Krishna Menon
Re: [PATCH 2/2] ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
Quoted 38 lines · Gopi Krishna Menon
Quoted 26 lines · Krzysztof Kozlowski
Quoted 25 lines · Daniel Baluta
Quoted 6 lines · Krzysztof Kozlowski
Quoted 5 lines · Gopi Krishna Menon
Running DTBS checks on st/spear1340-evb.dtb results in the following warning:
thermal@e07008c4 (st,thermal-spear1340): Unevaluated properties are not allowed ('
thermal_flags' was unexpected)
from schema $id: http://devicetree.org/schemas/thermal/st,thermal-spear1340.yamlQuoted 8 lines
How is it possible if there is no such file?
Did you just add new warning in patch #1 and then claim in patch #2 that you fix it?
You completely miss the point why this change is needed: how could the DTS work before? It could not. And that should be your justification for the patch, with explanation why it could not work.
Correct me if I'm wrong but I think there was a hidden bug here
drivers/thermal/spear_thermal.c:spear_thermal_probe:
if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return
-EINVAL;
» }Quoted 9 lines
Quoted 1 line
So, the driver was checking for the correct property as pointed by
Yes
Quoted 2 lines
bindings/thermal/spear-thermal.txtbut the dts was using the wrongNo, DTS had two properties - correct one and incorrect.
Quoted 6 lines
Yup, spear13xx is included by
spear1310.dtsiandspear1340.dtsiboth of which have st,thermal-flags correctly defined. When working on this patch, after converting the binding, I ran dtbs check and upon seeing dtbs warning immediately fixed it thinking it was complaining because st,thermal-flags (thermal_flags) was written incorrectly. (Which is not incorrect as st,thermal-flags was there in the final node but there was one
I meant 'incorrect' here not 'not incorrect'
Quoted 40 lines
additional property named
thermal_flagsas well which is not allowed as UnevaluatedProperty is set to false).Also I dont think we have to override the st,thermal-flags property in
spear1310.dtsias the flags value is same inspear13xx.dtsiandspear1310.dtsi(0x7000).Quoted 14 lines
Quoted 14 lines
property name:
arch/arm/boot/dts/st/spear13xx.dtsi» » » thermal@e07008c4 { » » » » compatible = "st,thermal-spear1340"; » » » » reg = <0xe07008c40x4>; » » » »thermal_flags= <0x7000>; » » » }; And because this check is wrong:if (!np || !of_property_read_u32(np, "st,thermal-flags", &val)) {
people really didn't notice it.
The check should be:
if (!np ||
of_property_read_u32(np, "st,thermal-flags", &val)) { » » dev_err(&pdev->dev, "Failed: DT Pdata not passed\n"); » » return-EINVAL;
» }Quoted 6 lines
Quoted 1 line
So, this actual patch has uncovered a bug!
Yes. Driver also has bug, so probably was never working. The point is whatever commit is doing, the
dtbs_checkwarning is not the justification, because it was introduced by this patchset.Please correct me if I am wrong Krzysztof but should i send a seperate patch fixing the
thermal_flagsproperty (Not connected to these converted bindings)?.Also, is it necessary to set additionalProperties to true? I am not able to figure out if that is needed.
Quoted 2 lines
Best regards,
KrzysztofThanks,
Gopi Krishna Menon
Quoted 14 lines · Gopi Krishna Menon
This patch series converts SPEAr Thermal Sensor bindings to DT schema and renames
thermal_flagsproperty inspear13xx.dtsito st,thermal-flags to fix the unevaluated property warning inst/spear1340-evb.dts.Note:
* This patch is part of the GSoC2026 application process for device tree bindings conversions
* https://github.com/LinuxFoundationGSoC/ProjectIdeas/wiki/GSoC-2026-Device-Tree-BindingsGopi Krishna Menon (2):
dt-bindings: thermal: st,thermal-spear1340: convert to dtschema
ARM: dts: st: spear: fix dtbs warning on spear thermal sensor
Quoted 6 lines
.../bindings/thermal/spear-thermal.txt | 14 -------- .../thermal/st,thermal-spear1340.yaml | 36 +++++++++++++++++++ arch/arm/boot/dts/st/spear13xx.dtsi | 2 +- 3 files changed, 37 insertions(+), 15 deletions(-) delete mode 100644 Documentation/devicetree/bindings/thermal/spear-thermal.txt create mode 100644 Documentation/devicetree/bindings/thermal/st,thermal-spear1340.yaml
Signature · 1 line
viresh