]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
arm: da850-evm: Enable DM and device tree support for da850-evm
authorAdam Ford <aford173@gmail.com>
Mon, 18 Sep 2017 01:43:46 +0000 (20:43 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 29 Sep 2017 14:52:21 +0000 (10:52 -0400)
With the device tree ported and DM compatible drivers, enable:
OF_CONTROL, DM_SPI, DM_SPI_FLASH and DM_SERIAL

Note: DM_SERIAL is not enabled for da850evm_direct_nor_defconfig
yet.

Reviewed-by: Jagan Teki <jagan@openedev.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
board/davinci/da8xxevm/Kconfig
board/davinci/da8xxevm/da850evm.c
configs/da850_am18xxevm_defconfig
configs/da850evm_defconfig
configs/da850evm_direct_nor_defconfig
include/configs/da850evm.h

index bb1188b4ea2d27ed3efd8225301755b0adc1548c..e0df97ca0ea4558244fb7e9716aabf5df70f4514 100644 (file)
@@ -33,6 +33,8 @@ config MAC_ADDR_IN_EEPROM
 
 endif
 
+source "board/ti/common/Kconfig"
+
 endif
 
 if TARGET_OMAPL138_LCDK
index 516d86df5097208c7b0d93595934f44c17adf8f4..83c9f2940fe87791908d6c7a739ad14bd98ad4ee 100644 (file)
@@ -60,7 +60,7 @@ static int get_mac_addr(u8 *addr)
                return -1;
        }
 
-       ret = spi_flash_read(flash, CFG_MAC_ADDR_OFFSET, 6, addr);
+       ret = spi_flash_read(flash, (CFG_MAC_ADDR_OFFSET) + 1, 7, addr);
        if (ret) {
                printf("Error - unable to read MAC address from SPI flash.\n");
                return -1;
@@ -140,6 +140,7 @@ int misc_init_r(void)
        uchar buff[6];
 
        spi_mac_read = get_mac_addr(buff);
+       buff[0] = 0;
 
        /*
         * MAC address not present in the environment
index 27370e7c0c32623c8d820630fbff85edc87dc860..832c9ceb0705fd2dd8e4d0168faa2a1ce2354a87 100644 (file)
@@ -1,17 +1,16 @@
 CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
-CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_MAC_ADDR_IN_EEPROM=y
+CONFIG_TI_COMMON_CMD_OPTIONS=y
 CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
 CONFIG_SYS_EXTRA_OPTIONS="DA850_AM18X_EVM,SYS_I2C_EEPROM_ADDR_LEN=2,SYS_I2C_EEPROM_ADDR=0x50"
 CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
@@ -19,7 +18,7 @@ CONFIG_BOARD_EARLY_INIT_F=y
 CONFIG_SPL=y
 CONFIG_SPL_BOARD_INIT=y
 CONFIG_HUSH_PARSER=y
-# CONFIG_CMD_BOOTZ is not set
+CONFIG_SYS_PROMPT="U-Boot > "
 # CONFIG_CMD_IMLS is not set
 CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EEPROM is not set
@@ -33,10 +32,14 @@ CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EXT4 is not set
 # CONFIG_CMD_FS_GENERIC is not set
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
 # CONFIG_FAT_WRITE is not set
-CONFIG_OF_LIBFDT=y
index bfa5ea1c4bc6f8b089b6421599ea10c1735388ef..05dc8131facbc674ed29d39c8690484630f83338 100644 (file)
@@ -7,9 +7,9 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
+CONFIG_SYS_EXTRA_OPTIONS="MAC_ADDR_IN_SPIFLASH"
 CONFIG_BOOTDELAY=3
-CONFIG_USE_BOOTARGS=y
-CONFIG_BOOTARGS="mem=32M console=ttyS2,115200n8 root=/dev/mtdblock2 rw noinitrd ip=dhcp"
 CONFIG_VERSION_VARIABLE=y
 # CONFIG_DISPLAY_CPUINFO is not set
 # CONFIG_DISPLAY_BOARDINFO is not set
@@ -31,10 +31,14 @@ CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_EXT4 is not set
 # CONFIG_CMD_FS_GENERIC is not set
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
+CONFIG_DM=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_DM_SERIAL=y
 CONFIG_SYS_NS16550=y
+CONFIG_DM_SPI=y
 # CONFIG_FAT_WRITE is not set
-CONFIG_OF_LIBFDT=y
index 24ab89224df17824ad0ac732b78af4179c4a8cfa..8f8bad075655128592f9407d955c6d17bb88f4fb 100644 (file)
@@ -2,6 +2,8 @@ CONFIG_ARM=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TARGET_DA850EVM=y
 CONFIG_TI_COMMON_CMD_OPTIONS=y
+CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
+# CONFIG_SYS_MALLOC_F is not set
 CONFIG_SYS_EXTRA_OPTIONS="USE_NOR,DIRECT_NOR_BOOT"
 CONFIG_BOOTDELAY=3
 CONFIG_USE_BOOTARGS=y
@@ -28,11 +30,14 @@ CONFIG_CRC32_VERIFY=y
 # CONFIG_CMD_FAT is not set
 # CONFIG_CMD_FS_GENERIC is not set
 CONFIG_CMD_DIAG=y
+CONFIG_OF_CONTROL=y
 CONFIG_ENV_IS_IN_FLASH=y
+CONFIG_DM=y
 # CONFIG_MMC is not set
 CONFIG_MTD_NOR_FLASH=y
+CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH=y
 CONFIG_SPI_FLASH_STMICRO=y
 CONFIG_SPI_FLASH_WINBOND=y
 CONFIG_SYS_NS16550=y
-CONFIG_OF_LIBFDT=y
+CONFIG_DM_SPI=y
index c05c64cad731bd7356f4097ee0b4adfae977352f..d383c23bbe0a29045c87df5e0da8f585f4ae28f7 100644 (file)
 #define CONFIG_USE_SPIFLASH
 #endif
 
+/*
+* Disable DM_* for SPL build and can be re-enabled after adding
+* DM support in SPL
+*/
+#ifdef CONFIG_SPL_BUILD
+#undef CONFIG_DM_SPI
+#undef CONFIG_DM_SPI_FLASH
+#undef CONFIG_DM_I2C
+#undef CONFIG_DM_I2C_COMPAT
+#endif
 /*
  * SoC Configuration
  */
 /*
  * Serial Driver info
  */
+
+#if defined(CONFIG_SPL_BUILD) || defined(CONFIG_DIRECT_NOR_BOOT)
 #define CONFIG_SYS_NS16550_SERIAL
 #define CONFIG_SYS_NS16550_REG_SIZE    -4      /* NS16550 register size */
 #define CONFIG_SYS_NS16550_COM1        DAVINCI_UART2_BASE /* Base address of UART2 */
+#endif
 #define CONFIG_SYS_NS16550_CLK clk_get(DAVINCI_UART2_CLKID)
 #define CONFIG_CONS_INDEX      1               /* use UART0 for console */
 
 #define CONFIG_SPI
 #define CONFIG_DAVINCI_SPI
-#define CONFIG_SYS_SPI_BASE            DAVINCI_SPI1_BASE
 #define CONFIG_SYS_SPI_CLK             clk_get(DAVINCI_SPI1_CLKID)
+#ifdef CONFIG_SPL_BUILD
+#define CONFIG_SYS_SPI_BASE            DAVINCI_SPI1_BASE
 #define CONFIG_SF_DEFAULT_SPEED                30000000
 #define CONFIG_ENV_SPI_MAX_HZ  CONFIG_SF_DEFAULT_SPEED
+#endif
 
 #ifdef CONFIG_USE_SPIFLASH
 #define CONFIG_SPL_SPI_LOAD
 #define CONFIG_CMDLINE_TAG
 #define CONFIG_REVISION_TAG
 #define CONFIG_SETUP_MEMORY_TAGS
-#define CONFIG_EXTRA_ENV_SETTINGS      "hwconfig=dsp:wake=yes"
+
+#define CONFIG_BOOTCOMMAND \
+               "run envboot; " \
+               "run mmcboot; "
+
+#define DEFAULT_LINUX_BOOT_ENV \
+       "loadaddr=0xc0700000\0" \
+       "fdtaddr=0xc0600000\0" \
+       "scriptaddr=0xc0600000\0"
+
+#include <environment/ti/mmc.h>
+
+#define CONFIG_EXTRA_ENV_SETTINGS \
+       DEFAULT_LINUX_BOOT_ENV \
+       DEFAULT_MMC_TI_ARGS \
+       "bootpart=0:2\0" \
+       "bootdir=/boot\0" \
+       "bootfile=zImage\0" \
+       "fdtfile=da850-evm.dtb\0" \
+       "boot_fdt=yes\0" \
+       "boot_fit=0\0" \
+       "console=ttyS2,115200n8\0" \
+       "hwconfig=dsp:wake=yes"
 
 #ifdef CONFIG_CMD_BDI
 #define CONFIG_CLOCKS