blob: 94f75b4465044dabd5acc8bf330244a3fc0a1d19 [file] [log] [blame]
Andreas Färber5851dcb2019-10-09 16:03:54 +02001// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2019 BayLibre, SAS
4 * Author: Neil Armstrong <narmstrong@baylibre.com>
5 * Copyright (c) 2019 Christian Hewitt <christianshewitt@gmail.com>
6 */
7
8#include <dt-bindings/input/input.h>
9#include <dt-bindings/gpio/meson-g12a-gpio.h>
10
11/ {
Andreas Färber5851dcb2019-10-09 16:03:54 +020012 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 0x80000000>;
24 };
25
26 adc-keys {
27 compatible = "adc-keys";
28 io-channels = <&saradc 2>;
29 io-channel-names = "buttons";
30 keyup-threshold-microvolt = <1710000>;
31
32 button-function {
33 label = "Function";
34 linux,code = <KEY_FN>;
35 press-threshold-microvolt = <10000>;
36 };
37 };
38
39 leds {
40 compatible = "gpio-leds";
41
Christian Hewittde649e62020-04-24 02:58:30 +000042 led-white {
Andreas Färber5851dcb2019-10-09 16:03:54 +020043 label = "vim3:white:sys";
44 gpios = <&gpio_ao GPIOAO_4 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "heartbeat";
46 };
47
Christian Hewittde649e62020-04-24 02:58:30 +000048 led-red {
Andreas Färber5851dcb2019-10-09 16:03:54 +020049 label = "vim3:red";
50 gpios = <&gpio_expander 5 GPIO_ACTIVE_LOW>;
51 };
52 };
53
54 emmc_pwrseq: emmc-pwrseq {
55 compatible = "mmc-pwrseq-emmc";
56 reset-gpios = <&gpio BOOT_12 GPIO_ACTIVE_LOW>;
57 };
58
59 gpio-keys-polled {
60 compatible = "gpio-keys-polled";
61 poll-interval = <100>;
62
63 power-button {
64 label = "power";
65 linux,code = <KEY_POWER>;
66 gpios = <&gpio_ao GPIOAO_7 GPIO_ACTIVE_LOW>;
67 };
68 };
69
70 sdio_pwrseq: sdio-pwrseq {
71 compatible = "mmc-pwrseq-simple";
72 reset-gpios = <&gpio GPIOX_6 GPIO_ACTIVE_LOW>;
73 clocks = <&wifi32k>;
74 clock-names = "ext_clock";
75 };
76
77 dc_in: regulator-dc_in {
78 compatible = "regulator-fixed";
79 regulator-name = "DC_IN";
80 regulator-min-microvolt = <5000000>;
81 regulator-max-microvolt = <5000000>;
82 regulator-always-on;
83 };
84
85 vcc_5v: regulator-vcc_5v {
86 compatible = "regulator-fixed";
87 regulator-name = "VCC_5V";
88 regulator-min-microvolt = <5000000>;
89 regulator-max-microvolt = <5000000>;
90 vin-supply = <&dc_in>;
91
92 gpio = <&gpio GPIOH_8 GPIO_OPEN_DRAIN>;
93 enable-active-high;
94 };
95
96 vcc_1v8: regulator-vcc_1v8 {
97 compatible = "regulator-fixed";
98 regulator-name = "VCC_1V8";
99 regulator-min-microvolt = <1800000>;
100 regulator-max-microvolt = <1800000>;
101 vin-supply = <&vcc_3v3>;
102 regulator-always-on;
103 };
104
105 vcc_3v3: regulator-vcc_3v3 {
106 compatible = "regulator-fixed";
107 regulator-name = "VCC_3V3";
108 regulator-min-microvolt = <3300000>;
109 regulator-max-microvolt = <3300000>;
110 vin-supply = <&vsys_3v3>;
111 regulator-always-on;
112 /* FIXME: actually controlled by VDDCPU_B_EN */
113 };
114
115 vddao_1v8: regulator-vddao_1v8 {
116 compatible = "regulator-fixed";
117 regulator-name = "VDDIO_AO1V8";
118 regulator-min-microvolt = <1800000>;
119 regulator-max-microvolt = <1800000>;
120 vin-supply = <&vsys_3v3>;
121 regulator-always-on;
122 };
123
124 emmc_1v8: regulator-emmc_1v8 {
125 compatible = "regulator-fixed";
126 regulator-name = "EMMC_AO1V8";
127 regulator-min-microvolt = <1800000>;
128 regulator-max-microvolt = <1800000>;
129 vin-supply = <&vcc_3v3>;
130 regulator-always-on;
131 };
132
133 vsys_3v3: regulator-vsys_3v3 {
134 compatible = "regulator-fixed";
135 regulator-name = "VSYS_3V3";
136 regulator-min-microvolt = <3300000>;
137 regulator-max-microvolt = <3300000>;
138 vin-supply = <&dc_in>;
139 regulator-always-on;
140 };
141
142 usb_pwr: regulator-usb_pwr {
143 compatible = "regulator-fixed";
144 regulator-name = "USB_PWR";
145 regulator-min-microvolt = <5000000>;
146 regulator-max-microvolt = <5000000>;
147 vin-supply = <&vcc_5v>;
148
149 gpio = <&gpio GPIOA_6 GPIO_ACTIVE_HIGH>;
150 enable-active-high;
151 };
152
153 hdmi-connector {
154 compatible = "hdmi-connector";
155 type = "a";
156
157 port {
158 hdmi_connector_in: endpoint {
159 remote-endpoint = <&hdmi_tx_tmds_out>;
160 };
161 };
162 };
163
164 wifi32k: wifi32k {
165 compatible = "pwm-clock";
166 #clock-cells = <0>;
167 clock-frequency = <32768>;
168 pwms = <&pwm_ef 0 30518 0>; /* PWM_E at 32.768KHz */
169 };
170};
171
172&cec_AO {
173 pinctrl-0 = <&cec_ao_a_h_pins>;
174 pinctrl-names = "default";
175 status = "disabled";
176 hdmi-phandle = <&hdmi_tx>;
177};
178
179&cecb_AO {
180 pinctrl-0 = <&cec_ao_b_h_pins>;
181 pinctrl-names = "default";
182 status = "okay";
183 hdmi-phandle = <&hdmi_tx>;
184};
185
Neil Armstrongfc85ec52020-09-21 09:34:12 +0200186&cpu_thermal {
187 trips {
188 cpu_active: cpu-active {
189 temperature = <80000>; /* millicelsius */
190 hysteresis = <2000>; /* millicelsius */
191 type = "active";
192 };
193 };
194
195 cooling-maps {
196 map {
197 trip = <&cpu_active>;
198 cooling-device = <&khadas_mcu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
199 };
200 };
201};
202
Andreas Färber5851dcb2019-10-09 16:03:54 +0200203&ext_mdio {
204 external_phy: ethernet-phy@0 {
205 /* Realtek RTL8211F (0x001cc916) */
206 reg = <0>;
207 max-speed = <1000>;
208
209 interrupt-parent = <&gpio_intc>;
210 /* MAC_INTR on GPIOZ_14 */
211 interrupts = <26 IRQ_TYPE_LEVEL_LOW>;
212 };
213};
214
215&ethmac {
216 pinctrl-0 = <&eth_pins>, <&eth_rgmii_pins>;
217 pinctrl-names = "default";
218 status = "okay";
219 phy-mode = "rgmii";
220 phy-handle = <&external_phy>;
221 amlogic,tx-delay-ns = <2>;
222};
223
224&hdmi_tx {
225 status = "okay";
226 pinctrl-0 = <&hdmitx_hpd_pins>, <&hdmitx_ddc_pins>;
227 pinctrl-names = "default";
228 hdmi-supply = <&vcc_5v>;
229};
230
231&hdmi_tx_tmds_port {
232 hdmi_tx_tmds_out: endpoint {
233 remote-endpoint = <&hdmi_connector_in>;
234 };
235};
236
237&i2c_AO {
238 status = "okay";
239 pinctrl-0 = <&i2c_ao_sck_pins>, <&i2c_ao_sda_pins>;
240 pinctrl-names = "default";
241
Neil Armstrongfc85ec52020-09-21 09:34:12 +0200242 khadas_mcu: system-controller@18 {
243 compatible = "khadas,mcu";
244 reg = <0x18>;
245 #cooling-cells = <2>;
246 };
247
Andreas Färber5851dcb2019-10-09 16:03:54 +0200248 gpio_expander: gpio-controller@20 {
249 compatible = "ti,tca6408";
250 reg = <0x20>;
251 vcc-supply = <&vcc_3v3>;
252 gpio-controller;
253 #gpio-cells = <2>;
254 };
255
256 rtc@51 {
257 compatible = "haoyu,hym8563";
258 reg = <0x51>;
259 #clock-cells = <0>;
260 };
261};
262
263&ir {
264 status = "okay";
265 pinctrl-0 = <&remote_input_ao_pins>;
266 pinctrl-names = "default";
267 linux,rc-map-name = "rc-khadas";
268};
269
Jerome Brunetd34d5ef2020-03-05 12:12:38 +0100270&pcie {
271 reset-gpios = <&gpio GPIOA_8 GPIO_ACTIVE_LOW>;
272};
273
Andreas Färber5851dcb2019-10-09 16:03:54 +0200274&pwm_ef {
275 status = "okay";
276 pinctrl-0 = <&pwm_e_pins>;
277 pinctrl-names = "default";
278};
279
280&saradc {
281 status = "okay";
282 vref-supply = <&vddao_1v8>;
283};
284
285/* SDIO */
286&sd_emmc_a {
287 status = "okay";
288 pinctrl-0 = <&sdio_pins>;
289 pinctrl-1 = <&sdio_clk_gate_pins>;
290 pinctrl-names = "default", "clk-gate";
291 #address-cells = <1>;
292 #size-cells = <0>;
293
294 bus-width = <4>;
295 cap-sd-highspeed;
Andreas Färber5851dcb2019-10-09 16:03:54 +0200296 max-frequency = <100000000>;
297
298 non-removable;
299 disable-wp;
300
Jerome Brunetd34d5ef2020-03-05 12:12:38 +0100301 /* WiFi firmware requires power to be kept while in suspend */
302 keep-power-in-suspend;
303
Andreas Färber5851dcb2019-10-09 16:03:54 +0200304 mmc-pwrseq = <&sdio_pwrseq>;
305
306 vmmc-supply = <&vsys_3v3>;
307 vqmmc-supply = <&vddao_1v8>;
308
309 brcmf: wifi@1 {
310 reg = <1>;
311 compatible = "brcm,bcm4329-fmac";
312 };
313};
314
315/* SD card */
316&sd_emmc_b {
317 status = "okay";
318 pinctrl-0 = <&sdcard_c_pins>;
319 pinctrl-1 = <&sdcard_clk_gate_c_pins>;
320 pinctrl-names = "default", "clk-gate";
321
322 bus-width = <4>;
323 cap-sd-highspeed;
324 max-frequency = <50000000>;
325 disable-wp;
326
327 cd-gpios = <&gpio GPIOC_6 GPIO_ACTIVE_LOW>;
328 vmmc-supply = <&vsys_3v3>;
329 vqmmc-supply = <&vsys_3v3>;
330};
331
332/* eMMC */
333&sd_emmc_c {
334 status = "okay";
Neil Armstrong2d18c8c2020-04-20 15:44:41 +0200335 pinctrl-0 = <&emmc_ctrl_pins>, <&emmc_data_8b_pins>, <&emmc_ds_pins>;
Andreas Färber5851dcb2019-10-09 16:03:54 +0200336 pinctrl-1 = <&emmc_clk_gate_pins>;
337 pinctrl-names = "default", "clk-gate";
338
339 bus-width = <8>;
340 cap-mmc-highspeed;
341 mmc-ddr-1_8v;
342 mmc-hs200-1_8v;
343 max-frequency = <200000000>;
344 disable-wp;
345
346 mmc-pwrseq = <&emmc_pwrseq>;
347 vmmc-supply = <&vcc_3v3>;
348 vqmmc-supply = <&emmc_1v8>;
349};
350
Neil Armstrong2d18c8c2020-04-20 15:44:41 +0200351/*
352 * EMMC_D4, EMMC_D5, EMMC_D6 and EMMC_D7 pins are shared between SPI NOR CS
353 * and eMMC Data 4 to 7 pins.
354 * Replace emmc_data_8b_pins to emmc_data_4b_pins from sd_emmc_c pinctrl-0,
355 * and change bus-width to 4 then spifc can be enabled.
356 */
357&spifc {
358 status = "disabled";
359 pinctrl-0 = <&nor_pins>;
360 pinctrl-names = "default";
361
Neil Armstrongfc85ec52020-09-21 09:34:12 +0200362 w25q128: spi-flash@0 {
Neil Armstrong2d18c8c2020-04-20 15:44:41 +0200363 #address-cells = <1>;
364 #size-cells = <1>;
365 compatible = "winbond,w25q128fw", "jedec,spi-nor";
366 reg = <0>;
367 spi-max-frequency = <104000000>;
368 };
369};
370
Andreas Färber5851dcb2019-10-09 16:03:54 +0200371&uart_A {
372 status = "okay";
373 pinctrl-0 = <&uart_a_pins>, <&uart_a_cts_rts_pins>;
374 pinctrl-names = "default";
375 uart-has-rtscts;
376
377 bluetooth {
378 compatible = "brcm,bcm43438-bt";
379 shutdown-gpios = <&gpio GPIOX_17 GPIO_ACTIVE_HIGH>;
380 max-speed = <2000000>;
381 clocks = <&wifi32k>;
382 clock-names = "lpo";
383 };
384};
385
386&uart_AO {
387 status = "okay";
388 pinctrl-0 = <&uart_ao_a_pins>;
389 pinctrl-names = "default";
390};
391
392&usb2_phy0 {
393 phy-supply = <&dc_in>;
394};
395
396&usb2_phy1 {
397 phy-supply = <&usb_pwr>;
398};
399
400&usb3_pcie_phy {
401 phy-supply = <&usb_pwr>;
402};
403
404&usb {
405 status = "okay";
406 dr_mode = "peripheral";
407};