linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient
@ 2019-05-23 14:25 Simon Horman
  2019-05-23 14:25 ` [PATCH v4 1/8] arm64: dts: renesas: r8a7795: Create thermal zone to support IPA Simon Horman
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Simon Horman

1) Setup a thermal zone driven by SoC temperature sensor.
   Create passive trip points and bind them to CPUFreq cooling
   device that supports power extension.

2) Describe dynamic power coefficient of CPUs

Changes since v3:
* Minor changelot updates
* Include updates for r8a7796, r8a77965 and r8a77990
  (omitted in v2 and v3 to reduce review/preparation overhead)

Changes since v2:
* Break power coefficient changes into separate patch.


Dien Pham (4):
  arm64: dts: renesas: r8a7795: Create thermal zone to support IPA
  arm64: dts: renesas: r8a7796: Create thermal zone to support IPA
  arm64: dts: renesas: r8a77965: Create thermal zone to support IPA
  arm64: dts: renesas: r8a77990: Create thermal zone to support IPA

Simon Horman (4):
  arm64: dts: renesas: r8a7795: Add dynamic power coefficient
  arm64: dts: renesas: r8a7796: Add dynamic power coefficient
  arm64: dts: renesas: r8a77965: Add dynamic power coefficient
  arm64: dts: renesas: r8a77990: Add dynamic power coefficient

 arch/arm64/boot/dts/renesas/r8a7795.dtsi  | 54 ++++++++++---------------------
 arch/arm64/boot/dts/renesas/r8a7796.dtsi  | 46 ++++++++++----------------
 arch/arm64/boot/dts/renesas/r8a77965.dtsi | 20 ++++++++++++
 arch/arm64/boot/dts/renesas/r8a77990.dtsi | 20 ++++++++++--
 4 files changed, 71 insertions(+), 69 deletions(-)

-- 
2.11.0


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

* [PATCH v4 1/8] arm64: dts: renesas: r8a7795: Create thermal zone to support IPA
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 2/8] arm64: dts: renesas: r8a7795: Add dynamic power coefficient Simon Horman
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Dien Pham,
	Keita Kobayashi, Gaku Inami, Hien Dang, An Huynh, Takeshi Kihara,
	Simon Horman

From: Dien Pham <dien.pham.ry@renesas.com>

Setup a thermal zone driven by SoC temperature sensor.
Create passive trip points and bind them to CPUFreq cooling
device that supports power extension.

In R-Car Gen3, IPA is supported for only one channel
(on H3/M3/M3N SoCs, it is channel THS3). Reason:
  Currently, IPA controls base on only CPU temperature.
  And only one thermal channel is assembled closest
  CPU cores is selected as target of IPA.
  If other channels are used, IPA controlling is not properly.

The A5 cooling device supports 5 cooling states which can be categorised as
follows:

0 & 1) boost (clocking up)
2)     default
3 & 4) cooling (clocking down)

Currently the thermal framework assumes that the default is the minimum,
or in other words there is no provision for handling boost states.
So this patch only describes the upper 3 states, default and cooling.

A single cooling device is described for all A57 CPUs and a separate
cooling device is described for all A53 CPUs. This reflects that physically
there is only one cooling device present for each type of CPU.

This patch improves on an earlier version by:

* Omitting cooling-max-level and cooling-min-level properties which
  are no longer present in mainline as of v4.17
* Removing an unused trip-point0 node sub-property from the trips
  property.
* Using cooling-device indexes such that maximum refers to maximum cooling
  rather than the inverse.
* Defers adding dynamic-power-coefficient properties to a separate patch as
  these are properties of the CPU.

The long signed-off by chain below reflects many revisions, mainly
internal, that this patch has been through.

Signed-off-by: Dien Pham <dien.pham.ry@renesas.com>
Signed-off-by: Keita Kobayashi <keita.kobayashi.ym@renesas.com>
Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: Hien Dang <hien.dang.eb@rvc.renesas.com>
Signed-off-by: An Huynh <an.huynh.uj@rvc.renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4 [Simon Horman]
* Update changelog
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 52 +++++++++-----------------------
 1 file changed, 15 insertions(+), 37 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index 7a8fd80331d0..6acdc0fd2422 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -207,6 +207,7 @@
 			power-domains = <&sysc R8A7795_PD_CA53_CPU0>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			#cooling-cells = <2>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
@@ -3179,58 +3180,30 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 0>;
+			sustainable-power = <6313>;
 
 			trips {
-				sensor1_passive: sensor1-passive {
-					temperature = <95000>;
-					hysteresis = <1000>;
-					type = "passive";
-				};
 				sensor1_crit: sensor1-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
 					type = "critical";
 				};
 			};
-
-			cooling-maps {
-				map0 {
-					trip = <&sensor1_passive>;
-					cooling-device = <&a57_0 4 4>,
-							 <&a57_1 4 4>,
-							 <&a57_2 4 4>,
-							 <&a57_3 4 4>;
-				};
-			};
 		};
 
 		sensor_thermal2: sensor-thermal2 {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 1>;
+			sustainable-power = <6313>;
 
 			trips {
-				sensor2_passive: sensor2-passive {
-					temperature = <95000>;
-					hysteresis = <1000>;
-					type = "passive";
-				};
 				sensor2_crit: sensor2-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
 					type = "critical";
 				};
 			};
-
-			cooling-maps {
-				map0 {
-					trip = <&sensor2_passive>;
-					cooling-device = <&a57_0 4 4>,
-							 <&a57_1 4 4>,
-							 <&a57_2 4 4>,
-							 <&a57_3 4 4>;
-				};
-			};
 		};
 
 		sensor_thermal3: sensor-thermal3 {
@@ -3239,11 +3212,12 @@
 			thermal-sensors = <&tsc 2>;
 
 			trips {
-				sensor3_passive: sensor3-passive {
-					temperature = <95000>;
+				target: trip-point1 {
+					temperature = <100000>;
 					hysteresis = <1000>;
 					type = "passive";
 				};
+
 				sensor3_crit: sensor3-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
@@ -3253,11 +3227,15 @@
 
 			cooling-maps {
 				map0 {
-					trip = <&sensor3_passive>;
-					cooling-device = <&a57_0 4 4>,
-							 <&a57_1 4 4>,
-							 <&a57_2 4 4>,
-							 <&a57_3 4 4>;
+					trip = <&target>;
+					cooling-device = <&a57_0 2 4>;
+					contribution = <1024>;
+				};
+
+				map1 {
+					trip = <&target>;
+					cooling-device = <&a53_0 0 2>;
+					contribution = <1024>;
 				};
 			};
 		};
-- 
2.11.0


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

* [PATCH v4 2/8] arm64: dts: renesas: r8a7795: Add dynamic power coefficient
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
  2019-05-23 14:25 ` [PATCH v4 1/8] arm64: dts: renesas: r8a7795: Create thermal zone to support IPA Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 3/8] arm64: dts: renesas: r8a7796: Create thermal zone to support IPA Simon Horman
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Simon Horman

Describe the dynamic power coefficient of A57 and A53 CPUs.

Based on work by Gaku Inami <gaku.inami.xw@bp.renesas.com> and others.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4
* No change

v3 [Simon Horman]
* Broken out of a larger patch
---
 arch/arm64/boot/dts/renesas/r8a7795.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7795.dtsi b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
index 6acdc0fd2422..681b092826c1 100644
--- a/arch/arm64/boot/dts/renesas/r8a7795.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7795.dtsi
@@ -155,6 +155,7 @@
 			power-domains = <&sysc R8A7795_PD_CA57_CPU0>;
 			next-level-cache = <&L2_CA57>;
 			enable-method = "psci";
+			dynamic-power-coefficient = <854>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z>;
 			operating-points-v2 = <&cluster0_opp>;
 			capacity-dmips-mhz = <1024>;
@@ -208,6 +209,7 @@
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
 			#cooling-cells = <2>;
+			dynamic-power-coefficient = <277>;
 			clocks = <&cpg CPG_CORE R8A7795_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
-- 
2.11.0


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

* [PATCH v4 3/8] arm64: dts: renesas: r8a7796: Create thermal zone to support IPA
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
  2019-05-23 14:25 ` [PATCH v4 1/8] arm64: dts: renesas: r8a7795: Create thermal zone to support IPA Simon Horman
  2019-05-23 14:25 ` [PATCH v4 2/8] arm64: dts: renesas: r8a7795: Add dynamic power coefficient Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 4/8] arm64: dts: renesas: r8a7796: Add dynamic power coefficient Simon Horman
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Dien Pham,
	Hien Dang, An Huynh, Takeshi Kihara, Simon Horman

From: Dien Pham <dien.pham.ry@renesas.com>

Setup a thermal zone driven by SoC temperature sensor.
Create passive trip points and bind them to CPUFreq cooling
device that supports power extension.

In R-Car Gen3, IPA is supported for only one channel
 (on H3/M3/M3N SoCs, it is channel THS3). Reason:
  Currently, IPA controls base on only CPU temperature.
  And only one thermal channel is assembled closest
  CPU cores is selected as target of IPA.
  If other channels are used, IPA controlling is not properly.

The A57 cooling device supports 5 cooling states which can be categorised
as follows:

0 & 1) boost (clocking up)
2)     default
3 & 4) cooling (clocking down)

Currently the thermal framework assumes that the default is the minimum,
or in other words there is no provision for handling boost states.
So this patch only describes the upper 3 states, default and cooling.

A single cooling device is described for all A57 CPUs and a separate
cooling device is described for all A53 CPUs. This reflects that physically
there is only one cooling device present for each type of CPU.

This patch improves on an earlier version by:

* Omitting cooling-max-level and cooling-min-level properties which
  are no longer present in mainline as of v4.17
* Removing an unused trip-point0 node sub-property from the trips
  property.
* Using cooling-device indexes such that maximum refers to maximum cooling
  rather than the inverse.
* Defers adding dynamic-power-coefficient properties to a separate patch as
  these are properties of the CPU.

The long signed-off by chain below reflects many revisions, mainly
internal, that this patch has been through.

Signed-off-by: Dien Pham <dien.pham.ry@renesas.com>
Signed-off-by: Hien Dang <hien.dang.eb@rvc.renesas.com>
Signed-off-by: An Huynh <an.huynh.uj@rvc.renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v4
* Updates described in changelog above including revision of changelog

v2, v3
* Omitted
---
 arch/arm64/boot/dts/renesas/r8a7796.dtsi | 44 +++++++++++---------------------
 1 file changed, 15 insertions(+), 29 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
index a5c6a9920214..9372a5dd8c7e 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
@@ -186,6 +186,7 @@
 			power-domains = <&sysc R8A7796_PD_CA53_CPU0>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			#cooling-cells = <2>;
 			clocks = <&cpg CPG_CORE R8A7796_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
@@ -2825,76 +2826,61 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 0>;
+			sustainable-power = <3874>;
 
 			trips {
-				sensor1_passive: sensor1-passive {
-					temperature = <95000>;
-					hysteresis = <1000>;
-					type = "passive";
-				};
 				sensor1_crit: sensor1-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
 					type = "critical";
 				};
 			};
-
-			cooling-maps {
-				map0 {
-					trip = <&sensor1_passive>;
-					cooling-device = <&a57_0 5 5>, <&a57_1 5 5>;
-				};
-			};
 		};
 
 		sensor_thermal2: sensor-thermal2 {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 1>;
+			sustainable-power = <3874>;
 
 			trips {
-				sensor2_passive: sensor2-passive {
-					temperature = <95000>;
-					hysteresis = <1000>;
-					type = "passive";
-				};
 				sensor2_crit: sensor2-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
 					type = "critical";
 				};
 			};
-
-			cooling-maps {
-				map0 {
-					trip = <&sensor2_passive>;
-					cooling-device = <&a57_0 5 5>, <&a57_1 5 5>;
-				};
-			};
 		};
 
 		sensor_thermal3: sensor-thermal3 {
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 2>;
+			sustainable-power = <3874>;
 
 			trips {
-				sensor3_passive: sensor3-passive {
-					temperature = <95000>;
+				target: trip-point1 {
+					temperature = <100000>;
 					hysteresis = <1000>;
 					type = "passive";
 				};
+
 				sensor3_crit: sensor3-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
 					type = "critical";
 				};
 			};
-
 			cooling-maps {
 				map0 {
-					trip = <&sensor3_passive>;
-					cooling-device = <&a57_0 5 5>, <&a57_1 5 5>;
+					trip = <&target>;
+					cooling-device = <&a57_0 2 4>;
+					contribution = <1024>;
+				};
+				map1 {
+					trip = <&target>;
+					cooling-device = <&a53_0 0 2>;
+					contribution = <1024>;
 				};
 			};
 		};
-- 
2.11.0


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

* [PATCH v4 4/8] arm64: dts: renesas: r8a7796: Add dynamic power coefficient
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
                   ` (2 preceding siblings ...)
  2019-05-23 14:25 ` [PATCH v4 3/8] arm64: dts: renesas: r8a7796: Create thermal zone to support IPA Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 5/8] arm64: dts: renesas: r8a77965: Create thermal zone to support IPA Simon Horman
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Simon Horman

Describe the dynamic power coefficient of A57 and A53 CPUs.

Based on work by Gaku Inami <gaku.inami.xw@bp.renesas.com> and others.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4 [Simon Horman]
* Broken out of a larger patch
---
 arch/arm64/boot/dts/renesas/r8a7796.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a7796.dtsi b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
index 9372a5dd8c7e..57380d89d384 100644
--- a/arch/arm64/boot/dts/renesas/r8a7796.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a7796.dtsi
@@ -160,6 +160,7 @@
 			power-domains = <&sysc R8A7796_PD_CA57_CPU0>;
 			next-level-cache = <&L2_CA57>;
 			enable-method = "psci";
+			dynamic-power-coefficient = <854>;
 			clocks = <&cpg CPG_CORE R8A7796_CLK_Z>;
 			operating-points-v2 = <&cluster0_opp>;
 			capacity-dmips-mhz = <1024>;
@@ -187,6 +188,7 @@
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
 			#cooling-cells = <2>;
+			dynamic-power-coefficient = <277>;
 			clocks = <&cpg CPG_CORE R8A7796_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 			capacity-dmips-mhz = <535>;
-- 
2.11.0


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

* [PATCH v4 5/8] arm64: dts: renesas: r8a77965: Create thermal zone to support IPA
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
                   ` (3 preceding siblings ...)
  2019-05-23 14:25 ` [PATCH v4 4/8] arm64: dts: renesas: r8a7796: Add dynamic power coefficient Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 6/8] arm64: dts: renesas: r8a77965: Add dynamic power coefficient Simon Horman
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Dien Pham,
	An Huynh, Takeshi Kihara, Simon Horman

From: Dien Pham <dien.pham.ry@renesas.com>

Setup a thermal zone driven by SoC temperature sensor.
Create passive trip points and bind them to CPUFreq cooling
device that supports power extension.

In R-Car Gen3, IPA is supported for only one channel
(on H3/M3/M3N SoCs, it is channel THS3). Reason:
  Currently, IPA controls base on only CPU temperature.
  And only one thermal channel is assembled closest
  CPU cores is selected as target of IPA.
  If other channels are used, IPA controlling is not properly.

The A57 cooling device supports 5 cooling states which can be categorised
as follows:

0 & 1) boost (clocking up)
2)     default
3 & 4) cooling (clocking down)

Currently the thermal framework assumes that the default is the minimum,
or in other words there is no provision for handling boost states.
So this patch only describes the upper 3 states, default and cooling.

A single cooling device is described for all A57 CPUs and a separate
cooling device is described for all A53 CPUs. This reflects that physically
there is only one cooling device present for each type of CPU.

This patch improves on an earlier version by:

* Omitting cooling-max-level and cooling-min-level properties which
  are no longer present in mainline as of v4.17
* Removing an unused trip-point0 node sub-property from the trips
  property.
* Using cooling-device indexes such that maximum refers to maximum cooling
  rather than the inverse.
* Defers adding dynamic-power-coefficient properties to a separate patch as
  these are properties of the CPU.

The long signed-off by chain below reflects many revisions, mainly
internal, that this patch has been through.

Signed-off-by: Dien Pham <dien.pham.ry@renesas.com>
Signed-off-by: An Huynh <an.huynh.uj@rvc.renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v4
* Updates described in changelog above including revision of changelog

v2, v3
* Omitted
---
 arch/arm64/boot/dts/renesas/r8a77965.dtsi | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index 41dfeadb89a6..f0fe4350a970 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -111,6 +111,7 @@
 			power-domains = <&sysc R8A77965_PD_CA57_CPU0>;
 			next-level-cache = <&L2_CA57>;
 			enable-method = "psci";
+			#cooling-cells = <2>;
 			clocks = <&cpg CPG_CORE R8A77965_CLK_Z>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
@@ -2530,6 +2531,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 0>;
+			sustainable-power = <2439>;
 
 			trips {
 				sensor1_crit: sensor1-crit {
@@ -2544,6 +2546,7 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 1>;
+			sustainable-power = <2439>;
 
 			trips {
 				sensor2_crit: sensor2-crit {
@@ -2558,14 +2561,30 @@
 			polling-delay-passive = <250>;
 			polling-delay = <1000>;
 			thermal-sensors = <&tsc 2>;
+			sustainable-power = <2439>;
 
 			trips {
+				target: trip-point1 {
+					/* miliCelsius  */
+					temperature = <100000>;
+					hysteresis = <1000>;
+					type = "passive";
+				};
+
 				sensor3_crit: sensor3-crit {
 					temperature = <120000>;
 					hysteresis = <1000>;
 					type = "critical";
 				};
 			};
+
+			cooling-maps {
+				map0 {
+					trip = <&target>;
+					cooling-device = <&a57_0 2 4>;
+					contribution = <1024>;
+				};
+			};
 		};
 	};
 
-- 
2.11.0


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

* [PATCH v4 6/8] arm64: dts: renesas: r8a77965: Add dynamic power coefficient
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
                   ` (4 preceding siblings ...)
  2019-05-23 14:25 ` [PATCH v4 5/8] arm64: dts: renesas: r8a77965: Create thermal zone to support IPA Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 7/8] arm64: dts: renesas: r8a77990: Create thermal zone to support IPA Simon Horman
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Simon Horman

Describe the dynamic power coefficient of A57 and A53 CPUs.

Based on work by Gaku Inami <gaku.inami.xw@bp.renesas.com> and others.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4 [Simon Horman]
* Broken out of a larger patch
---
 arch/arm64/boot/dts/renesas/r8a77965.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77965.dtsi b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
index f0fe4350a970..fa7be0e5e9e8 100644
--- a/arch/arm64/boot/dts/renesas/r8a77965.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77965.dtsi
@@ -112,6 +112,7 @@
 			next-level-cache = <&L2_CA57>;
 			enable-method = "psci";
 			#cooling-cells = <2>;
+			dynamic-power-coefficient = <854>;
 			clocks = <&cpg CPG_CORE R8A77965_CLK_Z>;
 			operating-points-v2 = <&cluster0_opp>;
 		};
-- 
2.11.0


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

* [PATCH v4 7/8] arm64: dts: renesas: r8a77990: Create thermal zone to support IPA
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
                   ` (5 preceding siblings ...)
  2019-05-23 14:25 ` [PATCH v4 6/8] arm64: dts: renesas: r8a77965: Add dynamic power coefficient Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-23 14:25 ` [PATCH v4 8/8] arm64: dts: renesas: r8a77990: Add dynamic power coefficient Simon Horman
  2019-05-31  9:35 ` [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and " Simon Horman
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Dien Pham,
	Takeshi Kihara, Simon Horman

From: Dien Pham <dien.pham.ry@renesas.com>

Setup a thermal zone driven by SoC temperature sensor.
Create passive trip points and bind them to CPUFreq cooling
device that supports power extension.

In R-Car Gen3, IPA is supported for only one channel
Reason:
  Currently, IPA controls base on only CPU temperature.
  And only one thermal channel is assembled closest
  CPU cores is selected as target of IPA.
  If other channels are used, IPA controlling is not properly.

A single cooling device is described for all A53 CPUs as this
reflects that physically there is only one cooling device present.

This patch improves on an earlier version by:

* Omitting cooling-max-level and cooling-min-level properties which
  are no longer present in mainline as of v4.17
* Removing an unused trip-point0 node sub-property from the trips
  property.
* Defers adding dynamic-power-coefficient properties to a separate patch as
  these are properties of the CPU.

The long signed-off by chain below reflects many revisions, mainly
internal, that this patch has been through.

Signed-off-by: Dien Pham <dien.pham.ry@renesas.com>
Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
v4
* Updates described in changelog above including revision of changelog

v2, v3
* Omitted
---
 arch/arm64/boot/dts/renesas/r8a77990.dtsi | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 56cb566ffa09..93603f6ca0fb 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -84,6 +84,7 @@
 			compatible = "arm,cortex-a53";
 			reg = <0>;
 			device_type = "cpu";
+			#cooling-cells = <2>;
 			power-domains = <&sysc R8A77990_PD_CA53_CPU0>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
@@ -1856,11 +1857,18 @@
 	thermal-zones {
 		cpu-thermal {
 			polling-delay-passive = <250>;
-			polling-delay = <1000>;
-			thermal-sensors = <&thermal>;
+			polling-delay = <0>;
+			thermal-sensors = <&thermal 0>;
+			sustainable-power = <717>;
 
 			trips {
-				cpu-crit {
+				target: trip-point1 {
+					temperature = <100000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+
+				sensor1_crit: sensor1-crit {
 					temperature = <120000>;
 					hysteresis = <2000>;
 					type = "critical";
@@ -1868,6 +1876,11 @@
 			};
 
 			cooling-maps {
+				map0 {
+					trip = <&target>;
+					cooling-device = <&a53_0 0 2>;
+					contribution = <1024>;
+				};
 			};
 		};
 	};
-- 
2.11.0


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

* [PATCH v4 8/8] arm64: dts: renesas: r8a77990: Add dynamic power coefficient
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
                   ` (6 preceding siblings ...)
  2019-05-23 14:25 ` [PATCH v4 7/8] arm64: dts: renesas: r8a77990: Create thermal zone to support IPA Simon Horman
@ 2019-05-23 14:25 ` Simon Horman
  2019-05-31  9:35 ` [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and " Simon Horman
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-23 14:25 UTC (permalink / raw)
  To: linux-renesas-soc
  Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko, Simon Horman

Describe the dynamic power coefficient of A53 CPUs.

Based on work by Gaku Inami <gaku.inami.xw@bp.renesas.com> and others.

Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---
v4 [Simon Horman]
* Broken out of a larger patch
---
 arch/arm64/boot/dts/renesas/r8a77990.dtsi | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/arm64/boot/dts/renesas/r8a77990.dtsi b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
index 93603f6ca0fb..84fb989711b3 100644
--- a/arch/arm64/boot/dts/renesas/r8a77990.dtsi
+++ b/arch/arm64/boot/dts/renesas/r8a77990.dtsi
@@ -88,6 +88,7 @@
 			power-domains = <&sysc R8A77990_PD_CA53_CPU0>;
 			next-level-cache = <&L2_CA53>;
 			enable-method = "psci";
+			dynamic-power-coefficient = <277>;
 			clocks =<&cpg CPG_CORE R8A77990_CLK_Z2>;
 			operating-points-v2 = <&cluster1_opp>;
 		};
-- 
2.11.0


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

* Re: [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient
  2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
                   ` (7 preceding siblings ...)
  2019-05-23 14:25 ` [PATCH v4 8/8] arm64: dts: renesas: r8a77990: Add dynamic power coefficient Simon Horman
@ 2019-05-31  9:35 ` Simon Horman
  8 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2019-05-31  9:35 UTC (permalink / raw)
  To: linux-renesas-soc; +Cc: linux-arm-kernel, Magnus Damm, Yoshihiro Kaneko

On Thu, May 23, 2019 at 04:25:36PM +0200, Simon Horman wrote:
> 1) Setup a thermal zone driven by SoC temperature sensor.
>    Create passive trip points and bind them to CPUFreq cooling
>    device that supports power extension.
> 
> 2) Describe dynamic power coefficient of CPUs
> 
> Changes since v3:
> * Minor changelot updates
> * Include updates for r8a7796, r8a77965 and r8a77990
>   (omitted in v2 and v3 to reduce review/preparation overhead)
> 
> Changes since v2:
> * Break power coefficient changes into separate patch.
> 
> 
> Dien Pham (4):
>   arm64: dts: renesas: r8a7795: Create thermal zone to support IPA
>   arm64: dts: renesas: r8a7796: Create thermal zone to support IPA
>   arm64: dts: renesas: r8a77965: Create thermal zone to support IPA
>   arm64: dts: renesas: r8a77990: Create thermal zone to support IPA
> 
> Simon Horman (4):
>   arm64: dts: renesas: r8a7795: Add dynamic power coefficient
>   arm64: dts: renesas: r8a7796: Add dynamic power coefficient
>   arm64: dts: renesas: r8a77965: Add dynamic power coefficient
>   arm64: dts: renesas: r8a77990: Add dynamic power coefficient
> 
>  arch/arm64/boot/dts/renesas/r8a7795.dtsi  | 54 ++++++++++---------------------
>  arch/arm64/boot/dts/renesas/r8a7796.dtsi  | 46 ++++++++++----------------
>  arch/arm64/boot/dts/renesas/r8a77965.dtsi | 20 ++++++++++++
>  arch/arm64/boot/dts/renesas/r8a77990.dtsi | 20 ++++++++++--
>  4 files changed, 71 insertions(+), 69 deletions(-)

Applied for v5.3.

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

end of thread, other threads:[~2019-05-31  9:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-23 14:25 [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and dynamic power coefficient Simon Horman
2019-05-23 14:25 ` [PATCH v4 1/8] arm64: dts: renesas: r8a7795: Create thermal zone to support IPA Simon Horman
2019-05-23 14:25 ` [PATCH v4 2/8] arm64: dts: renesas: r8a7795: Add dynamic power coefficient Simon Horman
2019-05-23 14:25 ` [PATCH v4 3/8] arm64: dts: renesas: r8a7796: Create thermal zone to support IPA Simon Horman
2019-05-23 14:25 ` [PATCH v4 4/8] arm64: dts: renesas: r8a7796: Add dynamic power coefficient Simon Horman
2019-05-23 14:25 ` [PATCH v4 5/8] arm64: dts: renesas: r8a77965: Create thermal zone to support IPA Simon Horman
2019-05-23 14:25 ` [PATCH v4 6/8] arm64: dts: renesas: r8a77965: Add dynamic power coefficient Simon Horman
2019-05-23 14:25 ` [PATCH v4 7/8] arm64: dts: renesas: r8a77990: Create thermal zone to support IPA Simon Horman
2019-05-23 14:25 ` [PATCH v4 8/8] arm64: dts: renesas: r8a77990: Add dynamic power coefficient Simon Horman
2019-05-31  9:35 ` [PATCH v4 0/8] arm64: dts: renesas: r8a7795: Add IPA support and " Simon Horman

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).