[V5,1/4] dt-bindings: Add Broadcom AVS RO thermal
diff mbox series

Message ID 1578941778-23321-2-git-send-email-stefan.wahren@i2se.com
State Accepted
Delegated to: Daniel Lezcano
Headers show
Series
  • ARM: Enable thermal support for Raspberry Pi 4
Related show

Commit Message

Stefan Wahren Jan. 13, 2020, 6:56 p.m. UTC
Since the BCM2711 doesn't have a AVS TMON block, the thermal information
must be retrieved from the AVS ring oscillator block. This block is part
of the AVS monitor which contains a bunch of raw sensors.

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
---
 .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml

Comments

Rob Herring Jan. 16, 2020, 5:33 p.m. UTC | #1
On Mon, Jan 13, 2020 at 12:56 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>
> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
> must be retrieved from the AVS ring oscillator block. This block is part
> of the AVS monitor which contains a bunch of raw sensors.
>
> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
> Reviewed-by: Rob Herring <robh@kernel.org>
> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
> ---
>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
>  1 file changed, 45 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml

The example fails 'make dt_binding_check':

/builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.example.dt.yaml:
thermal: 'reg' is a required property

> diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
> new file mode 100644
> index 0000000..98e7b57
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Broadcom AVS ring oscillator thermal
> +
> +maintainers:
> +  - Stefan Wahren <wahrenst@gmx.net>
> +
> +description: |+
> +  The thermal node should be the child of a syscon node with the
> +  required property:
> +
> +  - compatible: Should be one of the following:
> +                "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
> +
> +  Refer to the the bindings described in
> +  Documentation/devicetree/bindings/mfd/syscon.txt
> +
> +properties:
> +  compatible:
> +    const: brcm,bcm2711-thermal
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +
> +examples:
> +  - |
> +        avs-monitor@7d5d2000 {
> +                compatible = "brcm,bcm2711-avs-monitor",
> +                             "syscon", "simple-mfd";
> +                reg = <0x7d5d2000 0xf00>;
> +
> +                thermal: thermal {
> +                        compatible = "brcm,bcm2711-thermal";
> +                        #thermal-sensor-cells = <0>;

Also this is not documented. That's not caught because
'additionalProperties: false' is also needed.

Rob
Stefan Wahren Jan. 16, 2020, 6:23 p.m. UTC | #2
Hi Rob,

Am 16.01.20 um 18:33 schrieb Rob Herring:
> On Mon, Jan 13, 2020 at 12:56 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
>> must be retrieved from the AVS ring oscillator block. This block is part
>> of the AVS monitor which contains a bunch of raw sensors.
>>
>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>> ---
>>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
>>  1 file changed, 45 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
> The example fails 'make dt_binding_check':
>
> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.example.dt.yaml:
> thermal: 'reg' is a required property

can you please explain what is the reason for this? The example below
has a reg property. I'm confused.

Best regards
Stefan

>
>> diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>> new file mode 100644
>> index 0000000..98e7b57
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>> @@ -0,0 +1,45 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Broadcom AVS ring oscillator thermal
>> +
>> +maintainers:
>> +  - Stefan Wahren <wahrenst@gmx.net>
>> +
>> +description: |+
>> +  The thermal node should be the child of a syscon node with the
>> +  required property:
>> +
>> +  - compatible: Should be one of the following:
>> +                "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
>> +
>> +  Refer to the the bindings described in
>> +  Documentation/devicetree/bindings/mfd/syscon.txt
>> +
>> +properties:
>> +  compatible:
>> +    const: brcm,bcm2711-thermal
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +
>> +examples:
>> +  - |
>> +        avs-monitor@7d5d2000 {
>> +                compatible = "brcm,bcm2711-avs-monitor",
>> +                             "syscon", "simple-mfd";
>> +                reg = <0x7d5d2000 0xf00>;
>> +
>> +                thermal: thermal {
>> +                        compatible = "brcm,bcm2711-thermal";
>> +                        #thermal-sensor-cells = <0>;
> Also this is not documented. That's not caught because
> 'additionalProperties: false' is also needed.
>
> Rob
Stefan Wahren Jan. 16, 2020, 6:26 p.m. UTC | #3
Am 16.01.20 um 19:23 schrieb Stefan Wahren:
> Hi Rob,
>
> Am 16.01.20 um 18:33 schrieb Rob Herring:
>> On Mon, Jan 13, 2020 at 12:56 PM Stefan Wahren <stefan.wahren@i2se.com> wrote:
>>> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
>>> must be retrieved from the AVS ring oscillator block. This block is part
>>> of the AVS monitor which contains a bunch of raw sensors.
>>>
>>> Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
>>> Reviewed-by: Rob Herring <robh@kernel.org>
>>> Reviewed-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de>
>>> ---
>>>  .../bindings/thermal/brcm,avs-ro-thermal.yaml      | 45 ++++++++++++++++++++++
>>>  1 file changed, 45 insertions(+)
>>>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
>> The example fails 'make dt_binding_check':
>>
>> /builds/robherring/linux-dt-bindings/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.example.dt.yaml:
>> thermal: 'reg' is a required property
> can you please explain what is the reason for this? The example below
> has a reg property. I'm confused.

Please ignore, i got the issue.

Patch
diff mbox series

diff --git a/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
new file mode 100644
index 0000000..98e7b57
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/brcm,avs-ro-thermal.yaml
@@ -0,0 +1,45 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/brcm,avs-ro-thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Broadcom AVS ring oscillator thermal
+
+maintainers:
+  - Stefan Wahren <wahrenst@gmx.net>
+
+description: |+
+  The thermal node should be the child of a syscon node with the
+  required property:
+
+  - compatible: Should be one of the following:
+                "brcm,bcm2711-avs-monitor", "syscon", "simple-mfd"
+
+  Refer to the the bindings described in
+  Documentation/devicetree/bindings/mfd/syscon.txt
+
+properties:
+  compatible:
+    const: brcm,bcm2711-thermal
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+examples:
+  - |
+        avs-monitor@7d5d2000 {
+                compatible = "brcm,bcm2711-avs-monitor",
+                             "syscon", "simple-mfd";
+                reg = <0x7d5d2000 0xf00>;
+
+                thermal: thermal {
+                        compatible = "brcm,bcm2711-thermal";
+                        #thermal-sensor-cells = <0>;
+                };
+        };
+...