xref: /linux/arch/arm64/boot/dts/amlogic/meson-g12a-u200.dts (revision 6e7fd890f1d6ac83805409e9c346240de2705584)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Amlogic, Inc. All rights reserved.
4 */
5
6/dts-v1/;
7
8#include "meson-g12a.dtsi"
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/gpio/meson-g12a-gpio.h>
11#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
12#include <dt-bindings/sound/meson-g12a-toacodec.h>
13
14/ {
15	compatible = "amlogic,u200", "amlogic,g12a";
16	model = "Amlogic Meson G12A U200 Development Board";
17
18	aliases {
19		serial0 = &uart_AO;
20		ethernet0 = &ethmac;
21	};
22
23	dioo2133: audio-amplifier-0 {
24		compatible = "simple-audio-amplifier";
25		enable-gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
26		VCC-supply = <&vcc_5v>;
27		sound-name-prefix = "10U2";
28	};
29
30	spdif_dir: audio-codec-0 {
31		compatible = "linux,spdif-dir";
32		#sound-dai-cells = <0>;
33		sound-name-prefix = "DIR";
34	};
35
36	spdif_dit: audio-codec-1 {
37		compatible = "linux,spdif-dit";
38		#sound-dai-cells = <0>;
39		sound-name-prefix = "DIT";
40	};
41
42	chosen {
43		stdout-path = "serial0:115200n8";
44	};
45
46	cvbs-connector {
47		compatible = "composite-video-connector";
48
49		port {
50			cvbs_connector_in: endpoint {
51				remote-endpoint = <&cvbs_vdac_out>;
52			};
53		};
54	};
55
56	emmc_pwrseq: emmc-pwrseq {
57		compatible = "mmc-pwrseq-emmc";
58		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
59	};
60
61	hdmi-connector {
62		compatible = "hdmi-connector";
63		type = "a";
64
65		port {
66			hdmi_connector_in: endpoint {
67				remote-endpoint = <&hdmi_tx_tmds_out>;
68			};
69		};
70	};
71
72	memory@0 {
73		device_type = "memory";
74		reg = <0x0 0x0 0x0 0x40000000>;
75	};
76
77	flash_1v8: regulator-flash-1v8 {
78		compatible = "regulator-fixed";
79		regulator-name = "FLASH_1V8";
80		regulator-min-microvolt = <1800000>;
81		regulator-max-microvolt = <1800000>;
82		vin-supply = <&vcc_3v3>;
83		regulator-always-on;
84	};
85
86	main_12v: regulator-main-12v {
87		compatible = "regulator-fixed";
88		regulator-name = "12V";
89		regulator-min-microvolt = <12000000>;
90		regulator-max-microvolt = <12000000>;
91		regulator-always-on;
92	};
93
94	usb_pwr_en: regulator-usb-pwr-en {
95		compatible = "regulator-fixed";
96		regulator-name = "USB_PWR_EN";
97		regulator-min-microvolt = <5000000>;
98		regulator-max-microvolt = <5000000>;
99		vin-supply = <&vcc_5v>;
100
101		gpio = <&gpio GPIOH_6 GPIO_ACTIVE_HIGH>;
102		enable-active-high;
103	};
104
105	vcc_1v8: regulator-vcc-1v8 {
106		compatible = "regulator-fixed";
107		regulator-name = "VCC_1V8";
108		regulator-min-microvolt = <1800000>;
109		regulator-max-microvolt = <1800000>;
110		vin-supply = <&vcc_3v3>;
111		regulator-always-on;
112	};
113
114	vcc_3v3: regulator-vcc-3v3 {
115		compatible = "regulator-fixed";
116		regulator-name = "VCC_3V3";
117		regulator-min-microvolt = <3300000>;
118		regulator-max-microvolt = <3300000>;
119		vin-supply = <&vddao_3v3>;
120		regulator-always-on;
121		/* FIXME: actually controlled by VDDCPU_B_EN */
122	};
123
124	vcc_5v: regulator-vcc-5v {
125		compatible = "regulator-fixed";
126		regulator-name = "VCC_5V";
127		regulator-min-microvolt = <5000000>;
128		regulator-max-microvolt = <5000000>;
129		vin-supply = <&main_12v>;
130
131		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
132		enable-active-high;
133	};
134
135	vddao_1v8: regulator-vddao-1v8 {
136		compatible = "regulator-fixed";
137		regulator-name = "VDDAO_1V8";
138		regulator-min-microvolt = <1800000>;
139		regulator-max-microvolt = <1800000>;
140		vin-supply = <&vddao_3v3>;
141		regulator-always-on;
142	};
143
144	vddao_3v3: regulator-vddao-3v3 {
145		compatible = "regulator-fixed";
146		regulator-name = "VDDAO_3V3";
147		regulator-min-microvolt = <3300000>;
148		regulator-max-microvolt = <3300000>;
149		vin-supply = <&main_12v>;
150		regulator-always-on;
151	};
152
153	vddcpu: regulator-vddcpu {
154		/*
155		 * MP8756GD Regulator.
156		 */
157		compatible = "pwm-regulator";
158
159		regulator-name = "VDDCPU";
160		regulator-min-microvolt = <721000>;
161		regulator-max-microvolt = <1022000>;
162
163		pwm-supply = <&main_12v>;
164
165		pwms = <&pwm_AO_cd 1 1250 0>;
166		pwm-dutycycle-range = <100 0>;
167
168		regulator-boot-on;
169		regulator-always-on;
170	};
171
172	sound {
173		compatible = "amlogic,axg-sound-card";
174		model = "U200";
175		audio-widgets = "Line", "Lineout";
176		audio-aux-devs = <&tdmout_a>, <&tdmout_b>, <&tdmout_c>,
177				 <&tdmin_a>, <&tdmin_b>, <&tdmin_c>,
178				 <&tdmin_lb>, <&dioo2133>;
179		audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
180				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
181				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
182				"TDM_A Playback", "TDMOUT_A OUT",
183				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
184				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
185				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
186				"TDM_B Playback", "TDMOUT_B OUT",
187				"TDMOUT_C IN 0", "FRDDR_A OUT 2",
188				"TDMOUT_C IN 1", "FRDDR_B OUT 2",
189				"TDMOUT_C IN 2", "FRDDR_C OUT 2",
190				"TDM_C Playback", "TDMOUT_C OUT",
191				"SPDIFOUT_A IN 0", "FRDDR_A OUT 3",
192				"SPDIFOUT_A IN 1", "FRDDR_B OUT 3",
193				"SPDIFOUT_A IN 2", "FRDDR_C OUT 3",
194				"SPDIFOUT_B IN 0", "FRDDR_A OUT 4",
195				"SPDIFOUT_B IN 1", "FRDDR_B OUT 4",
196				"SPDIFOUT_B IN 2", "FRDDR_C OUT 4",
197				"TDMIN_A IN 0", "TDM_A Capture",
198				"TDMIN_A IN 1", "TDM_B Capture",
199				"TDMIN_A IN 2", "TDM_C Capture",
200				"TDMIN_A IN 3", "TDM_A Loopback",
201				"TDMIN_A IN 4", "TDM_B Loopback",
202				"TDMIN_A IN 5", "TDM_C Loopback",
203				"TDMIN_B IN 0", "TDM_A Capture",
204				"TDMIN_B IN 1", "TDM_B Capture",
205				"TDMIN_B IN 2", "TDM_C Capture",
206				"TDMIN_B IN 3", "TDM_A Loopback",
207				"TDMIN_B IN 4", "TDM_B Loopback",
208				"TDMIN_B IN 5", "TDM_C Loopback",
209				"TDMIN_C IN 0", "TDM_A Capture",
210				"TDMIN_C IN 1", "TDM_B Capture",
211				"TDMIN_C IN 2", "TDM_C Capture",
212				"TDMIN_C IN 3", "TDM_A Loopback",
213				"TDMIN_C IN 4", "TDM_B Loopback",
214				"TDMIN_C IN 5", "TDM_C Loopback",
215				"TDMIN_LB IN 3", "TDM_A Capture",
216				"TDMIN_LB IN 4", "TDM_B Capture",
217				"TDMIN_LB IN 5", "TDM_C Capture",
218				"TDMIN_LB IN 0", "TDM_A Loopback",
219				"TDMIN_LB IN 1", "TDM_B Loopback",
220				"TDMIN_LB IN 2", "TDM_C Loopback",
221				"TODDR_A IN 0", "TDMIN_A OUT",
222				"TODDR_B IN 0", "TDMIN_A OUT",
223				"TODDR_C IN 0", "TDMIN_A OUT",
224				"TODDR_A IN 1", "TDMIN_B OUT",
225				"TODDR_B IN 1", "TDMIN_B OUT",
226				"TODDR_C IN 1", "TDMIN_B OUT",
227				"TODDR_A IN 2", "TDMIN_C OUT",
228				"TODDR_B IN 2", "TDMIN_C OUT",
229				"TODDR_C IN 2", "TDMIN_C OUT",
230				"TODDR_A IN 3", "SPDIFIN Capture",
231				"TODDR_B IN 3", "SPDIFIN Capture",
232				"TODDR_C IN 3", "SPDIFIN Capture",
233				"TODDR_A IN 6", "TDMIN_LB OUT",
234				"TODDR_B IN 6", "TDMIN_LB OUT",
235				"TODDR_C IN 6", "TDMIN_LB OUT",
236				"10U2 INL", "ACODEC LOLP",
237				"10U2 INR", "ACODEC LORP",
238				"Lineout", "10U2 OUTL",
239				"Lineout", "10U2 OUTR";
240
241		assigned-clocks = <&clkc CLKID_MPLL2>,
242				  <&clkc CLKID_MPLL0>,
243				  <&clkc CLKID_MPLL1>;
244		assigned-clock-parents = <0>, <0>, <0>;
245		assigned-clock-rates = <294912000>,
246				       <270950400>,
247				       <393216000>;
248
249		dai-link-0 {
250			sound-dai = <&frddr_a>;
251		};
252
253		dai-link-1 {
254			sound-dai = <&frddr_b>;
255		};
256
257		dai-link-2 {
258			sound-dai = <&frddr_c>;
259		};
260
261		dai-link-3 {
262			sound-dai = <&toddr_a>;
263		};
264
265		dai-link-4 {
266			sound-dai = <&toddr_b>;
267		};
268
269		dai-link-5 {
270			sound-dai = <&toddr_c>;
271		};
272
273		/* Connected to the WIFI/BT chip */
274		dai-link-6 {
275			sound-dai = <&tdmif_a>;
276			dai-format = "dsp_a";
277			dai-tdm-slot-tx-mask-0 = <1 1>;
278			mclk-fs = <256>;
279
280			codec-0 {
281				sound-dai = <&toacodec TOACODEC_IN_A>;
282			};
283
284			codec-1 {
285				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
286			};
287		};
288
289		/* Connected to the onboard AD82584F DAC */
290		dai-link-7 {
291			sound-dai = <&tdmif_b>;
292			dai-format = "i2s";
293			dai-tdm-slot-tx-mask-0 = <1 1>;
294			mclk-fs = <256>;
295
296			codec-0 {
297				sound-dai = <&toacodec TOACODEC_IN_B>;
298			};
299
300			codec-1 {
301				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
302			};
303		};
304
305		/* 8ch HDMI interface */
306		dai-link-8 {
307			sound-dai = <&tdmif_c>;
308			dai-format = "i2s";
309			dai-tdm-slot-tx-mask-0 = <1 1>;
310			dai-tdm-slot-tx-mask-1 = <1 1>;
311			dai-tdm-slot-tx-mask-2 = <1 1>;
312			dai-tdm-slot-tx-mask-3 = <1 1>;
313			mclk-fs = <256>;
314
315			codec-0 {
316				sound-dai = <&toacodec TOACODEC_IN_C>;
317			};
318
319			codec-1 {
320				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_C>;
321			};
322		};
323
324		/* spdif hdmi and coax output */
325		dai-link-9 {
326			sound-dai = <&spdifout_a>;
327
328			codec-0 {
329				sound-dai = <&spdif_dit>;
330			};
331
332			codec-1 {
333				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_A>;
334			};
335		};
336
337		/* spdif hdmi interface */
338		dai-link-10 {
339			sound-dai = <&spdifout_b>;
340
341			codec {
342				sound-dai = <&tohdmitx TOHDMITX_SPDIF_IN_B>;
343			};
344		};
345
346		/* hdmi glue */
347		dai-link-11 {
348			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
349
350			codec {
351				sound-dai = <&hdmi_tx>;
352			};
353		};
354
355		/* internal codec glue */
356		dai-link-12 {
357			sound-dai = <&toacodec TOACODEC_OUT>;
358
359			codec {
360				sound-dai = <&acodec>;
361			};
362		};
363
364		/* spdif coax input */
365		dai-link-13 {
366			sound-dai = <&spdifin>;
367
368			codec {
369				sound-dai = <&spdif_dir>;
370			};
371		};
372	};
373};
374
375&acodec {
376	AVDD-supply = <&vddao_1v8>;
377	status = "okay";
378};
379
380&arb {
381	status = "okay";
382};
383
384&cec_AO {
385	pinctrl-0 = <&cec_ao_a_h_pins>;
386	pinctrl-names = "default";
387	status = "disabled";
388	hdmi-phandle = <&hdmi_tx>;
389};
390
391&cecb_AO {
392	pinctrl-0 = <&cec_ao_b_h_pins>;
393	pinctrl-names = "default";
394	status = "okay";
395	hdmi-phandle = <&hdmi_tx>;
396};
397
398&clkc_audio {
399	status = "okay";
400};
401
402&cpu0 {
403	cpu-supply = <&vddcpu>;
404	operating-points-v2 = <&cpu_opp_table>;
405	clocks = <&clkc CLKID_CPU_CLK>;
406	clock-latency = <50000>;
407};
408
409&cpu1 {
410	cpu-supply = <&vddcpu>;
411	operating-points-v2 = <&cpu_opp_table>;
412	clocks = <&clkc CLKID_CPU_CLK>;
413	clock-latency = <50000>;
414};
415
416&cpu2 {
417	cpu-supply = <&vddcpu>;
418	operating-points-v2 = <&cpu_opp_table>;
419	clocks = <&clkc CLKID_CPU_CLK>;
420	clock-latency = <50000>;
421};
422
423&cpu3 {
424	cpu-supply = <&vddcpu>;
425	operating-points-v2 = <&cpu_opp_table>;
426	clocks = <&clkc CLKID_CPU_CLK>;
427	clock-latency = <50000>;
428};
429
430&clkc_audio {
431	status = "okay";
432};
433
434&cvbs_vdac_port {
435	cvbs_vdac_out: endpoint {
436		remote-endpoint = <&cvbs_connector_in>;
437	};
438};
439
440&ethmac {
441	status = "okay";
442	phy-handle = <&internal_ephy>;
443	phy-mode = "rmii";
444};
445
446&frddr_a {
447	status = "okay";
448};
449
450&frddr_b {
451	status = "okay";
452};
453
454&frddr_c {
455	status = "okay";
456};
457
458&hdmi_tx {
459	status = "okay";
460	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
461	pinctrl-names = "default";
462	hdmi-supply = <&vcc_5v>;
463};
464
465&hdmi_tx_tmds_port {
466	hdmi_tx_tmds_out: endpoint {
467		remote-endpoint = <&hdmi_connector_in>;
468	};
469};
470
471&ir {
472	status = "okay";
473	pinctrl-0 = <&remote_input_ao_pins>;
474	pinctrl-names = "default";
475};
476
477/* i2c Touch */
478&i2c0 {
479	status = "okay";
480	pinctrl-0 = <&i2c0_sda_z0_pins>, <&i2c0_sck_z1_pins>;
481	pinctrl-names = "default";
482};
483
484/* i2c CM */
485&i2c2 {
486	status = "okay";
487	pinctrl-0 = <&i2c2_sda_z_pins>, <&i2c2_sck_z_pins>;
488	pinctrl-names = "default";
489};
490
491/* i2c Audio */
492&i2c3 {
493	status = "okay";
494	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
495	pinctrl-names = "default";
496};
497
498&pwm_AO_cd {
499	pinctrl-0 = <&pwm_ao_d_e_pins>;
500	pinctrl-names = "default";
501	clocks = <&xtal>;
502	clock-names = "clkin1";
503	status = "okay";
504};
505
506/* SD card */
507&sd_emmc_b {
508	status = "okay";
509	pinctrl-0 = <&sdcard_c_pins>;
510	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
511	pinctrl-names = "default", "clk-gate";
512
513	bus-width = <4>;
514	cap-sd-highspeed;
515	max-frequency = <50000000>;
516	disable-wp;
517
518	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
519	vmmc-supply = <&vddao_3v3>;
520	vqmmc-supply = <&vddao_3v3>;
521};
522
523/* eMMC */
524&sd_emmc_c {
525	status = "okay";
526	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
527	pinctrl-1 = <&emmc_clk_gate_pins>;
528	pinctrl-names = "default", "clk-gate";
529
530	bus-width = <8>;
531	cap-mmc-highspeed;
532	mmc-ddr-1_8v;
533	mmc-hs200-1_8v;
534	max-frequency = <200000000>;
535	non-removable;
536	disable-wp;
537
538	mmc-pwrseq = <&emmc_pwrseq>;
539	vmmc-supply = <&vcc_3v3>;
540	vqmmc-supply = <&flash_1v8>;
541};
542
543&spdifin {
544	pinctrl-0 = <&spdif_in_h_pins>;
545	pinctrl-names = "default";
546	status = "okay";
547};
548
549&spdifout_a {
550	pinctrl-0 = <&spdif_ao_out_pins>;
551	pinctrl-names = "default";
552	status = "okay";
553};
554
555&spdifout_b {
556	status = "okay";
557};
558
559&tdmif_a {
560	pinctrl-0 = <&tdm_a_fs_pins>, <&tdm_a_sclk_pins>, <&tdm_a_dout0_pins> ;
561	pinctrl-names = "default";
562	status = "okay";
563};
564
565&tdmif_b {
566	pinctrl-0 = <&mclk0_a_pins>, <&tdm_b_fs_pins>, <&tdm_b_sclk_pins>,
567		    <&tdm_b_dout0_pins>;
568	pinctrl-names = "default";
569	status = "okay";
570
571	assigned-clocks = <&clkc_audio AUD_CLKID_TDM_MCLK_PAD0>,
572			  <&clkc_audio AUD_CLKID_TDM_SCLK_PAD1>,
573			  <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD1>;
574	assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_B_MCLK>,
575				 <&clkc_audio AUD_CLKID_MST_B_SCLK>,
576				 <&clkc_audio AUD_CLKID_MST_B_LRCLK>;
577	assigned-clock-rates = <0>, <0>, <0>;
578};
579
580&tdmif_c {
581	status = "okay";
582};
583
584&tdmin_a {
585	status = "okay";
586};
587
588&tdmin_b {
589	status = "okay";
590};
591
592&tdmin_c {
593	status = "okay";
594};
595
596&tdmin_lb {
597	status = "okay";
598};
599
600&tdmout_a {
601	status = "okay";
602};
603
604&tdmout_b {
605	status = "okay";
606};
607
608&tdmout_c {
609	status = "okay";
610};
611
612&toacodec {
613	status = "okay";
614};
615
616&toddr_a {
617	status = "okay";
618};
619
620&toddr_b {
621	status = "okay";
622};
623
624&toddr_c {
625	status = "okay";
626};
627
628&tohdmitx {
629	status = "okay";
630};
631
632&uart_AO {
633	status = "okay";
634	pinctrl-0 = <&uart_ao_a_pins>;
635	pinctrl-names = "default";
636};
637
638&usb {
639	status = "okay";
640	vbus-supply = <&usb_pwr_en>;
641};
642
643&usb2_phy0 {
644	phy-supply = <&vcc_5v>;
645};
646
647&usb2_phy1 {
648	phy-supply = <&vcc_5v>;
649};
650