blob: 221acd10f6c8418ccacbdd996e9aa579de4ccf7f [file] [log] [blame]
Hans de Goededeed69d2015-09-08 22:28:30 +02001/*
2 * Copyright 2015 Hans de Goede <hdegoede@redhat.com>
3 *
4 * This file is dual-licensed: you can use it either under the terms
5 * of the GPL or the X11 license, at your option. Note that this dual
6 * licensing only applies to this file, and not this project as a
7 * whole.
8 *
9 * a) This file is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This file is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * Or, alternatively,
20 *
21 * b) Permission is hereby granted, free of charge, to any person
22 * obtaining a copy of this software and associated documentation
23 * files (the "Software"), to deal in the Software without
24 * restriction, including without limitation the rights to use,
25 * copy, modify, merge, publish, distribute, sublicense, and/or
26 * sell copies of the Software, and to permit persons to whom the
27 * Software is furnished to do so, subject to the following
28 * conditions:
29 *
30 * The above copyright notice and this permission notice shall be
31 * included in all copies or substantial portions of the Software.
32 *
33 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40 * OTHER DEALINGS IN THE SOFTWARE.
41 */
42
43/dts-v1/;
44#include "sun4i-a10.dtsi"
45#include "sunxi-common-regulators.dtsi"
46#include <dt-bindings/gpio/gpio.h>
47#include <dt-bindings/input/input.h>
48#include <dt-bindings/interrupt-controller/irq.h>
Hans de Goededeed69d2015-09-08 22:28:30 +020049
50/ {
51 model = "iNet-9F Rev 03";
52 compatible = "inet-tek,inet9f-rev03", "allwinner,sun4i-a10";
53
54 aliases {
55 serial0 = &uart0;
56 };
57
58 chosen {
59 stdout-path = "serial0:115200n8";
60 };
Hans de Goede80e5f832016-03-14 17:37:09 +010061
Jagan Teki3c92cca2018-08-05 00:40:07 +053062 gpio-keys {
Hans de Goede80e5f832016-03-14 17:37:09 +010063 compatible = "gpio-keys-polled";
64 pinctrl-names = "default";
65 pinctrl-0 = <&key_pins_inet9f>;
66 #address-cells = <1>;
67 #size-cells = <0>;
68 poll-interval = <20>;
69
Jagan Teki3c92cca2018-08-05 00:40:07 +053070 left-joystick-left {
Hans de Goede80e5f832016-03-14 17:37:09 +010071 label = "Left Joystick Left";
72 linux,code = <ABS_X>;
73 linux,input-type = <EV_ABS>;
74 linux,input-value = <0xffffffff>; /* -1 */
75 gpios = <&pio 0 6 GPIO_ACTIVE_LOW>; /* PA6 */
76 };
77
Jagan Teki3c92cca2018-08-05 00:40:07 +053078 left-joystick-right {
Hans de Goede80e5f832016-03-14 17:37:09 +010079 label = "Left Joystick Right";
80 linux,code = <ABS_X>;
81 linux,input-type = <EV_ABS>;
82 linux,input-value = <1>;
83 gpios = <&pio 0 5 GPIO_ACTIVE_LOW>; /* PA5 */
84 };
85
Jagan Teki3c92cca2018-08-05 00:40:07 +053086 left-joystick-up {
Hans de Goede80e5f832016-03-14 17:37:09 +010087 label = "Left Joystick Up";
88 linux,code = <ABS_Y>;
89 linux,input-type = <EV_ABS>;
90 linux,input-value = <0xffffffff>; /* -1 */
91 gpios = <&pio 0 8 GPIO_ACTIVE_LOW>; /* PA8 */
92 };
93
Jagan Teki3c92cca2018-08-05 00:40:07 +053094 left-joystick-down {
Hans de Goede80e5f832016-03-14 17:37:09 +010095 label = "Left Joystick Down";
96 linux,code = <ABS_Y>;
97 linux,input-type = <EV_ABS>;
98 linux,input-value = <1>;
99 gpios = <&pio 0 9 GPIO_ACTIVE_LOW>; /* PA9 */
100 };
101
Jagan Teki3c92cca2018-08-05 00:40:07 +0530102 right-joystick-left {
Hans de Goede80e5f832016-03-14 17:37:09 +0100103 label = "Right Joystick Left";
104 linux,code = <ABS_Z>;
105 linux,input-type = <EV_ABS>;
106 linux,input-value = <0xffffffff>; /* -1 */
107 gpios = <&pio 0 1 GPIO_ACTIVE_LOW>; /* PA1 */
108 };
109
Jagan Teki3c92cca2018-08-05 00:40:07 +0530110 right-joystick-right {
Hans de Goede80e5f832016-03-14 17:37:09 +0100111 label = "Right Joystick Right";
112 linux,code = <ABS_Z>;
113 linux,input-type = <EV_ABS>;
114 linux,input-value = <1>;
115 gpios = <&pio 0 0 GPIO_ACTIVE_LOW>; /* PA0 */
116 };
117
Jagan Teki3c92cca2018-08-05 00:40:07 +0530118 right-joystick-up {
Hans de Goede80e5f832016-03-14 17:37:09 +0100119 label = "Right Joystick Up";
120 linux,code = <ABS_RZ>;
121 linux,input-type = <EV_ABS>;
122 linux,input-value = <0xffffffff>; /* -1 */
123 gpios = <&pio 0 3 GPIO_ACTIVE_LOW>; /* PA3 */
124 };
125
Jagan Teki3c92cca2018-08-05 00:40:07 +0530126 right-joystick-down {
Hans de Goede80e5f832016-03-14 17:37:09 +0100127 label = "Right Joystick Down";
128 linux,code = <ABS_RZ>;
129 linux,input-type = <EV_ABS>;
130 linux,input-value = <1>;
131 gpios = <&pio 0 4 GPIO_ACTIVE_LOW>; /* PA4 */
132 };
133
Jagan Teki3c92cca2018-08-05 00:40:07 +0530134 dpad-left {
Hans de Goede80e5f832016-03-14 17:37:09 +0100135 label = "DPad Left";
136 linux,code = <ABS_HAT0X>;
137 linux,input-type = <EV_ABS>;
138 linux,input-value = <0xffffffff>; /* -1 */
139 gpios = <&pio 7 23 GPIO_ACTIVE_LOW>; /* PH23 */
140 };
141
Jagan Teki3c92cca2018-08-05 00:40:07 +0530142 dpad-right {
Hans de Goede80e5f832016-03-14 17:37:09 +0100143 label = "DPad Right";
144 linux,code = <ABS_HAT0X>;
145 linux,input-type = <EV_ABS>;
146 linux,input-value = <1>;
147 gpios = <&pio 7 24 GPIO_ACTIVE_LOW>; /* PH24 */
148 };
149
Jagan Teki3c92cca2018-08-05 00:40:07 +0530150 dpad-up {
Hans de Goede80e5f832016-03-14 17:37:09 +0100151 label = "DPad Up";
152 linux,code = <ABS_HAT0Y>;
153 linux,input-type = <EV_ABS>;
154 linux,input-value = <0xffffffff>; /* -1 */
155 gpios = <&pio 7 25 GPIO_ACTIVE_LOW>; /* PH25 */
156 };
157
Jagan Teki3c92cca2018-08-05 00:40:07 +0530158 dpad-down {
Hans de Goede80e5f832016-03-14 17:37:09 +0100159 label = "DPad Down";
160 linux,code = <ABS_HAT0Y>;
161 linux,input-type = <EV_ABS>;
162 linux,input-value = <1>;
163 gpios = <&pio 7 26 GPIO_ACTIVE_LOW>; /* PH26 */
164 };
165
Jagan Teki3c92cca2018-08-05 00:40:07 +0530166 x {
Hans de Goede80e5f832016-03-14 17:37:09 +0100167 label = "Button X";
168 linux,code = <BTN_X>;
169 gpios = <&pio 0 16 GPIO_ACTIVE_LOW>; /* PA16 */
170 };
171
Jagan Teki3c92cca2018-08-05 00:40:07 +0530172 y {
Hans de Goede80e5f832016-03-14 17:37:09 +0100173 label = "Button Y";
174 linux,code = <BTN_Y>;
175 gpios = <&pio 0 14 GPIO_ACTIVE_LOW>; /* PA14 */
176 };
177
Jagan Teki3c92cca2018-08-05 00:40:07 +0530178 a {
Hans de Goede80e5f832016-03-14 17:37:09 +0100179 label = "Button A";
180 linux,code = <BTN_A>;
181 gpios = <&pio 0 17 GPIO_ACTIVE_LOW>; /* PA17 */
182 };
183
Jagan Teki3c92cca2018-08-05 00:40:07 +0530184 b {
Hans de Goede80e5f832016-03-14 17:37:09 +0100185 label = "Button B";
186 linux,code = <BTN_B>;
187 gpios = <&pio 0 15 GPIO_ACTIVE_LOW>; /* PA15 */
188 };
189
Jagan Teki3c92cca2018-08-05 00:40:07 +0530190 select {
Hans de Goede80e5f832016-03-14 17:37:09 +0100191 label = "Select Button";
192 linux,code = <BTN_SELECT>;
193 gpios = <&pio 0 11 GPIO_ACTIVE_LOW>; /* PA11 */
194 };
195
Jagan Teki3c92cca2018-08-05 00:40:07 +0530196 start {
Hans de Goede80e5f832016-03-14 17:37:09 +0100197 label = "Start Button";
198 linux,code = <BTN_START>;
199 gpios = <&pio 0 12 GPIO_ACTIVE_LOW>; /* PA12 */
200 };
201
Jagan Teki3c92cca2018-08-05 00:40:07 +0530202 top-left {
Hans de Goede80e5f832016-03-14 17:37:09 +0100203 label = "Top Left Button";
204 linux,code = <BTN_TL>;
205 gpios = <&pio 7 22 GPIO_ACTIVE_LOW>; /* PH22 */
206 };
207
Jagan Teki3c92cca2018-08-05 00:40:07 +0530208 top-right {
Hans de Goede80e5f832016-03-14 17:37:09 +0100209 label = "Top Right Button";
210 linux,code = <BTN_TR>;
211 gpios = <&pio 0 13 GPIO_ACTIVE_LOW>; /* PA13 */
212 };
213 };
Hans de Goededeed69d2015-09-08 22:28:30 +0200214};
215
216&cpu0 {
217 cpu-supply = <&reg_dcdc2>;
218};
219
220&ehci1 {
221 status = "okay";
222};
223
224&i2c0 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200225 status = "okay";
226
227 axp209: pmic@34 {
228 reg = <0x34>;
229 interrupts = <0>;
230 };
231};
232
233#include "axp209.dtsi"
234
235&i2c1 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200236 status = "okay";
Hans de Goede80e5f832016-03-14 17:37:09 +0100237
238 /* Accelerometer */
239 bma250@18 {
240 compatible = "bosch,bma250";
241 reg = <0x18>;
242 interrupt-parent = <&pio>;
243 interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
244 };
Hans de Goededeed69d2015-09-08 22:28:30 +0200245};
246
247&i2c2 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200248 status = "okay";
Hans de Goede80e5f832016-03-14 17:37:09 +0100249
250 ft5406ee8: touchscreen@38 {
251 compatible = "edt,edt-ft5406";
252 reg = <0x38>;
253 interrupt-parent = <&pio>;
254 interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
255 touchscreen-size-x = <800>;
256 touchscreen-size-y = <480>;
257 };
Hans de Goededeed69d2015-09-08 22:28:30 +0200258};
259
260&lradc {
261 vref-supply = <&reg_ldo2>;
262 status = "okay";
263
Jagan Teki3c92cca2018-08-05 00:40:07 +0530264 button-200 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200265 label = "Menu";
266 linux,code = <KEY_MENU>;
267 channel = <0>;
268 voltage = <200000>;
269 };
270
Jagan Teki3c92cca2018-08-05 00:40:07 +0530271 button-600 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200272 label = "Volume Up";
273 linux,code = <KEY_VOLUMEUP>;
274 channel = <0>;
275 voltage = <600000>;
276 };
277
Jagan Teki3c92cca2018-08-05 00:40:07 +0530278 button-800 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200279 label = "Volume Down";
280 linux,code = <KEY_VOLUMEDOWN>;
281 channel = <0>;
282 voltage = <800000>;
283 };
284
Jagan Teki3c92cca2018-08-05 00:40:07 +0530285 button-1000 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200286 label = "Home";
287 linux,code = <KEY_HOMEPAGE>;
288 channel = <0>;
289 voltage = <1000000>;
290 };
291
Jagan Teki3c92cca2018-08-05 00:40:07 +0530292 button-1200 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200293 label = "Esc";
294 linux,code = <KEY_ESC>;
295 channel = <0>;
296 voltage = <1200000>;
297 };
298};
299
300&mmc0 {
Hans de Goededeed69d2015-09-08 22:28:30 +0200301 vmmc-supply = <&reg_vcc3v3>;
302 bus-width = <4>;
Jagan Teki3c92cca2018-08-05 00:40:07 +0530303 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
Hans de Goededeed69d2015-09-08 22:28:30 +0200304 status = "okay";
305};
306
307&otg_sram {
308 status = "okay";
309};
310
311&pio {
Jagan Teki3c92cca2018-08-05 00:40:07 +0530312 key_pins_inet9f: key-pins {
313 pins = "PA0", "PA1", "PA3", "PA4",
314 "PA5", "PA6", "PA8", "PA9",
315 "PA11", "PA12", "PA13",
316 "PA14", "PA15", "PA16", "PA17",
317 "PH22", "PH23", "PH24", "PH25", "PH26";
318 function = "gpio_in";
319 bias-pull-up;
Hans de Goede80e5f832016-03-14 17:37:09 +0100320 };
321
Jagan Teki3c92cca2018-08-05 00:40:07 +0530322 usb0_id_detect_pin: usb0-id-detect-pin {
323 pins = "PH4";
324 function = "gpio_in";
325 bias-pull-up;
Hans de Goededeed69d2015-09-08 22:28:30 +0200326 };
327
Jagan Teki3c92cca2018-08-05 00:40:07 +0530328 usb0_vbus_detect_pin: usb0-vbus-detect-pin {
329 pins = "PH5";
330 function = "gpio_in";
331 bias-pull-down;
Hans de Goededeed69d2015-09-08 22:28:30 +0200332 };
333};
334
335&reg_dcdc2 {
336 regulator-always-on;
337 regulator-min-microvolt = <1000000>;
338 regulator-max-microvolt = <1400000>;
339 regulator-name = "vdd-cpu";
340};
341
342&reg_dcdc3 {
343 regulator-always-on;
344 regulator-min-microvolt = <1250000>;
345 regulator-max-microvolt = <1250000>;
346 regulator-name = "vdd-int-dll";
347};
348
349&reg_ldo1 {
350 regulator-name = "vdd-rtc";
351};
352
353&reg_ldo2 {
354 regulator-always-on;
355 regulator-min-microvolt = <3000000>;
356 regulator-max-microvolt = <3000000>;
357 regulator-name = "avcc";
358};
359
360&reg_usb0_vbus {
361 status = "okay";
362};
363
364&reg_usb2_vbus {
365 status = "okay";
366};
367
368&uart0 {
369 pinctrl-names = "default";
Jagan Teki3c92cca2018-08-05 00:40:07 +0530370 pinctrl-0 = <&uart0_pb_pins>;
Hans de Goededeed69d2015-09-08 22:28:30 +0200371 status = "okay";
372};
373
374&usb_otg {
375 dr_mode = "otg";
376 status = "okay";
377};
378
379&usbphy {
380 pinctrl-names = "default";
381 pinctrl-0 = <&usb0_id_detect_pin>, <&usb0_vbus_detect_pin>;
382 usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
383 usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
384 usb0_vbus-supply = <&reg_usb0_vbus>;
385 usb2_vbus-supply = <&reg_usb2_vbus>;
386 status = "okay";
387};