1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (c) 2019 BayLibre, SAS.
4 * Author: Fabien Parent <fparent@baylibre.com>
5 */
6
7#include <dt-bindings/gpio/gpio.h>
8
9/ {
10	aliases {
11		serial0 = &uart0;
12		ethernet0 = &ethernet;
13	};
14
15	chosen {
16		stdout-path = "serial0:921600n8";
17	};
18
19	firmware {
20		optee: optee@4fd00000 {
21			compatible = "linaro,optee-tz";
22			method = "smc";
23		};
24	};
25
26	gpio-keys {
27		compatible = "gpio-keys";
28		input-name = "gpio-keys";
29		pinctrl-names = "default";
30		pinctrl-0 = <&gpio_keys_default>;
31
32		volume-up {
33			gpios = <&pio 42 GPIO_ACTIVE_LOW>;
34			label = "volume_up";
35			linux,code = <115>;
36			wakeup-source;
37			debounce-interval = <15>;
38		};
39
40		volume-down {
41			gpios = <&pio 43 GPIO_ACTIVE_LOW>;
42			label = "volume_down";
43			linux,code = <114>;
44			wakeup-source;
45			debounce-interval = <15>;
46		};
47	};
48};
49
50&i2c0 {
51	clock-div = <2>;
52	pinctrl-names = "default";
53	pinctrl-0 = <&i2c0_pins_a>;
54	status = "okay";
55
56	tca6416: gpio@20 {
57		compatible = "ti,tca6416";
58		reg = <0x20>;
59		reset-gpios = <&pio 65 GPIO_ACTIVE_LOW>;
60		pinctrl-names = "default";
61		pinctrl-0 = <&tca6416_pins>;
62
63		gpio-controller;
64		#gpio-cells = <2>;
65
66		eint20-mux-sel0-hog {
67			gpio-hog;
68			gpios = <0 0>;
69			input;
70			line-name = "eint20_mux_sel0";
71		};
72
73		expcon-mux-sel1-hog {
74			gpio-hog;
75			gpios = <1 0>;
76			input;
77			line-name = "expcon_mux_sel1";
78		};
79
80		mrg-di-mux-sel2-hog {
81			gpio-hog;
82			gpios = <2 0>;
83			input;
84			line-name = "mrg_di_mux_sel2";
85		};
86
87		sd-sdio-mux-sel3-hog {
88			gpio-hog;
89			gpios = <3 0>;
90			input;
91			line-name = "sd_sdio_mux_sel3";
92		};
93
94		sd-sdio-mux-ctrl7-hog {
95			gpio-hog;
96			gpios = <7 0>;
97			output-low;
98			line-name = "sd_sdio_mux_ctrl7";
99		};
100
101		hw-id0-hog {
102			gpio-hog;
103			gpios = <8 0>;
104			input;
105			line-name = "hw_id0";
106		};
107
108		hw-id1-hog {
109			gpio-hog;
110			gpios = <9 0>;
111			input;
112			line-name = "hw_id1";
113		};
114
115		hw-id2-hog {
116			gpio-hog;
117			gpios = <10 0>;
118			input;
119			line-name = "hw_id2";
120		};
121
122		fg-int-n-hog {
123			gpio-hog;
124			gpios = <11 0>;
125			input;
126			line-name = "fg_int_n";
127		};
128
129		usba-pwr-en-hog {
130			gpio-hog;
131			gpios = <12 0>;
132			output-high;
133			line-name = "usba_pwr_en";
134		};
135
136		wifi-3v3-pg-hog {
137			gpio-hog;
138			gpios = <13 0>;
139			input;
140			line-name = "wifi_3v3_pg";
141		};
142
143		cam-rst-hog {
144			gpio-hog;
145			gpios = <14 0>;
146			output-low;
147			line-name = "cam_rst";
148		};
149
150		cam-pwdn-hog {
151			gpio-hog;
152			gpios = <15 0>;
153			output-low;
154			line-name = "cam_pwdn";
155		};
156	};
157};
158
159&i2c2 {
160	clock-div = <2>;
161	pinctrl-names = "default";
162	pinctrl-0 = <&i2c2_pins_a>;
163	status = "okay";
164};
165
166&uart0 {
167	status = "okay";
168};
169
170&ethernet {
171	pinctrl-names = "default";
172	pinctrl-0 = <&ethernet_pins_default>;
173	phy-handle = <&eth_phy>;
174	phy-mode = "rmii";
175	mac-address = [00 00 00 00 00 00];
176	status = "okay";
177
178	mdio {
179		#address-cells = <1>;
180		#size-cells = <0>;
181
182		eth_phy: ethernet-phy@0 {
183			reg = <0>;
184		};
185	};
186};
187
188&usb0 {
189	status = "okay";
190	dr_mode = "peripheral";
191	usb-role-switch;
192
193	usb_con: connector {
194		compatible = "usb-c-connector";
195		label = "USB-C";
196	};
197};
198
199&usb_phy {
200	status = "okay";
201};
202
203&pio {
204	gpio_keys_default: gpiodefault {
205		pins_cmd_dat {
206			pinmux = <MT8516_PIN_42_KPCOL0__FUNC_GPIO42>,
207				 <MT8516_PIN_43_KPCOL1__FUNC_GPIO43>;
208			bias-pull-up;
209			input-enable;
210		};
211	};
212
213	i2c0_pins_a: i2c0@0 {
214		pins1 {
215			pinmux = <MT8516_PIN_58_SDA0__FUNC_SDA0_0>,
216				 <MT8516_PIN_59_SCL0__FUNC_SCL0_0>;
217			bias-disable;
218		};
219	};
220
221	i2c2_pins_a: i2c2@0 {
222		pins1 {
223			pinmux = <MT8516_PIN_60_SDA2__FUNC_SDA2_0>,
224				 <MT8516_PIN_61_SCL2__FUNC_SCL2_0>;
225			bias-disable;
226		};
227	};
228
229	tca6416_pins: pinmux_tca6416_pins {
230		gpio_mux_rst_n_pin {
231			pinmux = <MT8516_PIN_65_UTXD1__FUNC_GPIO65>;
232			output-high;
233		};
234
235		gpio_mux_int_n_pin {
236			pinmux = <MT8516_PIN_64_URXD1__FUNC_GPIO64>;
237			input-enable;
238			bias-pull-up;
239		};
240	};
241
242	ethernet_pins_default: ethernet {
243		pins_ethernet {
244			pinmux = <MT8516_PIN_0_EINT0__FUNC_EXT_TXD0>,
245				 <MT8516_PIN_1_EINT1__FUNC_EXT_TXD1>,
246				 <MT8516_PIN_5_EINT5__FUNC_EXT_RXER>,
247				 <MT8516_PIN_6_EINT6__FUNC_EXT_RXC>,
248				 <MT8516_PIN_7_EINT7__FUNC_EXT_RXDV>,
249				 <MT8516_PIN_8_EINT8__FUNC_EXT_RXD0>,
250				 <MT8516_PIN_9_EINT9__FUNC_EXT_RXD1>,
251				 <MT8516_PIN_12_EINT12__FUNC_EXT_TXEN>,
252				 <MT8516_PIN_38_MRG_DI__FUNC_EXT_MDIO>,
253				 <MT8516_PIN_39_MRG_DO__FUNC_EXT_MDC>;
254		};
255	};
256};
257