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