blob: 0a562b2cc5bc6771c65ed77c2c72d2f76c87bd55 [file] [log] [blame]
Hans de Goede44636032015-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 Goede44636032015-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 Goede19888a42016-03-14 17:37:09 +010061
Jagan Teki95ef47c2018-08-05 00:40:07 +053062 gpio-keys {
Hans de Goede19888a42016-03-14 17:37:09 +010063 compatible = "gpio-keys-polled";
Hans de Goede19888a42016-03-14 17:37:09 +010064 poll-interval = <20>;
65
Jagan Teki95ef47c2018-08-05 00:40:07 +053066 left-joystick-left {
Hans de Goede19888a42016-03-14 17:37:09 +010067 label = "Left Joystick Left";
68 linux,code = <ABS_X>;
69 linux,input-type = <EV_ABS>;
70 linux,input-value = <0xffffffff>; /* -1 */
Samuel Hollandb1411532022-05-25 22:26:02 -050071 gpios = <&pio 0 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA6 */
Hans de Goede19888a42016-03-14 17:37:09 +010072 };
73
Jagan Teki95ef47c2018-08-05 00:40:07 +053074 left-joystick-right {
Hans de Goede19888a42016-03-14 17:37:09 +010075 label = "Left Joystick Right";
76 linux,code = <ABS_X>;
77 linux,input-type = <EV_ABS>;
78 linux,input-value = <1>;
Samuel Hollandb1411532022-05-25 22:26:02 -050079 gpios = <&pio 0 5 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA5 */
Hans de Goede19888a42016-03-14 17:37:09 +010080 };
81
Jagan Teki95ef47c2018-08-05 00:40:07 +053082 left-joystick-up {
Hans de Goede19888a42016-03-14 17:37:09 +010083 label = "Left Joystick Up";
84 linux,code = <ABS_Y>;
85 linux,input-type = <EV_ABS>;
86 linux,input-value = <0xffffffff>; /* -1 */
Samuel Hollandb1411532022-05-25 22:26:02 -050087 gpios = <&pio 0 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA8 */
Hans de Goede19888a42016-03-14 17:37:09 +010088 };
89
Jagan Teki95ef47c2018-08-05 00:40:07 +053090 left-joystick-down {
Hans de Goede19888a42016-03-14 17:37:09 +010091 label = "Left Joystick Down";
92 linux,code = <ABS_Y>;
93 linux,input-type = <EV_ABS>;
94 linux,input-value = <1>;
Samuel Hollandb1411532022-05-25 22:26:02 -050095 gpios = <&pio 0 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA9 */
Hans de Goede19888a42016-03-14 17:37:09 +010096 };
97
Jagan Teki95ef47c2018-08-05 00:40:07 +053098 right-joystick-left {
Hans de Goede19888a42016-03-14 17:37:09 +010099 label = "Right Joystick Left";
100 linux,code = <ABS_Z>;
101 linux,input-type = <EV_ABS>;
102 linux,input-value = <0xffffffff>; /* -1 */
Samuel Hollandb1411532022-05-25 22:26:02 -0500103 gpios = <&pio 0 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA1 */
Hans de Goede19888a42016-03-14 17:37:09 +0100104 };
105
Jagan Teki95ef47c2018-08-05 00:40:07 +0530106 right-joystick-right {
Hans de Goede19888a42016-03-14 17:37:09 +0100107 label = "Right Joystick Right";
108 linux,code = <ABS_Z>;
109 linux,input-type = <EV_ABS>;
110 linux,input-value = <1>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500111 gpios = <&pio 0 0 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA0 */
Hans de Goede19888a42016-03-14 17:37:09 +0100112 };
113
Jagan Teki95ef47c2018-08-05 00:40:07 +0530114 right-joystick-up {
Hans de Goede19888a42016-03-14 17:37:09 +0100115 label = "Right Joystick Up";
116 linux,code = <ABS_RZ>;
117 linux,input-type = <EV_ABS>;
118 linux,input-value = <0xffffffff>; /* -1 */
Samuel Hollandb1411532022-05-25 22:26:02 -0500119 gpios = <&pio 0 3 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA3 */
Hans de Goede19888a42016-03-14 17:37:09 +0100120 };
121
Jagan Teki95ef47c2018-08-05 00:40:07 +0530122 right-joystick-down {
Hans de Goede19888a42016-03-14 17:37:09 +0100123 label = "Right Joystick Down";
124 linux,code = <ABS_RZ>;
125 linux,input-type = <EV_ABS>;
126 linux,input-value = <1>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500127 gpios = <&pio 0 4 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA4 */
Hans de Goede19888a42016-03-14 17:37:09 +0100128 };
129
Jagan Teki95ef47c2018-08-05 00:40:07 +0530130 dpad-left {
Hans de Goede19888a42016-03-14 17:37:09 +0100131 label = "DPad Left";
132 linux,code = <ABS_HAT0X>;
133 linux,input-type = <EV_ABS>;
134 linux,input-value = <0xffffffff>; /* -1 */
Samuel Hollandb1411532022-05-25 22:26:02 -0500135 gpios = <&pio 7 23 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH23 */
Hans de Goede19888a42016-03-14 17:37:09 +0100136 };
137
Jagan Teki95ef47c2018-08-05 00:40:07 +0530138 dpad-right {
Hans de Goede19888a42016-03-14 17:37:09 +0100139 label = "DPad Right";
140 linux,code = <ABS_HAT0X>;
141 linux,input-type = <EV_ABS>;
142 linux,input-value = <1>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500143 gpios = <&pio 7 24 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH24 */
Hans de Goede19888a42016-03-14 17:37:09 +0100144 };
145
Jagan Teki95ef47c2018-08-05 00:40:07 +0530146 dpad-up {
Hans de Goede19888a42016-03-14 17:37:09 +0100147 label = "DPad Up";
148 linux,code = <ABS_HAT0Y>;
149 linux,input-type = <EV_ABS>;
150 linux,input-value = <0xffffffff>; /* -1 */
Samuel Hollandb1411532022-05-25 22:26:02 -0500151 gpios = <&pio 7 25 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH25 */
Hans de Goede19888a42016-03-14 17:37:09 +0100152 };
153
Jagan Teki95ef47c2018-08-05 00:40:07 +0530154 dpad-down {
Hans de Goede19888a42016-03-14 17:37:09 +0100155 label = "DPad Down";
156 linux,code = <ABS_HAT0Y>;
157 linux,input-type = <EV_ABS>;
158 linux,input-value = <1>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500159 gpios = <&pio 7 26 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH26 */
Hans de Goede19888a42016-03-14 17:37:09 +0100160 };
161
Jagan Teki95ef47c2018-08-05 00:40:07 +0530162 x {
Hans de Goede19888a42016-03-14 17:37:09 +0100163 label = "Button X";
164 linux,code = <BTN_X>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500165 gpios = <&pio 0 16 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA16 */
Hans de Goede19888a42016-03-14 17:37:09 +0100166 };
167
Jagan Teki95ef47c2018-08-05 00:40:07 +0530168 y {
Hans de Goede19888a42016-03-14 17:37:09 +0100169 label = "Button Y";
170 linux,code = <BTN_Y>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500171 gpios = <&pio 0 14 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA14 */
Hans de Goede19888a42016-03-14 17:37:09 +0100172 };
173
Jagan Teki95ef47c2018-08-05 00:40:07 +0530174 a {
Hans de Goede19888a42016-03-14 17:37:09 +0100175 label = "Button A";
176 linux,code = <BTN_A>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500177 gpios = <&pio 0 17 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA17 */
Hans de Goede19888a42016-03-14 17:37:09 +0100178 };
179
Jagan Teki95ef47c2018-08-05 00:40:07 +0530180 b {
Hans de Goede19888a42016-03-14 17:37:09 +0100181 label = "Button B";
182 linux,code = <BTN_B>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500183 gpios = <&pio 0 15 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA15 */
Hans de Goede19888a42016-03-14 17:37:09 +0100184 };
185
Jagan Teki95ef47c2018-08-05 00:40:07 +0530186 select {
Hans de Goede19888a42016-03-14 17:37:09 +0100187 label = "Select Button";
188 linux,code = <BTN_SELECT>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500189 gpios = <&pio 0 11 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA11 */
Hans de Goede19888a42016-03-14 17:37:09 +0100190 };
191
Jagan Teki95ef47c2018-08-05 00:40:07 +0530192 start {
Hans de Goede19888a42016-03-14 17:37:09 +0100193 label = "Start Button";
194 linux,code = <BTN_START>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500195 gpios = <&pio 0 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA12 */
Hans de Goede19888a42016-03-14 17:37:09 +0100196 };
197
Jagan Teki95ef47c2018-08-05 00:40:07 +0530198 top-left {
Hans de Goede19888a42016-03-14 17:37:09 +0100199 label = "Top Left Button";
200 linux,code = <BTN_TL>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500201 gpios = <&pio 7 22 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PH22 */
Hans de Goede19888a42016-03-14 17:37:09 +0100202 };
203
Jagan Teki95ef47c2018-08-05 00:40:07 +0530204 top-right {
Hans de Goede19888a42016-03-14 17:37:09 +0100205 label = "Top Right Button";
206 linux,code = <BTN_TR>;
Samuel Hollandb1411532022-05-25 22:26:02 -0500207 gpios = <&pio 0 13 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PA13 */
Hans de Goede19888a42016-03-14 17:37:09 +0100208 };
209 };
Hans de Goede44636032015-09-08 22:28:30 +0200210};
211
212&cpu0 {
213 cpu-supply = <&reg_dcdc2>;
214};
215
216&ehci1 {
217 status = "okay";
218};
219
220&i2c0 {
Hans de Goede44636032015-09-08 22:28:30 +0200221 status = "okay";
222
223 axp209: pmic@34 {
224 reg = <0x34>;
225 interrupts = <0>;
226 };
227};
228
229#include "axp209.dtsi"
230
231&i2c1 {
Hans de Goede44636032015-09-08 22:28:30 +0200232 status = "okay";
Hans de Goede19888a42016-03-14 17:37:09 +0100233
234 /* Accelerometer */
235 bma250@18 {
236 compatible = "bosch,bma250";
237 reg = <0x18>;
238 interrupt-parent = <&pio>;
239 interrupts = <7 0 IRQ_TYPE_EDGE_RISING>; /* PH0 / EINT0 */
240 };
Hans de Goede44636032015-09-08 22:28:30 +0200241};
242
243&i2c2 {
Hans de Goede44636032015-09-08 22:28:30 +0200244 status = "okay";
Hans de Goede19888a42016-03-14 17:37:09 +0100245
246 ft5406ee8: touchscreen@38 {
247 compatible = "edt,edt-ft5406";
248 reg = <0x38>;
249 interrupt-parent = <&pio>;
250 interrupts = <7 21 IRQ_TYPE_EDGE_FALLING>;
251 touchscreen-size-x = <800>;
252 touchscreen-size-y = <480>;
253 };
Hans de Goede44636032015-09-08 22:28:30 +0200254};
255
256&lradc {
257 vref-supply = <&reg_ldo2>;
258 status = "okay";
259
Jagan Teki95ef47c2018-08-05 00:40:07 +0530260 button-200 {
Hans de Goede44636032015-09-08 22:28:30 +0200261 label = "Menu";
262 linux,code = <KEY_MENU>;
263 channel = <0>;
264 voltage = <200000>;
265 };
266
Jagan Teki95ef47c2018-08-05 00:40:07 +0530267 button-600 {
Hans de Goede44636032015-09-08 22:28:30 +0200268 label = "Volume Up";
269 linux,code = <KEY_VOLUMEUP>;
270 channel = <0>;
271 voltage = <600000>;
272 };
273
Jagan Teki95ef47c2018-08-05 00:40:07 +0530274 button-800 {
Hans de Goede44636032015-09-08 22:28:30 +0200275 label = "Volume Down";
276 linux,code = <KEY_VOLUMEDOWN>;
277 channel = <0>;
278 voltage = <800000>;
279 };
280
Jagan Teki95ef47c2018-08-05 00:40:07 +0530281 button-1000 {
Hans de Goede44636032015-09-08 22:28:30 +0200282 label = "Home";
283 linux,code = <KEY_HOMEPAGE>;
284 channel = <0>;
285 voltage = <1000000>;
286 };
287
Jagan Teki95ef47c2018-08-05 00:40:07 +0530288 button-1200 {
Hans de Goede44636032015-09-08 22:28:30 +0200289 label = "Esc";
290 linux,code = <KEY_ESC>;
291 channel = <0>;
292 voltage = <1200000>;
293 };
294};
295
296&mmc0 {
Hans de Goede44636032015-09-08 22:28:30 +0200297 vmmc-supply = <&reg_vcc3v3>;
298 bus-width = <4>;
Jagan Teki95ef47c2018-08-05 00:40:07 +0530299 cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>; /* PH1 */
Hans de Goede44636032015-09-08 22:28:30 +0200300 status = "okay";
301};
302
303&otg_sram {
304 status = "okay";
305};
306
Hans de Goede44636032015-09-08 22:28:30 +0200307&reg_dcdc2 {
308 regulator-always-on;
309 regulator-min-microvolt = <1000000>;
310 regulator-max-microvolt = <1400000>;
311 regulator-name = "vdd-cpu";
312};
313
314&reg_dcdc3 {
315 regulator-always-on;
316 regulator-min-microvolt = <1250000>;
317 regulator-max-microvolt = <1250000>;
318 regulator-name = "vdd-int-dll";
319};
320
321&reg_ldo1 {
322 regulator-name = "vdd-rtc";
323};
324
325&reg_ldo2 {
326 regulator-always-on;
327 regulator-min-microvolt = <3000000>;
328 regulator-max-microvolt = <3000000>;
329 regulator-name = "avcc";
330};
331
332&reg_usb0_vbus {
333 status = "okay";
334};
335
336&reg_usb2_vbus {
337 status = "okay";
338};
339
340&uart0 {
341 pinctrl-names = "default";
Jagan Teki95ef47c2018-08-05 00:40:07 +0530342 pinctrl-0 = <&uart0_pb_pins>;
Hans de Goede44636032015-09-08 22:28:30 +0200343 status = "okay";
344};
345
346&usb_otg {
347 dr_mode = "otg";
348 status = "okay";
349};
350
351&usbphy {
Samuel Hollandb1411532022-05-25 22:26:02 -0500352 usb0_id_det-gpios = <&pio 7 4 (GPIO_ACTIVE_HIGH | GPIO_PULL_UP)>; /* PH4 */
353 usb0_vbus_det-gpios = <&pio 7 5 (GPIO_ACTIVE_HIGH | GPIO_PULL_DOWN)>; /* PH5 */
Hans de Goede44636032015-09-08 22:28:30 +0200354 usb0_vbus-supply = <&reg_usb0_vbus>;
355 usb2_vbus-supply = <&reg_usb2_vbus>;
356 status = "okay";
357};