blob: 49890eb12781f4365ffa7a5d3cdb5ec8c09be3e2 [file] [log] [blame]
Tom Rini53633a82024-02-29 12:33:36 -05001// 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 {
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";
Tom Rini53633a82024-02-29 12:33:36 -050037 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 assigned-clocks = <&clkc CLKID_MPLL0>,
102 <&clkc CLKID_MPLL1>,
103 <&clkc CLKID_MPLL2>;
104 assigned-clock-rates = <270950400>,
105 <294912000>,
106 <393216000>;
107
108 dai-link-0 {
109 sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
110 };
111
112 dai-link-1 {
113 sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
114 dai-format = "i2s";
115 mclk-fs = <256>;
116
117 codec-0 {
118 sound-dai = <&rt5640>;
119 };
120 };
121 };
122
123 usb_vbus: regulator-usb-vbus {
124 /*
125 * Silergy SY6288CCAC-GP 2A Power Distribution Switch.
126 */
127 compatible = "regulator-fixed";
128
129 regulator-name = "USB_VBUS";
130
131 regulator-min-microvolt = <5000000>;
132 regulator-max-microvolt = <5000000>;
133
134 vin-supply = <&vcc_5v>;
135
136 /*
137 * signal name from the schematics: USB_PWR_EN
138 */
139 gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
140 enable-active-high;
141 };
142
143 vcc_5v: regulator-vcc5v {
144 /*
145 * supplied by the main power input which called PWR_5V_STB
146 * in the schematics
147 */
148 compatible = "regulator-fixed";
149
150 regulator-name = "VCC5V";
151
152 regulator-min-microvolt = <5000000>;
153 regulator-max-microvolt = <5000000>;
154
155 /*
156 * signal name from the schematics: 3V3_5V_EN
157 */
158 gpio = <&gpio GPIODV_29 GPIO_ACTIVE_LOW>;
159
160 regulator-boot-on;
161 regulator-always-on;
162 };
163
164 vcck: regulator-vcck {
165 /*
166 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
167 * Synchronous Step Down Regulator.
168 */
169 compatible = "pwm-regulator";
170
171 regulator-name = "VCCK";
172 regulator-min-microvolt = <860000>;
173 regulator-max-microvolt = <1140000>;
174
175 pwm-supply = <&vcc_5v>;
176
177 pwms = <&pwm_cd 0 1148 0>;
178 pwm-dutycycle-range = <100 0>;
179
180 regulator-boot-on;
181 regulator-always-on;
182 };
183
184 vcc_1v8: regulator-vcc1v8 {
185 /*
186 * ABLIC S-1339D18-M5001-GP
187 */
188 compatible = "regulator-fixed";
189
190 regulator-name = "VCC1V8";
191 regulator-min-microvolt = <1800000>;
192 regulator-max-microvolt = <1800000>;
193
194 vin-supply = <&vcc_3v3>;
195 };
196
197 vcc_3v3: regulator-vcc3v3 {
198 /*
199 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
200 * Synchronous Step Down Regulator. Also called
201 * VDDIO_AO3.3V in the schematics.
202 */
203 compatible = "regulator-fixed";
204
205 regulator-name = "VCC3V3";
206 regulator-min-microvolt = <3300000>;
207 regulator-max-microvolt = <3300000>;
208
209 vin-supply = <&vcc_5v>;
210 };
211
212 vcc_ddr3: regulator-vcc-ddr3 {
213 /*
214 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
215 * Synchronous Step Down Regulator. Also called
216 * DDR3_1.5V in the schematics.
217 */
218 compatible = "regulator-fixed";
219
220 regulator-name = "VCC_DDR3_1V5";
221 regulator-min-microvolt = <1500000>;
222 regulator-max-microvolt = <1500000>;
223
224 vin-supply = <&vcc_5v>;
225
226 regulator-boot-on;
227 regulator-always-on;
228 };
229
230 vcc_rtc: regulator-vcc-rtc {
231 /*
232 * Global Mixed-mode Technology Inc. G918T12U-GP
233 */
234 compatible = "regulator-fixed";
235
236 regulator-name = "VCC_RTC";
237 regulator-min-microvolt = <900000>;
238 regulator-max-microvolt = <900000>;
239
240 /*
241 * When the board is powered then the input is VCC3V3,
242 * otherwise power is taken from the coin cell battery.
243 */
244 vin-supply = <&vcc_3v3>;
245 };
246
247 vddee: regulator-vddee {
248 /*
249 * Silergy SY8089AAC-GP 2A continuous, 3A peak, 1MHz
250 * Synchronous Step Down Regulator. Also called VDDAO
251 * in a part of the schematics.
252 */
253 compatible = "pwm-regulator";
254
255 regulator-name = "VDDEE";
256 regulator-min-microvolt = <860000>;
257 regulator-max-microvolt = <1140000>;
258
259 pwm-supply = <&vcc_5v>;
260
261 pwms = <&pwm_cd 1 1148 0>;
262 pwm-dutycycle-range = <100 0>;
263
264 regulator-boot-on;
265 regulator-always-on;
266 };
267};
268
269&aiu {
270 status = "okay";
271
272 pinctrl-0 = <&i2s_am_clk_pins>, <&i2s_out_ao_clk_pins>,
273 <&i2s_out_lr_clk_pins>, <&i2s_out_ch01_ao_pins>;
274 pinctrl-names = "default";
275};
276
277&cpu0 {
278 cpu-supply = <&vcck>;
279};
280
281&ethmac {
282 status = "okay";
283
284 pinctrl-0 = <&eth_rmii_pins>;
285 pinctrl-names = "default";
286
287 phy-handle = <&eth_phy0>;
288 phy-mode = "rmii";
289
290 mdio {
291 compatible = "snps,dwmac-mdio";
292 #address-cells = <1>;
293 #size-cells = <0>;
294
295 eth_phy0: ethernet-phy@0 {
296 /* IC Plus IP101A/G (0x02430c54) */
297 reg = <0>;
298
299 reset-assert-us = <10000>;
300 reset-deassert-us = <10000>;
301 reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
302
303 icplus,select-interrupt;
304 interrupt-parent = <&gpio_intc>;
305 /* GPIOH_3 */
306 interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
307 };
308 };
309};
310
311&i2c_A {
312 status = "okay";
313 pinctrl-0 = <&i2c_a_pins>;
314 pinctrl-names = "default";
315
316 rt5640: codec@1c {
317 compatible = "realtek,rt5640";
318
319 reg = <0x1c>;
320
321 #sound-dai-cells = <0>;
322
323 interrupt-parent = <&gpio_intc>;
324 interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
325
326 /*
327 * TODO: realtek,ldo1-en-gpios is connected to GPIO_BSD_EN.
328 * We currently cannot configure this pin correctly.
329 * Luckily for us it's in the "right" state by default.
330 */
331 realtek,in1-differential;
332 };
333};
334
335&mali {
336 mali-supply = <&vddee>;
337};
338
339&saradc {
340 status = "okay";
341 vref-supply = <&vcc_1v8>;
342};
343
344&sdhc {
345 status = "okay";
346
347 pinctrl-0 = <&sdxc_c_pins>;
348 pinctrl-names = "default";
349
350 bus-width = <8>;
351 max-frequency = <50000000>;
352
353 cap-mmc-highspeed;
354 disable-wp;
355 non-removable;
356 no-sdio;
357
358 mmc-pwrseq = <&emmc_pwrseq>;
359
360 vmmc-supply = <&vcc_3v3>;
361 vqmmc-supply = <&vcc_3v3>;
362};
363
364&sdio {
365 status = "okay";
366
367 pinctrl-0 = <&sd_b_pins>;
368 pinctrl-names = "default";
369
370 /* SD card */
371 sd_card_slot: slot@1 {
372 compatible = "mmc-slot";
373 reg = <1>;
374 status = "okay";
375
376 bus-width = <4>;
377 no-sdio;
378 cap-mmc-highspeed;
379 cap-sd-highspeed;
380 disable-wp;
381
382 cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;
383
384 vmmc-supply = <&vcc_3v3>;
385 };
386};
387
388&gpio_ao {
389 gpio-line-names = "Linux_TX", "Linux_RX",
390 "SLP_S5_N", "USB2_OC_FLAG#",
391 "HUB_RST", "USB_PWR_EN",
392 "I2S_IN", "SLP_S1_N",
393 "TCK", "TMS", "TDI", "TDO",
394 "HDMI_CEC", "5640_IRQ",
395 "MUTE", "S805_TEST#";
396};
397
398&gpio {
399 gpio-line-names = /* Bank GPIOX */
400 "WIFI_SD_D0", "WIFI_SD_D1", "WIFI_SD_D2",
401 "WIFI_SD_D3", "BTPCM_DOUT", "BTPCM_DIN",
402 "BTPCM_SYNC", "BTPCM_CLK", "WIFI_SD_CLK",
403 "WIFI_SD_CMD", "WIFI_32K", "WIFI_PWREN",
404 "UART_B_TX", "UART_B_RX", "UART_B_CTS_N",
405 "UART_B_RTS_N", "BT_EN", "WIFI_WAKE_HOST",
406 /* Bank GPIOY */
407 "", "", "", "", "", "", "", "", "", "",
408 "", "",
409 /* Bank GPIODV */
410 "VCCK_PWM_C", "I2C_SDA_A", "I2C_SCL_A",
411 "I2C_SDA_B", "I2C_SCL_B", "VDDEE_PWM_D",
412 "VDDEE_PWM 3V3_5V_EN",
413 /* Bank GPIOH */
414 "HDMI_HPD", "HDMI_I2C_SDA", "HDMI_I2C_SCL",
415 "RMII_IRQ", "RMII_RST#", "RMII_TXD1",
416 "RMII_TXD0", "AV_select_1", "AV_select_2",
417 "MCU_Control_S",
418 /* Bank CARD */
419 "SD_D1_B", "SD_D0_B", "SD_CLK_8726MX",
420 "SD_CMD_8726MX", "SD_D3_B", "SD_D2_B",
421 "CARD_EN_DET (CARD_DET)",
422 /* Bank BOOT */
423 "NAND_D0 (EMMC)", "NAND_D1 (EMMC)",
424 "NAND_D2 (EMMC)", "NAND_D3 (EMMC)",
425 "NAND_D4 (EMMC)", "NAND_D5 (EMMC)",
426 "NAND_D6 (EMMC)", "NAND_D7 (EMMC)",
427 "NAND_CS1 (EMMC)", "NAND_CS2 iNAND_RS1 (EMMC)",
428 "NAND_nR/B iNAND_CMD (EMMC)", "NAND_ALE (EMMC)",
429 "NAND_CLE (EMMC)", "nRE_S1 NAND_nRE (EMMC)",
430 "nWE_S1 NAND_nWE (EMMC)", "", "", "SPI_CS",
431 /* Bank DIF */
432 "RMII_RXD1", "RMII_RXD0", "RMII_CRS_DV",
433 "RMII_50M_IN", "GPIODIF_4", "GPIODIF_5",
434 "RMII_TXEN", "CPUETH_25MOUT", "RMII_MDC",
435 "RMII_MDIO";
436};
437
438&pwm_cd {
439 status = "okay";
440 pinctrl-0 = <&pwm_c1_pins>, <&pwm_d_pins>;
441 pinctrl-names = "default";
442 clocks = <&xtal>, <&xtal>;
443 clock-names = "clkin0", "clkin1";
444};
445
446&rtc {
447 status = "okay";
448 clocks = <&rtc32k_xtal>;
449 vdd-supply = <&vcc_rtc>;
450};
451
452/* exposed through the pin headers labeled "URDUG1" on the top of the PCB */
453&uart_AO {
454 status = "okay";
455 pinctrl-0 = <&uart_ao_a_pins>;
456 pinctrl-names = "default";
457};
458
459/*
460 * connected to the Bluetooth part of the RTL8723BS SDIO wifi / Bluetooth
461 * combo chip. This is only available on the variant with 2GB RAM.
462 */
463&uart_B {
464 status = "okay";
465 pinctrl-0 = <&uart_b0_pins>, <&uart_b0_cts_rts_pins>;
466 pinctrl-names = "default";
467 uart-has-rtscts;
468};
469
470&usb1 {
471 status = "okay";
472 vbus-supply = <&usb_vbus>;
473};
474
475&usb1_phy {
476 status = "okay";
477};