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
13/ {
14	compatible = "seirobotics,sei610", "amlogic,sm1";
15	model = "SEI Robotics SEI610";
16
17	aliases {
18		serial0 = &uart_AO;
19		ethernet0 = &ethmac;
20	};
21
22	emmc_pwrseq: emmc-pwrseq {
23		compatible = "mmc-pwrseq-emmc";
24		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
25	};
26
27	gpio-keys {
28		compatible = "gpio-keys-polled";
29		poll-interval = <100>;
30
31		key1 {
32			label = "A";
33			linux,code = <BTN_0>;
34			gpios = <&gpio GPIOH_6 GPIO_ACTIVE_LOW>;
35		};
36
37		key2 {
38			label = "B";
39			linux,code = <BTN_1>;
40			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
41		};
42
43		key3 {
44			label = "C";
45			linux,code = <BTN_2>;
46			gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
47		};
48	};
49
50	hdmi-connector {
51		compatible = "hdmi-connector";
52		type = "a";
53
54		port {
55			hdmi_connector_in: endpoint {
56				remote-endpoint = <&hdmi_tx_tmds_out>;
57			};
58		};
59	};
60
61	leds {
62		compatible = "gpio-leds";
63
64		bluetooth {
65			label = "sei610:blue:bt";
66			gpios = <&gpio GPIOC_7 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
67			default-state = "off";
68		};
69	};
70
71	pwmleds {
72		compatible = "pwm-leds";
73
74		power {
75			label = "sei610:red:power";
76			pwms = <&pwm_AO_ab 0 30518 0>;
77			max-brightness = <255>;
78			linux,default-trigger = "default-on";
79			active-low;
80		};
81	};
82
83	memory@0 {
84		device_type = "memory";
85		reg = <0x0 0x0 0x0 0x40000000>;
86	};
87
88	ao_5v: regulator-ao_5v {
89		compatible = "regulator-fixed";
90		regulator-name = "AO_5V";
91		regulator-min-microvolt = <5000000>;
92		regulator-max-microvolt = <5000000>;
93		vin-supply = <&dc_in>;
94		regulator-always-on;
95	};
96
97	dc_in: regulator-dc_in {
98		compatible = "regulator-fixed";
99		regulator-name = "DC_IN";
100		regulator-min-microvolt = <5000000>;
101		regulator-max-microvolt = <5000000>;
102		regulator-always-on;
103	};
104
105	emmc_1v8: regulator-emmc_1v8 {
106		compatible = "regulator-fixed";
107		regulator-name = "EMMC_1V8";
108		regulator-min-microvolt = <1800000>;
109		regulator-max-microvolt = <1800000>;
110		vin-supply = <&vddao_3v3>;
111		regulator-always-on;
112	};
113
114	vddao_3v3: regulator-vddao_3v3 {
115		compatible = "regulator-fixed";
116		regulator-name = "VDDAO_3V3";
117		regulator-min-microvolt = <3300000>;
118		regulator-max-microvolt = <3300000>;
119		vin-supply = <&dc_in>;
120		regulator-always-on;
121	};
122
123	/* Used by Tuner, RGB Led & IR Emitter LED array */
124	vddao_3v3_t: regulator-vddao_3v3_t {
125		compatible = "regulator-fixed";
126		regulator-name = "VDDAO_3V3_T";
127		regulator-min-microvolt = <3300000>;
128		regulator-max-microvolt = <3300000>;
129		vin-supply = <&vddao_3v3>;
130		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
131		enable-active-low;
132		regulator-always-on;
133	};
134
135	vddcpu: regulator-vddcpu {
136		/*
137		 * SY8120B1ABC DC/DC Regulator.
138		 */
139		compatible = "pwm-regulator";
140
141		regulator-name = "VDDCPU";
142		regulator-min-microvolt = <690000>;
143		regulator-max-microvolt = <1050000>;
144
145		vin-supply = <&dc_in>;
146
147		pwms = <&pwm_AO_cd 1 1500 0>;
148		pwm-dutycycle-range = <100 0>;
149
150		regulator-boot-on;
151		regulator-always-on;
152	};
153
154	vddio_ao1v8: regulator-vddio_ao1v8 {
155		compatible = "regulator-fixed";
156		regulator-name = "VDDIO_AO1V8";
157		regulator-min-microvolt = <1800000>;
158		regulator-max-microvolt = <1800000>;
159		vin-supply = <&vddao_3v3>;
160		regulator-always-on;
161	};
162
163	reserved-memory {
164		/* TEE Reserved Memory */
165		bl32_reserved: bl32@5000000 {
166			reg = <0x0 0x05300000 0x0 0x2000000>;
167			no-map;
168		};
169	};
170
171	sdio_pwrseq: sdio-pwrseq {
172		compatible = "mmc-pwrseq-simple";
173		reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
174		clocks = <&wifi32k>;
175		clock-names = "ext_clock";
176	};
177
178	wifi32k: wifi32k {
179		compatible = "pwm-clock";
180		#clock-cells = <0>;
181		clock-frequency = <32768>;
182		pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
183	};
184};
185
186&cec_AO {
187	pinctrl-0 = <&cec_ao_a_h_pins>;
188	pinctrl-names = "default";
189	status = "disabled";
190	hdmi-phandle = <&hdmi_tx>;
191};
192
193&cecb_AO {
194	pinctrl-0 = <&cec_ao_b_h_pins>;
195	pinctrl-names = "default";
196	status = "okay";
197	hdmi-phandle = <&hdmi_tx>;
198};
199
200&cpu0 {
201	cpu-supply = <&vddcpu>;
202	operating-points-v2 = <&cpu_opp_table>;
203	clocks = <&clkc CLKID_CPU_CLK>;
204	clock-latency = <50000>;
205};
206
207&cpu1 {
208	cpu-supply = <&vddcpu>;
209	operating-points-v2 = <&cpu_opp_table>;
210	clocks = <&clkc CLKID_CPU1_CLK>;
211	clock-latency = <50000>;
212};
213
214&cpu2 {
215	cpu-supply = <&vddcpu>;
216	operating-points-v2 = <&cpu_opp_table>;
217	clocks = <&clkc CLKID_CPU2_CLK>;
218	clock-latency = <50000>;
219};
220
221&cpu3 {
222	cpu-supply = <&vddcpu>;
223	operating-points-v2 = <&cpu_opp_table>;
224	clocks = <&clkc CLKID_CPU3_CLK>;
225	clock-latency = <50000>;
226};
227
228&ethmac {
229	status = "okay";
230	phy-handle = <&internal_ephy>;
231	phy-mode = "rmii";
232};
233
234&hdmi_tx {
235	status = "okay";
236	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
237	pinctrl-names = "default";
238};
239
240&hdmi_tx_tmds_port {
241	hdmi_tx_tmds_out: endpoint {
242		remote-endpoint = <&hdmi_connector_in>;
243	};
244};
245
246&i2c3 {
247	status = "okay";
248	pinctrl-0 = <&i2c3_sda_a_pins>, <&i2c3_sck_a_pins>;
249	pinctrl-names = "default";
250};
251
252&ir {
253	status = "okay";
254	pinctrl-0 = <&remote_input_ao_pins>;
255	pinctrl-names = "default";
256};
257
258&pwm_AO_ab {
259	status = "okay";
260	pinctrl-0 = <&pwm_ao_a_pins>;
261	pinctrl-names = "default";
262	clocks = <&xtal>;
263	clock-names = "clkin0";
264};
265
266&pwm_AO_cd {
267	pinctrl-0 = <&pwm_ao_d_e_pins>;
268	pinctrl-names = "default";
269	clocks = <&xtal>;
270	clock-names = "clkin1";
271	status = "okay";
272};
273
274&pwm_ef {
275	status = "okay";
276	pinctrl-0 = <&pwm_e_pins>;
277	pinctrl-names = "default";
278	clocks = <&xtal>;
279	clock-names = "clkin0";
280};
281
282&saradc {
283	status = "okay";
284	vref-supply = <&vddio_ao1v8>;
285};
286
287/* SDIO */
288&sd_emmc_a {
289	status = "okay";
290	pinctrl-0 = <&sdio_pins>;
291	pinctrl-1 = <&sdio_clk_gate_pins>;
292	pinctrl-names = "default", "clk-gate";
293	#address-cells = <1>;
294	#size-cells = <0>;
295
296	bus-width = <4>;
297	cap-sd-highspeed;
298	sd-uhs-sdr50;
299	max-frequency = <100000000>;
300
301	non-removable;
302	disable-wp;
303
304	mmc-pwrseq = <&sdio_pwrseq>;
305
306	vmmc-supply = <&vddao_3v3>;
307	vqmmc-supply = <&vddio_ao1v8>;
308
309	brcmf: wifi@1 {
310		reg = <1>;
311		compatible = "brcm,bcm4329-fmac";
312	};
313};
314
315/* SD card */
316&sd_emmc_b {
317	status = "okay";
318	pinctrl-0 = <&sdcard_c_pins>;
319	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
320	pinctrl-names = "default", "clk-gate";
321
322	bus-width = <4>;
323	cap-sd-highspeed;
324	max-frequency = <50000000>;
325	disable-wp;
326
327	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
328	vmmc-supply = <&vddao_3v3>;
329	vqmmc-supply = <&vddao_3v3>;
330};
331
332/* eMMC */
333&sd_emmc_c {
334	status = "okay";
335	pinctrl-0 = <&emmc_pins>, <&emmc_ds_pins>;
336	pinctrl-1 = <&emmc_clk_gate_pins>;
337	pinctrl-names = "default", "clk-gate";
338
339	bus-width = <8>;
340	cap-mmc-highspeed;
341	mmc-ddr-1_8v;
342	mmc-hs200-1_8v;
343	max-frequency = <200000000>;
344	non-removable;
345	disable-wp;
346
347	mmc-pwrseq = <&emmc_pwrseq>;
348	vmmc-supply = <&vddao_3v3>;
349	vqmmc-supply = <&emmc_1v8>;
350};
351
352&uart_A {
353	status = "okay";
354	pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
355	pinctrl-names = "default";
356	uart-has-rtscts;
357
358	bluetooth {
359		compatible = "brcm,bcm43438-bt";
360		shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
361		max-speed = <2000000>;
362		clocks = <&wifi32k>;
363		clock-names = "lpo";
364		vbat-supply = <&vddao_3v3>;
365		vddio-supply = <&vddio_ao1v8>;
366	};
367};
368
369/* Exposed via the on-board USB to Serial FT232RL IC */
370&uart_AO {
371	status = "okay";
372	pinctrl-0 = <&uart_ao_a_pins>;
373	pinctrl-names = "default";
374};
375
376&usb {
377	status = "okay";
378	dr_mode = "otg";
379};
380