xref: /linux/scripts/dtc/include-prefixes/arm/amlogic/meson8b-ec100.dts (revision 3fd6c59042dbba50391e30862beac979491145fe)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2018 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/input/input.h>
10
11#include "meson8b.dtsi"
12
13/ {
14	model = "Endless Computers Endless Mini";
15	compatible = "endless,ec100", "amlogic,meson8b";
16
17	aliases {
18		serial0 = &uart_AO;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24
25	memory@40000000 {
26		device_type = "memory";
27		reg = <0x40000000 0x40000000>;
28	};
29
30	emmc_pwrseq: emmc-pwrseq {
31		compatible = "mmc-pwrseq-emmc";
32		reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
33	};
34
35	gpio-keys {
36		compatible = "gpio-keys-polled";
37		poll-interval = <100>;
38
39		pal-switch {
40			label = "pal";
41			linux,input-type = <EV_SW>;
42			linux,code = <KEY_SWITCHVIDEOMODE>;
43			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
44		};
45
46		ntsc-switch {
47			label = "ntsc";
48			linux,input-type = <EV_SW>;
49			linux,code = <KEY_SWITCHVIDEOMODE>;
50			gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
51		};
52
53		power-button {
54			label = "power";
55			linux,code = <KEY_POWER>;
56			gpios = <&gpio GPIOH_9 GPIO_ACTIVE_LOW>;
57		};
58	};
59
60	gpio-poweroff {
61		compatible = "gpio-poweroff";
62		/*
63		 * shutdown is managed by the EC (embedded micro-controller)
64		 * which is configured through GPIOAO_2 (poweroff GPIO) and
65		 * GPIOAO_7 (power LED, which has to go LOW as well).
66		 */
67		gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
68		timeout-ms = <20000>;
69	};
70
71	leds {
72		compatible = "gpio-leds";
73
74		led-power {
75			label = "ec100:red:power";
76			/*
77			 * Needs to go LOW (together with the poweroff GPIO)
78			 * during shutdown to allow the EC (embedded
79			 * micro-controller) to shutdown the system. Setting
80			 * the output to LOW signals the EC to start a
81			 * "breathing"/pulsing effect until the power is fully
82			 * turned off.
83			 */
84			gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
85			default-state = "on";
86		};
87	};
88
89	rtc32k_xtal: rtc32k-xtal-clk {
90		/* X2 in the schematics */
91		compatible = "fixed-clock";
92		clock-frequency = <32768>;
93		clock-output-names = "RTC32K";
94		#clock-cells = <0>;
95	};
96
97	sound {
98		compatible = "amlogic,gx-sound-card";
99		model = "M8B-EC100";
100
101		clocks = <&clkc CLKID_MPLL0>,
102			 <&clkc CLKID_MPLL1>,
103			 <&clkc CLKID_MPLL2>;
104
105		assigned-clocks = <&clkc CLKID_MPLL0>,
106				  <&clkc CLKID_MPLL1>,
107				  <&clkc CLKID_MPLL2>;
108		assigned-clock-rates = <270950400>,
109				       <294912000>,
110				       <393216000>;
111
112		dai-link-0 {
113			sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
114		};
115
116		dai-link-1 {
117			sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
118			dai-format = "i2s";
119			mclk-fs = <256>;
120
121			codec-0 {
122				sound-dai = <&rt5640>;
123			};
124		};
125	};
126
127	usb_vbus: regulator-usb-vbus {
128		/*
129		 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
130		 */
131		compatible = "regulator-fixed";
132
133		regulator-name = "USB_VBUS";
134
135		regulator-min-microvolt = <5000000>;
136		regulator-max-microvolt = <5000000>;
137
138		vin-supply = <&vcc_5v>;
139
140		/*
141		 * signal name from the schematics: USB_PWR_EN
142		 */
143		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
144		enable-active-high;
145	};
146
147	vcc_5v: regulator-vcc5v {
148		/*
149		 * supplied by the main power input which called PWR_5V_STB
150		 * in the schematics
151		 */
152		compatible = "regulator-fixed";
153
154		regulator-name = "VCC5V";
155
156		regulator-min-microvolt = <5000000>;
157		regulator-max-microvolt = <5000000>;
158
159		/*
160		 * signal name from the schematics: 3V3_5V_EN
161		 */
162		gpio = <&gpio GPIODV_29 GPIO_ACTIVE_LOW>;
163
164		regulator-boot-on;
165		regulator-always-on;
166	};
167
168	vcck: regulator-vcck {
169		/*
170		 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
171		 * Synchronous Step Down Regulator.
172		 */
173		compatible = "pwm-regulator";
174
175		regulator-name = "VCCK";
176		regulator-min-microvolt = <860000>;
177		regulator-max-microvolt = <1140000>;
178
179		pwm-supply = <&vcc_5v>;
180
181		pwms = <&pwm_cd 0 1148 0>;
182		pwm-dutycycle-range = <100 0>;
183
184		regulator-boot-on;
185		regulator-always-on;
186	};
187
188	vcc_1v8: regulator-vcc1v8 {
189		/*
190		 * ABLIC S-1339D18-M5001-GP
191		 */
192		compatible = "regulator-fixed";
193
194		regulator-name = "VCC1V8";
195		regulator-min-microvolt = <1800000>;
196		regulator-max-microvolt = <1800000>;
197
198		vin-supply = <&vcc_3v3>;
199	};
200
201	vcc_3v3: regulator-vcc3v3 {
202		/*
203		 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
204		 * Synchronous Step Down Regulator. Also called
205		 * VDDIO_AO3.3V in the schematics.
206		 */
207		compatible = "regulator-fixed";
208
209		regulator-name = "VCC3V3";
210		regulator-min-microvolt = <3300000>;
211		regulator-max-microvolt = <3300000>;
212
213		vin-supply = <&vcc_5v>;
214	};
215
216	vcc_ddr3: regulator-vcc-ddr3 {
217		/*
218		 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
219		 * Synchronous Step Down Regulator. Also called
220		 * DDR3_1.5V in the schematics.
221		 */
222		compatible = "regulator-fixed";
223
224		regulator-name = "VCC_DDR3_1V5";
225		regulator-min-microvolt = <1500000>;
226		regulator-max-microvolt = <1500000>;
227
228		vin-supply = <&vcc_5v>;
229
230		regulator-boot-on;
231		regulator-always-on;
232	};
233
234	vcc_rtc: regulator-vcc-rtc {
235		/*
236		 * Global Mixed-mode Technology Inc. G918T12U-GP
237		 */
238		compatible = "regulator-fixed";
239
240		regulator-name = "VCC_RTC";
241		regulator-min-microvolt = <900000>;
242		regulator-max-microvolt = <900000>;
243
244		/*
245		 * When the board is powered then the input is VCC3V3,
246		 * otherwise power is taken from the coin cell battery.
247		 */
248		vin-supply = <&vcc_3v3>;
249	};
250
251	vddee: regulator-vddee {
252		/*
253		 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
254		 * Synchronous Step Down Regulator. Also called VDDAO
255		 * in a part of the schematics.
256		 */
257		compatible = "pwm-regulator";
258
259		regulator-name = "VDDEE";
260		regulator-min-microvolt = <860000>;
261		regulator-max-microvolt = <1140000>;
262
263		pwm-supply = <&vcc_5v>;
264
265		pwms = <&pwm_cd 1 1148 0>;
266		pwm-dutycycle-range = <100 0>;
267
268		regulator-boot-on;
269		regulator-always-on;
270	};
271};
272
273&aiu {
274	status = "okay";
275
276	pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
277		    <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
278	pinctrl-names = "default";
279};
280
281&cpu0 {
282	cpu-supply = <&vcck>;
283};
284
285&ethmac {
286	status = "okay";
287
288	pinctrl-0 = <&eth_rmii_pins>;
289	pinctrl-names = "default";
290
291	phy-handle = <&eth_phy0>;
292	phy-mode = "rmii";
293
294	mdio {
295		compatible = "snps,dwmac-mdio";
296		#address-cells = <1>;
297		#size-cells = <0>;
298
299		eth_phy0: ethernet-phy@0 {
300			/* IC Plus IP101A/G (0x02430c54) */
301			reg = <0>;
302
303			reset-assert-us = <10000>;
304			reset-deassert-us = <10000>;
305			reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
306
307			icplus,select-interrupt;
308			interrupt-parent = <&gpio_intc>;
309			/* GPIOH_3 */
310			interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
311		};
312	};
313};
314
315&i2c_A {
316	status = "okay";
317	pinctrl-0 = <&i2c_a_pins>;
318	pinctrl-names = "default";
319
320	rt5640: codec@1c {
321		compatible = "realtek,rt5640";
322
323		reg = <0x1c>;
324
325		#sound-dai-cells = <0>;
326
327		interrupt-parent = <&gpio_intc>;
328		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
329
330		/*
331		 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
332		 * We currently cannot configure this pin correctly.
333		 * Luckily for us it's in the "right" state by default.
334		 */
335		realtek,in1-differential;
336	};
337};
338
339&mali {
340	mali-supply = <&vddee>;
341};
342
343&saradc {
344	status = "okay";
345	vref-supply = <&vcc_1v8>;
346};
347
348&sdhc {
349	status = "okay";
350
351	pinctrl-0 = <&sdxc_c_pins>;
352	pinctrl-names = "default";
353
354	bus-width = <8>;
355	max-frequency = <50000000>;
356
357	cap-mmc-highspeed;
358	disable-wp;
359	non-removable;
360	no-sdio;
361
362	mmc-pwrseq = <&emmc_pwrseq>;
363
364	vmmc-supply = <&vcc_3v3>;
365	vqmmc-supply = <&vcc_3v3>;
366};
367
368&sdio {
369	status = "okay";
370
371	pinctrl-0 = <&sd_b_pins>;
372	pinctrl-names = "default";
373
374	/* SD card */
375	sd_card_slot: slot@1 {
376		compatible = "mmc-slot";
377		reg = <1>;
378		status = "okay";
379
380		bus-width = <4>;
381		no-sdio;
382		cap-mmc-highspeed;
383		cap-sd-highspeed;
384		disable-wp;
385
386		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
387
388		vmmc-supply = <&vcc_3v3>;
389	};
390};
391
392&gpio_ao {
393	gpio-line-names = "Linux_TX", "Linux_RX",
394			  "SLP_S5_N", "USB2_OC_FLAG#",
395			  "HUB_RST", "USB_PWR_EN",
396			  "I2S_IN", "SLP_S1_N",
397			  "TCK", "TMS", "TDI", "TDO",
398			  "HDMI_CEC", "5640_IRQ",
399			  "MUTE", "S805_TEST#";
400};
401
402&gpio {
403	gpio-line-names = /* Bank GPIOX */
404			  "WIFI_SD_D0", "WIFI_SD_D1", "WIFI_SD_D2",
405			  "WIFI_SD_D3", "BTPCM_DOUT", "BTPCM_DIN",
406			  "BTPCM_SYNC", "BTPCM_CLK", "WIFI_SD_CLK",
407			  "WIFI_SD_CMD", "WIFI_32K", "WIFI_PWREN",
408			  "UART_B_TX", "UART_B_RX", "UART_B_CTS_N",
409			  "UART_B_RTS_N", "BT_EN", "WIFI_WAKE_HOST",
410			  /* Bank GPIOY */
411			  "", "", "", "", "", "", "", "", "", "",
412			  "", "",
413			  /* Bank GPIODV */
414			  "VCCK_PWM_C", "I2C_SDA_A", "I2C_SCL_A",
415			  "I2C_SDA_B", "I2C_SCL_B", "VDDEE_PWM_D",
416			  "VDDEE_PWM 3V3_5V_EN",
417			  /* Bank GPIOH */
418			  "HDMI_HPD", "HDMI_I2C_SDA", "HDMI_I2C_SCL",
419			  "RMII_IRQ", "RMII_RST#", "RMII_TXD1",
420			  "RMII_TXD0", "AV_select_1", "AV_select_2",
421			  "MCU_Control_S",
422			  /* Bank CARD */
423			  "SD_D1_B", "SD_D0_B", "SD_CLK_8726MX",
424			  "SD_CMD_8726MX", "SD_D3_B", "SD_D2_B",
425			  "CARD_EN_DET (CARD_DET)",
426			  /* Bank BOOT */
427			  "NAND_D0 (EMMC)", "NAND_D1 (EMMC)",
428			  "NAND_D2 (EMMC)", "NAND_D3 (EMMC)",
429			  "NAND_D4 (EMMC)", "NAND_D5 (EMMC)",
430			  "NAND_D6 (EMMC)", "NAND_D7 (EMMC)",
431			  "NAND_CS1 (EMMC)", "NAND_CS2 iNAND_RS1 (EMMC)",
432			  "NAND_nR/B iNAND_CMD (EMMC)", "NAND_ALE (EMMC)",
433			  "NAND_CLE (EMMC)", "nRE_S1 NAND_nRE (EMMC)",
434			  "nWE_S1 NAND_nWE (EMMC)",  "", "", "", "SPI_CS",
435			  /* Bank DIF */
436			  "RMII_RXD1", "RMII_RXD0", "RMII_CRS_DV",
437			  "RMII_50M_IN", "GPIODIF_4", "GPIODIF_5",
438			  "RMII_TXEN", "CPUETH_25MOUT", "RMII_MDC",
439			  "RMII_MDIO";
440};
441
442&pwm_cd {
443	status = "okay";
444	pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
445	pinctrl-names = "default";
446	clocks = <&xtal>, <&xtal>;
447	clock-names = "clkin0", "clkin1";
448};
449
450&rtc {
451	status = "okay";
452	clocks = <&rtc32k_xtal>;
453	vdd-supply = <&vcc_rtc>;
454};
455
456/* exposed through the pin headers labeled "URDUG1" on the top of the PCB */
457&uart_AO {
458	status = "okay";
459	pinctrl-0 = <&uart_ao_a_pins>;
460	pinctrl-names = "default";
461};
462
463/*
464 * connected to the Bluetooth part of the RTL8723BS SDIO wifi / Bluetooth
465 * combo chip. This is only available on the variant with 2GB RAM.
466 */
467&uart_B {
468	status = "okay";
469	pinctrl-0 = <&uart_b0_pins>, <&uart_b0_cts_rts_pins>;
470	pinctrl-names = "default";
471	uart-has-rtscts;
472};
473
474&usb1 {
475	status = "okay";
476	vbus-supply = <&usb_vbus>;
477};
478
479&usb1_phy {
480	status = "okay";
481};
482