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";
38 label = "EV3 Brick Buttons";
39 pinctrl-names = "default";
40 pinctrl-0 = <&button_pins>, <&button_bias>;
44 linux,code = <KEY_ENTER>;
45 gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
50 linux,code = <KEY_LEFT>;
51 gpios = <&gpio 102 GPIO_ACTIVE_HIGH>;
56 linux,code = <KEY_BACKSPACE>;
57 gpios = <&gpio 106 GPIO_ACTIVE_HIGH>;
62 linux,code = <KEY_RIGHT>;
63 gpios = <&gpio 124 GPIO_ACTIVE_HIGH>;
68 linux,code = <KEY_DOWN>;
69 gpios = <&gpio 126 GPIO_ACTIVE_HIGH>;
74 linux,code = <KEY_UP>;
75 gpios = <&gpio 127 GPIO_ACTIVE_HIGH>;
80 * The EV3 has two built-in bi-color LEDs behind the buttons.
83 compatible = "gpio-leds";
84 pinctrl-names = "default";
85 pinctrl-0 = <&led_pins>;
88 label = "led0:green:brick-status";
90 gpios = <&gpio 103 GPIO_ACTIVE_HIGH>;
91 linux,default-trigger = "default-on";
95 label = "led1:red:brick-status";
97 gpios = <&gpio 108 GPIO_ACTIVE_HIGH>;
98 linux,default-trigger = "default-on";
102 label = "led0:red:brick-status";
104 gpios = <&gpio 109 GPIO_ACTIVE_HIGH>;
105 linux,default-trigger = "default-on";
109 label = "led1:green:brick-status";
111 gpios = <&gpio 110 GPIO_ACTIVE_HIGH>;
112 linux,default-trigger = "default-on";
117 * The EV3 is powered down by turning off the main 5V supply.
120 compatible = "gpio-poweroff";
121 gpios = <&gpio 107 GPIO_ACTIVE_LOW>;
122 pinctrl-names = "default";
123 pinctrl-0 = <&system_power_pin>;
127 compatible = "pwm-beeper";
128 pinctrl-names = "default";
129 pinctrl-0 = <&ehrpwm0b_pins>;
130 pwms = <&ehrpwm0 1 1000000 0>;
135 * This is a 5V current limiting regulator that is shared by USB,
136 * the sensor (input) ports, the motor (output) ports and the A/DC.
139 pinctrl-names = "default";
140 pinctrl-0 = <&vcc5v_pins>;
141 compatible = "regulator-fixed";
142 regulator-name = "vcc5v";
143 regulator-min-microvolt = <5000000>;
144 regulator-max-microvolt = <5000000>;
145 gpio = <&gpio 101 0>;
146 over-current-gpios = <&gpio 99 GPIO_ACTIVE_LOW>;
152 * This is a simple voltage divider on VCC5V to provide a 2.5V
153 * reference signal to the ADC.
155 adc_ref: regulator2 {
156 compatible = "regulator-fixed";
157 regulator-name = "adc ref";
158 regulator-min-microvolt = <2500000>;
159 regulator-max-microvolt = <2500000>;
161 vin-supply = <&vcc5v>;
165 * This is the amplifier for the speaker.
168 pinctrl-names = "default";
169 pinctrl-0 = <&_pins>;
170 compatible = "regulator-fixed";
171 regulator-name = "amp";
172 gpio = <&gpio 111 GPIO_ACTIVE_HIGH>;
177 * The EV3 can use 6-AA batteries or a rechargeable Li-ion battery pack.
180 pinctrl-names = "default";
181 pinctrl-0 = <&battery_pins>;
182 compatible = "lego,ev3-battery";
183 io-channels = <&adc 4>, <&adc 3>;
184 io-channel-names = "voltage", "current";
185 rechargeable-gpios = <&gpio 136 GPIO_ACTIVE_LOW>;
190 compatible = "syscon", "simple-mfd";
191 reg = <0xffff0000 0x2000>; /* 8k */
194 * The I2C bootloader looks for this magic value to either
195 * boot normally or boot into a firmware update mode.
198 compatible = "syscon-reboot-mode";
200 mode-normal = <0x00000000>;
201 mode-loader = <0x5555aaaa>;
209 mmc0_cd_pin: pinmux_mmc0_cd {
210 pinctrl-single,bits = <
212 0x2C 0x00000080 0x000000f0
216 button_pins: pinmux_button_pins {
217 pinctrl-single,bits = <
219 0x8 0x00000800 0x00000f00
221 0x34 0x00800000 0x00f00000
223 0x38 0x00000080 0x000000f0
224 /* GP7[12], GP7[14], GP7[15] */
225 0x40 0x00808800 0x00f0ff00
229 led_pins: pinmux_led_pins {
230 pinctrl-single,bits = <
231 /* GP6[12], GP6[13], GP6[14] */
232 0x34 0x00008880 0x0000fff0
234 0x38 0x00000008 0x0000000f
238 system_power_pin: pinmux_system_power {
239 pinctrl-single,bits = <
241 0x34 0x00080000 0x000f0000
245 vcc5v_pins: pinmux_vcc5v {
246 pinctrl-single,bits = <
248 0x40 0x00000080 0x000000f0
250 0x4c 0x00008000 0x0000f000
254 amp_pins: pinmux_amp_pins {
255 pinctrl-single,bits = <
257 0x34 0x00000008 0x0000000f
261 battery_pins: pinmux_battery_pins {
262 pinctrl-single,bits = <
264 0x04 0x00000080 0x000000f0
266 0x4c 0x00000080 0x000000f0
270 ev3_lcd_pins: pinmux_lcd {
271 pinctrl-single,bits = <
272 /* SIMO, GP2[11], GP2[12], CLK */
273 0x14 0x00188100 0x00ffff00
275 0x30 0x80000000 0xf0000000
283 /* Buttons have external pulldown resistors */
284 button_bias: button-bias-groups {
286 groups = "cp5", "cp24", "cp25", "cp28";
295 pinctrl-names = "default";
296 pinctrl-0 = <&serial1_rxtx_pins>;
305 clock-frequency = <400000>;
306 pinctrl-names = "default";
307 pinctrl-0 = <&i2c0_pins>;
310 * EEPROM contains the first stage bootloader, HW ID and Bluetooth MAC.
313 compatible = "microchip,24c128", "atmel,24c128";
326 max-frequency = <50000000>;
328 cd-gpios = <&gpio 94 GPIO_ACTIVE_LOW>;
329 pinctrl-names = "default";
330 pinctrl-0 = <&mmc0_pins>, <&mmc0_cd_pin>;
335 pinctrl-names = "default";
336 pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>, <&spi0_cs3_pin>;
339 compatible = "n25q128a13", "jedec,spi-nor";
341 spi-max-frequency = <50000000>;
344 /* Partitions are based on the official firmware from LEGO */
346 compatible = "fixed-partitions";
347 #address-cells = <1>;
356 label = "U-Boot Env";
357 reg = <0x40000 0x10000>;
362 reg = <0x50000 0x200000>;
366 label = "Filesystem";
367 reg = <0x250000 0xa50000>;
372 reg = <0xcb0000 0x2f0000>;
378 compatible = "ti,ads7957";
380 #io-channel-cells = <1>;
381 spi-max-frequency = <10000000>;
382 vref-supply = <&adc_ref>;
388 pinctrl-0 = <&ev3_lcd_pins>;
389 pinctrl-names = "default";
390 cs-gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
393 compatible = "lego,ev3-lcd";
395 spi-max-frequency = <10000000>;
396 a0-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
397 reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
408 /* Don't pull down battery voltage adc io channel */
411 gpios = <6 GPIO_ACTIVE_HIGH>;
426 vbus-supply = <&vcc5v>;