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>;
176 bt_slow_clk: bt-clock {
177 pinctrl-names = "default";
178 pinctrl-0 = <&ecap2_pins>, <&bt_clock_bias>;
179 compatible = "pwm-clock";
181 clock-frequency = <32768>;
182 pwms = <&ecap2 0 30518 0>;
187 compatible = "syscon", "simple-mfd";
188 reg = <0xffff0000 0x2000>; /* 8k */
191 * The I2C bootloader looks for this magic value to either
192 * boot normally or boot into a firmware update mode.
195 compatible = "syscon-reboot-mode";
197 mode-normal = <0x00000000>;
198 mode-loader = <0x5555aaaa>;
204 clock-frequency = <24000000>;
210 ev3_lcd_pins: pinmux_lcd {
211 pinctrl-single,bits = <
213 0x14 0x00100100 0x00f00f00
221 /* Buttons have external pulldown resistors */
222 button_bias: button-bias-groups {
224 groups = "cp5", "cp24", "cp25", "cp28";
229 bt_clock_bias: bt-clock-bias-groups {
236 bt_pic_bias: bt-pic-bias-groups {
247 pinctrl-names = "default";
248 pinctrl-0 = <&serial1_rxtx_pins>;
252 pinctrl-names = "default";
253 pinctrl-0 = <&serial2_rxtx_pins>, <&serial2_rtscts_pins>, <&bt_pic_bias>;
257 compatible = "ti,cc2560";
258 clocks = <&bt_slow_clk>;
259 clock-names = "ext_clock";
260 enable-gpios = <&gpio 73 GPIO_ACTIVE_HIGH>;
261 max-speed = <2000000>;
262 nvmem-cells = <&bdaddr>;
263 nvmem-cell-names = "bd-address";
273 clock-frequency = <400000>;
274 pinctrl-names = "default";
275 pinctrl-0 = <&i2c0_pins>;
278 * EEPROM contains the first stage bootloader, HW ID and Bluetooth MAC.
281 compatible = "microchip,24c128", "atmel,24c128";
285 #address-cells = <1>;
288 bdaddr: bdaddr@3f06 {
300 max-frequency = <50000000>;
302 cd-gpios = <&gpio 94 GPIO_ACTIVE_LOW>;
303 pinctrl-names = "default";
304 pinctrl-0 = <&mmc0_pins>;
309 pinctrl-names = "default";
310 pinctrl-0 = <&spi0_pins>, <&spi0_cs0_pin>, <&spi0_cs3_pin>;
313 compatible = "n25q128a13", "jedec,spi-nor";
315 spi-max-frequency = <50000000>;
318 /* Partitions are based on the official firmware from LEGO */
320 compatible = "fixed-partitions";
321 #address-cells = <1>;
330 label = "U-Boot Env";
331 reg = <0x40000 0x10000>;
336 reg = <0x50000 0x200000>;
340 label = "Filesystem";
341 reg = <0x250000 0xa50000>;
346 reg = <0xcb0000 0x2f0000>;
352 compatible = "ti,ads7957";
354 #io-channel-cells = <1>;
355 spi-max-frequency = <1000000>;
356 ti,spi-wdelay = <63>;
357 vref-supply = <&adc_ref>;
363 pinctrl-0 = <&ev3_lcd_pins>;
364 pinctrl-names = "default";
365 cs-gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
368 compatible = "lego,ev3-lcd";
370 spi-max-frequency = <10000000>;
371 a0-gpios = <&gpio 43 GPIO_ACTIVE_HIGH>;
372 reset-gpios = <&gpio 80 GPIO_ACTIVE_HIGH>;
387 /* Don't pull down battery voltage adc io channel */
390 gpios = <6 GPIO_ACTIVE_HIGH>;
394 /* Don't impede Bluetooth clock signal */
397 gpios = <5 GPIO_ACTIVE_HIGH>;
402 * There is a PIC microcontroller for interfacing with an Apple MFi
403 * chip. This interferes with normal Bluetooth operation, so we need
404 * to make sure it is turned off. Note: The publicly available
405 * schematics from LEGO don't show that these pins are connected to
406 * anything, but they are present in the source code from LEGO.
411 gpios = <51 GPIO_ACTIVE_HIGH>;
417 gpios = <78 GPIO_ACTIVE_HIGH>;
423 gpios = <87 GPIO_ACTIVE_HIGH>;
438 vbus-supply = <&vcc5v>;