diff mbox series

[v2,2/6] arm64: dts: ti: k3-am62-wakeup: add VTM node

Message ID 20230120003051.9100-3-bb@ti.com (mailing list archive)
State New, archived
Headers show
Series add VTM nodes to TI's K3 SoCs | expand

Commit Message

Bryan Brattlof Jan. 20, 2023, 12:30 a.m. UTC
The am62x supports a single Voltage and Thermal Management (VTM) module
located in the wakeup domain with two associated temperature monitors
located in hot spots of the die.

Signed-off-by: Bryan Brattlof <bb@ti.com>
---
 arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi | 33 +++++++++++++++++++++
 arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi  |  8 +++++
 arch/arm64/boot/dts/ti/k3-am62.dtsi         |  6 +++-
 3 files changed, 46 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi

Comments

Vignesh Raghavendra Jan. 28, 2023, 5:23 a.m. UTC | #1
Hi Bryan,

On 1/20/2023 6:00 AM, Bryan Brattlof wrote:
> @@ -94,10 +95,13 @@ cbass_wakeup: bus@2b000000 {
>  			compatible = "simple-bus";
>  			#address-cells = <2>;
>  			#size-cells = <2>;
> -			ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
> +			ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */

You would need to update unit address in node name as well:
			cbass_wakeup: bus@b00000 {

> +				 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
>  				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
>  		};
>  	};
> +
> +	#include "k3-am62-thermal.dtsi"
>  };

Regards
Vignesh
Bryan Brattlof Jan. 31, 2023, 1:57 a.m. UTC | #2
Hi Vignesh!

On January 28, 2023 thus sayeth Raghavendra, Vignesh:
> Hi Bryan,
> 
> On 1/20/2023 6:00 AM, Bryan Brattlof wrote:
> > @@ -94,10 +95,13 @@ cbass_wakeup: bus@2b000000 {
> >  			compatible = "simple-bus";
> >  			#address-cells = <2>;
> >  			#size-cells = <2>;
> > -			ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
> > +			ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
> 
> You would need to update unit address in node name as well:
> 			cbass_wakeup: bus@b00000 {

Ah! I missed that. I'll get this fixed

~Bryan
Christian Gmeiner April 3, 2023, 1:04 p.m. UTC | #3
> Hi Vignesh!
>
> On January 28, 2023 thus sayeth Raghavendra, Vignesh:
> > Hi Bryan,
> >
> > On 1/20/2023 6:00 AM, Bryan Brattlof wrote:
> > > @@ -94,10 +95,13 @@ cbass_wakeup: bus@2b000000 {
> > >                     compatible = "simple-bus";
> > >                     #address-cells = <2>;
> > >                     #size-cells = <2>;
> > > -                   ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
> > > +                   ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
> >
> > You would need to update unit address in node name as well:
> >                       cbass_wakeup: bus@b00000 {
>
> Ah! I missed that. I'll get this fixed

Any update on this? Would be great if these changes could make it into
the next merge window.
Bryan Brattlof April 3, 2023, 2:09 p.m. UTC | #4
Hi Christian!

On April  3, 2023 thus sayeth Christian Gmeiner:
> > Hi Vignesh!
> >
> > On January 28, 2023 thus sayeth Raghavendra, Vignesh:
> > > Hi Bryan,
> > >
> > > On 1/20/2023 6:00 AM, Bryan Brattlof wrote:
> > > > @@ -94,10 +95,13 @@ cbass_wakeup: bus@2b000000 {
> > > >                     compatible = "simple-bus";
> > > >                     #address-cells = <2>;
> > > >                     #size-cells = <2>;
> > > > -                   ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
> > > > +                   ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
> > >
> > > You would need to update unit address in node name as well:
> > >                       cbass_wakeup: bus@b00000 {
> >
> > Ah! I missed that. I'll get this fixed
> 
> Any update on this? Would be great if these changes could make it into
> the next merge window.
> 

You got me :) I let this fall off my radar... I'll send out v3 by today 
or tomorrow to restart the review process.

Thank you for reviewing and for the reminder Christian
~Bryan
diff mbox series

Patch

diff --git a/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi
new file mode 100644
index 0000000000000..a358757e26f07
--- /dev/null
+++ b/arch/arm64/boot/dts/ti/k3-am62-thermal.dtsi
@@ -0,0 +1,33 @@ 
+// SPDX-License-Identifier: GPL-2.0
+
+#include <dt-bindings/thermal/thermal.h>
+
+thermal_zones: thermal-zones {
+	main0_thermal: main0-thermal {
+		polling-delay-passive = <250>;	/* milliSeconds */
+		polling-delay = <500>;		/* milliSeconds */
+		thermal-sensors = <&wkup_vtm0 0>;
+
+		trips {
+			main0_crit: main0-crit {
+				temperature = <105000>;	/* milliCelsius */
+				hysteresis = <2000>;	/* milliCelsius */
+				type = "critical";
+			};
+		};
+	};
+
+	main1_thermal: main1-thermal {
+		polling-delay-passive = <250>;	/* milliSeconds */
+		polling-delay = <500>;		/* milliSeconds */
+		thermal-sensors = <&wkup_vtm0 1>;
+
+		trips {
+			main1_crit: main1-crit {
+				temperature = <105000>;	/* milliCelsius */
+				hysteresis = <2000>;	/* milliCelsius */
+				type = "critical";
+			};
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
index 38dced6b4fef9..91ec9887ac6d1 100644
--- a/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62-wakeup.dtsi
@@ -40,4 +40,12 @@  wkup_i2c0: i2c@2b200000 {
 		clock-names = "fck";
 		status = "disabled";
 	};
+
+	wkup_vtm0: temperature-sensor@b00000 {
+		compatible = "ti,j7200-vtm";
+		reg = <0x00 0xb00000 0x00 0x400>,
+		      <0x00 0xb01000 0x00 0x400>;
+		power-domains = <&k3_pds 95 TI_SCI_PD_EXCLUSIVE>;
+		#thermal-sensor-cells = <1>;
+	};
 };
diff --git a/arch/arm64/boot/dts/ti/k3-am62.dtsi b/arch/arm64/boot/dts/ti/k3-am62.dtsi
index 37fcbe7a3c336..74cf1b4d7a6ad 100644
--- a/arch/arm64/boot/dts/ti/k3-am62.dtsi
+++ b/arch/arm64/boot/dts/ti/k3-am62.dtsi
@@ -80,6 +80,7 @@  cbass_main: bus@f0000 {
 			 <0x00 0x04000000 0x00 0x04000000 0x00 0x01ff1400>,
 
 			 /* Wakeup Domain Range */
+			 <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
 			 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>,
 			 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
 
@@ -94,10 +95,13 @@  cbass_wakeup: bus@2b000000 {
 			compatible = "simple-bus";
 			#address-cells = <2>;
 			#size-cells = <2>;
-			ranges = <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
+			ranges = <0x00 0x00b00000 0x00 0x00b00000 0x00 0x00002400>, /* VTM */
+				 <0x00 0x2b000000 0x00 0x2b000000 0x00 0x00300400>, /* Peripheral Window */
 				 <0x00 0x43000000 0x00 0x43000000 0x00 0x00020000>;
 		};
 	};
+
+	#include "k3-am62-thermal.dtsi"
 };
 
 /* Now include the peripherals for each bus segments */