From: Brian Norris <briannorris@chromium.org>
To: Heiko Stuebner <heiko@sntech.de>
Cc: linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org,
Caesar Wang <wxt@rock-chips.com>,
Doug Anderson <dianders@chromium.org>,
devicetree@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Stephen Barber <smbarber@chromium.org>,
linux-arm-kernel@lists.infradead.org,
Chris Zhong <zyw@rock-chips.com>,
Brian Norris <briannorris@chromium.org>
Subject: [PATCH 8/9] arm64: dts: rockchip: partially describe PWM regulators for Gru
Date: Thu, 1 Dec 2016 18:27:32 -0800 [thread overview]
Message-ID: <1480645653-36943-9-git-send-email-briannorris@chromium.org> (raw)
In-Reply-To: <1480645653-36943-1-git-send-email-briannorris@chromium.org>
We need to add regulators to the CPU nodes, so cpufreq doesn't think it
can crank up the clock speed without changing the voltage. However, we
don't yet have the DT bindings to fully describe the Over Voltage
Protection (OVP) circuits on these boards. Without that description, we
might end up changing the voltage too much, too fast.
Add the pwm-regulator descriptions and associate the CPU OPPs, but leave
them disabled.
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi | 146 +++++++++++++++++++++++++++
1 file changed, 146 insertions(+)
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 59b452504106..90adfb5cba38 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -172,6 +172,98 @@
vin-supply = <&ppvar_sys>;
};
+ ppvar_bigcpu: ppvar-bigcpu {
+ compatible = "pwm-regulator";
+ regulator-name = "ppvar_bigcpu";
+ /*
+ * OVP circuit requires special handling which is not yet
+ * represented. Keep disabled for now.
+ */
+ status = "disabled";
+
+ pwms = <&pwm1 0 3337 0>;
+
+ /* 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>;
+
+ pwm-supply = <&ppvar_sys>;
+ pwm-dutycycle-range = <100 0>;
+ pwm-dutycycle-unit = <100>;
+ };
+
+ ppvar_litcpu: ppvar-litcpu {
+ compatible = "pwm-regulator";
+ regulator-name = "ppvar_litcpu";
+ /*
+ * OVP circuit requires special handling which is not yet
+ * represented. Keep disabled for now.
+ */
+ status = "disabled";
+
+ pwms = <&pwm2 0 3337 0>;
+
+ /* 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>;
+
+ pwm-supply = <&ppvar_sys>;
+ pwm-dutycycle-range = <100 0>;
+ pwm-dutycycle-unit = <100>;
+ };
+
+ ppvar_gpu: ppvar-gpu {
+ compatible = "pwm-regulator";
+ regulator-name = "ppvar_gpu";
+ /*
+ * OVP circuit requires special handling which is not yet
+ * represented. Keep disabled for now.
+ */
+ status = "disabled";
+
+ pwms = <&pwm0 0 3337 0>;
+
+ /* 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>;
+
+ pwm-supply = <&ppvar_sys>;
+ pwm-dutycycle-range = <100 0>;
+ pwm-dutycycle-unit = <100>;
+ };
+
+ ppvar_centerlogic: ppvar-centerlogic {
+ compatible = "pwm-regulator";
+ regulator-name = "ppvar_centerlogic";
+ /*
+ * OVP circuit requires special handling which is not yet
+ * represented. Keep disabled for now.
+ */
+ status = "disabled";
+
+ pwms = <&pwm3 0 3337 0>;
+
+ /* 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>;
+
+ pwm-supply = <&ppvar_sys>;
+ pwm-dutycycle-range = <100 0>;
+ pwm-dutycycle-unit = <100>;
+ };
+
/* Schematics call this PPVAR even though it's fixed */
ppvar_logic: ppvar-logic {
compatible = "regulator-fixed";
@@ -444,6 +536,60 @@
};
};
+/*
+ * Set some suspend operating points to avoid OVP in suspend
+ *
+ * When we go into S3 ARM Trusted Firmware will transition our PWM regulators
+ * from wherever they're at back to the "default" operating point (whatever
+ * voltage we get when we set the PWM pins to "input").
+ *
+ * This quick transition under light load has the possibility to trigger the
+ * regulator "over voltage protection" (OVP).
+ *
+ * To make extra certain that we don't hit this OVP at suspend time, we'll
+ * transition to a voltage that's much closer to the default (~1.0 V) so that
+ * there will not be a big jump. Technically we only need to get within 200 mV
+ * of the default voltage, but the speed here should be fast enough and we need
+ * suspend/resume to be rock solid.
+ */
+
+&cluster0_opp {
+ opp05 {
+ opp-suspend;
+ };
+};
+
+&cluster1_opp {
+ opp06 {
+ opp-suspend;
+ };
+};
+
+&cpu_l0 {
+ cpu-supply = <&ppvar_litcpu>;
+};
+
+&cpu_l1 {
+ cpu-supply = <&ppvar_litcpu>;
+};
+
+&cpu_l2 {
+ cpu-supply = <&ppvar_litcpu>;
+};
+
+&cpu_l3 {
+ cpu-supply = <&ppvar_litcpu>;
+};
+
+&cpu_b0 {
+ cpu-supply = <&ppvar_bigcpu>;
+};
+
+&cpu_b1 {
+ cpu-supply = <&ppvar_bigcpu>;
+};
+
+
&cru {
assigned-clocks =
<&cru PLL_GPLL>, <&cru PLL_CPLL>,
--
2.8.0.rc3.226.g39d4020
next prev parent reply other threads:[~2016-12-02 2:27 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-02 2:27 [PATCH 0/9] arm64: dts: rockchip: support Google Kevin Brian Norris
2016-12-02 2:27 ` [PATCH 1/9] arm64: dts: Add symlinks for cros-ec-keyboard and cros-ec-sbs Brian Norris
2016-12-02 2:27 ` [PATCH 3/9] arm64: dts: rockchip: add rk3399 eDP HPD pinctrl Brian Norris
2016-12-07 16:56 ` Heiko Stuebner
[not found] ` <1480645653-36943-1-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-12-02 2:27 ` [PATCH 2/9] arm64: dts: rockchip: add rk3399 thermal_zones phandle Brian Norris
2016-12-07 16:55 ` Heiko Stuebner
2016-12-02 2:27 ` [PATCH 4/9] arm64: dts: rockchip: support dwc3 USB for rk3399 Brian Norris
2016-12-07 17:09 ` Heiko Stuebner
2016-12-07 17:52 ` Brian Norris
[not found] ` <20161207175208.GB87970-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2016-12-07 19:01 ` Heiko Stuebner
2016-12-07 19:03 ` Brian Norris
2016-12-07 19:09 ` Heiko Stuebner
2016-12-02 2:27 ` [PATCH 5/9] arm64: dts: rockchip: add rk3399 OPPs Brian Norris
2016-12-02 2:27 ` [PATCH 7/9] arm64: dts: rockchip: add Gru/Kevin DTS Brian Norris
2017-02-08 1:01 ` [PATCH 0/9] arm64: dts: rockchip: support Google Kevin Heiko Stuebner
2017-02-08 1:03 ` Brian Norris
2016-12-02 2:27 ` [PATCH 6/9] dt-bindings: Document rk3399 Gru/Kevin Brian Norris
[not found] ` <1480645653-36943-7-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-12-07 17:12 ` Heiko Stuebner
2016-12-07 17:41 ` Brian Norris
2016-12-07 19:15 ` Heiko Stuebner
2016-12-09 17:54 ` Rob Herring
2016-12-09 18:28 ` Heiko Stuebner
2016-12-02 2:27 ` Brian Norris [this message]
[not found] ` <1480645653-36943-9-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-12-07 16:48 ` [PATCH 8/9] arm64: dts: rockchip: partially describe PWM regulators for Gru Heiko Stuebner
2016-12-07 17:09 ` Brian Norris
2016-12-13 17:48 ` Heiko Stuebner
2016-12-22 16:09 ` Heiko Stübner
2016-12-02 2:27 ` [PATCH 9/9] arm64: dts: rockchip: add regulator info for Kevin digitizer Brian Norris
[not found] ` <1480645653-36943-10-git-send-email-briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2016-12-13 17:36 ` Heiko Stuebner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1480645653-36943-9-git-send-email-briannorris@chromium.org \
--to=briannorris@chromium.org \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=heiko@sntech.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=robh+dt@kernel.org \
--cc=smbarber@chromium.org \
--cc=wxt@rock-chips.com \
--cc=zyw@rock-chips.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).