xref: /freebsd/sys/contrib/device-tree/src/arm64/rockchip/rk3399-puma.dtsi (revision 0e8011faf58b743cc652e3b2ad0f7671227610df)
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#include "rk3399-opp.dtsi"
9
10/ {
11	aliases {
12		ethernet0 = &gmac;
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: 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: 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: vcc5v0-host-regulator {
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: 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: vcca-0v9-regulator {
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: vcca-1v8-regulator {
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: 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		rockchip,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 = "ti,amc6821";
398		reg = <0x18>;
399		#cooling-cells = <2>;
400	};
401
402	rtc_twi: rtc@6f {
403		compatible = "isil,isl1208";
404		reg = <0x6f>;
405	};
406};
407
408&i2c8 {
409	status = "okay";
410	clock-frequency = <400000>;
411
412	vdd_cpu_b: regulator@60 {
413		compatible = "fcs,fan53555";
414		reg = <0x60>;
415		vin-supply = <&vcc5v0_sys>;
416		regulator-name = "vdd_cpu_b";
417		regulator-min-microvolt = <600000>;
418		regulator-max-microvolt = <1230000>;
419		regulator-ramp-delay = <1000>;
420		fcs,suspend-voltage-selector = <1>;
421		regulator-always-on;
422		regulator-boot-on;
423	};
424};
425
426&i2s0 {
427	pinctrl-0 = <&i2s0_2ch_bus>;
428	pinctrl-1 = <&i2s0_2ch_bus_bclk_off>;
429	rockchip,playback-channels = <2>;
430	rockchip,capture-channels = <2>;
431	status = "okay";
432};
433
434/*
435 * As Q7 does not specify neither a global nor a RX clock for I2S these
436 * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO.
437 * Therefore we have to redefine the i2s0_2ch_bus and i2s0_2ch_bus_bclk_off
438 * definitions to prevent conflicts.
439 */
440&i2s0_2ch_bus {
441	rockchip,pins =
442		<3 RK_PD0 1 &pcfg_pull_none>,
443		<3 RK_PD2 1 &pcfg_pull_none>,
444		<3 RK_PD3 1 &pcfg_pull_none>,
445		<3 RK_PD7 1 &pcfg_pull_none>;
446};
447
448&i2s0_2ch_bus_bclk_off {
449	rockchip,pins =
450		<3 RK_PD0 RK_FUNC_GPIO &pcfg_pull_none>,
451		<3 RK_PD2 1 &pcfg_pull_none>,
452		<3 RK_PD3 1 &pcfg_pull_none>,
453		<3 RK_PD7 1 &pcfg_pull_none>;
454};
455
456&io_domains {
457	status = "okay";
458	bt656-supply = <&vcc_1v8>;
459	audio-supply = <&vcc_1v8>;
460	sdmmc-supply = <&vcc_sd>;
461	gpio1830-supply = <&vcc_1v8>;
462};
463
464&pcie0 {
465	/* PCIe PHY supplies */
466	vpcie0v9-supply = <&vcca_0v9>;
467	vpcie1v8-supply = <&vcca_1v8>;
468};
469
470&pcie_clkreqn_cpm {
471	rockchip,pins =
472		<2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_up>;
473};
474
475&pinctrl {
476	pinctrl-names = "default";
477	pinctrl-0 = <&q7_thermal_pin &bios_disable_override_hog_pin>;
478
479	gpios {
480		bios_disable_override_hog_pin: bios-disable-override-hog-pin {
481			rockchip,pins =
482				<3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_down>;
483		};
484
485		q7_thermal_pin: q7-thermal-pin {
486			rockchip,pins =
487				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
488		};
489	};
490
491	i2c8 {
492		i2c8_xfer_a: i2c8-xfer {
493			rockchip,pins =
494			  <1 RK_PC4 1 &pcfg_pull_up>,
495			  <1 RK_PC5 1 &pcfg_pull_up>;
496		};
497	};
498
499	leds {
500		module_led_pin: module-led-pin {
501			rockchip,pins =
502			  <2 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
503		};
504	};
505
506	pmic {
507		pmic_int_l: pmic-int-l {
508			rockchip,pins =
509			  <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
510		};
511	};
512
513	usb2 {
514		vcc5v0_host_en: vcc5v0-host-en {
515			rockchip,pins =
516			  <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
517		};
518	};
519
520	usb3 {
521		usb3_id: usb3-id {
522			rockchip,pins =
523			  <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
524		};
525	};
526};
527
528&pmu_io_domains {
529	status = "okay";
530	pmu1830-supply = <&vcc_1v8>;
531};
532
533&pwm2 {
534	status = "okay";
535};
536
537&sdhci {
538	/*
539	 * Signal integrity isn't great at 200MHz but 100MHz has proven stable
540	 * enough.
541	 */
542	max-frequency = <100000000>;
543
544	bus-width = <8>;
545	mmc-hs400-1_8v;
546	mmc-hs400-enhanced-strobe;
547	non-removable;
548	status = "okay";
549};
550
551&sdmmc {
552	vqmmc-supply = <&vcc_sd>;
553};
554
555&spi1 {
556	status = "okay";
557
558	norflash: flash@0 {
559		compatible = "jedec,spi-nor";
560		reg = <0>;
561		spi-max-frequency = <50000000>;
562	};
563};
564
565&tcphy1 {
566	status = "okay";
567};
568
569&tsadc {
570	rockchip,hw-tshut-mode = <1>;
571	rockchip,hw-tshut-polarity = <1>;
572	status = "okay";
573};
574
575&u2phy1 {
576	status = "okay";
577
578	u2phy1_otg: otg-port {
579		status = "okay";
580	};
581
582	u2phy1_host: host-port {
583		phy-supply = <&vcc5v0_host>;
584		status = "okay";
585	};
586};
587
588&usbdrd3_1 {
589	status = "okay";
590};
591
592&usbdrd_dwc3_1 {
593	status = "okay";
594	dr_mode = "host";
595};
596
597&usb_host1_ehci {
598	status = "okay";
599};
600
601&usb_host1_ohci {
602	status = "okay";
603};
604