diff mbox series

[1/4] dt-bindings: Add BCM2711 thermal

Message ID 1572615749-9524-2-git-send-email-wahrenst@gmx.net (mailing list archive)
State Superseded, archived
Headers show
Series ARM: Enable thermal support for Raspberry Pi 4 | expand

Commit Message

Stefan Wahren Nov. 1, 2019, 1:42 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. So add a new
suitable binding.

Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
---
 .../bindings/thermal/brcm,bcm2711-thermal.txt      | 39 ++++++++++++++++++++++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt

--
2.7.4

Comments

Rob Herring Nov. 6, 2019, 4:21 a.m. UTC | #1
On Fri, Nov 01, 2019 at 02:42:26PM +0100, Stefan Wahren wrote:
> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
> must be retrieved from the AVS ring oscillator block. So add a new
> suitable binding.

Anything else in that block? 
> 
> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
> ---
>  .../bindings/thermal/brcm,bcm2711-thermal.txt      | 39 ++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
> 
> diff --git a/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt b/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
> new file mode 100644
> index 0000000..5531d3f
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
> @@ -0,0 +1,39 @@
> +Binding for Thermal Sensor driver for BCM2711 SoCs.
> +
> +Required properties:
> +- compatible:		must be: "brcm,bcm2711-thermal"

If the block is called 'AVS ring oscillator', then the compatible name 
should mirror that.

> +- reg:			Address range of the thermal registers.
> +- clocks:		Phandle of the clock used by the thermal sensor.
> +- #thermal-sensor-cells:	should be 0 (see thermal.txt)
> +
> +Example:
> +
> +thermal-zones {
> +	cpu_thermal: cpu-thermal {
> +		polling-delay-passive = <0>;
> +		polling-delay = <1000>;
> +
> +		thermal-sensors = <&thermal>;
> +
> +		trips {
> +			cpu-crit {
> +				temperature	= <80000>;
> +				hysteresis	= <0>;
> +				type		= "critical";
> +			};
> +		};
> +
> +		coefficients = <(-487)  410040>;
> +
> +		cooling-maps {
> +		};
> +	};
> +};
> +
> +thermal@7d5d2200 {
> +	compatible = "brcm,bcm2711-thermal";
> +	reg = <0x7d5d2200 0x4>;
> +	clocks = <&clocks BCM2835_CLOCK_TSENS>;
> +	#thermal-sensor-cells = <0>;
> +};
> +
> --
> 2.7.4
>
Florian Fainelli Nov. 6, 2019, 4:41 a.m. UTC | #2
On 11/5/2019 8:21 PM, Rob Herring wrote:
> On Fri, Nov 01, 2019 at 02:42:26PM +0100, Stefan Wahren wrote:
>> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
>> must be retrieved from the AVS ring oscillator block. So add a new
>> suitable binding.
> 
> Anything else in that block? 

Yes, the register space is quite big, and contains a bunch of raw
sensors (voltage, ring oscillators etc.). It might be more appropriate
to define the ring oscillator node and then use a syscon phandle to it
with the appropriate register offset within that block.

>>
>> Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
>> ---
>>  .../bindings/thermal/brcm,bcm2711-thermal.txt      | 39 ++++++++++++++++++++++
>>  1 file changed, 39 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
>>
>> diff --git a/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt b/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
>> new file mode 100644
>> index 0000000..5531d3f
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
>> @@ -0,0 +1,39 @@
>> +Binding for Thermal Sensor driver for BCM2711 SoCs.
>> +
>> +Required properties:
>> +- compatible:		must be: "brcm,bcm2711-thermal"
> 
> If the block is called 'AVS ring oscillator', then the compatible name 
> should mirror that.
> 
>> +- reg:			Address range of the thermal registers.
>> +- clocks:		Phandle of the clock used by the thermal sensor.
>> +- #thermal-sensor-cells:	should be 0 (see thermal.txt)
>> +
>> +Example:
>> +
>> +thermal-zones {
>> +	cpu_thermal: cpu-thermal {
>> +		polling-delay-passive = <0>;
>> +		polling-delay = <1000>;
>> +
>> +		thermal-sensors = <&thermal>;
>> +
>> +		trips {
>> +			cpu-crit {
>> +				temperature	= <80000>;
>> +				hysteresis	= <0>;
>> +				type		= "critical";
>> +			};
>> +		};
>> +
>> +		coefficients = <(-487)  410040>;
>> +
>> +		cooling-maps {
>> +		};
>> +	};
>> +};
>> +
>> +thermal@7d5d2200 {
>> +	compatible = "brcm,bcm2711-thermal";
>> +	reg = <0x7d5d2200 0x4>;
>> +	clocks = <&clocks BCM2835_CLOCK_TSENS>;
>> +	#thermal-sensor-cells = <0>;
>> +};
>> +
>> --
>> 2.7.4
>>
Stefan Wahren Nov. 7, 2019, 7:26 p.m. UTC | #3
Am 06.11.19 um 05:41 schrieb Florian Fainelli:
>
> On 11/5/2019 8:21 PM, Rob Herring wrote:
>> On Fri, Nov 01, 2019 at 02:42:26PM +0100, Stefan Wahren wrote:
>>> Since the BCM2711 doesn't have a AVS TMON block, the thermal information
>>> must be retrieved from the AVS ring oscillator block. So add a new
>>> suitable binding.
>> Anything else in that block?
> Yes, the register space is quite big, and contains a bunch of raw
> sensors (voltage, ring oscillators etc.). It might be more appropriate
> to define the ring oscillator node and then use a syscon phandle to it
> with the appropriate register offset within that block.
AVS_MONITOR: 0x7d5d2000 - 0x7d5d2eff
AVS_RO_REGISTERS_0: 0x7d5d2200 - 0x7d5d22e3

So i should define a node for AVS_RO_REGISTERS_0 ?
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt b/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
new file mode 100644
index 0000000..5531d3f
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/brcm,bcm2711-thermal.txt
@@ -0,0 +1,39 @@ 
+Binding for Thermal Sensor driver for BCM2711 SoCs.
+
+Required properties:
+- compatible:		must be: "brcm,bcm2711-thermal"
+- reg:			Address range of the thermal registers.
+- clocks:		Phandle of the clock used by the thermal sensor.
+- #thermal-sensor-cells:	should be 0 (see thermal.txt)
+
+Example:
+
+thermal-zones {
+	cpu_thermal: cpu-thermal {
+		polling-delay-passive = <0>;
+		polling-delay = <1000>;
+
+		thermal-sensors = <&thermal>;
+
+		trips {
+			cpu-crit {
+				temperature	= <80000>;
+				hysteresis	= <0>;
+				type		= "critical";
+			};
+		};
+
+		coefficients = <(-487)  410040>;
+
+		cooling-maps {
+		};
+	};
+};
+
+thermal@7d5d2200 {
+	compatible = "brcm,bcm2711-thermal";
+	reg = <0x7d5d2200 0x4>;
+	clocks = <&clocks BCM2835_CLOCK_TSENS>;
+	#thermal-sensor-cells = <0>;
+};
+