summaryrefslogtreecommitdiffstats
path: root/dts/src/arm/meson8b-ec100.dts
blob: d50fc2f60fa31fc24e296de7f3ed2af3e4834321 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
/*
 * Copyright (c) 2018 Martin Blumenstingl <martin.blumenstingl@googlemail.com>.
 */

/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>

#include "meson8b.dtsi"

/ {
	model = "Endless Computers Endless Mini";
	compatible = "endless,ec100", "amlogic,meson8b";

	aliases {
		serial0 = &uart_AO;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	memory {
		reg = <0x40000000 0x40000000>;
	};

	gpio-keys {
		compatible = "gpio-keys-polled";
		#address-cells = <1>;
		#size-cells = <0>;
		poll-interval = <100>;

		pal-switch {
			label = "pal";
			linux,input-type = <EV_SW>;
			linux,code = <KEY_SWITCHVIDEOMODE>;
			gpios = <&gpio GPIOH_7 GPIO_ACTIVE_LOW>;
		};

		ntsc-switch {
			label = "ntsc";
			linux,input-type = <EV_SW>;
			linux,code = <KEY_SWITCHVIDEOMODE>;
			gpios = <&gpio GPIOH_8 GPIO_ACTIVE_HIGH>;
		};

		power-button {
			label = "power";
			linux,code = <KEY_POWER>;
			gpios = <&gpio GPIOH_9 GPIO_ACTIVE_LOW>;
		};
	};

	gpio-poweroff {
		compatible = "gpio-poweroff";
		/*
		 * shutdown is managed by the EC (embedded micro-controller)
		 * which is configured through GPIOAO_2 (poweroff GPIO) and
		 * GPIOAO_7 (power LED, which has to go LOW as well).
		 */
		gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
		timeout-ms = <20000>;
	};

	leds {
		compatible = "gpio-leds";

		power {
			label = "ec100:red:power";
			/*
			 * Needs to go LOW (together with the poweroff GPIO)
			 * during shutdown to allow the EC (embedded
			 * micro-controller) to shutdown the system. Setting
			 * the output to LOW signals the EC to start a
			 * "breathing"/pulsing effect until the power is fully
			 * turned off.
			 */
			gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_HIGH>;
			default-state = "on";
		};
	};

	usb_vbus: regulator-usb-vbus {
		compatible = "regulator-fixed";

		regulator-name = "USB_VBUS";

		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;

		gpio = <&gpio_ao GPIOAO_5 GPIO_ACTIVE_HIGH>;
		enable-active-high;
	};

	vcc_5v: regulator-vcc5v {
		compatible = "regulator-fixed";

		regulator-name = "VCC5V";

		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;

		gpio = <&gpio GPIODV_29 GPIO_ACTIVE_LOW>;

		regulator-boot-on;
		regulator-always-on;
	};

	vcck: regulator-vcck {
		compatible = "pwm-regulator";

		regulator-name = "VCCK";
		regulator-min-microvolt = <860000>;
		regulator-max-microvolt = <1140000>;

		pwms = <&pwm_cd 0 1148 0>;
		pwm-dutycycle-range = <100 0>;

		regulator-boot-on;
		regulator-always-on;
	};

	vcc_1v8: regulator-vcc1v8 {
		compatible = "regulator-fixed";

		regulator-name = "VCC1V8";
		regulator-min-microvolt = <1800000>;
		regulator-max-microvolt = <1800000>;
	};

	vcc_3v3: regulator-vcc3v3 {
		compatible = "regulator-fixed";

		regulator-name = "VCC3V3";
		regulator-min-microvolt = <3300000>;
		regulator-max-microvolt = <3300000>;
	};
};

&cpu0 {
	cpu-supply = <&vcck>;
};

&ethmac {
	status = "okay";

	pinctrl-0 = <&eth_rmii_pins>;
	pinctrl-names = "default";

	phy-handle = <&eth_phy0>;
	phy-mode = "rmii";

	snps,reset-gpio = <&gpio GPIOH_4 0>;
	snps,reset-delays-us = <0 10000 1000000>;
	snps,reset-active-low;

	mdio {
		compatible = "snps,dwmac-mdio";
		#address-cells = <1>;
		#size-cells = <0>;

		eth_phy0: ethernet-phy@0 {
			/* IC Plus IP101A/G (0x02430c54) */
			reg = <0>;
		};
	};
};

&i2c_A {
	status = "okay";
	pinctrl-0 = <&i2c_a_pins>;
	pinctrl-names = "default";

	rt5640: codec@1c {
		compatible = "realtek,rt5640";
		reg = <0x1c>;
		interrupt-parent = <&gpio_intc>;
		interrupts = <13 IRQ_TYPE_EDGE_BOTH>; /* GPIOAO_13 */
		realtek,in1-differential;
	};
};

&saradc {
	status = "okay";
	vref-supply = <&vcc_1v8>;
};

&sdio {
	status = "okay";

	pinctrl-0 = <&sd_b_pins>;
	pinctrl-names = "default";

	/* SD card */
	sd_card_slot: slot@1 {
		compatible = "mmc-slot";
		reg = <1>;
		status = "okay";

		bus-width = <4>;
		no-sdio;
		cap-mmc-highspeed;
		cap-sd-highspeed;
		disable-wp;

		cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_LOW>;

		vmmc-supply = <&vcc_3v3>;
	};
};

&pwm_cd {
	status = "okay";
	pinctrl-0 = <&pwm_c1_pins>;
	pinctrl-names = "default";
	clocks = <&clkc CLKID_XTAL>;
	clock-names = "clkin0";
};

/* exposed through the pin headers labeled "URDUG1" on the top of the PCB */
&uart_AO {
	status = "okay";
	pinctrl-0 = <&uart_ao_a_pins>;
	pinctrl-names = "default";
};

/*
 * connected to the Bluetooth part of the RTL8723BS SDIO wifi / Bluetooth
 * combo chip. This is only available on the variant with 2GB RAM.
 */
&uart_B {
	status = "okay";
	pinctrl-0 = <&uart_b0_pins>, <&uart_b0_cts_rts_pins>;
	pinctrl-names = "default";
	uart-has-rtscts;
};

&usb1 {
	status = "okay";
	vbus-supply = <&usb_vbus>;
};

&usb1_phy {
	status = "okay";
};