All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru
@ 2017-06-23 17:07 ` Brian Norris
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 17:07 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke, Brian Norris

From: Matthias Kaehlcke <mka@chromium.org>

Gru derivatives besides Kevin have slightly different voltage ranges for
their CPU regulators. Let's keep the base Gru file accurate and let
Kevin override.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 20 ++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi      | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
index 658bb9dc9dfd..658d63db0d6d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
@@ -264,6 +264,26 @@ ap_i2c_dig: &i2c2 {
 	};
 };
 
+&ppvar_bigcpu {
+	regulator-min-microvolt = <798674>;
+	regulator-max-microvolt = <1302172>;
+};
+
+&ppvar_litcpu {
+	regulator-min-microvolt = <799065>;
+	regulator-max-microvolt = <1303738>;
+};
+
+&ppvar_gpu {
+	regulator-min-microvolt = <785782>;
+	regulator-max-microvolt = <1217729>;
+};
+
+&ppvar_centerlogic {
+	regulator-min-microvolt = <800069>;
+	regulator-max-microvolt = <1049692>;
+};
+
 &saradc {
 	status = "okay";
 	vref-supply = <&pp1800_ap_io>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index eb5059344023..134afe8495b5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -181,8 +181,8 @@
 		/* EC turns on w/ ap_core_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <798674>;
-		regulator-max-microvolt = <1302172>;
+		regulator-min-microvolt = <800107>;
+		regulator-max-microvolt = <1302232>;
 	};
 
 	ppvar_litcpu: ppvar-litcpu {
@@ -202,8 +202,8 @@
 		/* EC turns on w/ ap_core_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <799065>;
-		regulator-max-microvolt = <1303738>;
+		regulator-min-microvolt = <797743>;
+		regulator-max-microvolt = <1307837>;
 	};
 
 	ppvar_gpu: ppvar-gpu {
@@ -223,8 +223,8 @@
 		/* EC turns on w/ ap_core_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <785782>;
-		regulator-max-microvolt = <1217729>;
+		regulator-min-microvolt = <786384>;
+		regulator-max-microvolt = <1217747>;
 	};
 
 	ppvar_centerlogic: ppvar-centerlogic {
@@ -244,8 +244,8 @@
 		/* EC turns on w/ ppvar_centerlogic_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <800069>;
-		regulator-max-microvolt = <1049692>;
+		regulator-min-microvolt = <799434>;
+		regulator-max-microvolt = <1049925>;
 	};
 
 	/* Schematics call this PPVAR even though it's fixed */
-- 
2.13.1.611.g7e3b11ae1-goog

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

* [PATCH 1/3] arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru
@ 2017-06-23 17:07 ` Brian Norris
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Kaehlcke <mka@chromium.org>

Gru derivatives besides Kevin have slightly different voltage ranges for
their CPU regulators. Let's keep the base Gru file accurate and let
Kevin override.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts | 20 ++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi      | 16 ++++++++--------
 2 files changed, 28 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
index 658bb9dc9dfd..658d63db0d6d 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
@@ -264,6 +264,26 @@ ap_i2c_dig: &i2c2 {
 	};
 };
 
+&ppvar_bigcpu {
+	regulator-min-microvolt = <798674>;
+	regulator-max-microvolt = <1302172>;
+};
+
+&ppvar_litcpu {
+	regulator-min-microvolt = <799065>;
+	regulator-max-microvolt = <1303738>;
+};
+
+&ppvar_gpu {
+	regulator-min-microvolt = <785782>;
+	regulator-max-microvolt = <1217729>;
+};
+
+&ppvar_centerlogic {
+	regulator-min-microvolt = <800069>;
+	regulator-max-microvolt = <1049692>;
+};
+
 &saradc {
 	status = "okay";
 	vref-supply = <&pp1800_ap_io>;
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index eb5059344023..134afe8495b5 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -181,8 +181,8 @@
 		/* EC turns on w/ ap_core_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <798674>;
-		regulator-max-microvolt = <1302172>;
+		regulator-min-microvolt = <800107>;
+		regulator-max-microvolt = <1302232>;
 	};
 
 	ppvar_litcpu: ppvar-litcpu {
@@ -202,8 +202,8 @@
 		/* EC turns on w/ ap_core_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <799065>;
-		regulator-max-microvolt = <1303738>;
+		regulator-min-microvolt = <797743>;
+		regulator-max-microvolt = <1307837>;
 	};
 
 	ppvar_gpu: ppvar-gpu {
@@ -223,8 +223,8 @@
 		/* EC turns on w/ ap_core_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <785782>;
-		regulator-max-microvolt = <1217729>;
+		regulator-min-microvolt = <786384>;
+		regulator-max-microvolt = <1217747>;
 	};
 
 	ppvar_centerlogic: ppvar-centerlogic {
@@ -244,8 +244,8 @@
 		/* EC turns on w/ ppvar_centerlogic_en; always on for AP */
 		regulator-always-on;
 		regulator-boot-on;
-		regulator-min-microvolt = <800069>;
-		regulator-max-microvolt = <1049692>;
+		regulator-min-microvolt = <799434>;
+		regulator-max-microvolt = <1049925>;
 	};
 
 	/* Schematics call this PPVAR even though it's fixed */
-- 
2.13.1.611.g7e3b11ae1-goog

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

* [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
  2017-06-23 17:07 ` Brian Norris
@ 2017-06-23 17:07   ` Brian Norris
  -1 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 17:07 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke, Brian Norris

From: Matthias Kaehlcke <mka@chromium.org>

The Gru device tree currently contains entries for the regulators
ppvar_bigcpu, ppvar_litcpu, ppvar_gpu and ppvar_centerlogic; however,
the regulators have not been made, due to the lack of binding and driver
support for keeping the over-voltage protection (OVP) at bay and
preventing unintended regulator shutdowns on voltage downshifts.

Now, the vctrl regulator driver has been merged, along with new bindings
for asymmetric settling time. The driver is OVP aware, it splits larger
voltage decreases in multiple steps when necessary and adds required
delays.

This change renames each of the aforementioned regulators to
<orig_name>_pwm and adds a new vctrl regulator named <orig_name>.
The vctrl regulators use the voltage of their corresponding PWM regulator
as control voltage. The OVP related values are empirical and stem from
the Chrome OS kernel tree.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts |  24 +++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi      | 104 ++++++++++++++++------
 2 files changed, 100 insertions(+), 28 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
index 658d63db0d6d..f86bd41be9c0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
@@ -264,24 +264,48 @@ ap_i2c_dig: &i2c2 {
 	};
 };
 
+&ppvar_bigcpu_pwm {
+	regulator-min-microvolt = <798674>;
+	regulator-max-microvolt = <1302172>;
+};
+
 &ppvar_bigcpu {
 	regulator-min-microvolt = <798674>;
 	regulator-max-microvolt = <1302172>;
+	ctrl-voltage-range = <798674 1302172>;
+};
+
+&ppvar_litcpu_pwm {
+	regulator-min-microvolt = <799065>;
+	regulator-max-microvolt = <1303738>;
 };
 
 &ppvar_litcpu {
 	regulator-min-microvolt = <799065>;
 	regulator-max-microvolt = <1303738>;
+	ctrl-voltage-range = <799065 1303738>;
+};
+
+&ppvar_gpu_pwm {
+	regulator-min-microvolt = <785782>;
+	regulator-max-microvolt = <1217729>;
 };
 
 &ppvar_gpu {
 	regulator-min-microvolt = <785782>;
 	regulator-max-microvolt = <1217729>;
+	ctrl-voltage-range = <785782 1217729>;
+};
+
+&ppvar_centerlogic_pwm {
+	regulator-min-microvolt = <800069>;
+	regulator-max-microvolt = <1049692>;
 };
 
 &ppvar_centerlogic {
 	regulator-min-microvolt = <800069>;
 	regulator-max-microvolt = <1049692>;
+	ctrl-voltage-range = <800069 1049692>;
 };
 
 &saradc {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 134afe8495b5..af51be6d5bed 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -164,14 +164,10 @@
 		vin-supply = <&ppvar_sys>;
 	};
 
-	ppvar_bigcpu: ppvar-bigcpu {
+	ppvar_bigcpu_pwm: ppvar-bigcpu_pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_bigcpu";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_bigcpu_pwm";
+		status = "okay";
 
 		pwms = <&pwm1 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -185,14 +181,26 @@
 		regulator-max-microvolt = <1302232>;
 	};
 
-	ppvar_litcpu: ppvar-litcpu {
+	ppvar_bigcpu: ppvar-bigcpu {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_bigcpu";
+		status = "okay";
+
+		regulator-min-microvolt = <800107>;
+		regulator-max-microvolt = <1302232>;
+
+		ctrl-supply = <&ppvar_bigcpu_pwm>;
+		ctrl-voltage-range = <800107 1302232>;
+
+		regulator-settling-time-up-us = <322>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
+	ppvar_litcpu_pwm: ppvar-litcpu_pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_litcpu";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_litcpu_pwm";
+		status = "okay";
 
 		pwms = <&pwm2 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -206,14 +214,26 @@
 		regulator-max-microvolt = <1307837>;
 	};
 
-	ppvar_gpu: ppvar-gpu {
+	ppvar_litcpu: ppvar-litcpu {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_litcpu";
+		status = "okay";
+
+		regulator-min-microvolt = <797743>;
+		regulator-max-microvolt = <1307837>;
+
+		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-voltage-range = <797743 1307837>;
+
+		regulator-settling-time-up-us = <384>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
+	ppvar_gpu_pwm: ppvar-gpu-pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_gpu";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_gpu_pwm";
+		status = "okay";
 
 		pwms = <&pwm0 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -227,14 +247,26 @@
 		regulator-max-microvolt = <1217747>;
 	};
 
-	ppvar_centerlogic: ppvar-centerlogic {
+	ppvar_gpu: ppvar-gpu {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_gpu";
+		status = "okay";
+
+		regulator-min-microvolt = <786384>;
+		regulator-max-microvolt = <1217747>;
+
+		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-voltage-range = <786384 1217747>;
+
+		regulator-settling-time-up-us = <390>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
+	ppvar_centerlogic_pwm: ppvar-centerlogic-pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_centerlogic";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_centerlogic_pwm";
+		status = "okay";
 
 		pwms = <&pwm3 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -248,6 +280,22 @@
 		regulator-max-microvolt = <1049925>;
 	};
 
+	ppvar_centerlogic: ppvar-centerlogic {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_centerlogic";
+		status = "okay";
+
+		regulator-min-microvolt = <799434>;
+		regulator-max-microvolt = <1049925>;
+
+		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-voltage-range = <799434 1049925>;
+
+		regulator-settling-time-up-us = <378>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
 	/* Schematics call this PPVAR even though it's fixed */
 	ppvar_logic: ppvar-logic {
 		compatible = "regulator-fixed";
-- 
2.13.1.611.g7e3b11ae1-goog

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

* [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
@ 2017-06-23 17:07   ` Brian Norris
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

From: Matthias Kaehlcke <mka@chromium.org>

The Gru device tree currently contains entries for the regulators
ppvar_bigcpu, ppvar_litcpu, ppvar_gpu and ppvar_centerlogic; however,
the regulators have not been made, due to the lack of binding and driver
support for keeping the over-voltage protection (OVP) at bay and
preventing unintended regulator shutdowns on voltage downshifts.

Now, the vctrl regulator driver has been merged, along with new bindings
for asymmetric settling time. The driver is OVP aware, it splits larger
voltage decreases in multiple steps when necessary and adds required
delays.

This change renames each of the aforementioned regulators to
<orig_name>_pwm and adds a new vctrl regulator named <orig_name>.
The vctrl regulators use the voltage of their corresponding PWM regulator
as control voltage. The OVP related values are empirical and stem from
the Chrome OS kernel tree.

Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts |  24 +++++
 arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi      | 104 ++++++++++++++++------
 2 files changed, 100 insertions(+), 28 deletions(-)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
index 658d63db0d6d..f86bd41be9c0 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
@@ -264,24 +264,48 @@ ap_i2c_dig: &i2c2 {
 	};
 };
 
+&ppvar_bigcpu_pwm {
+	regulator-min-microvolt = <798674>;
+	regulator-max-microvolt = <1302172>;
+};
+
 &ppvar_bigcpu {
 	regulator-min-microvolt = <798674>;
 	regulator-max-microvolt = <1302172>;
+	ctrl-voltage-range = <798674 1302172>;
+};
+
+&ppvar_litcpu_pwm {
+	regulator-min-microvolt = <799065>;
+	regulator-max-microvolt = <1303738>;
 };
 
 &ppvar_litcpu {
 	regulator-min-microvolt = <799065>;
 	regulator-max-microvolt = <1303738>;
+	ctrl-voltage-range = <799065 1303738>;
+};
+
+&ppvar_gpu_pwm {
+	regulator-min-microvolt = <785782>;
+	regulator-max-microvolt = <1217729>;
 };
 
 &ppvar_gpu {
 	regulator-min-microvolt = <785782>;
 	regulator-max-microvolt = <1217729>;
+	ctrl-voltage-range = <785782 1217729>;
+};
+
+&ppvar_centerlogic_pwm {
+	regulator-min-microvolt = <800069>;
+	regulator-max-microvolt = <1049692>;
 };
 
 &ppvar_centerlogic {
 	regulator-min-microvolt = <800069>;
 	regulator-max-microvolt = <1049692>;
+	ctrl-voltage-range = <800069 1049692>;
 };
 
 &saradc {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 134afe8495b5..af51be6d5bed 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -164,14 +164,10 @@
 		vin-supply = <&ppvar_sys>;
 	};
 
-	ppvar_bigcpu: ppvar-bigcpu {
+	ppvar_bigcpu_pwm: ppvar-bigcpu_pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_bigcpu";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_bigcpu_pwm";
+		status = "okay";
 
 		pwms = <&pwm1 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -185,14 +181,26 @@
 		regulator-max-microvolt = <1302232>;
 	};
 
-	ppvar_litcpu: ppvar-litcpu {
+	ppvar_bigcpu: ppvar-bigcpu {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_bigcpu";
+		status = "okay";
+
+		regulator-min-microvolt = <800107>;
+		regulator-max-microvolt = <1302232>;
+
+		ctrl-supply = <&ppvar_bigcpu_pwm>;
+		ctrl-voltage-range = <800107 1302232>;
+
+		regulator-settling-time-up-us = <322>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
+	ppvar_litcpu_pwm: ppvar-litcpu_pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_litcpu";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_litcpu_pwm";
+		status = "okay";
 
 		pwms = <&pwm2 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -206,14 +214,26 @@
 		regulator-max-microvolt = <1307837>;
 	};
 
-	ppvar_gpu: ppvar-gpu {
+	ppvar_litcpu: ppvar-litcpu {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_litcpu";
+		status = "okay";
+
+		regulator-min-microvolt = <797743>;
+		regulator-max-microvolt = <1307837>;
+
+		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-voltage-range = <797743 1307837>;
+
+		regulator-settling-time-up-us = <384>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
+	ppvar_gpu_pwm: ppvar-gpu-pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_gpu";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_gpu_pwm";
+		status = "okay";
 
 		pwms = <&pwm0 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -227,14 +247,26 @@
 		regulator-max-microvolt = <1217747>;
 	};
 
-	ppvar_centerlogic: ppvar-centerlogic {
+	ppvar_gpu: ppvar-gpu {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_gpu";
+		status = "okay";
+
+		regulator-min-microvolt = <786384>;
+		regulator-max-microvolt = <1217747>;
+
+		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-voltage-range = <786384 1217747>;
+
+		regulator-settling-time-up-us = <390>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
+	ppvar_centerlogic_pwm: ppvar-centerlogic-pwm {
 		compatible = "pwm-regulator";
-		regulator-name = "ppvar_centerlogic";
-		/*
-		 * OVP circuit requires special handling which is not yet
-		 * represented. Keep disabled for now.
-		 */
-		status = "disabled";
+		regulator-name = "ppvar_centerlogic_pwm";
+		status = "okay";
 
 		pwms = <&pwm3 0 3337 0>;
 		pwm-supply = <&ppvar_sys>;
@@ -248,6 +280,22 @@
 		regulator-max-microvolt = <1049925>;
 	};
 
+	ppvar_centerlogic: ppvar-centerlogic {
+		compatible = "vctrl-regulator";
+		regulator-name = "ppvar_centerlogic";
+		status = "okay";
+
+		regulator-min-microvolt = <799434>;
+		regulator-max-microvolt = <1049925>;
+
+		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-voltage-range = <799434 1049925>;
+
+		regulator-settling-time-up-us = <378>;
+		min-slew-down-rate = <225>;
+		ovp-threshold-percent = <16>;
+	};
+
 	/* Schematics call this PPVAR even though it's fixed */
 	ppvar_logic: ppvar-logic {
 		compatible = "regulator-fixed";
-- 
2.13.1.611.g7e3b11ae1-goog

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

* [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
  2017-06-23 17:07 ` Brian Norris
@ 2017-06-23 17:07   ` Brian Norris
  -1 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 17:07 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke, Brian Norris

Provide the dynamic power coefficient of the big and little CPU
clusters. These numbers are currently in use on the Samsung Chromebook
Plus ("Kevin").

The power allocator thermal governor doesn't know how to do anything if
it doesn't get power parameters from its cooling devices (in this case,
CPUfreq). So this effectively enables the power-allocator governor.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 69c56f7316c4..4f6667547814 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -109,6 +109,7 @@
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			#cooling-cells = <2>; /* min followed by max */
+			dynamic-power-coefficient = <100>;
 			clocks = <&cru ARMCLKL>;
 		};
 
@@ -142,6 +143,7 @@
 			reg = <0x0 0x100>;
 			enable-method = "psci";
 			#cooling-cells = <2>; /* min followed by max */
+			dynamic-power-coefficient = <100>;
 			clocks = <&cru ARMCLKB>;
 		};
 
-- 
2.13.1.611.g7e3b11ae1-goog

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

* [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
@ 2017-06-23 17:07   ` Brian Norris
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 17:07 UTC (permalink / raw)
  To: linux-arm-kernel

Provide the dynamic power coefficient of the big and little CPU
clusters. These numbers are currently in use on the Samsung Chromebook
Plus ("Kevin").

The power allocator thermal governor doesn't know how to do anything if
it doesn't get power parameters from its cooling devices (in this case,
CPUfreq). So this effectively enables the power-allocator governor.

Signed-off-by: Brian Norris <briannorris@chromium.org>
---
 arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
index 69c56f7316c4..4f6667547814 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
@@ -109,6 +109,7 @@
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			#cooling-cells = <2>; /* min followed by max */
+			dynamic-power-coefficient = <100>;
 			clocks = <&cru ARMCLKL>;
 		};
 
@@ -142,6 +143,7 @@
 			reg = <0x0 0x100>;
 			enable-method = "psci";
 			#cooling-cells = <2>; /* min followed by max */
+			dynamic-power-coefficient = <100>;
 			clocks = <&cru ARMCLKB>;
 		};
 
-- 
2.13.1.611.g7e3b11ae1-goog

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

* Re: [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
  2017-06-23 17:07   ` Brian Norris
@ 2017-06-23 18:39     ` Heiko Stuebner
  -1 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-23 18:39 UTC (permalink / raw)
  To: Brian Norris
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> Provide the dynamic power coefficient of the big and little CPU
> clusters. These numbers are currently in use on the Samsung Chromebook
> Plus ("Kevin").
> 
> The power allocator thermal governor doesn't know how to do anything if
> it doesn't get power parameters from its cooling devices (in this case,
> CPUfreq). So this effectively enables the power-allocator governor.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> index 69c56f7316c4..4f6667547814 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> @@ -109,6 +109,7 @@
>  			reg = <0x0 0x0>;
>  			enable-method = "psci";
>  			#cooling-cells = <2>; /* min followed by max */
> +			dynamic-power-coefficient = <100>;
>  			clocks = <&cru ARMCLKL>;
>  		};
>  
> @@ -142,6 +143,7 @@
>  			reg = <0x0 0x100>;
>  			enable-method = "psci";
>  			#cooling-cells = <2>; /* min followed by max */
> +			dynamic-power-coefficient = <100>;
>  			clocks = <&cru ARMCLKB>;
>  		};
>  
> 

I think these should be set for all cores, similar to clocks. While
cpufreq and friends regularly only take the first number, in a
hw-description sense, it should be part of every core in the dt.


Heiko

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

* [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
@ 2017-06-23 18:39     ` Heiko Stuebner
  0 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-23 18:39 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> Provide the dynamic power coefficient of the big and little CPU
> clusters. These numbers are currently in use on the Samsung Chromebook
> Plus ("Kevin").
> 
> The power allocator thermal governor doesn't know how to do anything if
> it doesn't get power parameters from its cooling devices (in this case,
> CPUfreq). So this effectively enables the power-allocator governor.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
>  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> index 69c56f7316c4..4f6667547814 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> @@ -109,6 +109,7 @@
>  			reg = <0x0 0x0>;
>  			enable-method = "psci";
>  			#cooling-cells = <2>; /* min followed by max */
> +			dynamic-power-coefficient = <100>;
>  			clocks = <&cru ARMCLKL>;
>  		};
>  
> @@ -142,6 +143,7 @@
>  			reg = <0x0 0x100>;
>  			enable-method = "psci";
>  			#cooling-cells = <2>; /* min followed by max */
> +			dynamic-power-coefficient = <100>;
>  			clocks = <&cru ARMCLKB>;
>  		};
>  
> 

I think these should be set for all cores, similar to clocks. While
cpufreq and friends regularly only take the first number, in a
hw-description sense, it should be part of every core in the dt.


Heiko

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

* Re: [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
  2017-06-23 18:39     ` Heiko Stuebner
@ 2017-06-23 18:49       ` Brian Norris
  -1 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 18:49 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

On Fri, Jun 23, 2017 at 08:39:25PM +0200, Heiko Stuebner wrote:
> Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> > Provide the dynamic power coefficient of the big and little CPU
> > clusters. These numbers are currently in use on the Samsung Chromebook
> > Plus ("Kevin").
> > 
> > The power allocator thermal governor doesn't know how to do anything if
> > it doesn't get power parameters from its cooling devices (in this case,
> > CPUfreq). So this effectively enables the power-allocator governor.
> > 
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > ---
> >  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > index 69c56f7316c4..4f6667547814 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > @@ -109,6 +109,7 @@
> >  			reg = <0x0 0x0>;
> >  			enable-method = "psci";
> >  			#cooling-cells = <2>; /* min followed by max */
> > +			dynamic-power-coefficient = <100>;
> >  			clocks = <&cru ARMCLKL>;
> >  		};
> >  
> > @@ -142,6 +143,7 @@
> >  			reg = <0x0 0x100>;
> >  			enable-method = "psci";
> >  			#cooling-cells = <2>; /* min followed by max */
> > +			dynamic-power-coefficient = <100>;
> >  			clocks = <&cru ARMCLKB>;
> >  		};
> >  
> > 
> 
> I think these should be set for all cores, similar to clocks. While
> cpufreq and friends regularly only take the first number, in a
> hw-description sense, it should be part of every core in the dt.

It's kinda paired with the cooling information (e.g., #cooling-cells)
which are only present in the first CPU in the cluster, currently.

I can copy this definitely real, empirical value into the other CPUs if
you really think that's necessary :)

Brian

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

* [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
@ 2017-06-23 18:49       ` Brian Norris
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-23 18:49 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Jun 23, 2017 at 08:39:25PM +0200, Heiko Stuebner wrote:
> Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> > Provide the dynamic power coefficient of the big and little CPU
> > clusters. These numbers are currently in use on the Samsung Chromebook
> > Plus ("Kevin").
> > 
> > The power allocator thermal governor doesn't know how to do anything if
> > it doesn't get power parameters from its cooling devices (in this case,
> > CPUfreq). So this effectively enables the power-allocator governor.
> > 
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > ---
> >  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > index 69c56f7316c4..4f6667547814 100644
> > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > @@ -109,6 +109,7 @@
> >  			reg = <0x0 0x0>;
> >  			enable-method = "psci";
> >  			#cooling-cells = <2>; /* min followed by max */
> > +			dynamic-power-coefficient = <100>;
> >  			clocks = <&cru ARMCLKL>;
> >  		};
> >  
> > @@ -142,6 +143,7 @@
> >  			reg = <0x0 0x100>;
> >  			enable-method = "psci";
> >  			#cooling-cells = <2>; /* min followed by max */
> > +			dynamic-power-coefficient = <100>;
> >  			clocks = <&cru ARMCLKB>;
> >  		};
> >  
> > 
> 
> I think these should be set for all cores, similar to clocks. While
> cpufreq and friends regularly only take the first number, in a
> hw-description sense, it should be part of every core in the dt.

It's kinda paired with the cooling information (e.g., #cooling-cells)
which are only present in the first CPU in the cluster, currently.

I can copy this definitely real, empirical value into the other CPUs if
you really think that's necessary :)

Brian

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

* Re: [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
  2017-06-23 18:49       ` Brian Norris
@ 2017-06-23 18:59         ` Heiko Stuebner
  -1 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-23 18:59 UTC (permalink / raw)
  To: Brian Norris
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

Am Freitag, 23. Juni 2017, 11:49:57 CEST schrieb Brian Norris:
> On Fri, Jun 23, 2017 at 08:39:25PM +0200, Heiko Stuebner wrote:
> > Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> > > Provide the dynamic power coefficient of the big and little CPU
> > > clusters. These numbers are currently in use on the Samsung Chromebook
> > > Plus ("Kevin").
> > > 
> > > The power allocator thermal governor doesn't know how to do anything if
> > > it doesn't get power parameters from its cooling devices (in this case,
> > > CPUfreq). So this effectively enables the power-allocator governor.
> > > 
> > > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > > ---
> > >  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > > index 69c56f7316c4..4f6667547814 100644
> > > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > > @@ -109,6 +109,7 @@
> > >  			reg = <0x0 0x0>;
> > >  			enable-method = "psci";
> > >  			#cooling-cells = <2>; /* min followed by max */
> > > +			dynamic-power-coefficient = <100>;
> > >  			clocks = <&cru ARMCLKL>;
> > >  		};
> > >  
> > > @@ -142,6 +143,7 @@
> > >  			reg = <0x0 0x100>;
> > >  			enable-method = "psci";
> > >  			#cooling-cells = <2>; /* min followed by max */
> > > +			dynamic-power-coefficient = <100>;
> > >  			clocks = <&cru ARMCLKB>;
> > >  		};
> > >  
> > > 
> > 
> > I think these should be set for all cores, similar to clocks. While
> > cpufreq and friends regularly only take the first number, in a
> > hw-description sense, it should be part of every core in the dt.
> 
> It's kinda paired with the cooling information (e.g., #cooling-cells)
> which are only present in the first CPU in the cluster, currently.
> 
> I can copy this definitely real, empirical value into the other CPUs if
> you really think that's necessary :)

I just remember that has come up in the past for other cpu properties.
dynamic-power-coefficient is defined in the general arm cpu binding,
similar to clocks.

And who knows, that value might not stay tied to only thermal in the
future, so I think they should be in all cores.

But you know what, I can duplicate this myself as well when applying :-) .


Heiko

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

* [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
@ 2017-06-23 18:59         ` Heiko Stuebner
  0 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-23 18:59 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag, 23. Juni 2017, 11:49:57 CEST schrieb Brian Norris:
> On Fri, Jun 23, 2017 at 08:39:25PM +0200, Heiko Stuebner wrote:
> > Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> > > Provide the dynamic power coefficient of the big and little CPU
> > > clusters. These numbers are currently in use on the Samsung Chromebook
> > > Plus ("Kevin").
> > > 
> > > The power allocator thermal governor doesn't know how to do anything if
> > > it doesn't get power parameters from its cooling devices (in this case,
> > > CPUfreq). So this effectively enables the power-allocator governor.
> > > 
> > > Signed-off-by: Brian Norris <briannorris@chromium.org>
> > > ---
> > >  arch/arm64/boot/dts/rockchip/rk3399.dtsi | 2 ++
> > >  1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > > index 69c56f7316c4..4f6667547814 100644
> > > --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > > +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
> > > @@ -109,6 +109,7 @@
> > >  			reg = <0x0 0x0>;
> > >  			enable-method = "psci";
> > >  			#cooling-cells = <2>; /* min followed by max */
> > > +			dynamic-power-coefficient = <100>;
> > >  			clocks = <&cru ARMCLKL>;
> > >  		};
> > >  
> > > @@ -142,6 +143,7 @@
> > >  			reg = <0x0 0x100>;
> > >  			enable-method = "psci";
> > >  			#cooling-cells = <2>; /* min followed by max */
> > > +			dynamic-power-coefficient = <100>;
> > >  			clocks = <&cru ARMCLKB>;
> > >  		};
> > >  
> > > 
> > 
> > I think these should be set for all cores, similar to clocks. While
> > cpufreq and friends regularly only take the first number, in a
> > hw-description sense, it should be part of every core in the dt.
> 
> It's kinda paired with the cooling information (e.g., #cooling-cells)
> which are only present in the first CPU in the cluster, currently.
> 
> I can copy this definitely real, empirical value into the other CPUs if
> you really think that's necessary :)

I just remember that has come up in the past for other cpu properties.
dynamic-power-coefficient is defined in the general arm cpu binding,
similar to clocks.

And who knows, that value might not stay tied to only thermal in the
future, so I think they should be in all cores.

But you know what, I can duplicate this myself as well when applying :-) .


Heiko

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

* Re: [PATCH 1/3] arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru
  2017-06-23 17:07 ` Brian Norris
@ 2017-06-28 15:41   ` Heiko Stuebner
  -1 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-28 15:41 UTC (permalink / raw)
  To: Brian Norris
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

Am Freitag, 23. Juni 2017, 10:07:35 CEST schrieb Brian Norris:
> From: Matthias Kaehlcke <mka@chromium.org>
> 
> Gru derivatives besides Kevin have slightly different voltage ranges for
> their CPU regulators. Let's keep the base Gru file accurate and let
> Kevin override.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

applied for 4.14


Thanks
Heiko

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

* [PATCH 1/3] arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru
@ 2017-06-28 15:41   ` Heiko Stuebner
  0 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-28 15:41 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag, 23. Juni 2017, 10:07:35 CEST schrieb Brian Norris:
> From: Matthias Kaehlcke <mka@chromium.org>
> 
> Gru derivatives besides Kevin have slightly different voltage ranges for
> their CPU regulators. Let's keep the base Gru file accurate and let
> Kevin override.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

applied for 4.14


Thanks
Heiko

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

* Re: [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
  2017-06-23 17:07   ` Brian Norris
@ 2017-06-28 15:44     ` Heiko Stuebner
  -1 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-28 15:44 UTC (permalink / raw)
  To: Brian Norris
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

Am Freitag, 23. Juni 2017, 10:07:36 CEST schrieb Brian Norris:
> From: Matthias Kaehlcke <mka@chromium.org>
> 
> The Gru device tree currently contains entries for the regulators
> ppvar_bigcpu, ppvar_litcpu, ppvar_gpu and ppvar_centerlogic; however,
> the regulators have not been made, due to the lack of binding and driver
> support for keeping the over-voltage protection (OVP) at bay and
> preventing unintended regulator shutdowns on voltage downshifts.
> 
> Now, the vctrl regulator driver has been merged, along with new bindings
> for asymmetric settling time. The driver is OVP aware, it splits larger
> voltage decreases in multiple steps when necessary and adds required
> delays.
> 
> This change renames each of the aforementioned regulators to
> <orig_name>_pwm and adds a new vctrl regulator named <orig_name>.
> The vctrl regulators use the voltage of their corresponding PWM regulator
> as control voltage. The OVP related values are empirical and stem from
> the Chrome OS kernel tree.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Running this on Kevin resulted in gpu+centerlogic being
children of litcpu, so applied for 4.14 with the diff below.

Please holler if something looks wrong
Heiko


diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 2f1ba5ba27c8..90259cf63bb6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -164,7 +164,7 @@
 		vin-supply = <&ppvar_sys>;
 	};
 
-	ppvar_bigcpu_pwm: ppvar-bigcpu_pwm {
+	ppvar_bigcpu_pwm: ppvar-bigcpu-pwm {
 		compatible = "pwm-regulator";
 		regulator-name = "ppvar_bigcpu_pwm";
 
@@ -195,7 +195,7 @@
 		ovp-threshold-percent = <16>;
 	};
 
-	ppvar_litcpu_pwm: ppvar-litcpu_pwm {
+	ppvar_litcpu_pwm: ppvar-litcpu-pwm {
 		compatible = "pwm-regulator";
 		regulator-name = "ppvar_litcpu_pwm";
 
@@ -249,7 +249,7 @@
 		regulator-min-microvolt = <786384>;
 		regulator-max-microvolt = <1217747>;
 
-		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-supply = <&ppvar_gpu_pwm>;
 		ctrl-voltage-range = <786384 1217747>;
 
 		regulator-settling-time-up-us = <390>;
@@ -280,7 +280,7 @@
 		regulator-min-microvolt = <799434>;
 		regulator-max-microvolt = <1049925>;
 
-		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-supply = <&ppvar_centerlogic_pwm>;
 		ctrl-voltage-range = <799434 1049925>;
 
 		regulator-settling-time-up-us = <378>;

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

* [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
@ 2017-06-28 15:44     ` Heiko Stuebner
  0 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-28 15:44 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag, 23. Juni 2017, 10:07:36 CEST schrieb Brian Norris:
> From: Matthias Kaehlcke <mka@chromium.org>
> 
> The Gru device tree currently contains entries for the regulators
> ppvar_bigcpu, ppvar_litcpu, ppvar_gpu and ppvar_centerlogic; however,
> the regulators have not been made, due to the lack of binding and driver
> support for keeping the over-voltage protection (OVP) at bay and
> preventing unintended regulator shutdowns on voltage downshifts.
> 
> Now, the vctrl regulator driver has been merged, along with new bindings
> for asymmetric settling time. The driver is OVP aware, it splits larger
> voltage decreases in multiple steps when necessary and adds required
> delays.
> 
> This change renames each of the aforementioned regulators to
> <orig_name>_pwm and adds a new vctrl regulator named <orig_name>.
> The vctrl regulators use the voltage of their corresponding PWM regulator
> as control voltage. The OVP related values are empirical and stem from
> the Chrome OS kernel tree.
> 
> Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> Signed-off-by: Brian Norris <briannorris@chromium.org>

Running this on Kevin resulted in gpu+centerlogic being
children of litcpu, so applied for 4.14 with the diff below.

Please holler if something looks wrong
Heiko


diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 2f1ba5ba27c8..90259cf63bb6 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -164,7 +164,7 @@
 		vin-supply = <&ppvar_sys>;
 	};
 
-	ppvar_bigcpu_pwm: ppvar-bigcpu_pwm {
+	ppvar_bigcpu_pwm: ppvar-bigcpu-pwm {
 		compatible = "pwm-regulator";
 		regulator-name = "ppvar_bigcpu_pwm";
 
@@ -195,7 +195,7 @@
 		ovp-threshold-percent = <16>;
 	};
 
-	ppvar_litcpu_pwm: ppvar-litcpu_pwm {
+	ppvar_litcpu_pwm: ppvar-litcpu-pwm {
 		compatible = "pwm-regulator";
 		regulator-name = "ppvar_litcpu_pwm";
 
@@ -249,7 +249,7 @@
 		regulator-min-microvolt = <786384>;
 		regulator-max-microvolt = <1217747>;
 
-		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-supply = <&ppvar_gpu_pwm>;
 		ctrl-voltage-range = <786384 1217747>;
 
 		regulator-settling-time-up-us = <390>;
@@ -280,7 +280,7 @@
 		regulator-min-microvolt = <799434>;
 		regulator-max-microvolt = <1049925>;
 
-		ctrl-supply = <&ppvar_litcpu_pwm>;
+		ctrl-supply = <&ppvar_centerlogic_pwm>;
 		ctrl-voltage-range = <799434 1049925>;
 
 		regulator-settling-time-up-us = <378>;

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

* Re: [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
  2017-06-23 17:07   ` Brian Norris
@ 2017-06-28 15:45     ` Heiko Stuebner
  -1 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-28 15:45 UTC (permalink / raw)
  To: Brian Norris
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> Provide the dynamic power coefficient of the big and little CPU
> clusters. These numbers are currently in use on the Samsung Chromebook
> Plus ("Kevin").
> 
> The power allocator thermal governor doesn't know how to do anything if
> it doesn't get power parameters from its cooling devices (in this case,
> CPUfreq). So this effectively enables the power-allocator governor.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

applied for 4.14 after extending the property to all cpu cores.


Thanks
Heiko

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

* [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients
@ 2017-06-28 15:45     ` Heiko Stuebner
  0 siblings, 0 replies; 20+ messages in thread
From: Heiko Stuebner @ 2017-06-28 15:45 UTC (permalink / raw)
  To: linux-arm-kernel

Am Freitag, 23. Juni 2017, 10:07:37 CEST schrieb Brian Norris:
> Provide the dynamic power coefficient of the big and little CPU
> clusters. These numbers are currently in use on the Samsung Chromebook
> Plus ("Kevin").
> 
> The power allocator thermal governor doesn't know how to do anything if
> it doesn't get power parameters from its cooling devices (in this case,
> CPUfreq). So this effectively enables the power-allocator governor.
> 
> Signed-off-by: Brian Norris <briannorris@chromium.org>

applied for 4.14 after extending the property to all cpu cores.


Thanks
Heiko

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

* Re: [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
  2017-06-28 15:44     ` Heiko Stuebner
@ 2017-06-29 20:53       ` Brian Norris
  -1 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-29 20:53 UTC (permalink / raw)
  To: Heiko Stuebner
  Cc: linux-rockchip, linux-kernel, Caesar Wang, Doug Anderson,
	linux-arm-kernel, Matthias Kaehlcke

Hi Heiko,

On Wed, Jun 28, 2017 at 05:44:27PM +0200, Heiko Stuebner wrote:
> Am Freitag, 23. Juni 2017, 10:07:36 CEST schrieb Brian Norris:
> > From: Matthias Kaehlcke <mka@chromium.org>
> > 
> > The Gru device tree currently contains entries for the regulators
> > ppvar_bigcpu, ppvar_litcpu, ppvar_gpu and ppvar_centerlogic; however,
> > the regulators have not been made, due to the lack of binding and driver
> > support for keeping the over-voltage protection (OVP) at bay and
> > preventing unintended regulator shutdowns on voltage downshifts.
> > 
> > Now, the vctrl regulator driver has been merged, along with new bindings
> > for asymmetric settling time. The driver is OVP aware, it splits larger
> > voltage decreases in multiple steps when necessary and adds required
> > delays.
> > 
> > This change renames each of the aforementioned regulators to
> > <orig_name>_pwm and adds a new vctrl regulator named <orig_name>.
> > The vctrl regulators use the voltage of their corresponding PWM regulator
> > as control voltage. The OVP related values are empirical and stem from
> > the Chrome OS kernel tree.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> 
> Running this on Kevin resulted in gpu+centerlogic being
> children of litcpu, so applied for 4.14 with the diff below.

Oops, don't know where that cropped up. Between the two of us (Matthias
and me) this got rebased and reworked a few times.

Wouldn't have much effect, since the DMC and GPU aren't hooked up yet
upstream yet.

> Please holler if something looks wrong
> Heiko
> 
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> index 2f1ba5ba27c8..90259cf63bb6 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> @@ -164,7 +164,7 @@
>  		vin-supply = <&ppvar_sys>;
>  	};
>  
> -	ppvar_bigcpu_pwm: ppvar-bigcpu_pwm {
> +	ppvar_bigcpu_pwm: ppvar-bigcpu-pwm {
>  		compatible = "pwm-regulator";
>  		regulator-name = "ppvar_bigcpu_pwm";
>  
> @@ -195,7 +195,7 @@
>  		ovp-threshold-percent = <16>;
>  	};
>  
> -	ppvar_litcpu_pwm: ppvar-litcpu_pwm {
> +	ppvar_litcpu_pwm: ppvar-litcpu-pwm {
>  		compatible = "pwm-regulator";
>  		regulator-name = "ppvar_litcpu_pwm";
>  
> @@ -249,7 +249,7 @@
>  		regulator-min-microvolt = <786384>;
>  		regulator-max-microvolt = <1217747>;
>  
> -		ctrl-supply = <&ppvar_litcpu_pwm>;
> +		ctrl-supply = <&ppvar_gpu_pwm>;
>  		ctrl-voltage-range = <786384 1217747>;
>  
>  		regulator-settling-time-up-us = <390>;
> @@ -280,7 +280,7 @@
>  		regulator-min-microvolt = <799434>;
>  		regulator-max-microvolt = <1049925>;
>  
> -		ctrl-supply = <&ppvar_litcpu_pwm>;
> +		ctrl-supply = <&ppvar_centerlogic_pwm>;
>  		ctrl-voltage-range = <799434 1049925>;
>  
>  		regulator-settling-time-up-us = <378>;
> 

Acked, LGTM, and tests fine. Thanks for fixing up all of this.

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

* [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
@ 2017-06-29 20:53       ` Brian Norris
  0 siblings, 0 replies; 20+ messages in thread
From: Brian Norris @ 2017-06-29 20:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Heiko,

On Wed, Jun 28, 2017 at 05:44:27PM +0200, Heiko Stuebner wrote:
> Am Freitag, 23. Juni 2017, 10:07:36 CEST schrieb Brian Norris:
> > From: Matthias Kaehlcke <mka@chromium.org>
> > 
> > The Gru device tree currently contains entries for the regulators
> > ppvar_bigcpu, ppvar_litcpu, ppvar_gpu and ppvar_centerlogic; however,
> > the regulators have not been made, due to the lack of binding and driver
> > support for keeping the over-voltage protection (OVP) at bay and
> > preventing unintended regulator shutdowns on voltage downshifts.
> > 
> > Now, the vctrl regulator driver has been merged, along with new bindings
> > for asymmetric settling time. The driver is OVP aware, it splits larger
> > voltage decreases in multiple steps when necessary and adds required
> > delays.
> > 
> > This change renames each of the aforementioned regulators to
> > <orig_name>_pwm and adds a new vctrl regulator named <orig_name>.
> > The vctrl regulators use the voltage of their corresponding PWM regulator
> > as control voltage. The OVP related values are empirical and stem from
> > the Chrome OS kernel tree.
> > 
> > Signed-off-by: Matthias Kaehlcke <mka@chromium.org>
> > Signed-off-by: Brian Norris <briannorris@chromium.org>
> 
> Running this on Kevin resulted in gpu+centerlogic being
> children of litcpu, so applied for 4.14 with the diff below.

Oops, don't know where that cropped up. Between the two of us (Matthias
and me) this got rebased and reworked a few times.

Wouldn't have much effect, since the DMC and GPU aren't hooked up yet
upstream yet.

> Please holler if something looks wrong
> Heiko
> 
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> index 2f1ba5ba27c8..90259cf63bb6 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
> @@ -164,7 +164,7 @@
>  		vin-supply = <&ppvar_sys>;
>  	};
>  
> -	ppvar_bigcpu_pwm: ppvar-bigcpu_pwm {
> +	ppvar_bigcpu_pwm: ppvar-bigcpu-pwm {
>  		compatible = "pwm-regulator";
>  		regulator-name = "ppvar_bigcpu_pwm";
>  
> @@ -195,7 +195,7 @@
>  		ovp-threshold-percent = <16>;
>  	};
>  
> -	ppvar_litcpu_pwm: ppvar-litcpu_pwm {
> +	ppvar_litcpu_pwm: ppvar-litcpu-pwm {
>  		compatible = "pwm-regulator";
>  		regulator-name = "ppvar_litcpu_pwm";
>  
> @@ -249,7 +249,7 @@
>  		regulator-min-microvolt = <786384>;
>  		regulator-max-microvolt = <1217747>;
>  
> -		ctrl-supply = <&ppvar_litcpu_pwm>;
> +		ctrl-supply = <&ppvar_gpu_pwm>;
>  		ctrl-voltage-range = <786384 1217747>;
>  
>  		regulator-settling-time-up-us = <390>;
> @@ -280,7 +280,7 @@
>  		regulator-min-microvolt = <799434>;
>  		regulator-max-microvolt = <1049925>;
>  
> -		ctrl-supply = <&ppvar_litcpu_pwm>;
> +		ctrl-supply = <&ppvar_centerlogic_pwm>;
>  		ctrl-voltage-range = <799434 1049925>;
>  
>  		regulator-settling-time-up-us = <378>;
> 

Acked, LGTM, and tests fine. Thanks for fixing up all of this.

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

end of thread, other threads:[~2017-06-29 20:53 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-23 17:07 [PATCH 1/3] arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru Brian Norris
2017-06-23 17:07 ` Brian Norris
2017-06-23 17:07 ` [PATCH 2/3] arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin Brian Norris
2017-06-23 17:07   ` Brian Norris
2017-06-28 15:44   ` Heiko Stuebner
2017-06-28 15:44     ` Heiko Stuebner
2017-06-29 20:53     ` Brian Norris
2017-06-29 20:53       ` Brian Norris
2017-06-23 17:07 ` [PATCH 3/3] arm64: dts: rockchip: set rk3399 dynamic CPU power coefficients Brian Norris
2017-06-23 17:07   ` Brian Norris
2017-06-23 18:39   ` Heiko Stuebner
2017-06-23 18:39     ` Heiko Stuebner
2017-06-23 18:49     ` Brian Norris
2017-06-23 18:49       ` Brian Norris
2017-06-23 18:59       ` Heiko Stuebner
2017-06-23 18:59         ` Heiko Stuebner
2017-06-28 15:45   ` Heiko Stuebner
2017-06-28 15:45     ` Heiko Stuebner
2017-06-28 15:41 ` [PATCH 1/3] arm64: dts: rockchip: Update CPU regulator voltage ranges for Gru Heiko Stuebner
2017-06-28 15:41   ` Heiko Stuebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.