Skip to contentSkip to conversation

arm: Add support for LEGO MINDSTORMS EV3

PATCH Superseded David Lechner 2 participants 3 messages Feb 26, 2016 – Mar 15, 2016

Subsystems (3)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: Add support for LEGO MINDSTORMS EV3

This is based on the davinci da850evm. It can boot from either the on-board 16MB flash or from a microSD card. It also reads board information from an I2C EEPROM.

The EV3 itself initally boots from write-protected EEPROM, so no u-boot SPL is needed.

---
 arch/arm/mach-davinci/Kconfig                 |   4 +
 arch/arm/mach-davinci/da850_pinmux.c          |  10 +
 arch/arm/mach-davinci/include/mach/hardware.h |   1 +
 board/lego/ev3/Kconfig                        |  12 ++
 board/lego/ev3/MAINTAINERS                    |   6 +
 board/lego/ev3/Makefile                       |  10 +
 board/lego/ev3/README                         |  32 ++++
 board/lego/ev3/legoev3.c                      | 176 ++++++++++++++++++
 configs/legoev3_defconfig                     |  12 ++
 include/configs/legoev3.h                     | 255 ++++++++++++++++++++++++++
 10 files changed, 518 insertions(+)
 create mode 100644 board/lego/ev3/Kconfig
 create mode 100644 board/lego/ev3/MAINTAINERS
 create mode 100644 board/lego/ev3/Makefile
 create mode 100644 board/lego/ev3/README
 create mode 100644 board/lego/ev3/legoev3.c
 create mode 100644 configs/legoev3_defconfig
 create mode 100644 include/configs/legoev3.h
arch/arm/mach-davinci/Kconfig +4 -0
index a8d3e2f..5d1c5c5 100644
@@ -22,6 +22,9 @@ config TARGET_OMAPL138_LCDK
 config TARGET_CALIMAIN
 	bool "Calimain board"
 
+config TARGET_LEGOEV3
+	bool "LEGO MINDSTORMS EV3"
+
 endchoice
 
 config SYS_SOC
@@ -31,5 +34,6 @@ source "board/Barix/ipam390/Kconfig"
 source "board/davinci/da8xxevm/Kconfig"
 source "board/davinci/ea20/Kconfig"
 source "board/omicron/calimain/Kconfig"
+source "board/lego/ev3/Kconfig"
 
 endif
arch/arm/mach-davinci/da850_pinmux.c +10 -0
index 6105f63..758109e 100644
@@ -12,6 +12,16 @@
 #include <asm/arch/pinmux_defs.h>
 
 /* SPI pin muxer settings */
+const struct pinmux_config spi0_pins_base[] = {
+	{ pinmux(3), 1, 0 }, /* SPI0_CLK */
+	{ pinmux(3), 1, 2 }, /* SPI0_SOMI */
+	{ pinmux(3), 1, 3 }, /* SPI0_SIMO */
+};
+
+const struct pinmux_config spi0_pins_scs0[] = {
+	{ pinmux(4), 1, 1 }, /* SPI0_SCS[0] */
+};
+
 const struct pinmux_config spi1_pins_base[] = {
 	{ pinmux(5), 1, 2 }, /* SPI1_CLK */
 	{ pinmux(5), 1, 4 }, /* SPI1_SOMI */
arch/arm/mach-davinci/include/mach/hardware.h +1 -0
index a4eb0bd..2a0360a 100644
@@ -503,6 +503,7 @@ struct davinci_syscfg_regs {
 #define DAVINCI_SYSCFG_SUSPSRC_SPI0		(1 << 21)
 #define DAVINCI_SYSCFG_SUSPSRC_SPI1		(1 << 22)
 #define DAVINCI_SYSCFG_SUSPSRC_UART0		(1 << 18)
+#define DAVINCI_SYSCFG_SUSPSRC_UART1		(1 << 19)
 #define DAVINCI_SYSCFG_SUSPSRC_UART2		(1 << 20)
 #define DAVINCI_SYSCFG_SUSPSRC_TIMER0		(1 << 27)
 
board/lego/ev3/Kconfig new file +12 -0
new file mode 100644
index 0000000..14b3f0c
@@ -0,0 +1,12 @@
+if TARGET_LEGOEV3
+
+config SYS_BOARD
+	default "ev3"
+
+config SYS_VENDOR
+	default "lego"
+
+config SYS_CONFIG_NAME
+	default "legoev3"
+
+endif
board/lego/ev3/MAINTAINERS new file +6 -0
new file mode 100644
index 0000000..11b3261
@@ -0,0 +1,6 @@
+LEGOEV3 BOARD
+M:	David Lechner <[email protected]>
+S:	Maintained
+F:	board/lego/ev3/
+F:	include/configs/legoev3.h
+F:	configs/legoev3_defconfig
board/lego/ev3/Makefile new file +10 -0
new file mode 100644
index 0000000..f3e717a
@@ -0,0 +1,10 @@
+#
+# (C) Copyright 2000, 2001, 2002
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# Copyright (C) 2007 Sergey Kubushyn <[email protected]>
+#
+# SPDX-License-Identifier:	GPL-2.0+
+#
+
+obj-y	+= legoev3.o
board/lego/ev3/README new file +32 -0
new file mode 100644
index 0000000..1a50ca9
@@ -0,0 +1,32 @@
+Summary
+=======
+
+LEGO MINDSTORMS EV3 is a toy robot produced by the LEGO Group. It is based
+on the davinci da850 evm. The EV3 has a 16MB spi flash and a SDHC microSD card
+reader.
+
+Booting
+=======
+
+The EV3 contains a bootloader in EEPROM that loads u-boot.bin from address 0x0
+of the spi flash memory. Using the default configuration, u-boot will check to
+see if there is a boot.scr file on the first FAT partition of the mmc. If there
+is, it will run the script and boot the kernel from the uImage file also in
+the FAT partition. Otherwise, it will load a kernel and rootfs from the flash.
+The kernel must be stored at address 0x50000 on the flash and have a maximum
+size of 3MiB. The rootfs must be a squasfs image and stored at 0x350000 in the
+flash and have a maximum size of 9.3MiB. The flash starting at 0xCB0000 is
+reserved for user data.
+
+Writing image to flash
+======================
+
+The EEPROM contains a program for uploading an image file to the flash memory.
+The program is started by holding down the right button on the EV3 when powering
+it on. You can also `run fwupdateboot` in the u-boot shell to reboot into this
+mode. The image can then be uploaded using the official LEGO MINDSTORMS EV3
+software or a 3rd party program capable of uploading a firmware file.
+
+If you are booting from the microSD card, it is enough to just write uboot.bin
+to the flash. If you are not using a microSD card, you will need to create an
+image file using the layout described above.
board/lego/ev3/legoev3.c new file +176 -0

176 lines not on this page · raw message

configs/legoev3_defconfig new file +12 -0
new file mode 100644
index 0000000..d838baa
@@ -0,0 +1,12 @@
+CONFIG_ARM=y
+CONFIG_ARCH_DAVINCI=y
+CONFIG_TARGET_LEGOEV3=y
+CONFIG_AUTOBOOT_KEYED=y
+CONFIG_AUTOBOOT_PROMPT="Autoboot in %d seconds - press 'l' to stop...\n"
+CONFIG_AUTOBOOT_STOP_STR="l"
+# CONFIG_CMD_IMLS is not set
+# CONFIG_CMD_FLASH is not set
+# CONFIG_CMD_SETEXPR is not set
+CONFIG_SPI_FLASH=y
+CONFIG_SPI_FLASH_STMICRO=y
+CONFIG_SYS_NS16550=y
include/configs/legoev3.h new file +255 -0

255 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 arm: Add support for LEGO MINDSTORMS EV3

Quoted 8 lines · David Lechner

This is based on the davinci da850evm. It can boot from either the on-board 16MB flash or from a microSD card. It also reads board information from an I2C EEPROM.

The EV3 itself initally boots from write-protected EEPROM, so no u-boot SPL is needed.

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160229/d737c3a0/attachment.sig>
#2 lore raw
In reply to David Lechner
Quoted 9 lines · David Lechner

This is based on the davinci da850evm. It can boot from either the on-board 16MB flash or from a microSD card. It also reads board information from an I2C EEPROM.

The EV3 itself initally boots from write-protected EEPROM, so no u-boot SPL is needed.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160315/34f5b891/attachment.sig>