aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Norris <briannorris@chromium.org>2017-03-20 19:53:43 -0400
committerHeiko Stuebner <heiko@sntech.de>2017-03-22 06:54:47 -0400
commitacaa71a6c746df80b33ace88689b336de96e833e (patch)
tree9a4fb4d8c5c9c4a5ba6a9c3ddf875309381b0350
parent48f4d9796d990850f6339b61eeeac9ca7fdb3695 (diff)
arm64: dts: rockchip: describe Gru/Kevin OPPs + CPU regulators
Used for Gru/Kevin only, as they're the only ones which have a described CPU regulator. Also, I'm not sure we've validated this table non-Gru boards. At the same time, partially describe PWM regulators for Gru, 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> [shared gru/kevin parts on a gru device] Tested-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> [with a bit of reordering] Signed-off-by: Heiko Stuebner <heiko@sntech.de>
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi139
-rw-r--r--arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi145
2 files changed, 284 insertions, 0 deletions
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
index 1a57014a7b59..0d960b7f7625 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi
@@ -44,6 +44,7 @@
44 44
45#include <dt-bindings/input/input.h> 45#include <dt-bindings/input/input.h>
46#include "rk3399.dtsi" 46#include "rk3399.dtsi"
47#include "rk3399-opp.dtsi"
47 48
48/ { 49/ {
49 chosen { 50 chosen {
@@ -163,6 +164,90 @@
163 vin-supply = <&ppvar_sys>; 164 vin-supply = <&ppvar_sys>;
164 }; 165 };
165 166
167 ppvar_bigcpu: ppvar-bigcpu {
168 compatible = "pwm-regulator";
169 regulator-name = "ppvar_bigcpu";
170 /*
171 * OVP circuit requires special handling which is not yet
172 * represented. Keep disabled for now.
173 */
174 status = "disabled";
175
176 pwms = <&pwm1 0 3337 0>;
177 pwm-supply = <&ppvar_sys>;
178 pwm-dutycycle-range = <100 0>;
179 pwm-dutycycle-unit = <100>;
180
181 /* EC turns on w/ ap_core_en; always on for AP */
182 regulator-always-on;
183 regulator-boot-on;
184 regulator-min-microvolt = <798674>;
185 regulator-max-microvolt = <1302172>;
186 };
187
188 ppvar_litcpu: ppvar-litcpu {
189 compatible = "pwm-regulator";
190 regulator-name = "ppvar_litcpu";
191 /*
192 * OVP circuit requires special handling which is not yet
193 * represented. Keep disabled for now.
194 */
195 status = "disabled";
196
197 pwms = <&pwm2 0 3337 0>;
198 pwm-supply = <&ppvar_sys>;
199 pwm-dutycycle-range = <100 0>;
200 pwm-dutycycle-unit = <100>;
201
202 /* EC turns on w/ ap_core_en; always on for AP */
203 regulator-always-on;
204 regulator-boot-on;
205 regulator-min-microvolt = <799065>;
206 regulator-max-microvolt = <1303738>;
207 };
208
209 ppvar_gpu: ppvar-gpu {
210 compatible = "pwm-regulator";
211 regulator-name = "ppvar_gpu";
212 /*
213 * OVP circuit requires special handling which is not yet
214 * represented. Keep disabled for now.
215 */
216 status = "disabled";
217
218 pwms = <&pwm0 0 3337 0>;
219 pwm-supply = <&ppvar_sys>;
220 pwm-dutycycle-range = <100 0>;
221 pwm-dutycycle-unit = <100>;
222
223 /* EC turns on w/ ap_core_en; always on for AP */
224 regulator-always-on;
225 regulator-boot-on;
226 regulator-min-microvolt = <785782>;
227 regulator-max-microvolt = <1217729>;
228 };
229
230 ppvar_centerlogic: ppvar-centerlogic {
231 compatible = "pwm-regulator";
232 regulator-name = "ppvar_centerlogic";
233 /*
234 * OVP circuit requires special handling which is not yet
235 * represented. Keep disabled for now.
236 */
237 status = "disabled";
238
239 pwms = <&pwm3 0 3337 0>;
240 pwm-supply = <&ppvar_sys>;
241 pwm-dutycycle-range = <100 0>;
242 pwm-dutycycle-unit = <100>;
243
244 /* EC turns on w/ ppvar_centerlogic_en; always on for AP */
245 regulator-always-on;
246 regulator-boot-on;
247 regulator-min-microvolt = <800069>;
248 regulator-max-microvolt = <1049692>;
249 };
250
166 /* Schematics call this PPVAR even though it's fixed */ 251 /* Schematics call this PPVAR even though it's fixed */
167 ppvar_logic: ppvar-logic { 252 ppvar_logic: ppvar-logic {
168 compatible = "regulator-fixed"; 253 compatible = "regulator-fixed";
@@ -393,6 +478,60 @@
393 }; 478 };
394}; 479};
395 480
481/*
482 * Set some suspend operating points to avoid OVP in suspend
483 *
484 * When we go into S3 ARM Trusted Firmware will transition our PWM regulators
485 * from wherever they're at back to the "default" operating point (whatever
486 * voltage we get when we set the PWM pins to "input").
487 *
488 * This quick transition under light load has the possibility to trigger the
489 * regulator "over voltage protection" (OVP).
490 *
491 * To make extra certain that we don't hit this OVP at suspend time, we'll
492 * transition to a voltage that's much closer to the default (~1.0 V) so that
493 * there will not be a big jump. Technically we only need to get within 200 mV
494 * of the default voltage, but the speed here should be fast enough and we need
495 * suspend/resume to be rock solid.
496 */
497
498&cluster0_opp {
499 opp05 {
500 opp-suspend;
501 };
502};
503
504&cluster1_opp {
505 opp06 {
506 opp-suspend;
507 };
508};
509
510&cpu_l0 {
511 cpu-supply = <&ppvar_litcpu>;
512};
513
514&cpu_l1 {
515 cpu-supply = <&ppvar_litcpu>;
516};
517
518&cpu_l2 {
519 cpu-supply = <&ppvar_litcpu>;
520};
521
522&cpu_l3 {
523 cpu-supply = <&ppvar_litcpu>;
524};
525
526&cpu_b0 {
527 cpu-supply = <&ppvar_bigcpu>;
528};
529
530&cpu_b1 {
531 cpu-supply = <&ppvar_bigcpu>;
532};
533
534
396&cru { 535&cru {
397 assigned-clocks = 536 assigned-clocks =
398 <&cru PLL_GPLL>, <&cru PLL_CPLL>, 537 <&cru PLL_GPLL>, <&cru PLL_CPLL>,
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi
new file mode 100644
index 000000000000..dd82e16236a8
--- /dev/null
+++ b/arch/arm64/boot/dts/rockchip/rk3399-opp.dtsi
@@ -0,0 +1,145 @@
1/*
2 * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,