1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Fuzhou Rockchip Electronics Co., Ltd
4 */
5
6/dts-v1/;
7#include <dt-bindings/gpio/gpio.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/pinctrl/rockchip.h>
10#include "px30.dtsi"
11
12/ {
13	model = "Rockchip PX30 EVB";
14	compatible = "rockchip,px30-evb", "rockchip,px30";
15
16	aliases {
17		mmc0 = &sdmmc;
18		mmc1 = &sdio;
19		mmc2 = &emmc;
20	};
21
22	chosen {
23		stdout-path = "serial5:115200n8";
24	};
25
26	adc-keys {
27		compatible = "adc-keys";
28		io-channels = <&saradc 2>;
29		io-channel-names = "buttons";
30		keyup-threshold-microvolt = <1800000>;
31		poll-interval = <100>;
32
33		esc-key {
34			label = "esc";
35			linux,code = <KEY_ESC>;
36			press-threshold-microvolt = <1310000>;
37		};
38
39		home-key {
40			label = "home";
41			linux,code = <KEY_HOME>;
42			press-threshold-microvolt = <624000>;
43		};
44
45		menu-key {
46			label = "menu";
47			linux,code = <KEY_MENU>;
48			press-threshold-microvolt = <987000>;
49		};
50
51		vol-down-key {
52			label = "volume down";
53			linux,code = <KEY_VOLUMEDOWN>;
54			press-threshold-microvolt = <300000>;
55		};
56
57		vol-up-key {
58			label = "volume up";
59			linux,code = <KEY_VOLUMEUP>;
60			press-threshold-microvolt = <17000>;
61		};
62	};
63
64	backlight: backlight {
65		compatible = "pwm-backlight";
66		pwms = <&pwm1 0 25000 0>;
67		power-supply = <&vcc3v3_lcd>;
68	};
69
70	emmc_pwrseq: emmc-pwrseq {
71		compatible = "mmc-pwrseq-emmc";
72		pinctrl-0 = <&emmc_reset>;
73		pinctrl-names = "default";
74		reset-gpios = <&gpio1 RK_PB3 GPIO_ACTIVE_HIGH>;
75	};
76
77	sdio_pwrseq: sdio-pwrseq {
78		compatible = "mmc-pwrseq-simple";
79		pinctrl-names = "default";
80		pinctrl-0 = <&wifi_enable_h>;
81
82		/*
83		 * On the module itself this is one of these (depending
84		 * on the actual card populated):
85		 * - SDIO_RESET_L_WL_REG_ON
86		 * - PDN (power down when low)
87		 */
88		reset-gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; /* GPIO3_A4 */
89	};
90
91	vcc5v0_sys: vccsys {
92		compatible = "regulator-fixed";
93		regulator-name = "vcc5v0_sys";
94		regulator-always-on;
95		regulator-boot-on;
96		regulator-min-microvolt = <5000000>;
97		regulator-max-microvolt = <5000000>;
98	};
99};
100
101&cpu0 {
102	cpu-supply = <&vdd_arm>;
103};
104
105&cpu1 {
106	cpu-supply = <&vdd_arm>;
107};
108
109&cpu2 {
110	cpu-supply = <&vdd_arm>;
111};
112
113&cpu3 {
114	cpu-supply = <&vdd_arm>;
115};
116
117&display_subsystem {
118	status = "okay";
119};
120
121&dsi {
122	status = "okay";
123
124	ports {
125		mipi_out: port@1 {
126			reg = <1>;
127
128			mipi_out_panel: endpoint {
129				remote-endpoint = <&mipi_in_panel>;
130			};
131		};
132	};
133
134	panel@0 {
135		compatible = "xinpeng,xpp055c272";
136		reg = <0>;
137		backlight = <&backlight>;
138		iovcc-supply = <&vcc_1v8>;
139		vci-supply = <&vcc3v3_lcd>;
140
141		port {
142			mipi_in_panel: endpoint {
143				remote-endpoint = <&mipi_out_panel>;
144			};
145		};
146	};
147};
148
149&dsi_dphy {
150	status = "okay";
151};
152
153&emmc {
154	cap-mmc-highspeed;
155	mmc-hs200-1_8v;
156	non-removable;
157	mmc-pwrseq = <&emmc_pwrseq>;
158	vmmc-supply = <&vcc_3v0>;
159	vqmmc-supply = <&vccio_flash>;
160	status = "okay";
161};
162
163&gmac {
164	clock_in_out = "output";
165	phy-supply = <&vcc_rmii>;
166	snps,reset-gpio = <&gpio2 13 GPIO_ACTIVE_LOW>;
167	snps,reset-active-low;
168	snps,reset-delays-us = <0 50000 50000>;
169	status = "okay";
170};
171
172&gpu {
173	mali-supply = <&vdd_log>;
174	status = "okay";
175};
176
177&i2c0 {
178	status = "okay";
179
180	rk809: pmic@20 {
181		compatible = "rockchip,rk809";
182		reg = <0x20>;
183		interrupt-parent = <&gpio0>;
184		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
185		pinctrl-names = "default";
186		pinctrl-0 = <&pmic_int>;
187		rockchip,system-power-controller;
188		wakeup-source;
189		#clock-cells = <0>;
190		clock-output-names = "xin32k";
191
192		vcc1-supply = <&vcc5v0_sys>;
193		vcc2-supply = <&vcc5v0_sys>;
194		vcc3-supply = <&vcc5v0_sys>;
195		vcc4-supply = <&vcc5v0_sys>;
196		vcc5-supply = <&vcc3v3_sys>;
197		vcc6-supply = <&vcc3v3_sys>;
198		vcc7-supply = <&vcc3v3_sys>;
199		vcc8-supply = <&vcc3v3_sys>;
200		vcc9-supply = <&vcc5v0_sys>;
201
202		regulators {
203			vdd_log: DCDC_REG1 {
204				regulator-name = "vdd_log";
205				regulator-min-microvolt = <950000>;
206				regulator-max-microvolt = <1350000>;
207				regulator-ramp-delay = <6001>;
208				regulator-always-on;
209				regulator-boot-on;
210
211				regulator-state-mem {
212					regulator-on-in-suspend;
213					regulator-suspend-microvolt = <950000>;
214				};
215			};
216
217			vdd_arm: DCDC_REG2 {
218				regulator-name = "vdd_arm";
219				regulator-min-microvolt = <950000>;
220				regulator-max-microvolt = <1350000>;
221				regulator-ramp-delay = <6001>;
222				regulator-always-on;
223				regulator-boot-on;
224
225				regulator-state-mem {
226					regulator-off-in-suspend;
227					regulator-suspend-microvolt = <950000>;
228				};
229			};
230
231			vcc_ddr: DCDC_REG3 {
232				regulator-name = "vcc_ddr";
233				regulator-always-on;
234				regulator-boot-on;
235
236				regulator-state-mem {
237					regulator-on-in-suspend;
238				};
239			};
240
241			vcc_3v0: vcc_rmii: DCDC_REG4 {
242				regulator-name = "vcc_3v0";
243				regulator-min-microvolt = <3000000>;
244				regulator-max-microvolt = <3000000>;
245				regulator-always-on;
246				regulator-boot-on;
247
248				regulator-state-mem {
249					regulator-on-in-suspend;
250					regulator-suspend-microvolt = <3000000>;
251				};
252			};
253
254			vcc3v3_sys: DCDC_REG5 {
255				regulator-name = "vcc3v3_sys";
256				regulator-min-microvolt = <3300000>;
257				regulator-max-microvolt = <3300000>;
258				regulator-always-on;
259				regulator-boot-on;
260
261				regulator-state-mem {
262					regulator-on-in-suspend;
263					regulator-suspend-microvolt = <3300000>;
264				};
265			};
266
267			vcc_1v0: LDO_REG1 {
268				regulator-name = "vcc_1v0";
269				regulator-min-microvolt = <1000000>;
270				regulator-max-microvolt = <1000000>;
271				regulator-always-on;
272				regulator-boot-on;
273
274				regulator-state-mem {
275					regulator-on-in-suspend;
276					regulator-suspend-microvolt = <1000000>;
277				};
278			};
279
280			vcc_1v8: vccio_flash: vccio_sdio: LDO_REG2 {
281				regulator-name = "vcc_1v8";
282				regulator-min-microvolt = <1800000>;
283				regulator-max-microvolt = <1800000>;
284				regulator-always-on;
285				regulator-boot-on;
286
287				regulator-state-mem {
288					regulator-on-in-suspend;
289					regulator-suspend-microvolt = <1800000>;
290				};
291			};
292
293			vdd_1v0: LDO_REG3 {
294				regulator-name = "vdd_1v0";
295				regulator-min-microvolt = <1000000>;
296				regulator-max-microvolt = <1000000>;
297				regulator-always-on;
298				regulator-boot-on;
299
300				regulator-state-mem {
301					regulator-on-in-suspend;
302					regulator-suspend-microvolt = <1000000>;
303				};
304			};
305
306			vcc3v0_pmu: LDO_REG4 {
307				regulator-name = "vcc3v0_pmu";
308				regulator-min-microvolt = <3000000>;
309				regulator-max-microvolt = <3000000>;
310				regulator-always-on;
311				regulator-boot-on;
312
313				regulator-state-mem {
314					regulator-on-in-suspend;
315					regulator-suspend-microvolt = <3000000>;
316				};
317			};
318
319			vccio_sd: LDO_REG5 {
320				regulator-name = "vccio_sd";
321				regulator-min-microvolt = <1800000>;
322				regulator-max-microvolt = <3300000>;
323				regulator-always-on;
324				regulator-boot-on;
325
326				regulator-state-mem {
327					regulator-on-in-suspend;
328					regulator-suspend-microvolt = <3300000>;
329				};
330			};
331
332			vcc_sd: LDO_REG6 {
333				regulator-name = "vcc_sd";
334				regulator-min-microvolt = <3300000>;
335				regulator-max-microvolt = <3300000>;
336				regulator-boot-on;
337
338				regulator-state-mem {
339					regulator-on-in-suspend;
340					regulator-suspend-microvolt = <3300000>;
341				};
342			};
343
344			vcc2v8_dvp: LDO_REG7 {
345				regulator-name = "vcc2v8_dvp";
346				regulator-min-microvolt = <2800000>;
347				regulator-max-microvolt = <2800000>;
348				regulator-boot-on;
349
350				regulator-state-mem {
351					regulator-off-in-suspend;
352					regulator-suspend-microvolt = <2800000>;
353				};
354			};
355
356			vcc1v8_dvp: LDO_REG8 {
357				regulator-name = "vcc1v8_dvp";
358				regulator-min-microvolt = <1800000>;
359				regulator-max-microvolt = <1800000>;
360				regulator-boot-on;
361
362				regulator-state-mem {
363					regulator-on-in-suspend;
364					regulator-suspend-microvolt = <1800000>;
365				};
366			};
367
368			vcc1v5_dvp: LDO_REG9 {
369				regulator-name = "vcc1v5_dvp";
370				regulator-min-microvolt = <1500000>;
371				regulator-max-microvolt = <1500000>;
372				regulator-boot-on;
373
374				regulator-state-mem {
375					regulator-off-in-suspend;
376					regulator-suspend-microvolt = <1500000>;
377				};
378			};
379
380			vcc3v3_lcd: SWITCH_REG1 {
381				regulator-name = "vcc3v3_lcd";
382				regulator-boot-on;
383			};
384
385			vcc5v0_host: SWITCH_REG2 {
386				regulator-name = "vcc5v0_host";
387				regulator-always-on;
388				regulator-boot-on;
389			};
390		};
391	};
392};
393
394&i2c1 {
395	status = "okay";
396
397	sensor@d {
398		compatible = "asahi-kasei,ak8963";
399		reg = <0x0d>;
400		gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
401		vdd-supply = <&vcc3v0_pmu>;
402		mount-matrix = "1", /* x0 */
403			       "0", /* y0 */
404			       "0", /* z0 */
405			       "0", /* x1 */
406			       "1", /* y1 */
407			       "0", /* z1 */
408			       "0", /* x2 */
409			       "0", /* y2 */
410			       "1"; /* z2 */
411	};
412
413	touchscreen@14 {
414		compatible = "goodix,gt1151";
415		reg = <0x14>;
416		interrupt-parent = <&gpio0>;
417		interrupts = <RK_PA5 IRQ_TYPE_LEVEL_LOW>;
418		irq-gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
419		reset-gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
420		VDDIO-supply = <&vcc3v3_lcd>;
421	};
422
423	sensor@4c {
424		compatible = "fsl,mma7660";
425		reg = <0x4c>;
426		interrupt-parent = <&gpio0>;
427		interrupts = <RK_PB7 IRQ_TYPE_LEVEL_LOW>;
428	};
429};
430
431&i2s1_2ch {
432	status = "okay";
433};
434
435&io_domains {
436	status = "okay";
437
438	vccio1-supply = <&vccio_sdio>;
439	vccio2-supply = <&vccio_sd>;
440	vccio3-supply = <&vcc_3v0>;
441	vccio4-supply = <&vcc3v0_pmu>;
442	vccio5-supply = <&vcc_3v0>;
443	vccio6-supply = <&vccio_flash>;
444};
445
446&pinctrl {
447	headphone {
448		hp_det: hp-det {
449			rockchip,pins =
450				<2 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
451		};
452	};
453
454	emmc {
455		emmc_reset: emmc-reset {
456			rockchip,pins = <1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
457		};
458	};
459
460	pmic {
461		pmic_int: pmic_int {
462			rockchip,pins =
463				<0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
464		};
465
466		soc_slppin_gpio: soc_slppin_gpio {
467			rockchip,pins =
468				<0 RK_PA4 RK_FUNC_GPIO &pcfg_output_low>;
469		};
470
471		soc_slppin_slp: soc_slppin_slp {
472			rockchip,pins =
473				<0 RK_PA4 1 &pcfg_pull_none>;
474		};
475
476		soc_slppin_rst: soc_slppin_rst {
477			rockchip,pins =
478				<0 RK_PA4 2 &pcfg_pull_none>;
479		};
480	};
481
482	sdio-pwrseq {
483		wifi_enable_h: wifi-enable-h {
484			rockchip,pins =
485				<0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
486		};
487	};
488};
489
490&pmu_io_domains {
491	status = "okay";
492
493	pmuio1-supply = <&vcc3v0_pmu>;
494	pmuio2-supply = <&vcc3v0_pmu>;
495};
496
497&pwm1 {
498	status = "okay";
499};
500
501&saradc {
502	vref-supply = <&vcc_1v8>;
503	status = "okay";
504};
505
506&sdmmc {
507	cap-mmc-highspeed;
508	cap-sd-highspeed;
509	card-detect-delay = <800>;
510	sd-uhs-sdr12;
511	sd-uhs-sdr25;
512	sd-uhs-sdr50;
513	sd-uhs-sdr104;
514	vmmc-supply = <&vcc_sd>;
515	vqmmc-supply = <&vccio_sd>;
516	status = "okay";
517};
518
519&sdio {
520	cap-sd-highspeed;
521	keep-power-in-suspend;
522	non-removable;
523	mmc-pwrseq = <&sdio_pwrseq>;
524	sd-uhs-sdr104;
525	status = "okay";
526};
527
528&tsadc {
529	rockchip,hw-tshut-mode = <1>;
530	rockchip,hw-tshut-polarity = <1>;
531	status = "okay";
532};
533
534&u2phy {
535	status = "okay";
536
537	u2phy_host: host-port {
538		status = "okay";
539	};
540
541	u2phy_otg: otg-port {
542		status = "okay";
543	};
544};
545
546&uart1 {
547	pinctrl-names = "default";
548	pinctrl-0 = <&uart1_xfer &uart1_cts>;
549	status = "okay";
550};
551
552&uart5 {
553	status = "okay";
554};
555
556&usb20_otg {
557	status = "okay";
558};
559
560&usb_host0_ehci {
561	status = "okay";
562};
563
564&usb_host0_ohci {
565	status = "okay";
566};
567
568&vopb {
569	status = "okay";
570};
571
572&vopb_mmu {
573	status = "okay";
574};
575
576&vopl {
577	status = "okay";
578};
579
580&vopl_mmu {
581	status = "okay";
582};
583