xref: /linux/arch/arm64/boot/dts/rockchip/rk3368-lba3368.dts (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3/dts-v1/;
4
5#include <dt-bindings/clock/rockchip,rk808.h>
6#include <dt-bindings/input/input.h>
7#include <dt-bindings/leds/common.h>
8#include <dt-bindings/sound/rt5640.h>
9#include "rk3368.dtsi"
10
11/ {
12	model = "Neardi LBA3368";
13	compatible = "neardi,lba3368", "rockchip,rk3368";
14
15	aliases {
16		ethernet0 = &gmac;
17		mmc0 = &emmc;
18		mmc1 = &sdmmc;
19		mmc2 = &sdio0;
20		rtc0 = &hym8563;
21		rtc1 = &rk808;
22	};
23
24	chosen {
25		stdout-path = "serial1:115200n8";
26	};
27
28	memory@0 {
29		device_type = "memory";
30		reg = <0x0 0x0 0x0 0x40000000>;
31	};
32
33	adc-key {
34		compatible = "adc-keys";
35		io-channels = <&saradc 1>;
36		io-channel-names = "buttons";
37		poll-interval = <100>;
38		keyup-threshold-microvolt = <1800000>;
39
40		button-recovery {
41			label = "Recovery";
42			linux,code = <KEY_VENDOR>;
43			press-threshold-microvolt = <0>;
44		};
45	};
46
47	analog-sound {
48		compatible = "audio-graph-card";
49		dais = <&i2s_8ch_p0>;
50		hp-det-gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
51		label = "alc5640";
52		routing = "Mic Jack", "MICBIAS1",
53			  "IN1P", "Mic Jack",
54			  "Headphone Jack", "HPOL",
55			  "Headphone Jack", "HPOR",
56			  "Speakers", "SPORP",
57			  "Speakers", "SPORN",
58			  "Speakers", "SPOLP",
59			  "Speakers", "SPOLN";
60		widgets = "Microphone", "Mic Jack",
61			  "Headphone", "Headphone Jack",
62			  "Speaker", "Speakers";
63		pinctrl-names = "default";
64		pinctrl-0 = <&hp_det>;
65	};
66
67	dc_12v: dc-12v-regulator {
68		compatible = "regulator-fixed";
69		regulator-name = "dc_12v";
70		regulator-min-microvolt = <12000000>;
71		regulator-max-microvolt = <12000000>;
72		regulator-always-on;
73		regulator-boot-on;
74	};
75
76	ext_gmac: gmac-clk {
77		compatible = "fixed-clock";
78		clock-frequency = <50000000>;
79		clock-output-names = "ext_gmac";
80		#clock-cells = <0>;
81	};
82
83	hub_avdd: hub-avdd-regulator {
84		compatible = "regulator-fixed";
85		regulator-name = "hub_avdd";
86		regulator-min-microvolt = <3300000>;
87		regulator-max-microvolt = <3300000>;
88		vin-supply = <&vcc_io>;
89		regulator-always-on;
90	};
91
92	leds {
93		compatible = "gpio-leds";
94
95		power-led {
96			gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
97			function = LED_FUNCTION_POWER;
98			color = <LED_COLOR_ID_GREEN>;
99			default-state = "on";
100			pinctrl-names = "default";
101			pinctrl-0 = <&power_led>;
102		};
103	};
104
105	sdio_pwrseq: sdio-pwrseq {
106		compatible = "mmc-pwrseq-simple";
107		clocks = <&rk808 RK808_CLKOUT1>;
108		clock-names = "ext_clock";
109		reset-gpios = <&gpio3 RK_PA5 GPIO_ACTIVE_LOW>;
110		pinctrl-names = "default";
111		pinctrl-0 = <&wifi_reg_on>;
112	};
113
114	vcc_host: vcc-host-regulator {
115		compatible = "regulator-fixed";
116		gpio = <&gpio3 RK_PC1 GPIO_ACTIVE_HIGH>;
117		regulator-name = "vcc_host";
118		regulator-min-microvolt = <5000000>;
119		regulator-max-microvolt = <5000000>;
120		vin-supply = <&vcc_sys>;
121		pinctrl-names = "default";
122		pinctrl-0 = <&host_vbus_drv>;
123		enable-active-high;
124		regulator-always-on;
125	};
126
127	vcc_lan: vcc-lan-regulator {
128		compatible = "regulator-fixed";
129		regulator-name = "vcc_lan";
130		regulator-min-microvolt = <3300000>;
131		regulator-max-microvolt = <3300000>;
132		vin-supply = <&vcc_io>;
133		regulator-always-on;
134	};
135
136	vcc_otg: vcc-otg-regulator {
137		compatible = "regulator-fixed";
138		gpio = <&gpio0 RK_PC1 GPIO_ACTIVE_HIGH>;
139		regulator-name = "vcc_otg";
140		regulator-min-microvolt = <5000000>;
141		regulator-max-microvolt = <5000000>;
142		vin-supply = <&vcc_sys>;
143		pinctrl-names = "default";
144		pinctrl-0 = <&otg_vbus_drv>;
145		enable-active-high;
146		regulator-always-on;
147	};
148
149	vcc_sys: vcc-sys-regulator {
150		compatible = "regulator-fixed";
151		regulator-name = "vcc_sys";
152		regulator-min-microvolt = <5000000>;
153		regulator-max-microvolt = <5000000>;
154		vin-supply = <&dc_12v>;
155		regulator-always-on;
156		regulator-boot-on;
157	};
158
159	vdd10_usb: vdd10-usb-regulator {
160		compatible = "regulator-fixed";
161		regulator-name = "vdd10_usb";
162		regulator-min-microvolt = <1000000>;
163		regulator-max-microvolt = <1000000>;
164		vin-supply = <&vdd_10>;
165		regulator-always-on;
166	};
167};
168
169&cpu_l0 {
170	cpu-supply = <&vdd_cpu>;
171};
172
173&cpu_l1 {
174	cpu-supply = <&vdd_cpu>;
175};
176
177&cpu_l2 {
178	cpu-supply = <&vdd_cpu>;
179};
180
181&cpu_l3 {
182	cpu-supply = <&vdd_cpu>;
183};
184
185&cpu_b0 {
186	cpu-supply = <&vdd_cpu>;
187};
188
189&cpu_b1 {
190	cpu-supply = <&vdd_cpu>;
191};
192
193&cpu_b2 {
194	cpu-supply = <&vdd_cpu>;
195};
196
197&cpu_b3 {
198	cpu-supply = <&vdd_cpu>;
199};
200
201&emmc {
202	bus-width = <8>;
203	vmmc-supply = <&vcc_io>;
204	vqmmc-supply = <&vcc_18>;
205	pinctrl-names = "default";
206	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
207	cap-mmc-highspeed;
208	non-removable;
209	no-sd;
210	no-sdio;
211	mmc-hs200-1_8v;
212	status = "okay";
213};
214
215&gmac {
216	clock_in_out = "input";
217	phy-handle = <&phy>;
218	phy-mode = "rmii";
219	phy-supply = <&vcc_lan>;
220	assigned-clocks = <&cru SCLK_MAC>;
221	assigned-clock-parents = <&ext_gmac>;
222	pinctrl-names = "default";
223	pinctrl-0 = <&rmii_pins>;
224	status = "okay";
225
226	mdio {
227		compatible = "snps,dwmac-mdio";
228		#address-cells = <1>;
229		#size-cells = <0>;
230
231		phy: ethernet-phy@1 {
232			compatible = "ethernet-phy-ieee802.3-c22";
233			reg = <1>;
234			max-speed = <100>;
235			reset-assert-us = <10000>;
236			reset-deassert-us = <1000000>;
237			reset-gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
238			pinctrl-names = "default";
239			pinctrl-0 = <&phy_rst>;
240		};
241	};
242};
243
244&io_domains {
245	audio-supply = <&vcca1v8_codec>;
246	dvp-supply = <&vcc_18>;
247	flash0-supply = <&vcc_18>;
248	gpio1830-supply = <&vcc_io>;
249	gpio30-supply = <&vcc_io>;
250	sdcard-supply = <&vccio_sd>;
251	wifi-supply = <&vdd1v8_wl>;
252	status = "okay";
253};
254
255&i2c0 {
256	status = "okay";
257
258	rk808: pmic@1b {
259		compatible = "rockchip,rk808";
260		reg = <0x1b>;
261		interrupts-extended = <&gpio0 RK_PA5 IRQ_TYPE_LEVEL_LOW>;
262		clock-output-names = "rk808-clkout1", "xin32k_wifi_bt";
263		vcc1-supply = <&vcc_sys>;
264		vcc2-supply = <&vcc_sys>;
265		vcc3-supply = <&vcc_sys>;
266		vcc4-supply = <&vcc_sys>;
267		vcc6-supply = <&vcc_sys>;
268		vcc7-supply = <&vcc_sys>;
269		vcc8-supply = <&vcc_io>;
270		vcc9-supply = <&vcc_sys>;
271		vcc10-supply = <&vcc_sys>;
272		vcc11-supply = <&vcc_sys>;
273		vcc12-supply = <&vcc_io>;
274		pinctrl-names = "default";
275		pinctrl-0 = <&pmic_int &pmic_sleep>;
276		system-power-controller;
277		wakeup-source;
278		#clock-cells = <1>;
279
280		regulators {
281			vdd_cpu: DCDC_REG1 {
282				regulator-name = "vdd_cpu";
283				regulator-min-microvolt = <700000>;
284				regulator-max-microvolt = <1350000>;
285				regulator-always-on;
286				regulator-boot-on;
287
288				regulator-state-mem {
289					regulator-off-in-suspend;
290				};
291			};
292
293			vdd_log: DCDC_REG2 {
294				regulator-name = "vdd_log";
295				regulator-min-microvolt = <1100000>;
296				regulator-max-microvolt = <1500000>;
297				regulator-ramp-delay = <6001>;
298				regulator-always-on;
299				regulator-boot-on;
300
301				regulator-state-mem {
302					regulator-suspend-microvolt = <1000000>;
303					regulator-on-in-suspend;
304				};
305			};
306
307			vcc_ddr: DCDC_REG3 {
308				regulator-name = "vcc_ddr";
309				regulator-always-on;
310				regulator-boot-on;
311
312				regulator-state-mem {
313					regulator-on-in-suspend;
314				};
315			};
316
317			vcc_io: DCDC_REG4 {
318				regulator-name = "vcc_io";
319				regulator-min-microvolt = <3300000>;
320				regulator-max-microvolt = <3300000>;
321				regulator-always-on;
322				regulator-boot-on;
323
324				regulator-state-mem {
325					regulator-suspend-microvolt = <3300000>;
326					regulator-on-in-suspend;
327				};
328			};
329
330			vcca1v8_codec: LDO_REG1 {
331				regulator-name = "vcca1v8_codec";
332				regulator-min-microvolt = <1800000>;
333				regulator-max-microvolt = <1800000>;
334				regulator-always-on;
335
336				regulator-state-mem {
337					regulator-off-in-suspend;
338				};
339			};
340
341			vcca3v0_codec: LDO_REG2 {
342				regulator-name = "vcca3v0_codec";
343				regulator-min-microvolt = <3000000>;
344				regulator-max-microvolt = <3000000>;
345				regulator-always-on;
346
347				regulator-state-mem {
348					regulator-off-in-suspend;
349				};
350			};
351
352			vdd_10: LDO_REG3 {
353				regulator-name = "vdd_10";
354				regulator-min-microvolt = <1000000>;
355				regulator-max-microvolt = <1000000>;
356				regulator-always-on;
357				regulator-boot-on;
358
359				regulator-state-mem {
360					regulator-suspend-microvolt = <1000000>;
361					regulator-on-in-suspend;
362				};
363			};
364
365			vdd1v8_wl: LDO_REG4 {
366				regulator-name = "vdd1v8_wl";
367				regulator-min-microvolt = <1800000>;
368				regulator-max-microvolt = <1800000>;
369
370				regulator-state-mem {
371					regulator-off-in-suspend;
372				};
373			};
374
375			vccio_sd: LDO_REG5 {
376				regulator-name = "vccio_sd";
377				regulator-min-microvolt = <1800000>;
378				regulator-max-microvolt = <3300000>;
379
380				regulator-state-mem {
381					regulator-off-in-suspend;
382				};
383			};
384
385			vdd10_lcd: LDO_REG6 {
386				regulator-name = "vdd10_lcd";
387				regulator-min-microvolt = <1000000>;
388				regulator-max-microvolt = <1000000>;
389
390				regulator-state-mem {
391					regulator-off-in-suspend;
392				};
393			};
394
395			vcc_18: LDO_REG7 {
396				regulator-name = "vcc_18";
397				regulator-min-microvolt = <1800000>;
398				regulator-max-microvolt = <1800000>;
399
400				regulator-state-mem {
401					regulator-suspend-microvolt = <1800000>;
402					regulator-on-in-suspend;
403				};
404			};
405
406			vcc18_lcd: LDO_REG8 {
407				regulator-name = "vcc18_lcd";
408				regulator-min-microvolt = <1800000>;
409				regulator-max-microvolt = <1800000>;
410
411				regulator-state-mem {
412					regulator-off-in-suspend;
413				};
414			};
415
416			vcc_tp: SWITCH_REG1 {
417				regulator-name = "vcc_tp";
418
419				regulator-state-mem {
420					regulator-on-in-suspend;
421				};
422			};
423
424			vcc_sd: SWITCH_REG2 {
425				regulator-name = "vcc_sd";
426
427				regulator-state-mem {
428					regulator-off-in-suspend;
429				};
430			};
431		};
432	};
433};
434
435&i2c1 {
436	status = "okay";
437
438	codec@1c {
439		compatible = "realtek,rt5640";
440		reg = <0x1c>;
441		clocks = <&cru SCLK_I2S_8CH_OUT>;
442		clock-names = "mclk";
443		realtek,dmic1-data-pin = <RT5640_DMIC1_DATA_PIN_IN1P>;
444		realtek,dmic2-data-pin = <RT5640_DMIC2_DATA_PIN_IN1N>;
445		realtek,in1-differential;
446		#sound-dai-cells = <0>;
447
448		port {
449			rt5640_p0_0: endpoint {
450				remote-endpoint = <&i2s_8ch_p0_0>;
451			};
452		};
453	};
454
455	hym8563: rtc@51 {
456		compatible = "haoyu,hym8563";
457		reg = <0x51>;
458		clock-output-names = "xin32k";
459		#clock-cells = <0>;
460	};
461};
462
463&i2s_8ch {
464	status = "okay";
465
466	i2s_8ch_p0: port {
467		i2s_8ch_p0_0: endpoint {
468			dai-format = "i2s";
469			mclk-fs = <256>;
470			remote-endpoint = <&rt5640_p0_0>;
471		};
472	};
473};
474
475&pinctrl {
476	bluetooth {
477		bt_host_wake: bt-host-wake {
478			rockchip,pins = <3 RK_PA7 RK_FUNC_GPIO &pcfg_pull_none>;
479		};
480
481		bt_reg_on: bt-reg-on {
482			rockchip,pins = <3 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
483		};
484
485		bt_wake: bt-wake {
486			rockchip,pins = <3 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
487		};
488	};
489
490	leds {
491		power_led: power-led {
492			rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
493		};
494	};
495
496	phy {
497		phy_rst: phy-rst {
498			rockchip,pins = <3 RK_PB4 RK_FUNC_GPIO &pcfg_pull_none>;
499		};
500	};
501
502	pmic {
503		pmic_int: pmic-int {
504			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
505		};
506
507		pmic_sleep: pmic-sleep {
508			rockchip,pins = <0 RK_PA0 2 &pcfg_pull_none>;
509		};
510	};
511
512	sdio-pwrseq {
513		wifi_reg_on: wifi-reg-on {
514			rockchip,pins = <3 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
515		};
516	};
517
518	sound {
519		hp_det: hp-det {
520			rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
521		};
522	};
523
524	usb {
525		host_vbus_drv: host-vbus-drv {
526			rockchip,pins = <3 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
527		};
528
529		otg_vbus_drv: otg-vbus-drv {
530			rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
531		};
532	};
533
534	wifi {
535		wifi_host_wake: wifi-host-wake {
536			rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
537		};
538	};
539};
540
541&pmu_io_domains {
542	pmu-supply = <&vcc_io>;
543	vop-supply = <&vcc_io>;
544	status = "okay";
545};
546
547&saradc {
548	vref-supply = <&vcc_18>;
549	status = "okay";
550};
551
552&sdio0 {
553	bus-width = <4>;
554	mmc-pwrseq = <&sdio_pwrseq>;
555	vmmc-supply = <&vcc_io>;
556	vqmmc-supply = <&vdd1v8_wl>;
557	assigned-clocks = <&cru SCLK_SDIO0>;
558	assigned-clock-parents = <&cru PLL_CPLL>;
559	pinctrl-names = "default";
560	pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
561	cap-sd-highspeed;
562	cap-sdio-irq;
563	no-sd;
564	no-mmc;
565	non-removable;
566	sd-uhs-sdr104;
567	#address-cells = <1>;
568	#size-cells = <0>;
569	status = "okay";
570
571	wifi@1 {
572		compatible = "brcm,bcm43455-fmac", "brcm,bcm4329-fmac";
573		reg = <1>;
574		interrupts-extended = <&gpio3 RK_PA6 IRQ_TYPE_LEVEL_HIGH>;
575		interrupt-names = "host-wake";
576		pinctrl-names = "default";
577		pinctrl-0 = <&wifi_host_wake>;
578	};
579};
580
581&sdmmc {
582	bus-width = <4>;
583	vmmc-supply = <&vcc_sd>;
584	vqmmc-supply = <&vccio_sd>;
585	pinctrl-names = "default";
586	pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4 &sdmmc_cd>;
587	cap-sd-highspeed;
588	disable-wp;
589	no-mmc;
590	no-sdio;
591	sd-uhs-sdr12;
592	sd-uhs-sdr25;
593	sd-uhs-sdr50;
594	sd-uhs-sdr104;
595	status = "okay";
596};
597
598&tsadc {
599	rockchip,hw-tshut-mode = <0>;
600	rockchip,hw-tshut-polarity = <1>;
601	status = "okay";
602};
603
604&uart0 {
605	pinctrl-names = "default";
606	pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
607	uart-has-rtscts;
608	status = "okay";
609
610	bluetooth {
611		compatible = "brcm,bcm4345c5";
612		interrupts-extended = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
613		interrupt-names = "host-wakeup";
614		clocks = <&rk808 RK808_CLKOUT1>;
615		clock-names = "lpo";
616		device-wakeup-gpios = <&gpio3 RK_PA3 GPIO_ACTIVE_HIGH>;
617		shutdown-gpios = <&gpio3 RK_PA2 GPIO_ACTIVE_HIGH>;
618		max-speed = <15000000>;
619		vbat-supply = <&vcc_io>;
620		vddio-supply = <&vdd1v8_wl>;
621		pinctrl-names = "default";
622		pinctrl-0 = <&bt_host_wake &bt_wake &bt_reg_on>;
623	};
624};
625
626&uart1 {
627	pinctrl-names = "default";
628	pinctrl-0 = <&uart1_xfer>;
629	status = "okay";
630};
631
632&uart4 {
633	pinctrl-names = "default";
634	pinctrl-0 = <&uart4_xfer>;
635	status = "okay";
636};
637
638&usb_host0_ehci {
639	#address-cells = <1>;
640	#size-cells = <0>;
641	status = "okay";
642
643	hub@1 {
644		compatible = "usb5e3,610";
645		reg = <1>;
646		vdd-supply = <&hub_avdd>;
647	};
648};
649
650&usb_otg {
651	vbus-supply = <&vcc_otg>;
652	vusb_a-supply = <&vcc_io>;
653	vusb_d-supply = <&vdd10_usb>;
654	status = "okay";
655};
656
657&wdt {
658	status = "okay";
659};
660