1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre SAS. 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/input/input.h>
11#include <dt-bindings/gpio/meson-g12a-gpio.h>
12#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
13
14/ {
15	compatible = "seirobotics,sei510", "amlogic,g12a";
16	model = "SEI Robotics SEI510";
17
18	adc_keys {
19		compatible = "adc-keys";
20		io-channels = <&saradc 0>;
21		io-channel-names = "buttons";
22		keyup-threshold-microvolt = <1800000>;
23
24		button-onoff {
25			label = "On/Off";
26			linux,code = <KEY_POWER>;
27			press-threshold-microvolt = <1700000>;
28		};
29	};
30
31	aliases {
32		serial0 = &uart_AO;
33		ethernet0 = &ethmac;
34	};
35
36	mono_dac: audio-codec-0 {
37		compatible = "maxim,max98357a";
38		#sound-dai-cells = <0>;
39		sound-name-prefix = "U16";
40		sdmode-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>;
41	};
42
43	dmics: audio-codec-1 {
44		#sound-dai-cells = <0>;
45		compatible = "dmic-codec";
46		num-channels = <2>;
47		wakeup-delay-ms = <50>;
48		status = "okay";
49		sound-name-prefix = "MIC";
50	};
51
52	chosen {
53		stdout-path = "serial0:115200n8";
54	};
55
56	cvbs-connector {
57		compatible = "composite-video-connector";
58
59		port {
60			cvbs_connector_in: endpoint {
61				remote-endpoint = <&cvbs_vdac_out>;
62			};
63		};
64	};
65
66	emmc_pwrseq: emmc-pwrseq {
67		compatible = "mmc-pwrseq-emmc";
68		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
69	};
70
71	hdmi-connector {
72		compatible = "hdmi-connector";
73		type = "a";
74
75		port {
76			hdmi_connector_in: endpoint {
77				remote-endpoint = <&hdmi_tx_tmds_out>;
78			};
79		};
80	};
81
82	memory@0 {
83		device_type = "memory";
84		reg = <0x0 0x0 0x0 0x40000000>;
85	};
86
87	ao_5v: regulator-ao_5v {
88		compatible = "regulator-fixed";
89		regulator-name = "AO_5V";
90		regulator-min-microvolt = <5000000>;
91		regulator-max-microvolt = <5000000>;
92		vin-supply = <&dc_in>;
93		regulator-always-on;
94	};
95
96	dc_in: regulator-dc_in {
97		compatible = "regulator-fixed";
98		regulator-name = "DC_IN";
99		regulator-min-microvolt = <5000000>;
100		regulator-max-microvolt = <5000000>;
101		regulator-always-on;
102	};
103
104	emmc_1v8: regulator-emmc_1v8 {
105		compatible = "regulator-fixed";
106		regulator-name = "EMMC_1V8";
107		regulator-min-microvolt = <1800000>;
108		regulator-max-microvolt = <1800000>;
109		vin-supply = <&vddao_3v3>;
110		regulator-always-on;
111	};
112
113	vddao_3v3: regulator-vddao_3v3 {
114		compatible = "regulator-fixed";
115		regulator-name = "VDDAO_3V3";
116		regulator-min-microvolt = <3300000>;
117		regulator-max-microvolt = <3300000>;
118		vin-supply = <&dc_in>;
119		regulator-always-on;
120	};
121
122	vddao_3v3_t: regultor-vddao_3v3_t {
123		compatible = "regulator-fixed";
124		regulator-name = "VDDAO_3V3_T";
125		regulator-min-microvolt = <3300000>;
126		regulator-max-microvolt = <3300000>;
127		vin-supply = <&vddao_3v3>;
128		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
129		enable-active-high;
130	};
131
132	vddio_ao1v8: regulator-vddio_ao1v8 {
133		compatible = "regulator-fixed";
134		regulator-name = "VDDIO_AO1V8";
135		regulator-min-microvolt = <1800000>;
136		regulator-max-microvolt = <1800000>;
137		vin-supply = <&vddao_3v3>;
138		regulator-always-on;
139	};
140
141	reserved-memory {
142		/* TEE Reserved Memory */
143		bl32_reserved: bl32@5000000 {
144			reg = <0x0 0x05300000 0x0 0x2000000>;
145			no-map;
146		};
147	};
148
149	sdio_pwrseq: sdio-pwrseq {
150		compatible = "mmc-pwrseq-simple";
151		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
152		clocks = <&wifi32k>;
153		clock-names = "ext_clock";
154	};
155
156	wifi32k: wifi32k {
157		compatible = "pwm-clock";
158		#clock-cells = <0>;
159		clock-frequency = <32768>;
160		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
161	};
162
163	sound {
164		compatible = "amlogic,axg-sound-card";
165		model = "G12A-SEI510";
166		audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
167				 <&tdmin_a>, <&tdmin_b>;
168		audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
169				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
170				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
171				"TDM_A Playback", "TDMOUT_A OUT",
172				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
173				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
174				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
175				"TDM_B Playback", "TDMOUT_B OUT",
176				"TODDR_A IN 4", "PDM Capture",
177				"TODDR_B IN 4", "PDM Capture",
178				"TODDR_C IN 4", "PDM Capture",
179				"TDMIN_A IN 0", "TDM_A Capture",
180				"TDMIN_A IN 3", "TDM_A Loopback",
181				"TDMIN_B IN 0", "TDM_A Capture",
182				"TDMIN_B IN 3", "TDM_A Loopback",
183				"TDMIN_A IN 1", "TDM_B Capture",
184				"TDMIN_A IN 4", "TDM_B Loopback",
185				"TDMIN_B IN 1", "TDM_B Capture",
186				"TDMIN_B IN 4", "TDM_B Loopback",
187				"TODDR_A IN 0", "TDMIN_A OUT",
188				"TODDR_B IN 0", "TDMIN_A OUT",
189				"TODDR_C IN 0", "TDMIN_A OUT",
190				"TODDR_A IN 1", "TDMIN_B OUT",
191				"TODDR_B IN 1", "TDMIN_B OUT",
192				"TODDR_C IN 1", "TDMIN_B OUT";
193
194		assigned-clocks = <&clkc CLKID_MPLL2>,
195				  <&clkc CLKID_MPLL0>,
196				  <&clkc CLKID_MPLL1>;
197		assigned-clock-parents = <0>, <0>, <0>;
198		assigned-clock-rates = <294912000>,
199				       <270950400>,
200				       <393216000>;
201		status = "okay";
202
203		dai-link-0 {
204			sound-dai = <&frddr_a>;
205		};
206
207		dai-link-1 {
208			sound-dai = <&frddr_b>;
209		};
210
211		dai-link-2 {
212			sound-dai = <&frddr_c>;
213		};
214
215		dai-link-3 {
216			sound-dai = <&toddr_a>;
217		};
218
219		dai-link-4 {
220			sound-dai = <&toddr_b>;
221		};
222
223		dai-link-5 {
224			sound-dai = <&toddr_c>;
225		};
226
227		/* internal speaker interface */
228		dai-link-6 {
229			sound-dai = <&tdmif_a>;
230			dai-format = "i2s";
231			dai-tdm-slot-tx-mask-0 = <1 1>;
232			mclk-fs = <256>;
233
234			codec-0 {
235				sound-dai = <&mono_dac>;
236			};
237
238			codec-1 {
239				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
240			};
241		};
242
243		/* 8ch hdmi interface */
244		dai-link-7 {
245			sound-dai = <&tdmif_b>;
246			dai-format = "i2s";
247			dai-tdm-slot-tx-mask-0 = <1 1>;
248			dai-tdm-slot-tx-mask-1 = <1 1>;
249			dai-tdm-slot-tx-mask-2 = <1 1>;
250			dai-tdm-slot-tx-mask-3 = <1 1>;
251			mclk-fs = <256>;
252
253			codec@0 {
254				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
255			};
256		};
257
258		/* internal digital mics */
259		dai-link-8 {
260			sound-dai = <&pdm>;
261
262			codec {
263				sound-dai = <&dmics>;
264			};
265		};
266
267		/* hdmi glue */
268		dai-link-9 {
269			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
270
271			codec {
272				sound-dai = <&hdmi_tx>;
273			};
274		};
275	};
276};
277
278&arb {
279	status = "okay";
280};
281
282&cec_AO {
283	pinctrl-0 = <&cec_ao_a_h_pins>;
284	pinctrl-names = "default";
285	status = "disabled";
286	hdmi-phandle = <&hdmi_tx>;
287};
288
289&cecb_AO {
290	pinctrl-0 = <&cec_ao_b_h_pins>;
291	pinctrl-names = "default";
292	status = "okay";
293	hdmi-phandle = <&hdmi_tx>;
294};
295
296&clkc_audio {
297	status = "okay";
298};
299
300&cvbs_vdac_port {
301	cvbs_vdac_out: endpoint {
302		remote-endpoint = <&cvbs_connector_in>;
303	};
304};
305
306&ethmac {
307	status = "okay";
308	phy-handle = <&internal_ephy>;
309	phy-mode = "rmii";
310};
311
312&frddr_a {
313	status = "okay";
314};
315
316&frddr_b {
317	status = "okay";
318};
319
320&frddr_c {
321	status = "okay";
322};
323
324&hdmi_tx {
325	status = "okay";
326	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
327	pinctrl-names = "default";
328};
329
330&hdmi_tx_tmds_port {
331	hdmi_tx_tmds_out: endpoint {
332		remote-endpoint = <&hdmi_connector_in>;
333	};
334};
335
336&i2c3 {
337	status = "okay";
338	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
339	pinctrl-names = "default";
340};
341
342&pwm_ef {
343	status = "okay";
344	pinctrl-0 = <&pwm_e_pins>;
345	pinctrl-names = "default";
346	clocks = <&xtal>;
347	clock-names = "clkin0";
348};
349
350&pdm {
351	pinctrl-0 = <&pdm_din0_z_pins>, <&pdm_din1_z_pins>,
352		    <&pdm_din2_z_pins>, <&pdm_din3_z_pins>,
353		    <&pdm_dclk_z_pins>;
354	pinctrl-names = "default";
355	status = "okay";
356};
357
358&saradc {
359	status = "okay";
360	vref-supply = <&vddio_ao1v8>;
361};
362
363/* SDIO */
364&sd_emmc_a {
365	status = "okay";
366	pinctrl-0 = <&sdio_pins>;
367	pinctrl-1 = <&sdio_clk_gate_pins>;
368	pinctrl-names = "default", "clk-gate";
369	#address-cells = <1>;
370	#size-cells = <0>;
371
372	bus-width = <4>;
373	cap-sd-highspeed;
374	sd-uhs-sdr50;
375	max-frequency = <100000000>;
376
377	non-removable;
378	disable-wp;
379
380	mmc-pwrseq = <&sdio_pwrseq>;
381
382	vmmc-supply = <&vddao_3v3>;
383	vqmmc-supply = <&vddio_ao1v8>;
384
385	brcmf: wifi@1 {
386		reg = <1>;
387		compatible = "brcm,bcm4329-fmac";
388	};
389};
390
391/* SD card */
392&sd_emmc_b {
393	status = "okay";
394	pinctrl-0 = <&sdcard_c_pins>;
395	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
396	pinctrl-names = "default", "clk-gate";
397
398	bus-width = <4>;
399	cap-sd-highspeed;
400	max-frequency = <50000000>;
401	disable-wp;
402
403	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
404	vmmc-supply = <&vddao_3v3>;
405	vqmmc-supply = <&vddao_3v3>;
406};
407
408/* eMMC */
409&sd_emmc_c {
410	status = "okay";
411	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
412	pinctrl-1 = <&emmc_clk_gate_pins>;
413	pinctrl-names = "default", "clk-gate";
414
415	bus-width = <8>;
416	cap-mmc-highspeed;
417	mmc-ddr-1_8v;
418	mmc-hs200-1_8v;
419	max-frequency = <200000000>;
420	non-removable;
421	disable-wp;
422
423	mmc-pwrseq = <&emmc_pwrseq>;
424	vmmc-supply = <&vddao_3v3>;
425	vqmmc-supply = <&emmc_1v8>;
426};
427
428&tdmif_a {
429	pinctrl-0 = <&tdm_a_dout0_pins>, <&tdm_a_fs_pins>, <&tdm_a_sclk_pins>;
430	pinctrl-names = "default";
431	status = "okay";
432
433	assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD0>,
434			  <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD0>;
435	assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
436				 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
437	assigned-clock-rates = <0>, <0>;
438};
439
440&tdmif_b {
441	status = "okay";
442};
443
444&tdmin_a {
445	status = "okay";
446};
447
448&tdmin_b {
449	status = "okay";
450};
451
452&tdmout_a {
453	status = "okay";
454};
455
456&tdmout_b {
457	status = "okay";
458};
459
460&toddr_a {
461	status = "okay";
462};
463
464&toddr_b {
465	status = "okay";
466};
467
468&toddr_c {
469	status = "okay";
470};
471
472&tohdmitx {
473	status = "okay";
474};
475
476&uart_A {
477	status = "okay";
478	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
479	pinctrl-names = "default";
480	uart-has-rtscts;
481
482	bluetooth {
483		compatible = "brcm,bcm43438-bt";
484		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
485		max-speed = <2000000>;
486		clocks = <&wifi32k>;
487		clock-names = "lpo";
488		vbat-supply = <&vddao_3v3>;
489		vddio-supply = <&vddio_ao1v8>;
490	};
491};
492
493&uart_AO {
494	status = "okay";
495	pinctrl-0 = <&uart_ao_a_pins>;
496	pinctrl-names = "default";
497};
498
499&usb {
500	status = "okay";
501	dr_mode = "host";
502};
503