xref: /openbmc/u-boot/arch/arm/dts/rk3399-puma.dtsi (revision e3963c09)
1// SPDX-License-Identifier: GPL-2.0+ OR X11
2/*
3 * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
4 */
5
6#include <dt-bindings/pwm/pwm.h>
7#include "rk3399.dtsi"
8
9/ {
10	model = "Theobroma Systems RK3399-Q7 SoM";
11	compatible = "tsd,rk3399-q7", "tsd,puma", "rockchip,rk3399";
12
13	config {
14		u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */
15		u-boot,mmc-env-offset = <0x4000>;      /* @  16KB */
16		u-boot,efi-partition-entries-offset = <0x200000>; /* 2MB */
17		u-boot,boot-led = "module_led";
18		sysreset-gpio = <&gpio1 RK_PA6 GPIO_ACTIVE_HIGH>;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23		u-boot,spl-boot-order = \
24			"same-as-spl", &spiflash, &sdhci, &sdmmc;
25	};
26
27	aliases {
28		spi0 = &spi1;
29		spi1 = &spi5;
30	};
31
32	leds {
33		compatible = "gpio-leds";
34		pinctrl-names = "default";
35		pinctrl-0 = <&leds_pins_puma>;
36
37		module_led {
38			label = "module_led";
39			gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>;
40			linux,default-trigger = "heartbeat";
41		};
42
43		sd_card_led {
44			label = "sd_card_led";
45			gpios = <&gpio1 RK_PA2 GPIO_ACTIVE_HIGH>;
46			linux,default-trigger = "mmc0";
47		};
48	};
49
50	clkin_gmac: external-gmac-clock {
51		compatible = "fixed-clock";
52		clock-frequency = <125000000>;
53		clock-output-names = "clkin_gmac";
54		#clock-cells = <0>;
55	};
56
57	dw_hdmi_audio: dw-hdmi-audio {
58		status = "enabled";
59		compatible = "rockchip,dw-hdmi-audio";
60		#sound-dai-cells = <0>;
61	};
62
63	hdmi_codec: hdmi-codec {
64		compatible = "simple-audio-card";
65		simple-audio-card,format = "i2s";
66		simple-audio-card,mclk-fs = <256>;
67		simple-audio-card,name = "HDMI-CODEC";
68
69		simple-audio-card,cpu {
70			sound-dai = <&i2s2>;
71		};
72
73		simple-audio-card,codec {
74			sound-dai = <&hdmi>;
75		};
76	};
77
78	hdmi_sound: hdmi-sound {
79		status = "disabled";
80		compatible = "simple-audio-card";
81		simple-audio-card,format = "i2s";
82		simple-audio-card,mclk-fs = <256>;
83		simple-audio-card,name = "rockchip,hdmi";
84
85		simple-audio-card,cpu {
86			sound-dai = <&i2s2>;
87		};
88		simple-audio-card,codec {
89			sound-dai = <&hdmi>;
90		};
91	};
92
93	usbhub_enable: usbhub_enable {
94		compatible = "regulator-fixed";
95		regulator-name = "usbhub_enable";
96		enable-active-low;
97		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
98		regulator-boot-on;
99		regulator-min-microvolt = <3300000>;
100		regulator-max-microvolt = <3300000>;
101	};
102
103	/*
104	 * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
105	 * eMMC and SPI flash powered-down initially (in fact it keeps the
106	 * reset signal asserted).  Even though it is an enable signal, we
107	 * model this as a regulator.
108	 */
109	bios_enable: bios_enable {
110		compatible = "regulator-fixed";
111		u-boot,dm-pre-reloc;
112		regulator-name = "bios_enable";
113		enable-active-high;
114		gpio = <&gpio3 RK_PD5 GPIO_ACTIVE_LOW>;
115		regulator-always-on;
116		regulator-boot-on;
117		regulator-min-microvolt = <1800000>;
118		regulator-max-microvolt = <1800000>;
119	};
120
121	vccadc_ref: vccadc-ref {
122		compatible = "regulator-fixed";
123		regulator-name = "vcc1v8_sys";
124		regulator-always-on;
125		regulator-boot-on;
126		regulator-min-microvolt = <1800000>;
127		regulator-max-microvolt = <1800000>;
128	};
129
130	vcc3v3_sys: vcc3v3-sys {
131		compatible = "regulator-fixed";
132		regulator-name = "vcc3v3_sys";
133		regulator-always-on;
134		regulator-boot-on;
135		regulator-min-microvolt = <3300000>;
136		regulator-max-microvolt = <3300000>;
137	};
138
139	vcc5v0_otg: vcc5v0-otg-regulator {
140		compatible = "regulator-fixed";
141		enable-active-high;
142		gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
143		pinctrl-names = "default";
144		pinctrl-0 = <&otg_vbus_drv>;
145		regulator-name = "vcc5v0_otg";
146		regulator-always-on;
147	};
148
149	vcc5v0_host: vcc5v0-host-regulator {
150		compatible = "regulator-fixed";
151		enable-active-low;
152		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
153		pinctrl-names = "default";
154		pinctrl-0 = <&host_vbus_drv>;
155		regulator-name = "vcc5v0_host";
156		regulator-always-on;
157	};
158
159	vcc5v0_sys: vcc5v0-sys {
160		compatible = "regulator-fixed";
161		regulator-name = "vcc5v0_sys";
162		regulator-always-on;
163		regulator-boot-on;
164		regulator-min-microvolt = <5000000>;
165		regulator-max-microvolt = <5000000>;
166	};
167
168	vcc_phy: vcc-phy-regulator {
169		compatible = "regulator-fixed";
170		regulator-name = "vcc_phy";
171		regulator-always-on;
172		regulator-boot-on;
173	};
174
175	vdd_log: vdd-log {
176		compatible = "pwm-regulator";
177		pwms = <&pwm2 0 25000 1>;
178		regulator-name = "vdd_log";
179		regulator-min-microvolt = <800000>;
180		regulator-max-microvolt = <1400000>;
181		regulator-always-on;
182		regulator-boot-on;
183
184		/* for rockchip boot on */
185		rockchip,pwm_id= <2>;
186		rockchip,pwm_voltage = <1000000>;
187	};
188};
189
190&emmc_phy {
191	status = "okay";
192};
193
194&gmac {
195	phy-supply = <&vcc_phy>;
196	phy-mode = "rgmii";
197	clock_in_out = "input";
198	snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
199	snps,reset-active-low;
200	snps,reset-delays-us = <2 10000 50000>;
201	assigned-clocks = <&cru SCLK_RMII_SRC>;
202	assigned-clock-parents = <&clkin_gmac>;
203	pinctrl-names = "default";
204	pinctrl-0 = <&rgmii_pins>;
205	tx_delay = <0x10>;
206	rx_delay = <0x10>;
207	status = "okay";
208};
209
210&hdmi {
211	#sound-dai-cells = <0>;
212	status = "okay";
213};
214
215&i2c0 {
216	status = "okay";
217	i2c-scl-rising-time-ns = <168>;
218	i2c-scl-falling-time-ns = <4>;
219	clock-frequency = <400000>;
220
221	vdd_gpu: vdd_gpu {
222		status = "okay";
223		compatible = "fcs,fan53555";
224		reg = <0x60>;
225		vsel-gpios = <&gpio1 RK_PB6 GPIO_ACTIVE_HIGH>;
226		vin-supply = <&vcc5v0_sys>;
227		regulator-compatible = "fan53555-reg";
228		regulator-name = "vdd_gpu";
229		regulator-min-microvolt = <600000>;
230		regulator-max-microvolt = <1230000>;
231		regulator-ramp-delay = <1000>;
232		fcs,suspend-voltage-selector = <1>;
233		regulator-always-on;
234		regulator-boot-on;
235		regulator-initial-state = <3>;
236			regulator-state-mem {
237			regulator-off-in-suspend;
238		};
239	};
240
241	rk808: pmic@1b {
242		compatible = "rockchip,rk808";
243		reg = <0x1b>;
244		interrupt-parent = <&gpio1>;
245		interrupts = <22 IRQ_TYPE_LEVEL_LOW>;  // TODO check interrupt?
246		pinctrl-names = "default";
247		pinctrl-0 = <&pmic_int_l>;
248		rockchip,system-power-controller;
249		wakeup-source;
250		#clock-cells = <1>;
251		clock-output-names = "xin32k", "rk808-clkout2";
252
253		vcc1-supply = <&vcc5v0_sys>;
254		vcc2-supply = <&vcc5v0_sys>;
255		vcc3-supply = <&vcc5v0_sys>;
256		vcc4-supply = <&vcc5v0_sys>;
257		vcc6-supply = <&vcc5v0_sys>;
258		vcc7-supply = <&vcc5v0_sys>;
259		vcc8-supply = <&vcc3v3_sys>;
260		vcc9-supply = <&vcc5v0_sys>;
261		vcc10-supply = <&vcc5v0_sys>;
262		vcc11-supply = <&vcc5v0_sys>;
263		vcc12-supply = <&vcc3v3_sys>;
264		vddio-supply = <&vcc1v8_pmu>;
265
266		regulators {
267			vdd_center: DCDC_REG1 {
268				regulator-always-on;
269				regulator-boot-on;
270				regulator-min-microvolt = <750000>;
271				regulator-max-microvolt = <1350000>;
272				regulator-ramp-delay = <6001>;
273				regulator-name = "vdd_center";
274				regulator-state-mem {
275					regulator-off-in-suspend;
276				};
277			};
278
279			vdd_cpu_l: DCDC_REG2 {
280				regulator-always-on;
281				regulator-boot-on;
282				regulator-min-microvolt = <750000>;
283				regulator-max-microvolt = <1350000>;
284				regulator-ramp-delay = <6001>;
285				regulator-name = "vdd_cpu_l";
286				regulator-state-mem {
287					regulator-off-in-suspend;
288				};
289			};
290
291			vcc_ddr: DCDC_REG3 {
292				regulator-always-on;
293				regulator-boot-on;
294				regulator-name = "vcc_ddr";
295				regulator-state-mem {
296					regulator-on-in-suspend;
297				};
298			};
299
300			vcc_1v8: DCDC_REG4 {
301				regulator-always-on;
302				regulator-boot-on;
303				regulator-min-microvolt = <1800000>;
304				regulator-max-microvolt = <1800000>;
305				regulator-name = "vcc_1v8";
306				regulator-state-mem {
307					regulator-on-in-suspend;
308					regulator-suspend-microvolt = <1800000>;
309				};
310			};
311
312			vcc_ldo1: LDO_REG1 {
313				regulator-boot-on;
314				regulator-min-microvolt = <1800000>;
315				regulator-max-microvolt = <1800000>;
316				regulator-name = "vcc_ldo1";
317				regulator-state-mem {
318					regulator-off-in-suspend;
319				};
320			};
321
322			vcc1v8_hdmi: LDO_REG2 {
323				regulator-always-on;
324				regulator-boot-on;
325				regulator-min-microvolt = <1800000>;
326				regulator-max-microvolt = <1800000>;
327				regulator-name = "vcc1v8_hdmi";
328				regulator-state-mem {
329					regulator-off-in-suspend;
330				};
331			};
332
333			vcc1v8_pmu: LDO_REG3 {
334				regulator-always-on;
335				regulator-boot-on;
336				regulator-min-microvolt = <1800000>;
337				regulator-max-microvolt = <1800000>;
338				regulator-name = "vcc1v8_pmu";
339				regulator-state-mem {
340					regulator-on-in-suspend;
341					regulator-suspend-microvolt = <1800000>;
342				};
343			};
344
345			vcc_sd: LDO_REG4 {
346				regulator-always-on;
347				regulator-boot-on;
348				regulator-min-microvolt = <1800000>;
349				regulator-max-microvolt = <3000000>;
350				regulator-name = "vcc_sd";
351				regulator-state-mem {
352					regulator-on-in-suspend;
353					regulator-suspend-microvolt = <3000000>;
354				};
355			};
356
357			vcc_ldo5: LDO_REG5 {
358				regulator-boot-on;
359				regulator-min-microvolt = <3000000>;
360				regulator-max-microvolt = <3000000>;
361				regulator-name = "vcc_ldo5";
362				regulator-state-mem {
363					regulator-off-in-suspend;
364				};
365			};
366
367			vcc_ldo6: LDO_REG6 {
368				regulator-boot-on;
369				regulator-min-microvolt = <1500000>;
370				regulator-max-microvolt = <1500000>;
371				regulator-name = "vcc_ldo6";
372				regulator-state-mem {
373					regulator-off-in-suspend;
374				};
375			};
376
377			vcc0v9_hdmi: LDO_REG7 {
378				regulator-always-on;
379				regulator-boot-on;
380				regulator-min-microvolt = <900000>;
381				regulator-max-microvolt = <900000>;
382				regulator-name = "vcc0v9_hdmi";
383				regulator-state-mem {
384					regulator-off-in-suspend;
385				};
386			};
387
388			vcc_efuse: LDO_REG8 {
389				regulator-always-on;
390				regulator-boot-on;
391				regulator-min-microvolt = <1800000>;
392				regulator-max-microvolt = <1800000>;
393				regulator-name = "vcc_efuse";
394				regulator-state-mem {
395					regulator-off-in-suspend;
396				};
397			};
398
399			vcc3v3_s3: SWITCH_REG1 {
400				regulator-always-on;
401				regulator-boot-on;
402				regulator-name = "vcc3v3_s3";
403				regulator-state-mem {
404					regulator-off-in-suspend;
405				};
406			};
407
408			vcc3v3_s0: SWITCH_REG2 {
409				regulator-always-on;
410				regulator-boot-on;
411				regulator-name = "vcc3v3_s0";
412				regulator-state-mem {
413					regulator-off-in-suspend;
414				};
415			};
416		};
417	};
418};
419
420&i2c8 {
421	status = "okay";
422	clock-frequency = <400000>;
423
424	vdd_cpu_b: vdd_cpu_b {
425		status = "okay";
426		compatible = "fcs,fan53555";
427		reg = <0x60>;
428		vsel-gpios = <&gpio1 RK_PA4 GPIO_ACTIVE_HIGH>;
429		vin-supply = <&vcc5v0_sys>;
430		regulator-compatible = "fan53555-reg";
431		regulator-name = "vdd_cpu_b";
432		regulator-min-microvolt = <600000>;
433		regulator-max-microvolt = <1230000>;
434		regulator-ramp-delay = <1000>;
435		fcs,suspend-voltage-selector = <1>;
436		regulator-always-on;
437		regulator-boot-on;
438		regulator-initial-state = <3>;
439			regulator-state-mem {
440			regulator-off-in-suspend;
441		};
442	};
443};
444
445&i2s0 {
446	status = "okay";
447	rockchip,i2s-broken-burst-len;
448	rockchip,playback-channels = <8>;
449	rockchip,capture-channels = <8>;
450	#sound-dai-cells = <0>;
451};
452
453&i2s2 {
454	#sound-dai-cells = <0>;
455	status = "okay";
456};
457
458&io_domains {
459	status = "okay";
460
461	bt656-supply = <&vcc_1v8>;	/* bt656_gpio2ab_ms */
462	audio-supply = <&vcc_1v8>;	/* audio_gpio3d4a_ms */
463	sdmmc-supply = <&vcc_sd>;	/* sdmmc_gpio4b_ms */
464	gpio1830-supply = <&vcc_1v8>;	/* gpio1833_gpio4cd_ms */
465};
466
467&pcie0 {
468	assigned-clocks = <&cru SCLK_PCIEPHY_REF>;
469	assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>;
470	assigned-clock-rates = <100000000>;
471	ep-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
472	num-lanes = <4>;
473	pinctrl-names = "default";
474	pinctrl-0 = <&pcie_clkreqn>;
475	status = "okay";
476};
477
478&pcie_phy {
479		status = "okay";
480};
481
482&pmu_io_domains {
483	status = "okay";
484	pmu1830-supply = <&vcc_1v8>;
485};
486
487&pwm0 {
488	status = "okay";
489};
490
491&pwm2 {
492	status = "okay";
493};
494
495&sdhci {
496	bus-width = <8>;
497	mmc-hs400-1_8v;
498	supports-emmc;
499	non-removable;
500	keep-power-in-suspend;
501	mmc-hs400-enhanced-strobe;
502	status = "okay";
503};
504
505&sdmmc {
506	u-boot,dm-pre-reloc;
507	clock-frequency = <150000000>;
508	max-frequency = <40000000>;
509	supports-sd;
510	bus-width = <4>;
511	cap-mmc-highspeed;
512	cap-sd-highspeed;
513	disable-wp;
514	num-slots = <1>;
515	vqmmc-supply = <&vcc_sd>;
516	pinctrl-names = "default";
517	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
518	status = "okay";
519};
520
521&uart2 {
522	status = "okay";
523};
524
525&usb_host0_ehci {
526	status = "disabled";
527};
528
529&usb_host0_ohci {
530	status = "disabled";
531};
532
533&dwc3_typec0 {
534	status = "okay";
535};
536
537&usb_host1_ehci {
538	status = "disabled";
539};
540
541&usb_host1_ohci {
542	status = "disabled";
543};
544
545&dwc3_typec1 {
546	status = "okay";
547	tsd,usb-port-power = "usbhub_enable";
548};
549
550&vopb {
551	status = "okay";
552};
553
554&gpio1 {
555	u-boot,dm-pre-reloc;
556};
557
558&gpio3 {
559	u-boot,dm-pre-reloc;
560};
561
562&pinctrl {
563	/* Pins that are not explicitely used by any devices */
564	pinctrl-names = "default";
565	pinctrl-0 = <&puma_pin_hog>;
566
567	hog {
568		puma_pin_hog: puma_pin_hog {
569			rockchip,pins =
570				/* We need pull-ups on Q7 buttons */
571				<RK_GPIO0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_up>, /* LID_BTN# */
572				<RK_GPIO0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_up>, /* BATLOW# */
573				<RK_GPIO0 RK_PB3 RK_FUNC_GPIO &pcfg_pull_up>, /* SLP_BTN# */
574				<RK_GPIO0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_up>; /* BIOS_DISABLE# */
575		};
576	};
577
578	pmic {
579		pmic_int_l: pmic-int-l {
580			rockchip,pins =
581				<RK_GPIO1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
582		};
583	};
584
585	leds_pins_puma: led_pins@0 {
586			rockchip,pins =
587				<RK_GPIO2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>,
588				<RK_GPIO1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
589	};
590
591	usb2 {
592		otg_vbus_drv: otg-vbus-drv {
593			rockchip,pins =
594				<RK_GPIO0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
595		};
596
597		host_vbus_drv: host-vbus-drv {
598			rockchip,pins =
599				<RK_GPIO4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
600		};
601	};
602
603	i2c8 {
604		i2c8_xfer_a: i2c8-xfer {
605			rockchip,pins =
606				<RK_GPIO1 RK_PC5 RK_FUNC_1 &pcfg_pull_up>,
607				<RK_GPIO1 RK_PC4 RK_FUNC_1 &pcfg_pull_up>;
608		};
609	};
610};
611
612&i2c1 {
613	status = "okay";
614	clock-frequency = <400000>;
615};
616&i2c2 {
617	status = "okay";
618	clock-frequency = <400000>;
619};
620&i2c4 {
621	status = "okay";
622	clock-frequency = <400000>;
623};
624&i2c6 {
625	status = "okay";
626	clock-frequency = <400000>;
627};
628
629&i2c6_xfer {
630	/* Enable pull-ups, the pins would float otherwise. */
631	rockchip,pins =
632		<RK_GPIO2 RK_PB2 RK_FUNC_2 &pcfg_pull_up>,
633		<RK_GPIO2 RK_PB1 RK_FUNC_2 &pcfg_pull_up>;
634};
635
636&i2c7 {
637	status = "okay";
638	clock-frequency = <400000>;
639
640	rtc_twi: rtc@6f {
641		compatible = "isil,isl1208";
642		reg = <0x6f>;
643	};
644	fan: fan@18 {
645		compatible = "ti,amc6821";
646		reg = <0x18>;
647		cooling-min-state = <0>;
648		cooling-max-state = <9>;
649		#cooling-cells = <2>;
650	};
651};
652
653&uart0 {
654	u-boot,dm-pre-reloc;
655	pinctrl-names = "default";
656	pinctrl-0 = <&uart0_xfer &uart0_cts>;
657	status = "okay";
658};
659
660
661&spi1 {
662	u-boot,dm-pre-reloc;
663
664	status = "okay";
665
666	#address-cells = <1>;
667	#size-cells = <0>;
668
669	spiflash: w25q32dw@0 {
670		u-boot,dm-pre-reloc;
671
672		compatible = "spi-flash";
673		reg = <0>;
674		spi-max-frequency = <49500000>;
675		spi-cpol;
676		spi-cpha;
677	};
678};
679
680&spi5 {
681	status = "okay";
682};
683