arm64: dts: rockchip: Add all CPUs in cooling maps
[muen/linux.git] / arch / arm64 / boot / dts / rockchip / rk3399-gru-kevin.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Google Gru-Kevin Rev 6+ board device tree source
4  *
5  * Copyright 2016-2017 Google, Inc
6  */
7
8 /dts-v1/;
9 #include "rk3399-gru-chromebook.dtsi"
10 #include <dt-bindings/input/linux-event-codes.h>
11
12 /*
13  * Kevin-specific things
14  *
15  * Things in this section should use names from Kevin schematic since no
16  * equivalent exists in Gru schematic.  If referring to signals that exist
17  * in Gru we use the Gru names, though.  Confusing enough for you?
18  */
19 / {
20         model = "Google Kevin";
21         compatible = "google,kevin-rev15", "google,kevin-rev14",
22                      "google,kevin-rev13", "google,kevin-rev12",
23                      "google,kevin-rev11", "google,kevin-rev10",
24                      "google,kevin-rev9", "google,kevin-rev8",
25                      "google,kevin-rev7", "google,kevin-rev6",
26                      "google,kevin", "google,gru", "rockchip,rk3399";
27
28         /* Power tree */
29
30         p3_3v_dig: p3-3v-dig {
31                 compatible = "regulator-fixed";
32                 regulator-name = "p3.3v_dig";
33                 pinctrl-names = "default";
34                 pinctrl-0 = <&cpu3_pen_pwr_en>;
35
36                 enable-active-high;
37                 gpio = <&gpio4 30 GPIO_ACTIVE_HIGH>;
38                 vin-supply = <&pp3300>;
39         };
40
41         edp_panel: edp-panel {
42                 compatible = "sharp,lq123p1jx31", "simple-panel";
43                 backlight = <&backlight>;
44                 power-supply = <&pp3300_disp>;
45
46                 ports {
47                         panel_in_edp: endpoint {
48                                 remote-endpoint = <&edp_out_panel>;
49                         };
50                 };
51         };
52
53         thermistor_ppvar_bigcpu: thermistor-ppvar-bigcpu {
54                 compatible = "murata,ncp15wb473";
55                 pullup-uv = <1800000>;
56                 pullup-ohm = <25500>;
57                 pulldown-ohm = <0>;
58                 io-channels = <&saradc 2>;
59                 #thermal-sensor-cells = <0>;
60         };
61
62         thermistor_ppvar_litcpu: thermistor-ppvar-litcpu {
63                 compatible = "murata,ncp15wb473";
64                 pullup-uv = <1800000>;
65                 pullup-ohm = <25500>;
66                 pulldown-ohm = <0>;
67                 io-channels = <&saradc 3>;
68                 #thermal-sensor-cells = <0>;
69         };
70 };
71
72 &backlight {
73         pwms = <&cros_ec_pwm 1>;
74 };
75
76 &gpio_keys {
77         pinctrl-names = "default";
78         pinctrl-0 = <&bt_host_wake_l>, <&cpu1_pen_eject>;
79
80         pen-insert {
81                 label = "Pen Insert";
82                 /* Insert = low, eject = high */
83                 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
84                 linux,code = <SW_PEN_INSERTED>;
85                 linux,input-type = <EV_SW>;
86                 wakeup-source;
87         };
88 };
89
90 &thermal_zones {
91         bigcpu_reg_thermal: bigcpu-reg-thermal {
92                 polling-delay-passive = <100>; /* milliseconds */
93                 polling-delay = <1000>; /* milliseconds */
94                 thermal-sensors = <&thermistor_ppvar_bigcpu 0>;
95                 sustainable-power = <4000>;
96
97                 ppvar_bigcpu_trips: trips {
98                         ppvar_bigcpu_on: ppvar-bigcpu-on {
99                                 temperature = <40000>;  /* millicelsius */
100                                 hysteresis = <2000>;    /* millicelsius */
101                                 type = "passive";
102                         };
103
104                         ppvar_bigcpu_alert: ppvar-bigcpu-alert {
105                                 temperature = <50000>;  /* millicelsius */
106                                 hysteresis = <2000>;    /* millicelsius */
107                                 type = "passive";
108                         };
109
110                         ppvar_bigcpu_crit: ppvar-bigcpu-crit {
111                                 temperature = <90000>;  /* millicelsius */
112                                 hysteresis = <0>;       /* millicelsius */
113                                 type = "critical";
114                         };
115                 };
116
117                 cooling-maps {
118                         map0 {
119                                 trip = <&ppvar_bigcpu_alert>;
120                                 cooling-device =
121                                         <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
122                                         <&cpu_l1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
123                                         <&cpu_l2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
124                                         <&cpu_l3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
125                                 contribution = <4096>;
126                         };
127                         map1 {
128                                 trip = <&ppvar_bigcpu_alert>;
129                                 cooling-device =
130                                         <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
131                                         <&cpu_b1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
132                                 contribution = <1024>;
133                         };
134                 };
135         };
136
137         litcpu_reg_thermal: litcpu-reg-thermal {
138                 polling-delay-passive = <100>; /* milliseconds */
139                 polling-delay = <1000>; /* milliseconds */
140                 thermal-sensors = <&thermistor_ppvar_litcpu 0>;
141                 sustainable-power = <4000>;
142
143                 ppvar_litcpu_trips: trips {
144                         ppvar_litcpu_on: ppvar-litcpu-on {
145                                 temperature = <40000>;  /* millicelsius */
146                                 hysteresis = <2000>;    /* millicelsius */
147                                 type = "passive";
148                         };
149
150                         ppvar_litcpu_alert: ppvar-litcpu-alert {
151                                 temperature = <50000>;  /* millicelsius */
152                                 hysteresis = <2000>;    /* millicelsius */
153                                 type = "passive";
154                         };
155
156                         ppvar_litcpu_crit: ppvar-litcpu-crit {
157                                 temperature = <90000>;  /* millicelsius */
158                                 hysteresis = <0>;       /* millicelsius */
159                                 type = "critical";
160                         };
161                 };
162         };
163 };
164
165 ap_i2c_tpm: &i2c0 {
166         status = "okay";
167
168         clock-frequency = <400000>;
169
170         /* These are relatively safe rise/fall times. */
171         i2c-scl-falling-time-ns = <50>;
172         i2c-scl-rising-time-ns = <300>;
173
174         tpm: tpm@20 {
175                 compatible = "infineon,slb9645tt";
176                 reg = <0x20>;
177                 powered-while-suspended;
178         };
179 };
180
181 ap_i2c_dig: &i2c2 {
182         status = "okay";
183
184         clock-frequency = <400000>;
185
186         /* These are relatively safe rise/fall times. */
187         i2c-scl-falling-time-ns = <50>;
188         i2c-scl-rising-time-ns = <300>;
189
190         digitizer: digitizer@9 {
191                 /* wacom,w9013 */
192                 compatible = "hid-over-i2c";
193                 reg = <0x9>;
194                 pinctrl-names = "default";
195                 pinctrl-0 = <&cpu1_dig_irq_l &cpu1_dig_pdct_l>;
196
197                 vdd-supply = <&p3_3v_dig>;
198                 post-power-on-delay-ms = <100>;
199
200                 interrupt-parent = <&gpio2>;
201                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
202
203                 hid-descr-addr = <0x1>;
204         };
205 };
206
207 /* Adjustments to things in the gru baseboard */
208
209 &ap_i2c_tp {
210         trackpad@4a {
211                 compatible = "atmel,maxtouch";
212                 reg = <0x4a>;
213                 pinctrl-names = "default";
214                 pinctrl-0 = <&trackpad_int_l>;
215                 interrupt-parent = <&gpio1>;
216                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
217                 linux,gpio-keymap = <KEY_RESERVED
218                                      KEY_RESERVED
219                                      KEY_RESERVED
220                                      BTN_LEFT>;
221                 wakeup-source;
222         };
223 };
224
225 &ap_i2c_ts {
226         touchscreen@4b {
227                 compatible = "atmel,maxtouch";
228                 reg = <0x4b>;
229                 pinctrl-names = "default";
230                 pinctrl-0 = <&touch_int_l>;
231                 interrupt-parent = <&gpio3>;
232                 interrupts = <13 IRQ_TYPE_LEVEL_LOW>;
233         };
234 };
235
236 &ppvar_bigcpu_pwm {
237         regulator-min-microvolt = <798674>;
238         regulator-max-microvolt = <1302172>;
239 };
240
241 &ppvar_bigcpu {
242         regulator-min-microvolt = <798674>;
243         regulator-max-microvolt = <1302172>;
244         ctrl-voltage-range = <798674 1302172>;
245 };
246
247 &ppvar_litcpu_pwm {
248         regulator-min-microvolt = <799065>;
249         regulator-max-microvolt = <1303738>;
250 };
251
252 &ppvar_litcpu {
253         regulator-min-microvolt = <799065>;
254         regulator-max-microvolt = <1303738>;
255         ctrl-voltage-range = <799065 1303738>;
256 };
257
258 &ppvar_gpu_pwm {
259         regulator-min-microvolt = <785782>;
260         regulator-max-microvolt = <1217729>;
261 };
262
263 &ppvar_gpu {
264         regulator-min-microvolt = <785782>;
265         regulator-max-microvolt = <1217729>;
266         ctrl-voltage-range = <785782 1217729>;
267 };
268
269 &ppvar_centerlogic_pwm {
270         regulator-min-microvolt = <800069>;
271         regulator-max-microvolt = <1049692>;
272 };
273
274 &ppvar_centerlogic {
275         regulator-min-microvolt = <800069>;
276         regulator-max-microvolt = <1049692>;
277         ctrl-voltage-range = <800069 1049692>;
278 };
279
280 &saradc {
281         status = "okay";
282         vref-supply = <&pp1800_ap_io>;
283 };
284
285 &mvl_wifi {
286         marvell,wakeup-pin = <14>; /* GPIO_14 on Marvell */
287 };
288
289 &pinctrl {
290         digitizer {
291                 /* Has external pullup */
292                 cpu1_dig_irq_l: cpu1-dig-irq-l {
293                         rockchip,pins = <2 4 RK_FUNC_GPIO &pcfg_pull_none>;
294                 };
295
296                 /* Has external pullup */
297                 cpu1_dig_pdct_l: cpu1-dig-pdct-l {
298                         rockchip,pins = <2 5 RK_FUNC_GPIO &pcfg_pull_none>;
299                 };
300         };
301
302         discrete-regulators {
303                 cpu3_pen_pwr_en: cpu3-pen-pwr-en {
304                         rockchip,pins = <4 30 RK_FUNC_GPIO &pcfg_pull_none>;
305                 };
306         };
307
308         pen {
309                 cpu1_pen_eject: cpu1-pen-eject {
310                         rockchip,pins = <0 13 RK_FUNC_GPIO &pcfg_pull_up>;
311                 };
312         };
313 };