OSDN Git Service

arm64: dts: rockchip: Use vctrl regulators for dynamic CPU voltages on Gru/Kevin
authorMatthias Kaehlcke <mka@chromium.org>
Fri, 23 Jun 2017 17:07:36 +0000 (10:07 -0700)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 16 Jul 2017 15:09:37 +0000 (17:09 +0200)
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 enabled, 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>
[fixed node names and parent supplies of gpu and centerlogic]
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-gru-kevin.dts
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi

index 1cb4af7..a3d3cea 100644 (file)
@@ -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 {
index b4ba9fa..90259cf 100644 (file)
                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";
 
                pwms = <&pwm1 0 3337 0>;
                pwm-supply = <&ppvar_sys>;
                regulator-max-microvolt = <1302232>;
        };
 
-       ppvar_litcpu: ppvar-litcpu {
+       ppvar_bigcpu: ppvar-bigcpu {
+               compatible = "vctrl-regulator";
+               regulator-name = "ppvar_bigcpu";
+
+               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";
 
                pwms = <&pwm2 0 3337 0>;
                pwm-supply = <&ppvar_sys>;
                regulator-max-microvolt = <1307837>;
        };
 
-       ppvar_gpu: ppvar-gpu {
+       ppvar_litcpu: ppvar-litcpu {
+               compatible = "vctrl-regulator";
+               regulator-name = "ppvar_litcpu";
+
+               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";
 
                pwms = <&pwm0 0 3337 0>;
                pwm-supply = <&ppvar_sys>;
                regulator-max-microvolt = <1217747>;
        };
 
-       ppvar_centerlogic: ppvar-centerlogic {
+       ppvar_gpu: ppvar-gpu {
+               compatible = "vctrl-regulator";
+               regulator-name = "ppvar_gpu";
+
+               regulator-min-microvolt = <786384>;
+               regulator-max-microvolt = <1217747>;
+
+               ctrl-supply = <&ppvar_gpu_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";
 
                pwms = <&pwm3 0 3337 0>;
                pwm-supply = <&ppvar_sys>;
                regulator-max-microvolt = <1049925>;
        };
 
+       ppvar_centerlogic: ppvar-centerlogic {
+               compatible = "vctrl-regulator";
+               regulator-name = "ppvar_centerlogic";
+
+               regulator-min-microvolt = <799434>;
+               regulator-max-microvolt = <1049925>;
+
+               ctrl-supply = <&ppvar_centerlogic_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";