ARM: legoev3: convert to driver model
PATCH 1/1 ARM: legoev3: convert to driver model
This converts LEGO MINDSTORMS EV3 to the driver model. MMC, SERIAL, SPI and SPI_FLASH are converted.
The device tree contains only the minimal nodes required by U-Boot since the size of U-Boot is limited to 256K on this device.
Signed-off-by David Lechner <[email protected]>
--- arch/arm/dts/Makefile | 3 +- arch/arm/dts/da850-lego-ev3.dts | 89 +++++++++++++++++++++++++++++++++ board/lego/ev3/README | 3 ++ board/lego/ev3/legoev3.c | 22 -------- configs/legoev3_defconfig | 9 +++- include/configs/legoev3.h | 3 -- 6 files changed, 102 insertions(+), 27 deletions(-) create mode 100644 arch/arm/dts/da850-lego-ev3.dts
arch/arm/dts/Makefile +2 -1
@@ -30,7 +30,8 @@ dtb-$(CONFIG_EXYNOS7420) += exynos7420-espresso7420.dtb dtb-$(CONFIG_ARCH_DAVINCI) += \ da850-evm.dtb \ - da850-lcdk.dtb + da850-lcdk.dtb \ + da850-lego-ev3.dtb dtb-$(CONFIG_KIRKWOOD) += \ kirkwood-atl-sbx81lifkw.dtb \
arch/arm/dts/da850-lego-ev3.dts new file +89 -0
89 lines not on this page · raw message
board/lego/ev3/README +3 -0
@@ -50,3 +50,6 @@ 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. + +IMPORTANT: The EEPROM bootloader only copies 256k, so u-boot.img must not +exceed that size!
board/lego/ev3/legoev3.c +0 -22
@@ -25,11 +25,6 @@#include <asm/mach-types.h> #include <asm/setup.h> -#ifdef CONFIG_MMC_DAVINCI -#include <mmc.h> -#include <asm/arch/sdmmc_defs.h> -#endif -DECLARE_GLOBAL_DATA_PTR ;u8 board_rev;
@@ -38,23 +33,6 @@ u8 board_rev;#define EEPROM_REV_OFFSET 0x3F00#define EEPROM_MAC_OFFSET 0x3F06 -#ifdef CONFIG_MMC_DAVINCI -static struct davinci_mmc mmc_sd0 = { - .reg_base = (struct davinci_mmc_regs *)DAVINCI_MMC_SD0_BASE , - .host_caps =MMC_MODE_4BIT ,/* DA850 supports only 4-bit SD/MMC */ - .voltages =MMC_VDD_32_33 |MMC_VDD_33_34 , - .version =MMC_CTLR_VERSION_2 , -}; - -int board_mmc_init (bd_t *bis) -{ - mmc_sd0.input_clk =clk_get (DAVINCI_MMCSD_CLKID ); - -/* Add slot-0 to mmc subsystem */ -return davinci_mmc_init (bis, &mmc_sd0); -} -#endif -const struct pinmux_resource pinmuxes[] = {PINMUX_ITEM (spi0_pins_base),PINMUX_ITEM (spi0_pins_scs0),
configs/legoev3_defconfig +8 -1
@@ -23,12 +23,19 @@ CONFIG_CMD_SPI=y CONFIG_CMD_EXT4=y CONFIG_CMD_FAT=y CONFIG_CMD_DIAG=y +CONFIG_OF_CONTROL=y +CONFIG_DEFAULT_DEVICE_TREE="da850-lego-ev3" +CONFIG_DM=y +# CONFIG_DM_DEVICE_REMOVE is not set CONFIG_SYS_I2C_DAVINCI=y +CONFIG_DM_MMC=y +CONFIG_DM_SPI_FLASH=y CONFIG_SPI_FLASH=y CONFIG_SF_DEFAULT_SPEED=50000000 CONFIG_SPI_FLASH_STMICRO=y +CONFIG_DM_SERIAL=y CONFIG_SYS_NS16550=y CONFIG_SPI=y +CONFIG_DM_SPI=y CONFIG_DAVINCI_SPI=y -CONFIG_OF_LIBFDT=y # CONFIG_EFI_LOADER is not set
include/configs/legoev3.h +0 -3
@@ -42,11 +42,8 @@* Serial Driver info */ #define CONFIG_SYS_NS16550_SERIAL -#define CONFIG_SYS_NS16550_REG_SIZE -4/* NS16550 register size */ -#define CONFIG_SYS_NS16550_COM1 DAVINCI_UART1_BASE/* Base address of UART1 */ #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID) -#define CONFIG_SYS_SPI_BASE DAVINCI_SPI0_BASE#define CONFIG_SYS_SPI_CLK clk_get(DAVINCI_SPI0_CLKID)/*
Signature · 1 line
2.17.1
PATCH 1/1 ARM: legoev3: convert to driver model
Quoted 7 lines · David Lechner
This converts LEGO MINDSTORMS EV3 to the driver model. MMC, SERIAL, SPI and
SPI_FLASHare converted.The device tree contains only the minimal nodes required by U-Boot since the size of U-Boot is limited to 256K on this device.
Signed-off-by David Lechner <[email protected]>
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: 819 bytes Desc: not available URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190714/cefd709c/attachment.sig>