[PATCH v2 7/9] arm64: tegra: set hot trips for Tegra210

2016-04-26 Thread Wei Ni
Enable throttle function for SOC_THERM.
Set "hot" trips for cpu and gpu thermal zones, which
can trigger the SOC_THERM hardware throttle.

Signed-off-by: Wei Ni 
---
 arch/arm64/boot/dts/nvidia/tegra210.dtsi | 41 +---
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi 
b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
index e3cca58a4c86..332771ab38e8 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
@@ -804,7 +804,9 @@
 
soctherm: thermal-sensor@0,700e2000 {
compatible = "nvidia,tegra210-soctherm";
-   reg = <0x0 0x700e2000 0x0 0x1000>;
+   reg = <0x0 0x700e2000 0x0 0x600 /* SOC_THERM reg_base */
+   0x0 0x60006000 0x0 0x400>; /* CAR reg_base */
+   reg-names = "soctherm-reg", "car-reg";
interrupts = ;
clocks = <_car TEGRA210_CLK_TSENSOR>,
<_car TEGRA210_CLK_SOC_THERM>;
@@ -812,6 +814,15 @@
resets = <_car 78>;
reset-names = "soctherm";
#thermal-sensor-cells = <1>;
+
+   throttle-cfgs {
+   throttle_heavy: heavy {
+   priority = <100>;
+   cpu-throt-depth = <85>;
+
+   #cooling-cells = <2>;
+   };
+   };
};
 
thermal-zones {
@@ -828,13 +839,19 @@
hysteresis = <0>;
type = "critical";
};
+
+   cpu_throttle_trip: throttle-trip {
+   temperature = <98500>;
+   hysteresis = <1000>;
+   type = "hot";
+   };
};
 
cooling-maps {
-   /*
-* There are currently no cooling maps,
-* because there are no cooling devices.
-*/
+   map0 {
+   trip = <_throttle_trip>;
+   cooling-device = <_heavy 1 1>;
+   };
};
};
mem {
@@ -872,13 +889,19 @@
hysteresis = <0>;
type = "critical";
};
+
+   gpu_throttle_trip: throttle-trip {
+   temperature = <10>;
+   hysteresis = <1000>;
+   type = "hot";
+   };
};
 
cooling-maps {
-   /*
-* There are currently no cooling maps,
-* because there are no cooling devices.
-*/
+   map0 {
+   trip = <_throttle_trip>;
+   cooling-device = <_heavy 1 1>;
+   };
};
};
pllx {
-- 
1.9.1



[PATCH v2 7/9] arm64: tegra: set hot trips for Tegra210

2016-04-26 Thread Wei Ni
Enable throttle function for SOC_THERM.
Set "hot" trips for cpu and gpu thermal zones, which
can trigger the SOC_THERM hardware throttle.

Signed-off-by: Wei Ni 
---
 arch/arm64/boot/dts/nvidia/tegra210.dtsi | 41 +---
 1 file changed, 32 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra210.dtsi 
b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
index e3cca58a4c86..332771ab38e8 100644
--- a/arch/arm64/boot/dts/nvidia/tegra210.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra210.dtsi
@@ -804,7 +804,9 @@
 
soctherm: thermal-sensor@0,700e2000 {
compatible = "nvidia,tegra210-soctherm";
-   reg = <0x0 0x700e2000 0x0 0x1000>;
+   reg = <0x0 0x700e2000 0x0 0x600 /* SOC_THERM reg_base */
+   0x0 0x60006000 0x0 0x400>; /* CAR reg_base */
+   reg-names = "soctherm-reg", "car-reg";
interrupts = ;
clocks = <_car TEGRA210_CLK_TSENSOR>,
<_car TEGRA210_CLK_SOC_THERM>;
@@ -812,6 +814,15 @@
resets = <_car 78>;
reset-names = "soctherm";
#thermal-sensor-cells = <1>;
+
+   throttle-cfgs {
+   throttle_heavy: heavy {
+   priority = <100>;
+   cpu-throt-depth = <85>;
+
+   #cooling-cells = <2>;
+   };
+   };
};
 
thermal-zones {
@@ -828,13 +839,19 @@
hysteresis = <0>;
type = "critical";
};
+
+   cpu_throttle_trip: throttle-trip {
+   temperature = <98500>;
+   hysteresis = <1000>;
+   type = "hot";
+   };
};
 
cooling-maps {
-   /*
-* There are currently no cooling maps,
-* because there are no cooling devices.
-*/
+   map0 {
+   trip = <_throttle_trip>;
+   cooling-device = <_heavy 1 1>;
+   };
};
};
mem {
@@ -872,13 +889,19 @@
hysteresis = <0>;
type = "critical";
};
+
+   gpu_throttle_trip: throttle-trip {
+   temperature = <10>;
+   hysteresis = <1000>;
+   type = "hot";
+   };
};
 
cooling-maps {
-   /*
-* There are currently no cooling maps,
-* because there are no cooling devices.
-*/
+   map0 {
+   trip = <_throttle_trip>;
+   cooling-device = <_heavy 1 1>;
+   };
};
};
pllx {
-- 
1.9.1