xref: /linux/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi (revision 3fd6c59042dbba50391e30862beac979491145fe)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2017 Theobroma Systems Design und Consulting GmbH
4 */
5
6#include <dt-bindings/pwm/pwm.h>
7#include "rk3399.dtsi"
8
9/ {
10	aliases {
11		ethernet0 = &gmac;
12		i2c10 = &i2c10;
13		mmc0 = &sdhci;
14	};
15
16	leds {
17		compatible = "gpio-leds";
18		pinctrl-names = "default";
19		pinctrl-0 = <&module_led_pin>;
20
21		module_led: led-0 {
22			label = "module_led";
23			gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_HIGH>;
24			linux,default-trigger = "heartbeat";
25			panic-indicator;
26		};
27	};
28
29	extcon_usb3: extcon-usb3 {
30		compatible = "linux,extcon-usb-gpio";
31		id-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>;
32		pinctrl-names = "default";
33		pinctrl-0 = <&usb3_id>;
34	};
35
36	clkin_gmac: external-gmac-clock {
37		compatible = "fixed-clock";
38		clock-frequency = <125000000>;
39		clock-output-names = "clkin_gmac";
40		#clock-cells = <0>;
41	};
42
43	vcc1v2_phy: regulator-vcc1v2-phy {
44		compatible = "regulator-fixed";
45		regulator-name = "vcc1v2_phy";
46		regulator-always-on;
47		regulator-boot-on;
48		regulator-min-microvolt = <1200000>;
49		regulator-max-microvolt = <1200000>;
50		vin-supply = <&vcc5v0_sys>;
51	};
52
53	vcc3v3_sys: regulator-vcc3v3-sys {
54		compatible = "regulator-fixed";
55		regulator-name = "vcc3v3_sys";
56		regulator-always-on;
57		regulator-boot-on;
58		regulator-min-microvolt = <3300000>;
59		regulator-max-microvolt = <3300000>;
60		vin-supply = <&vcc5v0_sys>;
61	};
62
63	vcc5v0_host: regulator-vcc5v0-host {
64		compatible = "regulator-fixed";
65		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_LOW>;
66		pinctrl-names = "default";
67		pinctrl-0 = <&vcc5v0_host_en>;
68		regulator-name = "vcc5v0_host";
69		regulator-always-on;
70		vin-supply = <&vcc5v0_sys>;
71	};
72
73	vcc5v0_sys: regulator-vcc5v0-sys {
74		compatible = "regulator-fixed";
75		regulator-name = "vcc5v0_sys";
76		regulator-always-on;
77		regulator-boot-on;
78		regulator-min-microvolt = <5000000>;
79		regulator-max-microvolt = <5000000>;
80	};
81
82	vcca_0v9: regulator-vcca-0v9 {
83		compatible = "regulator-fixed";
84		regulator-name = "vcca_0v9";
85		regulator-always-on;
86		regulator-boot-on;
87		regulator-min-microvolt = <900000>;
88		regulator-max-microvolt = <900000>;
89		vin-supply = <&vcc_1v8>;
90	};
91
92	vcca_1v8: regulator-vcca-1v8 {
93		compatible = "regulator-fixed";
94		regulator-name = "vcca_1v8";
95		regulator-always-on;
96		regulator-boot-on;
97		regulator-min-microvolt = <1800000>;
98		regulator-max-microvolt = <1800000>;
99		vin-supply = <&vcc3v3_sys>;
100	};
101
102	vdd_log: regulator-vdd-log {
103		compatible = "pwm-regulator";
104		pwms = <&pwm2 0 25000 1>;
105		pwm-supply = <&vcc5v0_sys>;
106		regulator-name = "vdd_log";
107		regulator-min-microvolt = <800000>;
108		regulator-max-microvolt = <1400000>;
109		regulator-always-on;
110		regulator-boot-on;
111	};
112};
113
114&cpu_b0 {
115	cpu-supply = <&vdd_cpu_b>;
116};
117
118&cpu_b1 {
119	cpu-supply = <&vdd_cpu_b>;
120};
121
122&cpu_l0 {
123	cpu-supply = <&vdd_cpu_l>;
124};
125
126&cpu_l1 {
127	cpu-supply = <&vdd_cpu_l>;
128};
129
130&cpu_l2 {
131	cpu-supply = <&vdd_cpu_l>;
132};
133
134&cpu_l3 {
135	cpu-supply = <&vdd_cpu_l>;
136};
137
138&emmc_phy {
139	status = "okay";
140	drive-impedance-ohm = <33>;
141};
142
143&gpio0 {
144	/*
145	 * The BIOS_DISABLE hog is a feedback pin for the actual status of the
146	 * signal. This usually represents the state of a switch on the baseboard.
147	 * The pin has a 10k pull-up resistor connected, so no pull-up setting is needed.
148	 */
149	bios-disable-hog {
150		gpios = <RK_PB0 GPIO_ACTIVE_HIGH>;
151		gpio-hog;
152		input;
153		line-name = "bios_disable";
154	};
155};
156
157&gpio3 {
158	/*
159	 * The Qseven BIOS_DISABLE signal on the RK3399-Q7 keeps the on-module
160	 * eMMC and SPI flash powered-down initially (in fact it keeps the
161	 * reset signal asserted). BIOS_DISABLE_OVERRIDE pin allows to override
162	 * that signal so that eMMC and SPI can be used regardless of the state
163	 * of the signal.
164	 */
165	bios-disable-override-hog {
166		gpios = <RK_PD5 GPIO_ACTIVE_LOW>;
167		gpio-hog;
168		line-name = "bios_disable_override";
169		output-high;
170	};
171};
172
173&gmac {
174	assigned-clocks = <&cru SCLK_RMII_SRC>;
175	assigned-clock-parents = <&clkin_gmac>;
176	clock_in_out = "input";
177	phy-supply = <&vcc1v2_phy>;
178	phy-mode = "rgmii";
179	pinctrl-names = "default";
180	pinctrl-0 = <&rgmii_pins>;
181	snps,reset-gpio = <&gpio3 RK_PC0 GPIO_ACTIVE_LOW>;
182	snps,reset-active-low;
183	snps,reset-delays-us = <0 10000 50000>;
184	tx_delay = <0x10>;
185	rx_delay = <0x10>;
186	status = "okay";
187};
188
189&gpu {
190	mali-supply = <&vdd_gpu>;
191	status = "okay";
192};
193
194&i2c0 {
195	status = "okay";
196	i2c-scl-rising-time-ns = <168>;
197	i2c-scl-falling-time-ns = <4>;
198	clock-frequency = <400000>;
199
200	rk808: pmic@1b {
201		compatible = "rockchip,rk808";
202		reg = <0x1b>;
203		interrupt-parent = <&gpio1>;
204		interrupts = <22 IRQ_TYPE_LEVEL_LOW>;
205		#clock-cells = <1>;
206		clock-output-names = "xin32k", "rk808-clkout2";
207		pinctrl-names = "default";
208		pinctrl-0 = <&pmic_int_l>;
209		system-power-controller;
210		wakeup-source;
211
212		vcc1-supply = <&vcc5v0_sys>;
213		vcc2-supply = <&vcc5v0_sys>;
214		vcc3-supply = <&vcc5v0_sys>;
215		vcc4-supply = <&vcc5v0_sys>;
216		vcc6-supply = <&vcc5v0_sys>;
217		vcc7-supply = <&vcc5v0_sys>;
218		vcc8-supply = <&vcc3v3_sys>;
219		vcc9-supply = <&vcc5v0_sys>;
220		vcc10-supply = <&vcc5v0_sys>;
221		vcc11-supply = <&vcc5v0_sys>;
222		vcc12-supply = <&vcc3v3_sys>;
223		vddio-supply = <&vcc1v8_pmu>;
224
225		regulators {
226			vdd_center: DCDC_REG1 {
227				regulator-name = "vdd_center";
228				regulator-min-microvolt = <750000>;
229				regulator-max-microvolt = <1350000>;
230				regulator-ramp-delay = <6001>;
231				regulator-always-on;
232				regulator-boot-on;
233				regulator-state-mem {
234					regulator-off-in-suspend;
235				};
236			};
237
238			vdd_cpu_l: DCDC_REG2 {
239				regulator-name = "vdd_cpu_l";
240				regulator-min-microvolt = <750000>;
241				regulator-max-microvolt = <1350000>;
242				regulator-ramp-delay = <6001>;
243				regulator-always-on;
244				regulator-boot-on;
245				regulator-state-mem {
246					regulator-off-in-suspend;
247				};
248			};
249
250			vcc_ddr: DCDC_REG3 {
251				regulator-name = "vcc_ddr";
252				regulator-always-on;
253				regulator-boot-on;
254				regulator-state-mem {
255					regulator-on-in-suspend;
256				};
257			};
258
259			vcc_1v8: DCDC_REG4 {
260				regulator-name = "vcc_1v8";
261				regulator-min-microvolt = <1800000>;
262				regulator-max-microvolt = <1800000>;
263				regulator-always-on;
264				regulator-boot-on;
265				regulator-state-mem {
266					regulator-on-in-suspend;
267					regulator-suspend-microvolt = <1800000>;
268				};
269			};
270
271			vcc_ldo1: LDO_REG1 {
272				regulator-name = "vcc_ldo1";
273				regulator-min-microvolt = <1800000>;
274				regulator-max-microvolt = <1800000>;
275				regulator-boot-on;
276				regulator-state-mem {
277					regulator-off-in-suspend;
278				};
279			};
280
281			vcc1v8_hdmi: LDO_REG2 {
282				regulator-name = "vcc1v8_hdmi";
283				regulator-min-microvolt = <1800000>;
284				regulator-max-microvolt = <1800000>;
285				regulator-always-on;
286				regulator-boot-on;
287				regulator-state-mem {
288					regulator-off-in-suspend;
289				};
290			};
291
292			vcc1v8_pmu: LDO_REG3 {
293				regulator-name = "vcc1v8_pmu";
294				regulator-min-microvolt = <1800000>;
295				regulator-max-microvolt = <1800000>;
296				regulator-always-on;
297				regulator-boot-on;
298				regulator-state-mem {
299					regulator-on-in-suspend;
300					regulator-suspend-microvolt = <1800000>;
301				};
302			};
303
304			vcc_sd: LDO_REG4 {
305				regulator-name = "vcc_sd";
306				regulator-min-microvolt = <1800000>;
307				regulator-max-microvolt = <3000000>;
308				regulator-always-on;
309				regulator-boot-on;
310				regulator-state-mem {
311					regulator-on-in-suspend;
312					regulator-suspend-microvolt = <3000000>;
313				};
314			};
315
316			vcc_ldo5: LDO_REG5 {
317				regulator-name = "vcc_ldo5";
318				regulator-min-microvolt = <3000000>;
319				regulator-max-microvolt = <3000000>;
320				regulator-boot-on;
321				regulator-state-mem {
322					regulator-off-in-suspend;
323				};
324			};
325
326			vcc_ldo6: LDO_REG6 {
327				regulator-name = "vcc_ldo6";
328				regulator-min-microvolt = <1500000>;
329				regulator-max-microvolt = <1500000>;
330				regulator-boot-on;
331				regulator-state-mem {
332					regulator-off-in-suspend;
333				};
334			};
335
336			vcc0v9_hdmi: LDO_REG7 {
337				regulator-name = "vcc0v9_hdmi";
338				regulator-min-microvolt = <900000>;
339				regulator-max-microvolt = <900000>;
340				regulator-always-on;
341				regulator-boot-on;
342				regulator-state-mem {
343					regulator-off-in-suspend;
344				};
345			};
346
347			vcc_efuse: LDO_REG8 {
348				regulator-name = "vcc_efuse";
349				regulator-min-microvolt = <1800000>;
350				regulator-max-microvolt = <1800000>;
351				regulator-always-on;
352				regulator-boot-on;
353				regulator-state-mem {
354					regulator-off-in-suspend;
355				};
356			};
357
358			vcc3v3_s3: SWITCH_REG1 {
359				regulator-name = "vcc3v3_s3";
360				regulator-always-on;
361				regulator-boot-on;
362				regulator-state-mem {
363					regulator-off-in-suspend;
364				};
365			};
366
367			vcc3v3_s0: SWITCH_REG2 {
368				regulator-name = "vcc3v3_s0";
369				regulator-always-on;
370				regulator-boot-on;
371				regulator-state-mem {
372					regulator-off-in-suspend;
373				};
374			};
375		};
376	};
377
378	vdd_gpu: regulator@60 {
379		compatible = "fcs,fan53555";
380		reg = <0x60>;
381		fcs,suspend-voltage-selector = <1>;
382		regulator-name = "vdd_gpu";
383		regulator-min-microvolt = <600000>;
384		regulator-max-microvolt = <1230000>;
385		regulator-ramp-delay = <1000>;
386		regulator-always-on;
387		regulator-boot-on;
388		vin-supply = <&vcc5v0_sys>;
389	};
390};
391
392&i2c7 {
393	status = "okay";
394	clock-frequency = <400000>;
395
396	fan: fan@18 {
397		compatible = "tsd,mule", "ti,amc6821";
398		reg = <0x18>;
399
400		i2c-mux {
401			compatible = "tsd,mule-i2c-mux";
402			#address-cells = <1>;
403			#size-cells = <0>;
404
405			i2c10: i2c@0 {
406				reg = <0x0>;
407				#address-cells = <1>;
408				#size-cells = <0>;
409
410				rtc_twi: rtc@6f {
411					compatible = "isil,isl1208";
412					reg = <0x6f>;
413				};
414			};
415		};
416	};
417};
418
419&i2c8 {
420	status = "okay";
421	clock-frequency = <400000>;
422
423	vdd_cpu_b: regulator@60 {
424		compatible = "fcs,fan53555";
425		reg = <0x60>;
426		vin-supply = <&vcc5v0_sys>;
427		regulator-name = "vdd_cpu_b";
428		regulator-min-microvolt = <600000>;
429		regulator-max-microvolt = <1230000>;
430		regulator-ramp-delay = <1000>;
431		fcs,suspend-voltage-selector = <1>;
432		regulator-always-on;
433		regulator-boot-on;
434	};
435};
436
437&i2s0 {
438	pinctrl-0 = <&i2s0_2ch_bus>;
439	pinctrl-1 = <&i2s0_2ch_bus_bclk_off>;
440	rockchip,playback-channels = <2>;
441	rockchip,capture-channels = <2>;
442	status = "okay";
443};
444
445/*
446 * As Q7 does not specify neither a global nor a RX clock for I2S these
447 * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO.
448 * Therefore we have to redefine the i2s0_2ch_bus and i2s0_2ch_bus_bclk_off
449 * definitions to prevent conflicts.
450 */
451&i2s0_2ch_bus {
452	rockchip,pins =
453		<3 RK_PD0 1 &pcfg_pull_none>,
454		<3 RK_PD2 1 &pcfg_pull_none>,
455		<3 RK_PD3 1 &pcfg_pull_none>,
456		<3 RK_PD7 1 &pcfg_pull_none>;
457};
458
459&i2s0_2ch_bus_bclk_off {
460	rockchip,pins =
461		<3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>,
462		<3 RK_PD2 1 &pcfg_pull_none>,
463		<3 RK_PD3 1 &pcfg_pull_none>,
464		<3 RK_PD7 1 &pcfg_pull_none>;
465};
466
467&io_domains {
468	status = "okay";
469	bt656-supply = <&vcc_1v8>;
470	audio-supply = <&vcc_1v8>;
471	sdmmc-supply = <&vcc_sd>;
472	gpio1830-supply = <&vcc_1v8>;
473};
474
475&pcie0 {
476	/* PCIe PHY supplies */
477	vpcie0v9-supply = <&vcca_0v9>;
478	vpcie1v8-supply = <&vcca_1v8>;
479};
480
481&pcie_clkreqn_cpm {
482	rockchip,pins =
483		<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
484};
485
486&pinctrl {
487	pinctrl-names = "default";
488	pinctrl-0 = <&q7_thermal_pin &bios_disable_override_hog_pin>;
489
490	gpios {
491		bios_disable_override_hog_pin: bios-disable-override-hog-pin {
492			rockchip,pins =
493				<3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
494		};
495
496		q7_thermal_pin: q7-thermal-pin {
497			rockchip,pins =
498				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
499		};
500	};
501
502	i2c8 {
503		i2c8_xfer_a: i2c8-xfer {
504			rockchip,pins =
505			  <1 RK_PC4 1 &pcfg_pull_up>,
506			  <1 RK_PC5 1 &pcfg_pull_up>;
507		};
508	};
509
510	leds {
511		module_led_pin: module-led-pin {
512			rockchip,pins =
513			  <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
514		};
515	};
516
517	pmic {
518		pmic_int_l: pmic-int-l {
519			rockchip,pins =
520			  <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
521		};
522	};
523
524	usb2 {
525		vcc5v0_host_en: vcc5v0-host-en {
526			rockchip,pins =
527			  <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
528		};
529	};
530
531	usb3 {
532		usb3_id: usb3-id {
533			rockchip,pins =
534			  <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
535		};
536	};
537};
538
539&pmu_io_domains {
540	status = "okay";
541	pmu1830-supply = <&vcc_1v8>;
542};
543
544&pwm2 {
545	status = "okay";
546};
547
548&sdhci {
549	/*
550	 * Signal integrity isn't great at 200MHz but 100MHz has proven stable
551	 * enough.
552	 */
553	max-frequency = <100000000>;
554
555	bus-width = <8>;
556	mmc-hs400-1_8v;
557	mmc-hs400-enhanced-strobe;
558	non-removable;
559	status = "okay";
560};
561
562&sdmmc {
563	vqmmc-supply = <&vcc_sd>;
564};
565
566&spi1 {
567	status = "okay";
568
569	norflash: flash@0 {
570		compatible = "jedec,spi-nor";
571		reg = <0>;
572		spi-max-frequency = <50000000>;
573	};
574};
575
576&tcphy1 {
577	status = "okay";
578};
579
580&tsadc {
581	rockchip,hw-tshut-mode = <1>;
582	rockchip,hw-tshut-polarity = <1>;
583	status = "okay";
584};
585
586&u2phy1 {
587	status = "okay";
588
589	u2phy1_otg: otg-port {
590		status = "okay";
591	};
592
593	u2phy1_host: host-port {
594		phy-supply = <&vcc5v0_host>;
595		status = "okay";
596	};
597};
598
599&usbdrd3_1 {
600	status = "okay";
601};
602
603&usbdrd_dwc3_1 {
604	status = "okay";
605	dr_mode = "host";
606};
607
608&usb_host1_ehci {
609	status = "okay";
610};
611
612&usb_host1_ohci {
613	status = "okay";
614};
615