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