linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15
@ 2021-07-11 23:43 Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 01/13] ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees Dmitry Osipenko
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

This series:

  - adds SoC thermal sensor node
  - adds interrupt for LM90 to Ouya, AC100, Nexus 7 and A500 devices
  - fixes interrupt of LM90 sensor for all boards
  - removes bogus VBUS regulators from A500 device-tree
  - improves thermal zones of Nexus 7 and A500 devices based on previous
    discussion with Daniel Lezcano [1]

[1] https://lore.kernel.org/lkml/1abadc69-1dd1-5939-c089-37a84be4781b@linaro.org/

Dmitry Osipenko (13):
  ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees
  ARM: tegra: ouya: Add interrupt to temperature sensor node
  ARM: tegra: paz00: Add interrupt to temperature sensor node
  ARM: tegra: nexus7: Add interrupt to temperature sensor node
  ARM: tegra: acer-a500: Add interrupt to temperature sensor node
  ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor
  ARM: tegra: apalis: Correct interrupt trigger type of temperature
    sensor
  ARM: tegra: cardhu: Correct interrupt trigger type of temperature
    sensor
  ARM: tegra: dalmore: Correct interrupt trigger type of temperature
    sensor
  ARM: tegra: jetson-tk1: Correct interrupt trigger type of temperature
    sensor
  ARM: tegra: acer-a500: Remove bogus USB VBUS regulators
  ARM: tegra: acer-a500: Improve thermal zones
  ARM: tegra: nexus7: Improve thermal zones

 arch/arm/boot/dts/tegra114-dalmore.dts        |  2 +-
 arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi   |  2 +-
 arch/arm/boot/dts/tegra124-apalis.dtsi        |  2 +-
 arch/arm/boot/dts/tegra124-jetson-tk1.dts     |  2 +-
 arch/arm/boot/dts/tegra124-nyan.dtsi          |  2 +-
 .../boot/dts/tegra20-acer-a500-picasso.dts    | 84 +++++++++++-------
 arch/arm/boot/dts/tegra20-paz00.dts           |  4 +
 .../tegra30-asus-nexus7-grouper-common.dtsi   | 60 ++++++++++++-
 arch/arm/boot/dts/tegra30-cardhu.dtsi         |  2 +-
 arch/arm/boot/dts/tegra30-ouya.dts            | 13 ++-
 arch/arm/boot/dts/tegra30.dtsi                | 87 ++++++++++++++++++-
 11 files changed, 206 insertions(+), 54 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH v1 01/13] ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 02/13] ARM: tegra: ouya: Add interrupt to temperature sensor node Dmitry Osipenko
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

Add the on-chip SoC thermal sensor to Tegra30 device-trees. Now CPU
temperature reporting and thermal throttling is available on all Tegra30
devices universally.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra30.dtsi | 87 ++++++++++++++++++++++++++++++++--
 1 file changed, 83 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index c577c191be4b..eaf4951d9ff8 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -5,6 +5,7 @@
 #include <dt-bindings/pinctrl/pinctrl-tegra.h>
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/soc/tegra-pmc.h>
+#include <dt-bindings/thermal/thermal.h>
 
 #include "tegra30-peripherals-opp.dtsi"
 
@@ -800,6 +801,20 @@ fuse@7000f800 {
 		reset-names = "fuse";
 	};
 
+	tsensor: tsensor@70014000 {
+		compatible = "nvidia,tegra30-tsensor";
+		reg = <0x70014000 0x500>;
+		interrupts = <GIC_SPI 102 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&tegra_car TEGRA30_CLK_TSENSOR>;
+		resets = <&tegra_car TEGRA30_CLK_TSENSOR>;
+
+		assigned-clocks = <&tegra_car TEGRA30_CLK_TSENSOR>;
+		assigned-clock-parents = <&tegra_car TEGRA30_CLK_CLK_M>;
+		assigned-clock-rates = <500000>;
+
+		#thermal-sensor-cells = <1>;
+	};
+
 	hda@70030000 {
 		compatible = "nvidia,tegra30-hda";
 		reg = <0x70030000 0x10000>;
@@ -1062,32 +1077,36 @@ cpus {
 		#address-cells = <1>;
 		#size-cells = <0>;
 
-		cpu@0 {
+		cpu0: cpu@0 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <0>;
 			clocks = <&tegra_car TEGRA30_CLK_CCLK_G>;
+			#cooling-cells = <2>;
 		};
 
-		cpu@1 {
+		cpu1: cpu@1 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <1>;
 			clocks = <&tegra_car TEGRA30_CLK_CCLK_G>;
+			#cooling-cells = <2>;
 		};
 
-		cpu@2 {
+		cpu2: cpu@2 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <2>;
 			clocks = <&tegra_car TEGRA30_CLK_CCLK_G>;
+			#cooling-cells = <2>;
 		};
 
-		cpu@3 {
+		cpu3: cpu@3 {
 			device_type = "cpu";
 			compatible = "arm,cortex-a9";
 			reg = <3>;
 			clocks = <&tegra_car TEGRA30_CLK_CCLK_G>;
+			#cooling-cells = <2>;
 		};
 	};
 
@@ -1102,4 +1121,64 @@ pmu {
 				     <&{/cpus/cpu@2}>,
 				     <&{/cpus/cpu@3}>;
 	};
+
+	thermal-zones {
+		tsensor0-thermal {
+			polling-delay-passive = <1000>; /* milliseconds */
+			polling-delay = <5000>; /* milliseconds */
+
+			thermal-sensors = <&tsensor 0>;
+
+			trips {
+				level1_trip: dvfs-alert {
+					/* throttle at 80C until temperature drops to 79.8C */
+					temperature = <80000>;
+					hysteresis = <200>;
+					type = "passive";
+				};
+
+				level2_trip: cpu-div2-throttle {
+					/* hardware CPU x2 freq throttle at 85C */
+					temperature = <85000>;
+					hysteresis = <200>;
+					type = "hot";
+				};
+
+				level3_trip: soc-critical {
+					/* hardware shut down at 90C */
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map0 {
+					trip = <&level1_trip>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&actmon THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+
+		tsensor1-thermal {
+			status = "disabled";
+
+			polling-delay-passive = <1000>; /* milliseconds */
+			polling-delay = <0>; /* milliseconds */
+
+			thermal-sensors = <&tsensor 1>;
+
+			trips {
+				dvfs-alert {
+					temperature = <80000>;
+					hysteresis = <200>;
+					type = "passive";
+				};
+			};
+		};
+	};
 };
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 02/13] ARM: tegra: ouya: Add interrupt to temperature sensor node
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 01/13] ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 03/13] ARM: tegra: paz00: " Dmitry Osipenko
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC.
Add interrupt property to the temperature sensor and enable it in pinmux,
for completeness.

Tested-by: Matt Merhar <mattmerhar@protonmail.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra30-ouya.dts | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/arch/arm/boot/dts/tegra30-ouya.dts b/arch/arm/boot/dts/tegra30-ouya.dts
index ab8744f3d72d..90db5ff72537 100644
--- a/arch/arm/boot/dts/tegra30-ouya.dts
+++ b/arch/arm/boot/dts/tegra30-ouya.dts
@@ -124,12 +124,11 @@ cpu_temp: nct1008@4c {
 			compatible = "onnn,nct1008";
 			reg = <0x4c>;
 			vcc-supply = <&sys_3v3_reg>;
+
+			interrupt-parent = <&gpio>;
+			interrupts = <TEGRA_GPIO(CC, 2) IRQ_TYPE_EDGE_FALLING>;
+
 			#thermal-sensor-cells = <1>;
-/*
- *			The interrupt is bugged, once triggered it never clears.
- *			interrupt-parent = <&gpio>;
- *			interrupts = <TEGRA_GPIO(CC, 2) IRQ_TYPE_LEVEL_LOW>;
- */
 		};
 
 		pmic: pmic@2d {
@@ -4376,8 +4375,8 @@ pcc2 {
 		nvidia,pins = "pcc2";
 		nvidia,function = "i2s4";
 		nvidia,pull = <TEGRA_PIN_PULL_NONE>;
-		nvidia,tristate = <TEGRA_PIN_ENABLE>;
-		nvidia,enable-input = <TEGRA_PIN_DISABLE>;
+		nvidia,tristate = <TEGRA_PIN_DISABLE>;
+		nvidia,enable-input = <TEGRA_PIN_ENABLE>;
 	};
 	sdmmc4_rst_n_pcc3 {
 		nvidia,pins = "sdmmc4_rst_n_pcc3";
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 03/13] ARM: tegra: paz00: Add interrupt to temperature sensor node
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 01/13] ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 02/13] ARM: tegra: ouya: Add interrupt to temperature sensor node Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 04/13] ARM: tegra: nexus7: " Dmitry Osipenko
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC.
Add interrupt property to the temperature sensor for completeness.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra20-paz00.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/tegra20-paz00.dts b/arch/arm/boot/dts/tegra20-paz00.dts
index 3180bff90756..acc816bfd233 100644
--- a/arch/arm/boot/dts/tegra20-paz00.dts
+++ b/arch/arm/boot/dts/tegra20-paz00.dts
@@ -503,6 +503,10 @@ ldo_rtc {
 		adt7461: temperature-sensor@4c {
 			compatible = "adi,adt7461";
 			reg = <0x4c>;
+
+			interrupt-parent = <&gpio>;
+			interrupts = <TEGRA_GPIO(N, 6) IRQ_TYPE_EDGE_FALLING>;
+
 			#thermal-sensor-cells = <1>;
 		};
 	};
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 04/13] ARM: tegra: nexus7: Add interrupt to temperature sensor node
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (2 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 03/13] ARM: tegra: paz00: " Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 05/13] ARM: tegra: acer-a500: " Dmitry Osipenko
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC.
Add interrupt property to the temperature sensor for completeness.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi b/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
index ae8300baa2d4..33985fca956f 100644
--- a/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
+++ b/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
@@ -920,6 +920,10 @@ nct72: temperature-sensor@4c {
 			compatible = "onnn,nct1008";
 			reg = <0x4c>;
 			vcc-supply = <&vdd_3v3_sys>;
+
+			interrupt-parent = <&gpio>;
+			interrupts = <TEGRA_GPIO(S, 3) IRQ_TYPE_EDGE_FALLING>;
+
 			#thermal-sensor-cells = <1>;
 		};
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 05/13] ARM: tegra: acer-a500: Add interrupt to temperature sensor node
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (3 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 04/13] ARM: tegra: nexus7: " Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 06/13] ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor Dmitry Osipenko
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The TEMP_ALERT pin of LM90 temperature sensor is connected to Tegra SoC.
Add interrupt property to the temperature sensor for completeness.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra20-acer-a500-picasso.dts | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
index 1976c383912a..4897079680bd 100644
--- a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
+++ b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
@@ -693,6 +693,10 @@ nct1008: temperature-sensor@4c {
 			compatible = "onnn,nct1008";
 			reg = <0x4c>;
 			vcc-supply = <&vdd_3v3_sys>;
+
+			interrupt-parent = <&gpio>;
+			interrupts = <TEGRA_GPIO(N, 6) IRQ_TYPE_EDGE_FALLING>;
+
 			#thermal-sensor-cells = <1>;
 		};
 	};
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 06/13] ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (4 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 05/13] ARM: tegra: acer-a500: " Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 07/13] ARM: tegra: apalis: " Dmitry Osipenko
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The LM90 temperature sensor should use edge-triggered interrupt because
LM90 hardware doesn't deassert interrupt line until temperature is back
to normal state, which results in interrupt storm. Correct the interrupt
trigger type.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra124-nyan.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra124-nyan.dtsi b/arch/arm/boot/dts/tegra124-nyan.dtsi
index 5f71add38dfe..63a81270300a 100644
--- a/arch/arm/boot/dts/tegra124-nyan.dtsi
+++ b/arch/arm/boot/dts/tegra124-nyan.dtsi
@@ -91,7 +91,7 @@ temperature-sensor@4c {
 			compatible = "ti,tmp451";
 			reg = <0x4c>;
 			interrupt-parent = <&gpio>;
-			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_EDGE_FALLING>;
 
 			#thermal-sensor-cells = <1>;
 		};
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 07/13] ARM: tegra: apalis: Correct interrupt trigger type of temperature sensor
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (5 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 06/13] ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 08/13] ARM: tegra: cardhu: " Dmitry Osipenko
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The LM90 temperature sensor should use edge-triggered interrupt because
LM90 hardware doesn't deassert interrupt line until temperature is back
to normal state, which results in interrupt storm. Correct the interrupt
trigger type.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi | 2 +-
 arch/arm/boot/dts/tegra124-apalis.dtsi      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
index 1e30fa405fa0..cde9ae8fa04b 100644
--- a/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis-v1.2.dtsi
@@ -1751,7 +1751,7 @@ temp-sensor@4c {
 			compatible = "ti,tmp451";
 			reg = <0x4c>;
 			interrupt-parent = <&gpio>;
-			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_EDGE_FALLING>;
 			#thermal-sensor-cells = <1>;
 			vcc-supply = <&reg_module_3v3>;
 		};
diff --git a/arch/arm/boot/dts/tegra124-apalis.dtsi b/arch/arm/boot/dts/tegra124-apalis.dtsi
index 608896f8dd52..a46d9ba9bb7a 100644
--- a/arch/arm/boot/dts/tegra124-apalis.dtsi
+++ b/arch/arm/boot/dts/tegra124-apalis.dtsi
@@ -1744,7 +1744,7 @@ temp-sensor@4c {
 			compatible = "ti,tmp451";
 			reg = <0x4c>;
 			interrupt-parent = <&gpio>;
-			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_EDGE_FALLING>;
 			#thermal-sensor-cells = <1>;
 			vcc-supply = <&reg_module_3v3>;
 		};
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 08/13] ARM: tegra: cardhu: Correct interrupt trigger type of temperature sensor
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (6 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 07/13] ARM: tegra: apalis: " Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:43 ` [PATCH v1 09/13] ARM: tegra: dalmore: " Dmitry Osipenko
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The LM90 temperature sensor should use edge-triggered interrupt because
LM90 hardware doesn't deassert interrupt line until temperature is back
to normal state, which results in interrupt storm. Correct the interrupt
trigger type.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra30-cardhu.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra30-cardhu.dtsi b/arch/arm/boot/dts/tegra30-cardhu.dtsi
index d9dd11569d4b..448f1397e64a 100644
--- a/arch/arm/boot/dts/tegra30-cardhu.dtsi
+++ b/arch/arm/boot/dts/tegra30-cardhu.dtsi
@@ -348,7 +348,7 @@ nct1008: temperature-sensor@4c {
 			reg = <0x4c>;
 			vcc-supply = <&sys_3v3_reg>;
 			interrupt-parent = <&gpio>;
-			interrupts = <TEGRA_GPIO(CC, 2) IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <TEGRA_GPIO(CC, 2) IRQ_TYPE_EDGE_FALLING>;
 			#thermal-sensor-cells = <1>;
 		};
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 09/13] ARM: tegra: dalmore: Correct interrupt trigger type of temperature sensor
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (7 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 08/13] ARM: tegra: cardhu: " Dmitry Osipenko
@ 2021-07-11 23:43 ` Dmitry Osipenko
  2021-07-11 23:44 ` [PATCH v1 10/13] ARM: tegra: jetson-tk1: " Dmitry Osipenko
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:43 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The LM90 temperature sensor should use edge-triggered interrupt because
LM90 hardware doesn't deassert interrupt line until temperature is back
to normal state, which results in interrupt storm. Correct the interrupt
trigger type.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra114-dalmore.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra114-dalmore.dts b/arch/arm/boot/dts/tegra114-dalmore.dts
index c04162ddec3c..7fd901f8d39a 100644
--- a/arch/arm/boot/dts/tegra114-dalmore.dts
+++ b/arch/arm/boot/dts/tegra114-dalmore.dts
@@ -788,7 +788,7 @@ temperature-sensor@4c {
 			reg = <0x4c>;
 			vcc-supply = <&palmas_ldo6_reg>;
 			interrupt-parent = <&gpio>;
-			interrupts = <TEGRA_GPIO(O, 4) IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <TEGRA_GPIO(O, 4) IRQ_TYPE_EDGE_FALLING>;
 		};
 	};
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 10/13] ARM: tegra: jetson-tk1: Correct interrupt trigger type of temperature sensor
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (8 preceding siblings ...)
  2021-07-11 23:43 ` [PATCH v1 09/13] ARM: tegra: dalmore: " Dmitry Osipenko
@ 2021-07-11 23:44 ` Dmitry Osipenko
  2021-07-11 23:44 ` [PATCH v1 11/13] ARM: tegra: acer-a500: Remove bogus USB VBUS regulators Dmitry Osipenko
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:44 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The LM90 temperature sensor should use edge-triggered interrupt because
LM90 hardware doesn't deassert interrupt line until temperature is back
to normal state, which results in interrupt storm. Correct the interrupt
trigger type.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 arch/arm/boot/dts/tegra124-jetson-tk1.dts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/tegra124-jetson-tk1.dts b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
index 414cd1cafa7f..35ab296408e1 100644
--- a/arch/arm/boot/dts/tegra124-jetson-tk1.dts
+++ b/arch/arm/boot/dts/tegra124-jetson-tk1.dts
@@ -1427,7 +1427,7 @@ temperature-sensor@4c {
 			compatible = "ti,tmp451";
 			reg = <0x4c>;
 			interrupt-parent = <&gpio>;
-			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_LEVEL_LOW>;
+			interrupts = <TEGRA_GPIO(I, 6) IRQ_TYPE_EDGE_FALLING>;
 		};
 
 		eeprom@56 {
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 11/13] ARM: tegra: acer-a500: Remove bogus USB VBUS regulators
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (9 preceding siblings ...)
  2021-07-11 23:44 ` [PATCH v1 10/13] ARM: tegra: jetson-tk1: " Dmitry Osipenko
@ 2021-07-11 23:44 ` Dmitry Osipenko
  2021-07-11 23:44 ` [PATCH v1 12/13] ARM: tegra: acer-a500: Improve thermal zones Dmitry Osipenko
  2021-07-11 23:44 ` [PATCH v1 13/13] ARM: tegra: nexus7: " Dmitry Osipenko
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:44 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

The configuration of USB VBUS regulators was borrowed from downstream
kernel, which is incorrect because the corresponding GPIOs are connected
to PROX_EN (A501 3G model) and LED_EN pins in accordance to the board
schematics. USB works fine with both GPIOs being disabled, so remove the
bogus USB VBUS regulators. The USB VBUS of USB3 is supplied from the fixed
5v system regulator and device-mode USB1 doesn't have VBUS switches.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 .../boot/dts/tegra20-acer-a500-picasso.dts    | 25 +------------------
 1 file changed, 1 insertion(+), 24 deletions(-)

diff --git a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
index 4897079680bd..c385b13d4faa 100644
--- a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
+++ b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
@@ -723,7 +723,6 @@ usb-phy@c5000000 {
 		nvidia,xcvr-setup-use-fuses;
 		nvidia,xcvr-lsfslew = <2>;
 		nvidia,xcvr-lsrslew = <2>;
-		vbus-supply = <&vdd_vbus1>;
 	};
 
 	usb@c5008000 {
@@ -735,7 +734,7 @@ usb-phy@c5008000 {
 		nvidia,xcvr-setup-use-fuses;
 		nvidia,xcvr-lsfslew = <2>;
 		nvidia,xcvr-lsrslew = <2>;
-		vbus-supply = <&vdd_vbus3>;
+		vbus-supply = <&vdd_5v0_sys>;
 	};
 
 	brcm_wifi_pwrseq: wifi-pwrseq {
@@ -995,28 +994,6 @@ vdd_pnl: regulator@3 {
 		vin-supply = <&vdd_5v0_sys>;
 	};
 
-	vdd_vbus1: regulator@4 {
-		compatible = "regulator-fixed";
-		regulator-name = "vdd_usb1_vbus";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-always-on;
-		gpio = <&gpio TEGRA_GPIO(D, 0) GPIO_ACTIVE_HIGH>;
-		enable-active-high;
-		vin-supply = <&vdd_5v0_sys>;
-	};
-
-	vdd_vbus3: regulator@5 {
-		compatible = "regulator-fixed";
-		regulator-name = "vdd_usb3_vbus";
-		regulator-min-microvolt = <5000000>;
-		regulator-max-microvolt = <5000000>;
-		regulator-always-on;
-		gpio = <&gpio TEGRA_GPIO(D, 3) GPIO_ACTIVE_HIGH>;
-		enable-active-high;
-		vin-supply = <&vdd_5v0_sys>;
-	};
-
 	sound {
 		compatible = "nvidia,tegra-audio-wm8903-picasso",
 			     "nvidia,tegra-audio-wm8903";
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 12/13] ARM: tegra: acer-a500: Improve thermal zones
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (10 preceding siblings ...)
  2021-07-11 23:44 ` [PATCH v1 11/13] ARM: tegra: acer-a500: Remove bogus USB VBUS regulators Dmitry Osipenko
@ 2021-07-11 23:44 ` Dmitry Osipenko
  2021-07-11 23:44 ` [PATCH v1 13/13] ARM: tegra: nexus7: " Dmitry Osipenko
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:44 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

Use skin temperature for maintaining temperature that is suitable
specifically for A500. Add CPU thermal zone that protects silicon.
All these changes don't make a significant difference, but it is a
more correct definition of thermal zones.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 .../boot/dts/tegra20-acer-a500-picasso.dts    | 55 ++++++++++++++++---
 1 file changed, 46 insertions(+), 9 deletions(-)

diff --git a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
index c385b13d4faa..75ce986df958 100644
--- a/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
+++ b/arch/arm/boot/dts/tegra20-acer-a500-picasso.dts
@@ -1025,11 +1025,48 @@ sound {
 	};
 
 	thermal-zones {
+		/*
+		 * NCT1008 has two sensors:
+		 *
+		 *	0: internal that monitors ambient/skin temperature
+		 *	1: external that is connected to the CPU's diode
+		 *
+		 * Ideally we should use userspace thermal governor,
+		 * but it's a much more complex solution.  The "skin"
+		 * zone is a simpler solution which prevents A500 from
+		 * getting too hot from a user's tactile perspective.
+		 * The CPU zone is intended to protect silicon from damage.
+		 */
+
 		skin-thermal {
 			polling-delay-passive = <1000>; /* milliseconds */
-			polling-delay = <0>; /* milliseconds */
+			polling-delay = <5000>; /* milliseconds */
 
 			thermal-sensors = <&nct1008 0>;
+
+			trips {
+				trip0: skin-alert {
+					/* start throttling at 60C */
+					temperature = <60000>;
+					hysteresis = <200>;
+					type = "passive";
+				};
+
+				trip1: skin-crit {
+					/* shut down at 70C */
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map0 {
+					trip = <&trip0>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+				};
+			};
 		};
 
 		cpu-thermal {
@@ -1039,24 +1076,24 @@ cpu-thermal {
 			thermal-sensors = <&nct1008 1>;
 
 			trips {
-				trip0: cpu-alert0 {
-					/* start throttling at 60C */
-					temperature = <60000>;
+				trip2: cpu-alert {
+					/* throttle at 85C until temperature drops to 84.8C */
+					temperature = <85000>;
 					hysteresis = <200>;
 					type = "passive";
 				};
 
-				trip1: cpu-crit {
-					/* shut down at 70C */
-					temperature = <70000>;
+				trip3: cpu-crit {
+					/* shut down at 90C */
+					temperature = <90000>;
 					hysteresis = <2000>;
 					type = "critical";
 				};
 			};
 
 			cooling-maps {
-				map0 {
-					trip = <&trip0>;
+				map1 {
+					trip = <&trip2>;
 					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
 							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
 				};
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [PATCH v1 13/13] ARM: tegra: nexus7: Improve thermal zones
  2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
                   ` (11 preceding siblings ...)
  2021-07-11 23:44 ` [PATCH v1 12/13] ARM: tegra: acer-a500: Improve thermal zones Dmitry Osipenko
@ 2021-07-11 23:44 ` Dmitry Osipenko
  12 siblings, 0 replies; 14+ messages in thread
From: Dmitry Osipenko @ 2021-07-11 23:44 UTC (permalink / raw)
  To: Thierry Reding, Jonathan Hunter, Matt Merhar, Peter Geis
  Cc: Daniel Lezcano, linux-kernel, linux-tegra

Use skin temperature for maintaining temperature that is suitable
specifically for Nexus 7. Add CPU thermal zone that protects silicon.
All these changes don't make a significant difference, but it is a
more correct definition of thermal zones.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 .../tegra30-asus-nexus7-grouper-common.dtsi   | 56 +++++++++++++++++--
 1 file changed, 52 insertions(+), 4 deletions(-)

diff --git a/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi b/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
index 33985fca956f..9732cd6f20b7 100644
--- a/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
+++ b/arch/arm/boot/dts/tegra30-asus-nexus7-grouper-common.dtsi
@@ -1255,21 +1255,34 @@ sound {
 	};
 
 	thermal-zones {
-		cpu-thermal {
+		/*
+		 * NCT72 has two sensors:
+		 *
+		 *	0: internal that monitors ambient/skin temperature
+		 *	1: external that is connected to the CPU's diode
+		 *
+		 * Ideally we should use userspace thermal governor,
+		 * but it's a much more complex solution.  The "skin"
+		 * zone is a simpler solution which prevents Nexus 7
+		 * from getting too hot from a user's tactile perspective.
+		 * The CPU zone is intended to protect silicon from damage.
+		 */
+
+		skin-thermal {
 			polling-delay-passive = <1000>; /* milliseconds */
 			polling-delay = <5000>; /* milliseconds */
 
-			thermal-sensors = <&nct72 1>;
+			thermal-sensors = <&nct72 0>;
 
 			trips {
-				trip0: cpu-alert0 {
+				trip0: skin-alert {
 					/* throttle at 57C until temperature drops to 56.8C */
 					temperature = <57000>;
 					hysteresis = <200>;
 					type = "passive";
 				};
 
-				trip1: cpu-crit {
+				trip1: skin-crit {
 					/* shut down at 65C */
 					temperature = <65000>;
 					hysteresis = <2000>;
@@ -1289,5 +1302,40 @@ map0 {
 				};
 			};
 		};
+
+		cpu-thermal {
+			polling-delay-passive = <1000>; /* milliseconds */
+			polling-delay = <5000>; /* milliseconds */
+
+			thermal-sensors = <&nct72 1>;
+
+			trips {
+				trip2: cpu-alert {
+					/* throttle at 85C until temperature drops to 84.8C */
+					temperature = <85000>;
+					hysteresis = <200>;
+					type = "passive";
+				};
+
+				trip3: cpu-crit {
+					/* shut down at 90C */
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map1 {
+					trip = <&trip2>;
+					cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+							 <&actmon THERMAL_NO_LIMIT
+								  THERMAL_NO_LIMIT>;
+				};
+			};
+		};
 	};
 };
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-07-11 23:45 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-11 23:43 [PATCH v1 00/13] Tegra ARM32 device-tree improvements for 5.15 Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 01/13] ARM: tegra: Add SoC thermal sensor to Tegra30 device-trees Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 02/13] ARM: tegra: ouya: Add interrupt to temperature sensor node Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 03/13] ARM: tegra: paz00: " Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 04/13] ARM: tegra: nexus7: " Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 05/13] ARM: tegra: acer-a500: " Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 06/13] ARM: tegra: nyan: Correct interrupt trigger type of temperature sensor Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 07/13] ARM: tegra: apalis: " Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 08/13] ARM: tegra: cardhu: " Dmitry Osipenko
2021-07-11 23:43 ` [PATCH v1 09/13] ARM: tegra: dalmore: " Dmitry Osipenko
2021-07-11 23:44 ` [PATCH v1 10/13] ARM: tegra: jetson-tk1: " Dmitry Osipenko
2021-07-11 23:44 ` [PATCH v1 11/13] ARM: tegra: acer-a500: Remove bogus USB VBUS regulators Dmitry Osipenko
2021-07-11 23:44 ` [PATCH v1 12/13] ARM: tegra: acer-a500: Improve thermal zones Dmitry Osipenko
2021-07-11 23:44 ` [PATCH v1 13/13] ARM: tegra: nexus7: " Dmitry Osipenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).