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-sm1.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,sei610", "amlogic,sm1";
16	model = "SEI Robotics SEI610";
17
18	aliases {
19		serial0 = &uart_AO;
20		ethernet0 = &ethmac;
21	};
22
23	mono_dac: audio-codec-0 {
24		compatible = "maxim,max98357a";
25		#sound-dai-cells = <0>;
26		sound-name-prefix = "U16";
27		sdmode-gpios = <&gpio GPIOX_8 GPIO_ACTIVE_HIGH>;
28	};
29
30	dmics: audio-codec-1 {
31		#sound-dai-cells = <0>;
32		compatible = "dmic-codec";
33		num-channels = <2>;
34		wakeup-delay-ms = <50>;
35		status = "okay";
36		sound-name-prefix = "MIC";
37	};
38
39	chosen {
40		stdout-path = "serial0:115200n8";
41	};
42
43	emmc_pwrseq: emmc-pwrseq {
44		compatible = "mmc-pwrseq-emmc";
45		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
46	};
47
48	gpio-keys {
49		compatible = "gpio-keys-polled";
50		poll-interval = <100>;
51
52		key1 {
53			label = "A";
54			linux,code = <BTN_0>;
55			gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
56		};
57
58		key2 {
59			label = "B";
60			linux,code = <BTN_1>;
61			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
62		};
63
64		key3 {
65			label = "C";
66			linux,code = <BTN_2>;
67			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
68		};
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	leds {
83		compatible = "gpio-leds";
84
85		bluetooth {
86			label = "sei610:blue:bt";
87			gpios = <&gpio GPIOC_7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
88			default-state = "off";
89		};
90	};
91
92	pwmleds {
93		compatible = "pwm-leds";
94
95		power {
96			label = "sei610:red:power";
97			pwms = <&pwm_AO_ab 0 30518 0>;
98			max-brightness = <255>;
99			linux,default-trigger = "default-on";
100			active-low;
101		};
102	};
103
104	memory@0 {
105		device_type = "memory";
106		reg = <0x0 0x0 0x0 0x40000000>;
107	};
108
109	ao_5v: regulator-ao_5v {
110		compatible = "regulator-fixed";
111		regulator-name = "AO_5V";
112		regulator-min-microvolt = <5000000>;
113		regulator-max-microvolt = <5000000>;
114		vin-supply = <&dc_in>;
115		regulator-always-on;
116	};
117
118	dc_in: regulator-dc_in {
119		compatible = "regulator-fixed";
120		regulator-name = "DC_IN";
121		regulator-min-microvolt = <5000000>;
122		regulator-max-microvolt = <5000000>;
123		regulator-always-on;
124	};
125
126	emmc_1v8: regulator-emmc_1v8 {
127		compatible = "regulator-fixed";
128		regulator-name = "EMMC_1V8";
129		regulator-min-microvolt = <1800000>;
130		regulator-max-microvolt = <1800000>;
131		vin-supply = <&vddao_3v3>;
132		regulator-always-on;
133	};
134
135	vddao_3v3: regulator-vddao_3v3 {
136		compatible = "regulator-fixed";
137		regulator-name = "VDDAO_3V3";
138		regulator-min-microvolt = <3300000>;
139		regulator-max-microvolt = <3300000>;
140		vin-supply = <&dc_in>;
141		regulator-always-on;
142	};
143
144	/* Used by Tuner, RGB Led & IR Emitter LED array */
145	vddao_3v3_t: regulator-vddao_3v3_t {
146		compatible = "regulator-fixed";
147		regulator-name = "VDDAO_3V3_T";
148		regulator-min-microvolt = <3300000>;
149		regulator-max-microvolt = <3300000>;
150		vin-supply = <&vddao_3v3>;
151		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
152		enable-active-low;
153		regulator-always-on;
154	};
155
156	vddcpu: regulator-vddcpu {
157		/*
158		 * SY8120B1ABC DC/DC Regulator.
159		 */
160		compatible = "pwm-regulator";
161
162		regulator-name = "VDDCPU";
163		regulator-min-microvolt = <690000>;
164		regulator-max-microvolt = <1050000>;
165
166		vin-supply = <&dc_in>;
167
168		pwms = <&pwm_AO_cd 1 1500 0>;
169		pwm-dutycycle-range = <100 0>;
170
171		regulator-boot-on;
172		regulator-always-on;
173	};
174
175	vddio_ao1v8: regulator-vddio_ao1v8 {
176		compatible = "regulator-fixed";
177		regulator-name = "VDDIO_AO1V8";
178		regulator-min-microvolt = <1800000>;
179		regulator-max-microvolt = <1800000>;
180		vin-supply = <&vddao_3v3>;
181		regulator-always-on;
182	};
183
184	reserved-memory {
185		/* TEE Reserved Memory */
186		bl32_reserved: bl32@5000000 {
187			reg = <0x0 0x05300000 0x0 0x2000000>;
188			no-map;
189		};
190	};
191
192	sdio_pwrseq: sdio-pwrseq {
193		compatible = "mmc-pwrseq-simple";
194		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
195		clocks = <&wifi32k>;
196		clock-names = "ext_clock";
197	};
198
199	sound {
200		compatible = "amlogic,axg-sound-card";
201		model = "SM1-SEI610";
202		audio-aux-devs = <&tdmout_a>, <&tdmout_b>,
203				 <&tdmin_a>, <&tdmin_b>;
204		audio-routing = "TDMOUT_A IN 0", "FRDDR_A OUT 0",
205				"TDMOUT_A IN 1", "FRDDR_B OUT 0",
206				"TDMOUT_A IN 2", "FRDDR_C OUT 0",
207				"TDM_A Playback", "TDMOUT_A OUT",
208				"TDMOUT_B IN 0", "FRDDR_A OUT 1",
209				"TDMOUT_B IN 1", "FRDDR_B OUT 1",
210				"TDMOUT_B IN 2", "FRDDR_C OUT 1",
211				"TDM_B Playback", "TDMOUT_B OUT",
212				"TODDR_A IN 4", "PDM Capture",
213				"TODDR_B IN 4", "PDM Capture",
214				"TODDR_C IN 4", "PDM Capture",
215				"TDMIN_A IN 0", "TDM_A Capture",
216				"TDMIN_A IN 3", "TDM_A Loopback",
217				"TDMIN_B IN 0", "TDM_A Capture",
218				"TDMIN_B IN 3", "TDM_A Loopback",
219				"TDMIN_A IN 1", "TDM_B Capture",
220				"TDMIN_A IN 4", "TDM_B Loopback",
221				"TDMIN_B IN 1", "TDM_B Capture",
222				"TDMIN_B IN 4", "TDM_B Loopback",
223				"TODDR_A IN 0", "TDMIN_A OUT",
224				"TODDR_B IN 0", "TDMIN_A OUT",
225				"TODDR_C IN 0", "TDMIN_A OUT",
226				"TODDR_A IN 1", "TDMIN_B OUT",
227				"TODDR_B IN 1", "TDMIN_B OUT",
228				"TODDR_C IN 1", "TDMIN_B OUT";
229
230		assigned-clocks = <&clkc CLKID_MPLL2>,
231				  <&clkc CLKID_MPLL0>,
232				  <&clkc CLKID_MPLL1>;
233		assigned-clock-parents = <0>, <0>, <0>;
234		assigned-clock-rates = <294912000>,
235				       <270950400>,
236				       <393216000>;
237		status = "okay";
238
239		dai-link-0 {
240			sound-dai = <&frddr_a>;
241		};
242
243		dai-link-1 {
244			sound-dai = <&frddr_b>;
245		};
246
247		dai-link-2 {
248			sound-dai = <&frddr_c>;
249		};
250
251		dai-link-3 {
252			sound-dai = <&toddr_a>;
253		};
254
255		dai-link-4 {
256			sound-dai = <&toddr_b>;
257		};
258
259		dai-link-5 {
260			sound-dai = <&toddr_c>;
261		};
262
263		/* internal speaker interface */
264		dai-link-6 {
265			sound-dai = <&tdmif_a>;
266			dai-format = "i2s";
267			dai-tdm-slot-tx-mask-0 = <1 1>;
268			mclk-fs = <256>;
269
270			codec-0 {
271				sound-dai = <&mono_dac>;
272			};
273
274			codec-1 {
275				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_A>;
276			};
277		};
278
279		/* 8ch hdmi interface */
280		dai-link-7 {
281			sound-dai = <&tdmif_b>;
282			dai-format = "i2s";
283			dai-tdm-slot-tx-mask-0 = <1 1>;
284			dai-tdm-slot-tx-mask-1 = <1 1>;
285			dai-tdm-slot-tx-mask-2 = <1 1>;
286			dai-tdm-slot-tx-mask-3 = <1 1>;
287			mclk-fs = <256>;
288
289			codec {
290				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
291			};
292		};
293
294		/* internal digital mics */
295		dai-link-8 {
296			sound-dai = <&pdm>;
297
298			codec {
299				sound-dai = <&dmics>;
300			};
301		};
302
303		/* hdmi glue */
304		dai-link-9 {
305			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
306
307			codec {
308				sound-dai = <&hdmi_tx>;
309			};
310		};
311	};
312
313	wifi32k: wifi32k {
314		compatible = "pwm-clock";
315		#clock-cells = <0>;
316		clock-frequency = <32768>;
317		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
318	};
319};
320
321&arb {
322	status = "okay";
323};
324
325&cec_AO {
326	pinctrl-0 = <&cec_ao_a_h_pins>;
327	pinctrl-names = "default";
328	status = "disabled";
329	hdmi-phandle = <&hdmi_tx>;
330};
331
332&cecb_AO {
333	pinctrl-0 = <&cec_ao_b_h_pins>;
334	pinctrl-names = "default";
335	status = "okay";
336	hdmi-phandle = <&hdmi_tx>;
337};
338
339&clkc_audio {
340	status = "okay";
341};
342
343&cpu0 {
344	cpu-supply = <&vddcpu>;
345	operating-points-v2 = <&cpu_opp_table>;
346	clocks = <&clkc CLKID_CPU_CLK>;
347	clock-latency = <50000>;
348};
349
350&cpu1 {
351	cpu-supply = <&vddcpu>;
352	operating-points-v2 = <&cpu_opp_table>;
353	clocks = <&clkc CLKID_CPU1_CLK>;
354	clock-latency = <50000>;
355};
356
357&cpu2 {
358	cpu-supply = <&vddcpu>;
359	operating-points-v2 = <&cpu_opp_table>;
360	clocks = <&clkc CLKID_CPU2_CLK>;
361	clock-latency = <50000>;
362};
363
364&cpu3 {
365	cpu-supply = <&vddcpu>;
366	operating-points-v2 = <&cpu_opp_table>;
367	clocks = <&clkc CLKID_CPU3_CLK>;
368	clock-latency = <50000>;
369};
370
371&ethmac {
372	status = "okay";
373	phy-handle = <&internal_ephy>;
374	phy-mode = "rmii";
375};
376
377&frddr_a {
378	status = "okay";
379};
380
381&frddr_b {
382	status = "okay";
383};
384
385&frddr_c {
386	status = "okay";
387};
388
389&hdmi_tx {
390	status = "okay";
391	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
392	pinctrl-names = "default";
393};
394
395&hdmi_tx_tmds_port {
396	hdmi_tx_tmds_out: endpoint {
397		remote-endpoint = <&hdmi_connector_in>;
398	};
399};
400
401&i2c3 {
402	status = "okay";
403	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
404	pinctrl-names = "default";
405};
406
407&ir {
408	status = "okay";
409	pinctrl-0 = <&remote_input_ao_pins>;
410	pinctrl-names = "default";
411};
412
413&pdm {
414	pinctrl-0 = <&pdm_din0_z_pins>, <&pdm_dclk_z_pins>;
415	pinctrl-names = "default";
416	status = "okay";
417};
418
419&pwm_AO_ab {
420	status = "okay";
421	pinctrl-0 = <&pwm_ao_a_pins>;
422	pinctrl-names = "default";
423	clocks = <&xtal>;
424	clock-names = "clkin0";
425};
426
427&pwm_AO_cd {
428	pinctrl-0 = <&pwm_ao_d_e_pins>;
429	pinctrl-names = "default";
430	clocks = <&xtal>;
431	clock-names = "clkin1";
432	status = "okay";
433};
434
435&pwm_ef {
436	status = "okay";
437	pinctrl-0 = <&pwm_e_pins>;
438	pinctrl-names = "default";
439	clocks = <&xtal>;
440	clock-names = "clkin0";
441};
442
443&saradc {
444	status = "okay";
445	vref-supply = <&vddio_ao1v8>;
446};
447
448/* SDIO */
449&sd_emmc_a {
450	status = "okay";
451	pinctrl-0 = <&sdio_pins>;
452	pinctrl-1 = <&sdio_clk_gate_pins>;
453	pinctrl-names = "default", "clk-gate";
454	#address-cells = <1>;
455	#size-cells = <0>;
456
457	bus-width = <4>;
458	cap-sd-highspeed;
459	sd-uhs-sdr50;
460	max-frequency = <100000000>;
461
462	non-removable;
463	disable-wp;
464
465	/* WiFi firmware requires power to be kept while in suspend */
466	keep-power-in-suspend;
467
468	mmc-pwrseq = <&sdio_pwrseq>;
469
470	vmmc-supply = <&vddao_3v3>;
471	vqmmc-supply = <&vddio_ao1v8>;
472
473	brcmf: wifi@1 {
474		reg = <1>;
475		compatible = "brcm,bcm4329-fmac";
476	};
477};
478
479/* SD card */
480&sd_emmc_b {
481	status = "okay";
482	pinctrl-0 = <&sdcard_c_pins>;
483	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
484	pinctrl-names = "default", "clk-gate";
485
486	bus-width = <4>;
487	cap-sd-highspeed;
488	max-frequency = <50000000>;
489	disable-wp;
490
491	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
492	vmmc-supply = <&vddao_3v3>;
493	vqmmc-supply = <&vddao_3v3>;
494};
495
496/* eMMC */
497&sd_emmc_c {
498	status = "okay";
499	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
500	pinctrl-1 = <&emmc_clk_gate_pins>;
501	pinctrl-names = "default", "clk-gate";
502
503	bus-width = <8>;
504	cap-mmc-highspeed;
505	mmc-ddr-1_8v;
506	mmc-hs200-1_8v;
507	max-frequency = <200000000>;
508	non-removable;
509	disable-wp;
510
511	mmc-pwrseq = <&emmc_pwrseq>;
512	vmmc-supply = <&vddao_3v3>;
513	vqmmc-supply = <&emmc_1v8>;
514};
515
516&tdmif_a {
517	pinctrl-0 = <&tdm_a_dout0_pins>, <&tdm_a_fs_pins>, <&tdm_a_sclk_pins>;
518	pinctrl-names = "default";
519	status = "okay";
520
521	assigned-clocks = <&clkc_audio AUD_CLKID_TDM_SCLK_PAD0>,
522			  <&clkc_audio AUD_CLKID_TDM_LRCLK_PAD0>;
523	assigned-clock-parents = <&clkc_audio AUD_CLKID_MST_A_SCLK>,
524				 <&clkc_audio AUD_CLKID_MST_A_LRCLK>;
525	assigned-clock-rates = <0>, <0>;
526};
527
528&tdmif_b {
529	status = "okay";
530};
531
532&tdmin_a {
533	status = "okay";
534};
535
536&tdmin_b {
537	status = "okay";
538};
539
540&tdmout_a {
541	status = "okay";
542};
543
544&tdmout_b {
545	status = "okay";
546};
547
548&toddr_a {
549	status = "okay";
550};
551
552&toddr_b {
553	status = "okay";
554};
555
556&toddr_c {
557	status = "okay";
558};
559
560&tohdmitx {
561	status = "okay";
562};
563
564&uart_A {
565	status = "okay";
566	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
567	pinctrl-names = "default";
568	uart-has-rtscts;
569
570	bluetooth {
571		compatible = "brcm,bcm43438-bt";
572		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
573		max-speed = <2000000>;
574		clocks = <&wifi32k>;
575		clock-names = "lpo";
576		vbat-supply = <&vddao_3v3>;
577		vddio-supply = <&vddio_ao1v8>;
578	};
579};
580
581/* Exposed via the on-board USB to Serial FT232RL IC */
582&uart_AO {
583	status = "okay";
584	pinctrl-0 = <&uart_ao_a_pins>;
585	pinctrl-names = "default";
586};
587
588&usb {
589	status = "okay";
590	dr_mode = "otg";
591};
592