2 * Device tree for LEGO MINDSTORMS EV3
4 * Copyright (C) 2017 David Lechner <david@lechnology.com>
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, version 2.
12 #include <dt-bindings/gpio/gpio.h>
13 #include <dt-bindings/input/linux-event-codes.h>
14 #include <dt-bindings/pwm/pwm.h>
19 compatible = "lego,ev3", "ti,da850";
20 model = "LEGO MINDSTORMS EV3";
27 device_type = "memory";
28 reg = <0xc0000000 0x04000000>;
32 * The buttons on the EV3 are mapped to keyboard keys.
35 compatible = "gpio-keys";
36 label = "EV3 Brick Buttons";
37 pinctrl-names = "default";
38 pinctrl-0 = <&button_bias>;
42 linux,code = <KEY_ENTER>;
43 gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
48 linux,code = <KEY_LEFT>;
49 gpios = <&gpio 102 GPIO_ACTIVE_HIGH>;
54 linux,code = <KEY_BACKSPACE>;
55 gpios = <&gpio 106 GPIO_ACTIVE_HIGH>;
60 linux,code = <KEY_RIGHT>;
61 gpios = <&gpio 124 GPIO_ACTIVE_HIGH>;
66 linux,code = <KEY_DOWN>;
67 gpios = <&gpio 126 GPIO_ACTIVE_HIGH>;
72 linux,code = <KEY_UP>;
73 gpios = <&gpio 127 GPIO_ACTIVE_HIGH>;
78 * The EV3 has two built-in bi-color LEDs behind the buttons.
81 compatible = "gpio-leds";
84 label = "led0:green:brick-status";
86 gpios = <&gpio 103 GPIO_ACTIVE_HIGH>;
87 linux,default-trigger = "default-on";
91 label = "led1:red:brick-status";
93 gpios = <&gpio 108 GPIO_ACTIVE_HIGH>;
94 linux,default-trigger = "default-on";
98 label = "led0:red:brick-status";
100 gpios = <&gpio 109 GPIO_ACTIVE_HIGH>;
101 linux,default-trigger = "default-on";
105 label = "led1:green:brick-status";
107 gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
108 linux,default-trigger = "default-on";
113 * The EV3 is powered down by turning off the main 5V supply.
116 compatible = "gpio-poweroff";
117 gpios = <&gpio 107 GPIO_ACTIVE_LOW>;
121 compatible = "pwm-beeper";
122 pinctrl-names = "default";
123 pinctrl-0 = <&ehrpwm0b_pins>;
124 pwms = <&ehrpwm0 1 1000000 0>;
129 * This is a 5V current limiting regulator that is shared by USB,
130 * the sensor (input) ports, the motor (output) ports and the A/DC.
133 compatible = "regulator-fixed";
134 regulator-name = "vcc5v";
135 regulator-min-microvolt = <5000000>;
136 regulator-max-microvolt = <5000000>;
137 gpio = <&gpio 101 0>;
138 over-current-gpios = <&gpio 99 GPIO_ACTIVE_LOW>;
144 * This is a simple voltage divider on VCC5V to provide a 2.5V
145 * reference signal to the ADC.
147 adc_ref: regulator2 {
148 compatible = "regulator-fixed";
149 regulator-name = "adc ref";
150 regulator-min-microvolt = <2500000>;
151 regulator-max-microvolt = <2500000>;
153 vin-supply = <&vcc5v>;
157 * This is the amplifier for the speaker.
160 compatible = "regulator-fixed";
161 regulator-name = "amp";
162 gpio = <&gpio 111 GPIO_ACTIVE_HIGH>;
167 * The EV3 can use 6-AA batteries or a rechargeable Li-ion battery pack.
170 compatible = "lego,ev3-battery";
171 io-channels = <&adc 4>, <&adc 3>;
172 io-channel-names = "voltage", "current";
173 rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>;
178 compatible = "syscon", "simple-mfd";
179 reg = <0xffff0000 0x2000>; /* 8k */
182 * The I2C bootloader looks for this magic value to either
183 * boot normally or boot into a firmware update mode.
186 compatible = "syscon-reboot-mode";
188 mode-normal = <0x00000000>;
189 mode-loader = <0x5555aaaa>;
197 ev3_lcd_pins: pinmux_lcd {
198 pinctrl-single,bits = <
200 0x14 0x00100100 0x00f00f00
208 /* Buttons have external pulldown resistors */
209 button_bias: button-bias-groups {
211 groups = "cp5", "cp24", "cp25", "cp28";
220 pinctrl-names = "default";
221 pinctrl-0 = <&serial1_rxtx_pins>;
230 clock-frequency = <400000>;
231 pinctrl-names = "default";
232 pinctrl-0 = <&i2c0_pins>;
235 * EEPROM contains the first stage bootloader, HW ID and Bluetooth MAC.
238 compatible = "microchip,24c128", "atmel,24c128";
251 max-frequency = <50000000>;
253 cd-gpios = <&gpio 94 GPIO_ACTIVE_LOW>;
254 pinctrl-names = "default";
255 pinctrl-0 = <&mmc0_pins>;
260 pinctrl-names = "default";
261 pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>, <&spi0_cs3_pin>;
264 compatible = "n25q128a13", "jedec,spi-nor";
266 spi-max-frequency = <50000000>;
269 /* Partitions are based on the official firmware from LEGO */
271 compatible = "fixed-partitions";
272 #address-cells = <1>;
281 label = "U-Boot Env";
282 reg = <0x40000 0x10000>;
287 reg = <0x50000 0x200000>;
291 label = "Filesystem";
292 reg = <0x250000 0xa50000>;
297 reg = <0xcb0000 0x2f0000>;
303 compatible = "ti,ads7957";
305 #io-channel-cells = <1>;
306 spi-max-frequency = <10000000>;
307 vref-supply = <&adc_ref>;
313 pinctrl-0 = <&ev3_lcd_pins>;
314 pinctrl-names = "default";
315 cs-gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
318 compatible = "lego,ev3-lcd";
320 spi-max-frequency = <10000000>;
321 a0-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
322 reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
333 /* Don't pull down battery voltage adc io channel */
336 gpios = <6 GPIO_ACTIVE_HIGH>;
351 vbus-supply = <&vcc5v>;