xref: /linux/arch/arm64/boot/dts/rockchip/px30-cobra.dtsi (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2025 Cherry Embedded Solutions GmbH
4 */
5
6/dts-v1/;
7#include <dt-bindings/gpio/gpio.h>
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/leds/common.h>
10#include <dt-bindings/pinctrl/rockchip.h>
11#include "px30.dtsi"
12
13/ {
14	aliases {
15		ethernet0 = &gmac;
16		mmc0 = &emmc;
17	};
18
19	chosen {
20		stdout-path = "serial5:115200n8";
21	};
22
23	backlight: backlight {
24		compatible = "pwm-backlight";
25		power-supply = <&vcc5v0_sys>;
26		pwms = <&pwm0 0 25000 0>;
27	};
28
29	beeper {
30		compatible = "pwm-beeper";
31		pwms = <&pwm1 0 1000 0>;
32	};
33
34	emmc_pwrseq: emmc-pwrseq {
35		compatible = "mmc-pwrseq-emmc";
36		pinctrl-0 = <&emmc_reset>;
37		pinctrl-names = "default";
38		reset-gpios = <&gpio1 RK_PB3 GPIO_ACTIVE_HIGH>;
39	};
40
41	gpio-leds {
42		compatible = "gpio-leds";
43		pinctrl-names = "default";
44		pinctrl-0 = <&heartbeat_led_pin>;
45
46		/*
47		 * LED14 on the PCB. Typically NOT populated.
48		 */
49		led-0 {
50			color = <LED_COLOR_ID_BLUE>;
51			gpios = <&gpio0 RK_PA0 GPIO_ACTIVE_HIGH>;
52			label = "heartbeat";
53			linux,default-trigger = "heartbeat";
54		};
55	};
56
57	pwm-leds {
58		compatible = "pwm-leds";
59
60		ring_red: led-0 {
61			color = <LED_COLOR_ID_RED>;
62			default-state = "off";
63			label = "ring_red";
64			pwms = <&pwm5 0 1000000 0>;
65			max-brightness = <255>;
66		};
67
68		ring_green: led-1 {
69			color = <LED_COLOR_ID_GREEN>;
70			default-state = "off";
71			label = "ring_green";
72			pwms = <&pwm6 0 1000000 0>;
73			max-brightness = <255>;
74		};
75
76		ring_blue: led-2 {
77			color = <LED_COLOR_ID_BLUE>;
78			default-state = "off";
79			label = "ring_blue";
80			pwms = <&pwm7 0 1000000 0>;
81			max-brightness = <255>;
82		};
83	};
84
85	/* also named 5V_Q7 in schematics */
86	vcc5v0_sys: regulator-vccsys {
87		compatible = "regulator-fixed";
88		regulator-name = "vcc5v0_sys";
89		regulator-always-on;
90		regulator-boot-on;
91		regulator-min-microvolt = <5000000>;
92		regulator-max-microvolt = <5000000>;
93	};
94};
95
96&cpu0 {
97	cpu-supply = <&vdd_arm>;
98};
99
100&cpu1 {
101	cpu-supply = <&vdd_arm>;
102};
103
104&cpu2 {
105	cpu-supply = <&vdd_arm>;
106};
107
108&cpu3 {
109	cpu-supply = <&vdd_arm>;
110};
111
112&display_subsystem {
113	status = "okay";
114};
115
116&dsi_dphy {
117	status = "okay";
118};
119
120&emmc {
121	bus-width = <8>;
122	cap-mmc-highspeed;
123	/*
124	 * For hs200 support, U-Boot would have to set the RK809 DCDC4
125	 * rail to 1.8V from the default of 3.0V. It doesn't do that on
126	 * devices out in the field, so disable hs200.
127	 * mmc-hs200-1_8v;
128	 */
129	mmc-pwrseq = <&emmc_pwrseq>;
130	non-removable;
131	vmmc-supply = <&vcc_3v3>;
132	vqmmc-supply = <&vcc_emmc>;
133	status = "okay";
134};
135
136&gmac {
137	clock_in_out = "output";
138	phy-handle = <&dp83825>;
139	phy-supply = <&vcc_3v3>;
140	status = "okay";
141};
142
143&gpu {
144	mali-supply = <&vdd_log>;
145	status = "okay";
146};
147
148/* I2C0 = PMIC, STUSB4500, RTC */
149&i2c0 {
150	status = "okay";
151
152	rk809: pmic@20 {
153		compatible = "rockchip,rk809";
154		reg = <0x20>;
155		#clock-cells = <0>;
156		clock-output-names = "xin32k";
157		interrupt-parent = <&gpio0>;
158		interrupts = <RK_PA7 IRQ_TYPE_LEVEL_LOW>;
159		pinctrl-names = "default";
160		pinctrl-0 = <&pmic_int>;
161		system-power-controller;
162		wakeup-source;
163
164		vcc1-supply = <&vcc5v0_sys>;
165		vcc2-supply = <&vcc5v0_sys>;
166		vcc3-supply = <&vcc5v0_sys>;
167		vcc4-supply = <&vcc5v0_sys>;
168		vcc5-supply = <&vcc_3v3>;
169		vcc6-supply = <&vcc_3v3>;
170		vcc7-supply = <&vcc_3v3>;
171		vcc9-supply = <&vcc5v0_sys>;
172
173		regulators {
174			vdd_log: DCDC_REG1 {
175				regulator-name = "vdd_log";
176				regulator-always-on;
177				regulator-boot-on;
178				regulator-min-microvolt = <950000>;
179				regulator-max-microvolt = <1350000>;
180				regulator-ramp-delay = <6001>;
181
182				regulator-state-mem {
183					regulator-on-in-suspend;
184					regulator-suspend-microvolt = <950000>;
185				};
186			};
187
188			vdd_arm: DCDC_REG2 {
189				regulator-name = "vdd_arm";
190				regulator-always-on;
191				regulator-boot-on;
192				regulator-min-microvolt = <950000>;
193				regulator-max-microvolt = <1350000>;
194				regulator-ramp-delay = <6001>;
195
196				regulator-state-mem {
197					regulator-off-in-suspend;
198					regulator-suspend-microvolt = <950000>;
199				};
200			};
201
202			vcc_ddr: DCDC_REG3 {
203				regulator-name = "vcc_ddr";
204				regulator-always-on;
205				regulator-boot-on;
206
207				regulator-state-mem {
208					regulator-on-in-suspend;
209				};
210			};
211
212			vcc_3v0_1v8: vcc_emmc: DCDC_REG4 {
213				regulator-name = "vcc_3v0_1v8";
214				regulator-always-on;
215				regulator-boot-on;
216				regulator-min-microvolt = <3000000>;
217				regulator-max-microvolt = <3000000>;
218
219				regulator-state-mem {
220					regulator-on-in-suspend;
221					regulator-suspend-microvolt = <3000000>;
222				};
223			};
224
225			vcc_3v3: DCDC_REG5 {
226				regulator-name = "vcc_3v3";
227				regulator-always-on;
228				regulator-boot-on;
229				regulator-min-microvolt = <3300000>;
230				regulator-max-microvolt = <3300000>;
231
232				regulator-state-mem {
233					regulator-on-in-suspend;
234					regulator-suspend-microvolt = <3300000>;
235				};
236			};
237
238			vcc_1v8: LDO_REG2 {
239				regulator-name = "vcc_1v8";
240				regulator-always-on;
241				regulator-boot-on;
242				regulator-min-microvolt = <1800000>;
243				regulator-max-microvolt = <1800000>;
244
245				regulator-state-mem {
246					regulator-on-in-suspend;
247					regulator-suspend-microvolt = <1800000>;
248				};
249			};
250
251			vcc_1v0: LDO_REG3 {
252				regulator-name = "vcc_1v0";
253				regulator-always-on;
254				regulator-boot-on;
255				regulator-min-microvolt = <1000000>;
256				regulator-max-microvolt = <1000000>;
257
258				regulator-state-mem {
259					regulator-on-in-suspend;
260					regulator-suspend-microvolt = <1000000>;
261				};
262			};
263
264			vcc_2v8: LDO_REG4 {
265				regulator-name = "vcc_2v8";
266				regulator-always-on;
267				regulator-boot-on;
268				regulator-min-microvolt = <2800000>;
269				regulator-max-microvolt = <2800000>;
270
271				regulator-state-mem {
272					regulator-off-in-suspend;
273					regulator-suspend-microvolt = <2800000>;
274				};
275			};
276
277			/*
278			 * vccio_sd also supplies the vmmc supply on prototypes
279			 * with sd-slots, so needs to stay single voltage for
280			 * those. Production models don't have sd-slots anymore
281			 * and only supply vccio2 from this regulator.
282			 */
283			vccio_sd: LDO_REG5 {
284				regulator-name = "vccio_sd";
285				regulator-always-on;
286				regulator-boot-on;
287				regulator-min-microvolt = <3000000>;
288				regulator-max-microvolt = <3000000>;
289
290				regulator-state-mem {
291					regulator-on-in-suspend;
292					regulator-suspend-microvolt = <3000000>;
293				};
294			};
295
296			/* vcc_sdio also supplies the pull-up resistors for i2c1 */
297			vcc_sdio: LDO_REG6 {
298				regulator-name = "vcc_sdio";
299				regulator-always-on;
300				regulator-boot-on;
301				regulator-min-microvolt = <3000000>;
302				regulator-max-microvolt = <3000000>;
303
304				regulator-state-mem {
305					regulator-on-in-suspend;
306					regulator-suspend-microvolt = <3300000>;
307				};
308			};
309
310			vcc_lcd: LDO_REG7 {
311				regulator-name = "vcc_lcd";
312				regulator-always-on;
313				regulator-boot-on;
314				regulator-min-microvolt = <1000000>;
315				regulator-max-microvolt = <1000000>;
316
317				regulator-state-mem {
318					regulator-off-in-suspend;
319					regulator-suspend-microvolt = <1000000>;
320				};
321			};
322
323			vcc_1v8_lcd: LDO_REG8 {
324				regulator-name = "vcc_1v8_lcd";
325				regulator-always-on;
326				regulator-boot-on;
327				regulator-min-microvolt = <1800000>;
328				regulator-max-microvolt = <1800000>;
329
330				regulator-state-mem {
331					regulator-on-in-suspend;
332					regulator-suspend-microvolt = <1800000>;
333				};
334			};
335
336			vcca_1v8: LDO_REG9 {
337				regulator-name = "vcca_1v8";
338				regulator-always-on;
339				regulator-boot-on;
340				regulator-min-microvolt = <1800000>;
341				regulator-max-microvolt = <1800000>;
342
343				regulator-state-mem {
344					regulator-off-in-suspend;
345					regulator-suspend-microvolt = <1800000>;
346				};
347			};
348		};
349	};
350};
351
352&i2c1 {
353	clock-frequency = <100000>;
354	status = "okay";
355};
356
357&i2c2 {
358	clock-frequency = <100000>;
359	i2c-scl-falling-time-ns = <50>;
360	i2c-scl-rising-time-ns = <300>;
361	status = "okay";
362
363	touchscreen@14 {
364		compatible = "goodix,gt911";
365		reg = <0x14>;
366		AVDD28-supply = <&vcc_2v8>;
367		interrupt-parent = <&gpio0>;
368		interrupts = <RK_PA1 IRQ_TYPE_LEVEL_LOW>;
369		irq-gpios = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>;
370		pinctrl-names = "default";
371		pinctrl-0 = <&tch_int &tch_rst>;
372		reset-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
373		touchscreen-inverted-x;
374		VDDIO-supply = <&vcc_3v3>;
375	};
376};
377
378/*
379 * Enable pull-ups to prevent floating pins when the touch
380 * panel is not connected.
381 */
382&i2c2_xfer {
383	rockchip,pins =
384		<2 RK_PB7 2 &pcfg_pull_up>,
385		<2 RK_PC0 2 &pcfg_pull_up>;
386};
387
388&io_domains {
389	vccio1-supply = <&vcc_sdio>;
390	vccio2-supply = <&vccio_sd>;
391	vccio3-supply = <&vcc_3v3>;
392	vccio4-supply = <&vcc_3v3>;
393	vccio5-supply = <&vcc_1v8>;
394	vccio6-supply = <&vcc_emmc>;
395	status = "okay";
396};
397
398&mdio {
399	dp83825: ethernet-phy@0 {
400		compatible = "ethernet-phy-ieee802.3-c22";
401		reg = <0x0>;
402		pinctrl-names = "default";
403		pinctrl-0 = <&phy_rst>;
404		reset-assert-us = <50000>;
405		reset-deassert-us = <50000>;
406		reset-gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_LOW>;
407	};
408};
409
410&pinctrl {
411	pinctrl-names = "default";
412	pinctrl-0 = <&cobra_pin_hog>;
413
414	hog {
415		cobra_pin_hog: cobra-pin-hog {
416			rockchip,pins =
417				/* USB_HUB2_RESET */
418				<0 RK_PA5 RK_FUNC_GPIO &pcfg_output_high>,
419				/* USB_HUB1_RESET */
420				<0 RK_PB4 RK_FUNC_GPIO &pcfg_output_high>,
421				/* The default pull-down can keep the IC in reset. */
422				<3 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>,
423				/* USB-A 5V enable */
424				<3 RK_PC0 RK_FUNC_GPIO &pcfg_output_high>,
425				/* USB-A data enable */
426				<3 RK_PD3 RK_FUNC_GPIO &pcfg_output_high>;
427		};
428	};
429
430	emmc {
431		emmc_reset: emmc-reset {
432			rockchip,pins =
433				<1 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
434		};
435	};
436
437	ethernet {
438		phy_rst: phy-rst {
439			rockchip,pins =
440				<2 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
441		};
442	};
443
444	leds {
445		heartbeat_led_pin: heartbeat-led-pin {
446			rockchip,pins =
447				<0 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
448		};
449	};
450
451	panel {
452		dsp_rst: dsp-rst {
453			rockchip,pins =
454				<0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_down>;
455		};
456
457		tch_int: tch-int {
458			rockchip,pins =
459				<0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>;
460		};
461
462		tch_rst: tch-rst {
463			rockchip,pins =
464				<0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
465		};
466	};
467
468	pmic {
469		pmic_int: pmic-int {
470			rockchip,pins =
471				<0 RK_PA7 RK_FUNC_GPIO &pcfg_pull_up>;
472		};
473	};
474};
475
476&pmu_io_domains {
477	pmuio1-supply = <&vcc_3v3>;
478	pmuio2-supply = <&vcc_3v3>;
479	status = "okay";
480};
481
482&pwm0 {
483	status = "okay";
484};
485
486&pwm1 {
487	status = "okay";
488};
489
490&pwm5 {
491	status = "okay";
492};
493
494&pwm6 {
495	status = "okay";
496};
497
498&pwm7 {
499	status = "okay";
500};
501
502&saradc {
503	vref-supply = <&vcc_1v8>;
504	status = "okay";
505};
506
507&tsadc {
508	status = "okay";
509};
510
511&u2phy {
512	status = "okay";
513};
514
515&u2phy_host {
516	status = "okay";
517};
518
519&u2phy_otg {
520	status = "okay";
521};
522
523&uart1 {
524	/delete-property/ dmas;
525	/delete-property/ dma-names;
526	pinctrl-names = "default";
527	pinctrl-0 = <&uart1_xfer>;
528	status = "okay";
529};
530
531&uart5 {
532	pinctrl-0 = <&uart5_xfer>;
533	status = "okay";
534};
535
536&usb20_otg {
537	status = "okay";
538};
539
540&usb_host0_ehci {
541	status = "okay";
542};
543
544&usb_host0_ohci {
545	status = "okay";
546};
547
548&vopb {
549	status = "okay";
550};
551
552&vopb_mmu {
553	status = "okay";
554};
555
556&vopl {
557	status = "disabled";
558};
559
560&vopl_mmu {
561	status = "disabled";
562};
563
564&wdt {
565	status = "okay";
566};
567