GNU Linux-libre 6.1.90-gnu
[releases.git] / arch / arm64 / boot / dts / rockchip / rk3399-pinephone-pro.dts
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (c) 2020 Martijn Braam <martijn@brixit.nl>
4  * Copyright (c) 2021 Kamil TrzciƄski <ayufan@ayufan.eu>
5  */
6
7 /*
8  * PinePhone Pro datasheet:
9  * https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf
10  */
11
12 /dts-v1/;
13 #include <dt-bindings/input/linux-event-codes.h>
14 #include "rk3399.dtsi"
15 #include "rk3399-opp.dtsi"
16
17 / {
18         model = "Pine64 PinePhonePro";
19         compatible = "pine64,pinephone-pro", "rockchip,rk3399";
20         chassis-type = "handset";
21
22         aliases {
23                 mmc0 = &sdio0;
24                 mmc1 = &sdmmc;
25                 mmc2 = &sdhci;
26         };
27
28         chosen {
29                 stdout-path = "serial2:115200n8";
30         };
31
32         gpio-keys {
33                 compatible = "gpio-keys";
34                 pinctrl-names = "default";
35                 pinctrl-0 = <&pwrbtn_pin>;
36
37                 key-power {
38                         debounce-interval = <20>;
39                         gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
40                         label = "Power";
41                         linux,code = <KEY_POWER>;
42                         wakeup-source;
43                 };
44         };
45
46         vcc_sys: vcc-sys-regulator {
47                 compatible = "regulator-fixed";
48                 regulator-name = "vcc_sys";
49                 regulator-always-on;
50                 regulator-boot-on;
51         };
52
53         vcc3v3_sys: vcc3v3-sys-regulator {
54                 compatible = "regulator-fixed";
55                 regulator-name = "vcc3v3_sys";
56                 regulator-always-on;
57                 regulator-boot-on;
58                 regulator-min-microvolt = <3300000>;
59                 regulator-max-microvolt = <3300000>;
60                 vin-supply = <&vcc_sys>;
61         };
62
63         vcca1v8_s3: vcc1v8-s3-regulator {
64                 compatible = "regulator-fixed";
65                 regulator-name = "vcca1v8_s3";
66                 regulator-min-microvolt = <1800000>;
67                 regulator-max-microvolt = <1800000>;
68                 vin-supply = <&vcc3v3_sys>;
69                 regulator-always-on;
70                 regulator-boot-on;
71         };
72
73         vcc1v8_codec: vcc1v8-codec-regulator {
74                 compatible = "regulator-fixed";
75                 enable-active-high;
76                 gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
77                 pinctrl-names = "default";
78                 pinctrl-0 = <&vcc1v8_codec_en>;
79                 regulator-name = "vcc1v8_codec";
80                 regulator-min-microvolt = <1800000>;
81                 regulator-max-microvolt = <1800000>;
82                 vin-supply = <&vcc3v3_sys>;
83         };
84 };
85
86 &cpu_alert0 {
87         temperature = <65000>;
88 };
89 &cpu_alert1 {
90         temperature = <68000>;
91 };
92
93 &cpu_l0 {
94         cpu-supply = <&vdd_cpu_l>;
95 };
96
97 &cpu_l1 {
98         cpu-supply = <&vdd_cpu_l>;
99 };
100
101 &cpu_l2 {
102         cpu-supply = <&vdd_cpu_l>;
103 };
104
105 &cpu_l3 {
106         cpu-supply = <&vdd_cpu_l>;
107 };
108
109 &cpu_b0 {
110         cpu-supply = <&vdd_cpu_b>;
111 };
112
113 &cpu_b1 {
114         cpu-supply = <&vdd_cpu_b>;
115 };
116
117 &emmc_phy {
118         status = "okay";
119 };
120
121 &i2c0 {
122         clock-frequency = <400000>;
123         i2c-scl-rising-time-ns = <168>;
124         i2c-scl-falling-time-ns = <4>;
125         status = "okay";
126
127         rk818: pmic@1c {
128                 compatible = "rockchip,rk818";
129                 reg = <0x1c>;
130                 interrupt-parent = <&gpio1>;
131                 interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
132                 #clock-cells = <1>;
133                 clock-output-names = "xin32k", "rk808-clkout2";
134                 pinctrl-names = "default";
135                 pinctrl-0 = <&pmic_int_l>;
136                 rockchip,system-power-controller;
137                 wakeup-source;
138
139                 vcc1-supply = <&vcc_sys>;
140                 vcc2-supply = <&vcc_sys>;
141                 vcc3-supply = <&vcc_sys>;
142                 vcc4-supply = <&vcc_sys>;
143                 vcc6-supply = <&vcc_sys>;
144                 vcc7-supply = <&vcc3v3_sys>;
145                 vcc8-supply = <&vcc_sys>;
146                 vcc9-supply = <&vcc3v3_sys>;
147
148                 regulators {
149                         vdd_cpu_l: DCDC_REG1 {
150                                 regulator-name = "vdd_cpu_l";
151                                 regulator-always-on;
152                                 regulator-boot-on;
153                                 regulator-min-microvolt = <875000>;
154                                 regulator-max-microvolt = <975000>;
155                                 regulator-ramp-delay = <6001>;
156                                 regulator-state-mem {
157                                         regulator-off-in-suspend;
158                                 };
159                         };
160
161                         vdd_center: DCDC_REG2 {
162                                 regulator-name = "vdd_center";
163                                 regulator-always-on;
164                                 regulator-boot-on;
165                                 regulator-min-microvolt = <800000>;
166                                 regulator-max-microvolt = <1000000>;
167                                 regulator-ramp-delay = <6001>;
168                                 regulator-state-mem {
169                                         regulator-off-in-suspend;
170                                 };
171                         };
172
173                         vcc_ddr: DCDC_REG3 {
174                                 regulator-name = "vcc_ddr";
175                                 regulator-always-on;
176                                 regulator-boot-on;
177                                 regulator-state-mem {
178                                         regulator-on-in-suspend;
179                                 };
180                         };
181
182                         vcc_1v8: DCDC_REG4 {
183                                 regulator-name = "vcc_1v8";
184                                 regulator-always-on;
185                                 regulator-boot-on;
186                                 regulator-min-microvolt = <1800000>;
187                                 regulator-max-microvolt = <1800000>;
188                                 regulator-state-mem {
189                                         regulator-on-in-suspend;
190                                 };
191                         };
192
193                         vcca3v0_codec: LDO_REG1 {
194                                 regulator-name = "vcca3v0_codec";
195                                 regulator-min-microvolt = <3000000>;
196                                 regulator-max-microvolt = <3000000>;
197                         };
198
199                         vcc3v0_touch: LDO_REG2 {
200                                 regulator-name = "vcc3v0_touch";
201                                 regulator-min-microvolt = <3000000>;
202                                 regulator-max-microvolt = <3000000>;
203                         };
204
205                         vcca1v8_codec: LDO_REG3 {
206                                 regulator-name = "vcca1v8_codec";
207                                 regulator-min-microvolt = <1800000>;
208                                 regulator-max-microvolt = <1800000>;
209                         };
210
211                         rk818_pwr_on: LDO_REG4 {
212                                 regulator-name = "rk818_pwr_on";
213                                 regulator-always-on;
214                                 regulator-boot-on;
215                                 regulator-min-microvolt = <3300000>;
216                                 regulator-max-microvolt = <3300000>;
217                                 regulator-state-mem {
218                                         regulator-on-in-suspend;
219                                 };
220                         };
221
222                         vcc_3v0: LDO_REG5 {
223                                 regulator-name = "vcc_3v0";
224                                 regulator-always-on;
225                                 regulator-boot-on;
226                                 regulator-min-microvolt = <3000000>;
227                                 regulator-max-microvolt = <3000000>;
228                                 regulator-state-mem {
229                                         regulator-on-in-suspend;
230                                 };
231                         };
232
233                         vcc_1v5: LDO_REG6 {
234                                 regulator-name = "vcc_1v5";
235                                 regulator-always-on;
236                                 regulator-boot-on;
237                                 regulator-min-microvolt = <1500000>;
238                                 regulator-max-microvolt = <1500000>;
239                                 regulator-state-mem {
240                                         regulator-on-in-suspend;
241                                 };
242                         };
243
244                         vcc1v8_dvp: LDO_REG7 {
245                                 regulator-name = "vcc1v8_dvp";
246                                 regulator-min-microvolt = <1800000>;
247                                 regulator-max-microvolt = <1800000>;
248                         };
249
250                         vcc3v3_s3: LDO_REG8 {
251                                 regulator-name = "vcc3v3_s3";
252                                 regulator-always-on;
253                                 regulator-boot-on;
254                                 regulator-min-microvolt = <3300000>;
255                                 regulator-max-microvolt = <3300000>;
256                                 regulator-state-mem {
257                                         regulator-off-in-suspend;
258                                 };
259                         };
260
261                         vccio_sd: LDO_REG9 {
262                                 regulator-name = "vccio_sd";
263                                 regulator-min-microvolt = <1800000>;
264                                 regulator-max-microvolt = <3300000>;
265                         };
266
267                         vcc3v3_s0: SWITCH_REG {
268                                 regulator-name = "vcc3v3_s0";
269                                 regulator-always-on;
270                                 regulator-boot-on;
271                                 regulator-state-mem {
272                                         regulator-on-in-suspend;
273                                 };
274                         };
275                 };
276         };
277
278         vdd_cpu_b: regulator@40 {
279                 compatible = "silergy,syr827";
280                 reg = <0x40>;
281                 fcs,suspend-voltage-selector = <1>;
282                 pinctrl-names = "default";
283                 pinctrl-0 = <&vsel1_pin>;
284                 regulator-name = "vdd_cpu_b";
285                 regulator-min-microvolt = <875000>;
286                 regulator-max-microvolt = <1150000>;
287                 regulator-ramp-delay = <1000>;
288                 regulator-always-on;
289                 regulator-boot-on;
290
291                 regulator-state-mem {
292                         regulator-off-in-suspend;
293                 };
294         };
295
296         vdd_gpu: regulator@41 {
297                 compatible = "silergy,syr828";
298                 reg = <0x41>;
299                 fcs,suspend-voltage-selector = <1>;
300                 pinctrl-names = "default";
301                 pinctrl-0 = <&vsel2_pin>;
302                 regulator-name = "vdd_gpu";
303                 regulator-min-microvolt = <875000>;
304                 regulator-max-microvolt = <975000>;
305                 regulator-ramp-delay = <1000>;
306                 regulator-always-on;
307                 regulator-boot-on;
308
309                 regulator-state-mem {
310                         regulator-off-in-suspend;
311                 };
312         };
313 };
314
315 &cluster0_opp {
316         opp04 {
317                 status = "disabled";
318         };
319
320         opp05 {
321                 status = "disabled";
322         };
323 };
324
325 &cluster1_opp {
326         opp06 {
327                 opp-hz = /bits/ 64 <1500000000>;
328                 opp-microvolt = <1100000 1100000 1150000>;
329         };
330
331         opp07 {
332                 status = "disabled";
333         };
334 };
335
336 &io_domains {
337         bt656-supply = <&vcc1v8_dvp>;
338         audio-supply = <&vcca1v8_codec>;
339         sdmmc-supply = <&vccio_sd>;
340         gpio1830-supply = <&vcc_3v0>;
341         status = "okay";
342 };
343
344 &pmu_io_domains {
345         pmu1830-supply = <&vcc_1v8>;
346         status = "okay";
347 };
348
349 &pinctrl {
350         buttons {
351                 pwrbtn_pin: pwrbtn-pin {
352                         rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
353                 };
354         };
355
356         pmic {
357                 pmic_int_l: pmic-int-l {
358                         rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
359                 };
360
361                 vsel1_pin: vsel1-pin {
362                         rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
363                 };
364
365                 vsel2_pin: vsel2-pin {
366                         rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
367                 };
368         };
369
370         sound {
371                 vcc1v8_codec_en: vcc1v8-codec-en {
372                         rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
373                 };
374         };
375 };
376
377 &sdmmc {
378         bus-width = <4>;
379         cap-sd-highspeed;
380         cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
381         disable-wp;
382         max-frequency = <150000000>;
383         pinctrl-names = "default";
384         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
385         vmmc-supply = <&vcc3v3_sys>;
386         vqmmc-supply = <&vccio_sd>;
387         status = "okay";
388 };
389
390 &sdhci {
391         bus-width = <8>;
392         mmc-hs200-1_8v;
393         non-removable;
394         status = "okay";
395 };
396
397 &tsadc {
398         rockchip,hw-tshut-mode = <1>;
399         rockchip,hw-tshut-polarity = <1>;
400         status = "okay";
401 };
402
403 &uart2 {
404         status = "okay";
405 };