Skip to contentSkip to conversation

DT: bindings: Powerzone new bindings

RFC In review Daniel Lezcano 2 participants 3 messages Nov 16, 2021 – Nov 18, 2021 Device tree bindings

lore
Share & tools
lore
#0 lore raw

RFC 1/1 DT: bindings: Powerzone new bindings

The proposed bindings are describing a powerzone, a power capping capable place to act on and where we can read the power consumption. The powerzone semantic is also found on the Intel platform with the RAPL register.

The powerzone can also represent a group of children powerzones, hence the description can result on a hierarchy.

The description gives the power constraint dependencies to apply on a specific group of logically or physically aggregated devices. They do not represent the physical location or the power domains of the SoC even if the description could be similar.

---
 .../devicetree/bindings/power/power-zone.yaml | 122 ++++++++++++++++++
 1 file changed, 122 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/power/power-zone.yaml
Documentation/devicetree/bindings/power/power-zone.yaml new file +122 -0
new file mode 100644
index 000000000000..b19ea399bd5b
@@ -0,0 +1,122 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/power/power-zone.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Power zones description
+
+maintainers:
+  - Daniel Lezcano <[email protected]>
+
+description: |+
+
+  A System on Chip contains a multitude of active components and each
+  of them is a source of heat. Even if a temperature sensor is not
+  present, a source of heat can be controlled by acting on the
+  consumed power via different techniques.
+
+  A powerzone describes a component or a group of components where we
+  can control the maximum power consumption. For instance, a group of
+  CPUs via the performance domain, a LCD screen via the brightness,
+  etc ...
+
+  Different components when they are used together can significantly
+  increase the overall temperature, so the description needs to
+  reflect this dependency in order to assign a power budget for a
+  group of powerzones.
+
+  This description is done via a hierarchy and the DT reflects it. It
+  does not represent the physical location or a topology, eg. on a
+  big.Little system, the little CPUs may not be represented as they do
+  not contribute significantly to the heat, however the GPU can be
+  tied with the big CPUs as they usually have a connection for
+  multimedia or game workloads.
+    
+properties:
+  $nodename:
+    const: powerzones
+    description:
+      A description
+
+  compatible:
+    const: powerzones
+
+  "#powerzone-cells":
+    description:
+      Number of cells in powerzone specifier. Typically 0 for nodes
+      representing but it can be any number in the future to describe
+      parameters of the powerzone.
+
+  powerzone:
+    description:
+      A phandle to a parent powerzone. If no powerzone attribute is set, the
+      described powerzone is the topmost in the hierarchy.
+
+required:
+  - compatible
+
+
+additionalProperties: true
+
+examples:
+  - |
+    POWERZONES: powerzones {
+      compatible = "powerzones";
+
+      SOC_PZ: soc {
+      };
+
+      PKG_PZ: pkg {
+        #powerzone-cells = <0>;
+        powerzone = <&SOC_PZ>;
+      };
+
+      BIG_PZ: big {
+        #powerzone-cells = <0>;
+        powerzone = <&PKG_PZ>;
+      };
+
+      GPU_PZ: gpu {
+        #powerzone-cells = <0>;
+        powerzone = <&PKG_PZ>;
+      };
+
+      MULTIMEDIA_PZ: multimedia {
+        #powerzone-cells = <0>;
+        powerzone = <&SOC_PZ>;
+      };
+    };
+
+  - |
+    A57_0: big@0 {
+      compatible = "arm,cortex-a57";
+      reg = <0x0 0x0>;
+      device_type = "cpu";
+      #powerzone-cells = <0>;
+      powerzone = <&BIG_PZ>;
+    };
+
+    A57_1: big@1 {
+      compatible = "arm,cortex-a57";
+      reg = <0x0 0x0>;
+      device_type = "cpu";
+      #powerzone-cells = <0>;
+      powerzone = <&BIG_PZ>;
+    };
+
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    gpu@ffe40000 {
+      compatible = "amlogic,meson-g12a-mali", "arm,mali-bifrost";
+      reg = <0xffe40000 0x10000>;
+      interrupts = <GIC_SPI 160 IRQ_TYPE_LEVEL_HIGH>,
+             <GIC_SPI 161 IRQ_TYPE_LEVEL_HIGH>,
+             <GIC_SPI 162 IRQ_TYPE_LEVEL_HIGH>;
+      interrupt-names = "job", "mmu", "gpu";
+      clocks = <&clk 1>;
+      #powerzone-cells = <0>;
+      powerzone = <&GPU_PZ>;
+    };
+...
Signature · 1 line
2.25.1
#1 lore raw
Quoted 9 lines · Daniel Lezcano

The proposed bindings are describing a powerzone, a power capping capable place to act on and where we can read the power consumption. The powerzone semantic is also found on the Intel platform with the RAPL register.

The powerzone can also represent a group of children powerzones, hence the description can result on a hierarchy.

Quoted 6 lines

The description gives the power constraint dependencies to apply on a specific group of logically or physically aggregated devices. They do not represent the physical location or the power domains of the SoC even if the description could be similar.

Hi Daniel,

This looks reasonable to me, based on what I remember from previous discussions, but it would be good if you could summarize the points that have already been discussed in the past, e.g. which approaches you have tried out before and how you ended up here, including links to mailing list archives.

I know you've been at this for quite some time now, but I can never remember the bits that we discussed in the past myself.

Arnd

#2 lore raw

Hi Arnd,

thanks you for your feedbacks.

I'll wait for feedbacks from Rob and propose a version with implementation.

Quoted 31 lines · Arnd Bergmann
Quoted 9 lines · Daniel Lezcano

The proposed bindings are describing a powerzone, a power capping capable place to act on and where we can read the power consumption. The powerzone semantic is also found on the Intel platform with the RAPL register.

The powerzone can also represent a group of children powerzones, hence the description can result on a hierarchy.

Quoted 6 lines

The description gives the power constraint dependencies to apply on a specific group of logically or physically aggregated devices. They do not represent the physical location or the power domains of the SoC even if the description could be similar.

Hi Daniel,

This looks reasonable to me, based on what I remember from previous discussions, but it would be good if you could summarize the points that have already been discussed in the past, e.g. which approaches you have tried out before and how you ended up here, including links to mailing list archives.

I know you've been at this for quite some time now, but I can never remember the bits that we discussed in the past myself.

Arnd

Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog