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