Merge tag 'lsk-v4.4-16.07-android'
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-evb-rev2.dtsi
1 /*
2  * Copyright (c) 2016 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 file 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 file 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,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 #include "rk3399-evb.dtsi"
44
45 / {
46         compatible = "rockchip,rk3399-evb-rev2", "rockchip,rk3399";
47
48         vcc5v0_sys: vcc5v0-sys {
49                 compatible = "regulator-fixed";
50                 regulator-name = "vcc5v0_sys";
51                 regulator-always-on;
52                 regulator-boot-on;
53                 regulator-min-microvolt = <5000000>;
54                 regulator-max-microvolt = <5000000>;
55         };
56 };
57
58 &cpu_l0 {
59         dynamic-power-coefficient = <121>;
60 };
61
62 &cpu_b0 {
63         dynamic-power-coefficient = <1068>;
64 };
65
66 &cluster0_opp {
67         opp@408000000 {
68                 opp-hz = /bits/ 64 <408000000>;
69                 opp-microvolt = <800000>;
70                 clock-latency-ns = <40000>;
71         };
72         opp@600000000 {
73                 opp-hz = /bits/ 64 <600000000>;
74                 opp-microvolt = <800000>;
75         };
76         opp@816000000 {
77                 opp-hz = /bits/ 64 <816000000>;
78                 opp-microvolt = <800000>;
79         };
80         opp@1008000000 {
81                 opp-hz = /bits/ 64 <1008000000>;
82                 opp-microvolt = <875000>;
83         };
84         opp@1200000000 {
85                 opp-hz = /bits/ 64 <1200000000>;
86                 opp-microvolt = <925000>;
87         };
88         opp@1416000000 {
89                 opp-hz = /bits/ 64 <1416000000>;
90                 opp-microvolt = <1025000>;
91         };
92         opp@1512000000 {
93                 opp-hz = /bits/ 64 <1512000000>;
94                 opp-microvolt = <1075000>;
95         };
96 };
97
98 &cluster1_opp {
99         opp@408000000 {
100                 opp-hz = /bits/ 64 <408000000>;
101                 opp-microvolt = <800000>;
102                 clock-latency-ns = <40000>;
103         };
104         opp@600000000 {
105                 opp-hz = /bits/ 64 <600000000>;
106                 opp-microvolt = <800000>;
107         };
108         opp@816000000 {
109                 opp-hz = /bits/ 64 <816000000>;
110                 opp-microvolt = <800000>;
111         };
112         opp@1008000000 {
113                 opp-hz = /bits/ 64 <1008000000>;
114                 opp-microvolt = <850000>;
115         };
116         opp@1200000000 {
117                 opp-hz = /bits/ 64 <1200000000>;
118                 opp-microvolt = <925000>;
119         };
120         opp@1416000000 {
121                 opp-hz = /bits/ 64 <1416000000>;
122                 opp-microvolt = <1025000>;
123         };
124         opp@1608000000 {
125                 opp-hz = /bits/ 64 <1608000000>;
126                 opp-microvolt = <1125000>;
127         };
128         opp@1800000000 {
129                 opp-hz = /bits/ 64 <1800000000>;
130                 opp-microvolt = <1200000>;
131                 status = "disabeld";
132         };
133 };
134
135 &CPU_COST_A72 {
136         busy-cost-data = <
137                 232   349       /*  408MHz */
138                 341   547       /*  600MHz */
139                 464   794       /*  816MHz */
140                 573   1141      /* 1008MHz */
141                 683   1850      /* 1200MHz */
142                 805   2499      /* 1416MHz */
143                 915   2922      /* 1608MHz */
144         //      1024  3416      /* 1800MHz */
145         >;
146         idle-cost-data = <
147               15
148               15
149                0
150         >;
151 };
152
153 &CPU_COST_A53 {
154         busy-cost-data = <
155                 121    40       /*  408M */
156                 179    62       /*  600M */
157                 243    90       /*  816M */
158                 300    126      /* 1008M */
159                 357    196      /* 1200M */
160                 421    246      /* 1416M */
161                 449    263      /* 1512M */
162         >;
163         idle-cost-data = <
164               6
165               6
166               0
167         >;
168 };
169
170 &CLUSTER_COST_A72 {
171         busy-cost-data = <
172                 232   349       /*  408MHz */
173                 341   547       /*  600MHz */
174                 464   794       /*  816MHz */
175                 573   1141      /* 1008MHz */
176                 683   1850      /* 1200MHz */
177                 805   2499      /* 1416MHz */
178                 915   2922      /* 1608MHz */
179         //      1024  3416      /* 1800MHz */
180         >;
181         idle-cost-data = <
182                  65
183                  65
184                  65
185         >;
186 };
187
188 &CLUSTER_COST_A53 {
189         busy-cost-data = <
190                 121    40       /*  408M */
191                 179    62       /*  600M */
192                 243    90       /*  816M */
193                 300    126      /* 1008M */
194                 357    196      /* 1200M */
195                 421    246      /* 1416M */
196                 449    263      /* 1512M */
197         >;
198         idle-cost-data = <
199                 56
200                 56
201                 56
202         >;
203 };
204
205 &soc_thermal {
206         sustainable-power = <1600>; /* milliwatts */
207
208         cooling-maps {
209                 map0 {
210                         trip = <&target>;
211                         cooling-device =
212                                 <&cpu_l0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
213                         contribution = <10240>;
214                 };
215                 map1 {
216                         trip = <&target>;
217                         cooling-device =
218                                 <&cpu_b0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
219                         contribution = <1024>;
220                 };
221                 map2 {
222                         trip = <&target>;
223                         cooling-device =
224                                 <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
225                         contribution = <10240>;
226                 };
227         };
228 };
229
230 &gpu_power_model {
231         dynamic-power = <1780>;
232 };
233
234 &i2c0 {
235         fusb1: fusb30x@22 {
236                 compatible = "fairchild,fusb302";
237                 reg = <0x22>;
238                 pinctrl-names = "default";
239                 pinctrl-0 = <&fusb1_int>;
240                 vbus-5v-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
241                 int-n-gpios = <&gpio1 24 GPIO_ACTIVE_HIGH>;
242                 status = "okay";
243         };
244
245         vdd_cpu_b: syr827@40 {
246                 compatible = "silergy,syr827";
247                 reg = <0x40>;
248                 vin-supply = <&vcc5v0_sys>;
249                 regulator-compatible = "fan53555-reg";
250                 regulator-name = "vdd_cpu_b";
251                 regulator-min-microvolt = <712500>;
252                 regulator-max-microvolt = <1500000>;
253                 regulator-ramp-delay = <1000>;
254                 fcs,suspend-voltage-selector = <1>;
255                 regulator-always-on;
256                 regulator-boot-on;
257                 regulator-initial-state = <3>;
258                         regulator-state-mem {
259                         regulator-off-in-suspend;
260                 };
261         };
262
263         lp8752: lp8752@60 {
264                 compatible = "ti,lp8752";
265                 reg = <0x60>;
266                 vin0-supply = <&vcc5v0_sys>;
267                 regulators {
268                         vdd_gpu: lp8752_buck0 {
269                                 regulator-name = "vdd_gpu";
270                                 regulator-min-microvolt = <735000>;
271                                 regulator-max-microvolt = <1400000>;
272                                 regulator-always-on;
273                                 regulator-boot-on;
274                         };
275                 };
276         };
277
278         rk808: pmic@1b {
279                 compatible = "rockchip,rk808";
280                 reg = <0x1b>;
281                 interrupt-parent = <&gpio1>;
282                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
283                 pinctrl-names = "default";
284                 pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
285                 rockchip,system-power-controller;
286                 wakeup-source;
287                 #clock-cells = <1>;
288                 clock-output-names = "xin32k", "rk808-clkout2";
289
290                 vcc1-supply = <&vcc3v3_sys>;
291                 vcc2-supply = <&vcc3v3_sys>;
292                 vcc3-supply = <&vcc3v3_sys>;
293                 vcc4-supply = <&vcc3v3_sys>;
294                 vcc6-supply = <&vcc3v3_sys>;
295                 vcc7-supply = <&vcc3v3_sys>;
296                 vcc8-supply = <&vcc3v3_sys>;
297                 vcc9-supply = <&vcc3v3_sys>;
298                 vcc10-supply = <&vcc3v3_sys>;
299                 vcc11-supply = <&vcc3v3_sys>;
300                 vcc12-supply = <&vcc3v3_sys>;
301                 vddio-supply = <&vcc1v8_pmu>;
302
303                 regulators {
304                         vdd_log: DCDC_REG1 {
305                                 regulator-always-on;
306                                 regulator-boot-on;
307                                 regulator-min-microvolt = <750000>;
308                                 regulator-max-microvolt = <1350000>;
309                                 regulator-name = "vdd_log";
310                                 regulator-state-mem {
311                                         regulator-on-in-suspend;
312                                         regulator-suspend-microvolt = <900000>;
313                                 };
314                         };
315
316                         vdd_cpu_l: DCDC_REG2 {
317                                 regulator-always-on;
318                                 regulator-boot-on;
319                                 regulator-min-microvolt = <750000>;
320                                 regulator-max-microvolt = <1350000>;
321                                 regulator-name = "vdd_cpu_l";
322                                 regulator-state-mem {
323                                         regulator-off-in-suspend;
324                                 };
325                         };
326
327                         vcc_ddr: DCDC_REG3 {
328                                 regulator-always-on;
329                                 regulator-boot-on;
330                                 regulator-name = "vcc_ddr";
331                                 regulator-state-mem {
332                                         regulator-on-in-suspend;
333                                 };
334                         };
335
336                         vcc_1v8: DCDC_REG4 {
337                                 regulator-always-on;
338                                 regulator-boot-on;
339                                 regulator-min-microvolt = <1800000>;
340                                 regulator-max-microvolt = <1800000>;
341                                 regulator-name = "vcc_1v8";
342                                 regulator-state-mem {
343                                         regulator-on-in-suspend;
344                                         regulator-suspend-microvolt = <1800000>;
345                                 };
346                         };
347
348                         vcc1v8_dvp: LDO_REG1 {
349                                 regulator-always-on;
350                                 regulator-boot-on;
351                                 regulator-min-microvolt = <1800000>;
352                                 regulator-max-microvolt = <1800000>;
353                                 regulator-name = "vcc1v8_dvp";
354                                 regulator-state-mem {
355                                         regulator-off-in-suspend;
356                                 };
357                         };
358
359                         vcc3v0_tp: LDO_REG2 {
360                                 regulator-always-on;
361                                 regulator-boot-on;
362                                 regulator-min-microvolt = <3000000>;
363                                 regulator-max-microvolt = <3000000>;
364                                 regulator-name = "vcc3v0_tp";
365                                 regulator-state-mem {
366                                         regulator-off-in-suspend;
367                                 };
368                         };
369
370                         vcc1v8_pmu: LDO_REG3 {
371                                 regulator-always-on;
372                                 regulator-boot-on;
373                                 regulator-min-microvolt = <1800000>;
374                                 regulator-max-microvolt = <1800000>;
375                                 regulator-name = "vcc1v8_pmu";
376                                 regulator-state-mem {
377                                         regulator-on-in-suspend;
378                                         regulator-suspend-microvolt = <1800000>;
379                                 };
380                         };
381
382                         vcc_sd: LDO_REG4 {
383                                 regulator-always-on;
384                                 regulator-boot-on;
385                                 regulator-min-microvolt = <1800000>;
386                                 regulator-max-microvolt = <3300000>;
387                                 regulator-name = "vcc_sd";
388                                 regulator-state-mem {
389                                         regulator-on-in-suspend;
390                                         regulator-suspend-microvolt = <3300000>;
391                                 };
392                         };
393
394                         vcca3v0_codec: LDO_REG5 {
395                                 regulator-always-on;
396                                 regulator-boot-on;
397                                 regulator-min-microvolt = <3000000>;
398                                 regulator-max-microvolt = <3000000>;
399                                 regulator-name = "vcca3v0_codec";
400                                 regulator-state-mem {
401                                         regulator-off-in-suspend;
402                                 };
403                         };
404
405                         vcc_1v5: LDO_REG6 {
406                                 regulator-always-on;
407                                 regulator-boot-on;
408                                 regulator-min-microvolt = <1500000>;
409                                 regulator-max-microvolt = <1500000>;
410                                 regulator-name = "vcc_1v5";
411                                 regulator-state-mem {
412                                         regulator-on-in-suspend;
413                                         regulator-suspend-microvolt = <1500000>;
414                                 };
415                         };
416
417                         vcca1v8_codec: LDO_REG7 {
418                                 regulator-always-on;
419                                 regulator-boot-on;
420                                 regulator-min-microvolt = <1800000>;
421                                 regulator-max-microvolt = <1800000>;
422                                 regulator-name = "vcca1v8_codec";
423                                 regulator-state-mem {
424                                         regulator-off-in-suspend;
425                                 };
426                         };
427
428                         vcc_3v0: LDO_REG8 {
429                                 regulator-always-on;
430                                 regulator-boot-on;
431                                 regulator-min-microvolt = <3000000>;
432                                 regulator-max-microvolt = <3000000>;
433                                 regulator-name = "vcc_3v0";
434                                 regulator-state-mem {
435                                         regulator-on-in-suspend;
436                                         regulator-suspend-microvolt = <3000000>;
437                                 };
438                         };
439
440                         vcc3v3_s3: SWITCH_REG1 {
441                                 regulator-always-on;
442                                 regulator-boot-on;
443                                 regulator-name = "vcc3v3_s3";
444                                 regulator-state-mem {
445                                         regulator-off-in-suspend;
446                                 };
447                         };
448
449                         vcc3v3_s0: SWITCH_REG2 {
450                                 regulator-always-on;
451                                 regulator-boot-on;
452                                 regulator-name = "vcc3v3_s0";
453                                 regulator-state-mem {
454                                         regulator-off-in-suspend;
455                                 };
456                         };
457                 };
458         };
459 };
460
461 &u2phy0_otg {
462         rockchip,utmi-avalid;
463 };
464
465 &i2c6 {
466         status = "okay";
467         fusb0: fusb30x@22 {
468                 compatible = "fairchild,fusb302";
469                 reg = <0x22>;
470                 pinctrl-names = "default";
471                 pinctrl-0 = <&fusb0_int>;
472                 vbus-5v-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
473                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
474                 status = "okay";
475         };
476 };