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