xref: /linux/arch/arm64/boot/dts/amlogic/meson-sm1-odroid.dtsi (revision ec71f661a572a770d7c861cd52a50cbbb0e1a8d1)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2020 Dongjin Kim <tobetter@gmail.com>
4 */
5
6#include "meson-sm1.dtsi"
7#include <dt-bindings/gpio/meson-g12a-gpio.h>
8#include <dt-bindings/leds/common.h>
9#include <dt-bindings/sound/meson-g12a-tohdmitx.h>
10
11/ {
12	aliases {
13		serial0 = &uart_AO;
14		ethernet0 = &ethmac;
15	};
16
17	chosen {
18		stdout-path = "serial0:115200n8";
19	};
20
21	memory@0 {
22		device_type = "memory";
23		reg = <0x0 0x0 0x0 0x40000000>;
24	};
25
26	emmc_pwrseq: emmc-pwrseq {
27		compatible = "mmc-pwrseq-emmc";
28		reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
29	};
30
31	tflash_vdd: regulator-tflash-vdd {
32		compatible = "regulator-fixed";
33
34		regulator-name = "TFLASH_VDD";
35		regulator-min-microvolt = <3300000>;
36		regulator-max-microvolt = <3300000>;
37
38		gpio = <&gpio_ao GPIOAO_3 GPIO_OPEN_DRAIN>;
39		enable-active-high;
40		regulator-always-on;
41	};
42
43	tf_io: gpio-regulator-tf-io {
44		compatible = "regulator-gpio";
45
46		regulator-name = "TF_IO";
47		regulator-min-microvolt = <1800000>;
48		regulator-max-microvolt = <3300000>;
49		vin-supply = <&vcc_5v>;
50
51		enable-gpios = <&gpio_ao GPIOE_2 GPIO_OPEN_DRAIN>;
52		enable-active-high;
53		regulator-always-on;
54
55		gpios = <&gpio_ao GPIOAO_6 GPIO_OPEN_SOURCE>;
56		gpios-states = <0>;
57
58		states = <3300000 0>,
59			 <1800000 1>;
60	};
61
62	flash_1v8: regulator-flash-1v8 {
63		compatible = "regulator-fixed";
64		regulator-name = "FLASH_1V8";
65		regulator-min-microvolt = <1800000>;
66		regulator-max-microvolt = <1800000>;
67		vin-supply = <&vcc_3v3>;
68		regulator-always-on;
69	};
70
71	main_12v: regulator-main-12v {
72		compatible = "regulator-fixed";
73		regulator-name = "12V";
74		regulator-min-microvolt = <12000000>;
75		regulator-max-microvolt = <12000000>;
76		regulator-always-on;
77	};
78
79	vcc_5v: regulator-vcc-5v {
80		compatible = "regulator-fixed";
81		regulator-name = "5V";
82		regulator-min-microvolt = <5000000>;
83		regulator-max-microvolt = <5000000>;
84		regulator-always-on;
85		vin-supply = <&main_12v>;
86		gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
87		enable-active-high;
88	};
89
90	vcc_1v8: regulator-vcc-1v8 {
91		compatible = "regulator-fixed";
92		regulator-name = "VCC_1V8";
93		regulator-min-microvolt = <1800000>;
94		regulator-max-microvolt = <1800000>;
95		vin-supply = <&vcc_3v3>;
96		regulator-always-on;
97	};
98
99	vcc_3v3: regulator-vcc-3v3 {
100		compatible = "regulator-fixed";
101		regulator-name = "VCC_3V3";
102		regulator-min-microvolt = <3300000>;
103		regulator-max-microvolt = <3300000>;
104		vin-supply = <&vddao_3v3>;
105		regulator-always-on;
106		/* FIXME: actually controlled by VDDCPU_B_EN */
107	};
108
109	vddcpu: regulator-vddcpu {
110		/*
111		 * MP8756GD Regulator.
112		 */
113		compatible = "pwm-regulator";
114
115		regulator-name = "VDDCPU";
116		regulator-min-microvolt = <721000>;
117		regulator-max-microvolt = <1022000>;
118
119		pwm-supply = <&main_12v>;
120
121		pwms = <&pwm_AO_cd 1 1250 0>;
122		pwm-dutycycle-range = <100 0>;
123
124		regulator-boot-on;
125		regulator-always-on;
126	};
127
128	usb_pwr_en: regulator-usb-pwr-en {
129		compatible = "regulator-fixed";
130		regulator-name = "USB_PWR_EN";
131		regulator-min-microvolt = <5000000>;
132		regulator-max-microvolt = <5000000>;
133		vin-supply = <&vcc_5v>;
134
135		/* Connected to the microUSB port power enable */
136		gpio = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_HIGH>;
137		enable-active-high;
138	};
139
140	vddao_1v8: regulator-vddao-1v8 {
141		compatible = "regulator-fixed";
142		regulator-name = "VDDAO_1V8";
143		regulator-min-microvolt = <1800000>;
144		regulator-max-microvolt = <1800000>;
145		vin-supply = <&vddao_3v3>;
146		regulator-always-on;
147	};
148
149	vddao_3v3: regulator-vddao-3v3 {
150		compatible = "regulator-fixed";
151		regulator-name = "VDDAO_3V3";
152		regulator-min-microvolt = <3300000>;
153		regulator-max-microvolt = <3300000>;
154		vin-supply = <&main_12v>;
155		regulator-always-on;
156	};
157
158	hdmi-connector {
159		compatible = "hdmi-connector";
160		type = "a";
161
162		port {
163			hdmi_connector_in: endpoint {
164				remote-endpoint = <&hdmi_tx_tmds_out>;
165			};
166		};
167	};
168
169	sound {
170		compatible = "amlogic,axg-sound-card";
171		audio-aux-devs = <&tdmout_b>;
172		audio-routing = "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
177		clocks = <&clkc CLKID_MPLL2>,
178			 <&clkc CLKID_MPLL0>,
179			 <&clkc CLKID_MPLL1>;
180
181		assigned-clocks = <&clkc CLKID_MPLL2>,
182				  <&clkc CLKID_MPLL0>,
183				  <&clkc CLKID_MPLL1>;
184		assigned-clock-parents = <0>, <0>, <0>;
185		assigned-clock-rates = <294912000>,
186				       <270950400>,
187				       <393216000>;
188
189		dai-link-0 {
190			sound-dai = <&frddr_a>;
191		};
192
193		dai-link-1 {
194			sound-dai = <&frddr_b>;
195		};
196
197		dai-link-2 {
198			sound-dai = <&frddr_c>;
199		};
200
201		/* 8ch hdmi interface */
202		dai-link-3 {
203			sound-dai = <&tdmif_b>;
204			dai-format = "i2s";
205			dai-tdm-slot-tx-mask-0 = <1 1>;
206			dai-tdm-slot-tx-mask-1 = <1 1>;
207			dai-tdm-slot-tx-mask-2 = <1 1>;
208			dai-tdm-slot-tx-mask-3 = <1 1>;
209			mclk-fs = <256>;
210
211			codec {
212				sound-dai = <&tohdmitx TOHDMITX_I2S_IN_B>;
213			};
214		};
215
216		/* hdmi glue */
217		dai-link-4 {
218			sound-dai = <&tohdmitx TOHDMITX_I2S_OUT>;
219
220			codec {
221				sound-dai = <&hdmi_tx>;
222			};
223		};
224	};
225};
226
227&arb {
228	status = "okay";
229};
230
231&cec_AO {
232	pinctrl-0 = <&cec_ao_a_h_pins>;
233	pinctrl-names = "default";
234	status = "disabled";
235	hdmi-phandle = <&hdmi_tx>;
236};
237
238&cecb_AO {
239	pinctrl-0 = <&cec_ao_b_h_pins>;
240	pinctrl-names = "default";
241	status = "okay";
242	hdmi-phandle = <&hdmi_tx>;
243};
244
245&clkc_audio {
246	status = "okay";
247};
248
249&cpu0 {
250	cpu-supply = <&vddcpu>;
251	operating-points-v2 = <&cpu_opp_table>;
252	clocks = <&clkc CLKID_CPU_CLK>;
253};
254
255&cpu1 {
256	cpu-supply = <&vddcpu>;
257	operating-points-v2 = <&cpu_opp_table>;
258	clocks = <&clkc CLKID_CPU1_CLK>;
259};
260
261&cpu2 {
262	cpu-supply = <&vddcpu>;
263	operating-points-v2 = <&cpu_opp_table>;
264	clocks = <&clkc CLKID_CPU2_CLK>;
265};
266
267&cpu3 {
268	cpu-supply = <&vddcpu>;
269	operating-points-v2 = <&cpu_opp_table>;
270	clocks = <&clkc CLKID_CPU3_CLK>;
271};
272
273&ext_mdio {
274	external_phy: ethernet-phy@0 {
275		/* Realtek RTL8211F (0x001cc916) */
276		reg = <0>;
277		max-speed = <1000>;
278
279		reset-assert-us = <10000>;
280		reset-deassert-us = <80000>;
281		reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
282
283		interrupt-parent = <&gpio_intc>;
284		/* MAC_INTR on GPIOZ_14 */
285		interrupts = <IRQID_GPIOZ_14 IRQ_TYPE_LEVEL_LOW>;
286	};
287};
288
289&ethmac {
290	pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
291	pinctrl-names = "default";
292	status = "okay";
293	phy-mode = "rgmii";
294	phy-handle = <&external_phy>;
295	amlogic,tx-delay-ns = <2>;
296};
297
298&frddr_a {
299	status = "okay";
300};
301
302&frddr_b {
303	status = "okay";
304};
305
306&frddr_c {
307	status = "okay";
308};
309
310&gpio {
311	gpio-line-names =
312		/* GPIOZ */
313		"", "", "", "", "", "", "", "",
314		"", "", "", "", "", "", "", "",
315		/* GPIOH */
316		"", "", "", "", "",
317		"PIN_36", /* GPIOH_5 */
318		"PIN_26", /* GPIOH_6 */
319		"PIN_32", /* GPIOH_7 */
320		"",
321		/* BOOT */
322		"", "", "", "", "", "", "", "",
323		"", "", "", "", "", "", "", "",
324		/* GPIOC */
325		"", "", "", "", "", "", "", "",
326		/* GPIOA */
327		"", "", "", "", "", "", "", "",
328		"", "", "", "", "", "",
329		"PIN_27", /* GPIOA_14 */
330		"PIN_28", /* GPIOA_15 */
331		/* GPIOX */
332		"PIN_16", /* GPIOX_0 */
333		"PIN_18", /* GPIOX_1 */
334		"PIN_22", /* GPIOX_2 */
335		"PIN_11", /* GPIOX_3 */
336		"PIN_13", /* GPIOX_4 */
337		"PIN_7",  /* GPIOX_5 */
338		"PIN_33", /* GPIOX_6 */
339		"PIN_15", /* GPIOX_7 */
340		"PIN_19", /* GPIOX_8 */
341		"PIN_21", /* GPIOX_9 */
342		"PIN_24", /* GPIOX_10 */
343		"PIN_23", /* GPIOX_11 */
344		"PIN_8",  /* GPIOX_12 */
345		"PIN_10", /* GPIOX_13 */
346		"PIN_29", /* GPIOX_14 */
347		"PIN_31", /* GPIOX_15 */
348		"PIN_12", /* GPIOX_16 */
349		"PIN_3",  /* GPIOX_17 */
350		"PIN_5",  /* GPIOX_18 */
351		"PIN_35"; /* GPIOX_19 */
352};
353
354&gpio_ao {
355	gpio-line-names =
356		/* GPIOAO */
357		"", "", "", "",
358		"PIN_47", /* GPIOAO_4 */
359		"", "",
360		"PIN_45", /* GPIOAO_7 */
361		"PIN_46", /* GPIOAO_8 */
362		"PIN_44", /* GPIOAO_9 */
363		"PIN_42", /* GPIOAO_10 */
364		"",
365		/* GPIOE */
366		"", "", "";
367};
368
369&hdmi_tx {
370	status = "okay";
371	pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
372	pinctrl-names = "default";
373	hdmi-supply = <&vcc_5v>;
374};
375
376&hdmi_tx_tmds_port {
377	hdmi_tx_tmds_out: endpoint {
378		remote-endpoint = <&hdmi_connector_in>;
379	};
380};
381
382&ir {
383	status = "okay";
384	pinctrl-0 = <&remote_input_ao_pins>;
385	pinctrl-names = "default";
386};
387
388&pwm_AO_cd {
389	pinctrl-0 = <&pwm_ao_d_e_pins>;
390	pinctrl-names = "default";
391	status = "okay";
392};
393
394&saradc {
395	status = "okay";
396};
397
398/* SD card */
399&sd_emmc_b {
400	status = "okay";
401	pinctrl-0 = <&sdcard_c_pins>;
402	pinctrl-1 = <&sdcard_clk_gate_c_pins>;
403	pinctrl-names = "default", "clk-gate";
404
405	bus-width = <4>;
406	cap-sd-highspeed;
407	max-frequency = <200000000>;
408	sd-uhs-sdr12;
409	sd-uhs-sdr25;
410	sd-uhs-sdr50;
411	sd-uhs-sdr104;
412	disable-wp;
413
414	cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
415	vmmc-supply = <&tflash_vdd>;
416	vqmmc-supply = <&tf_io>;
417};
418
419/* eMMC */
420&sd_emmc_c {
421	status = "okay";
422	pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
423	pinctrl-1 = <&emmc_clk_gate_pins>;
424	pinctrl-names = "default", "clk-gate";
425
426	bus-width = <8>;
427	cap-mmc-highspeed;
428	mmc-ddr-1_8v;
429	mmc-hs200-1_8v;
430	max-frequency = <200000000>;
431	disable-wp;
432
433	mmc-pwrseq = <&emmc_pwrseq>;
434	vmmc-supply = <&vcc_3v3>;
435	vqmmc-supply = <&flash_1v8>;
436};
437
438&tdmif_b {
439	status = "okay";
440};
441
442&tdmout_b {
443	status = "okay";
444};
445
446&tohdmitx {
447	status = "okay";
448};
449
450&uart_AO {
451	status = "okay";
452	pinctrl-0 = <&uart_ao_a_pins>;
453	pinctrl-names = "default";
454};
455
456&usb {
457	status = "okay";
458	vbus-supply = <&usb_pwr_en>;
459};
460
461&usb2_phy0 {
462	phy-supply = <&vcc_5v>;
463};
464
465