board: da8xxevm: Add SPL DM for serial, spi
authorJagan Teki <jagan@amarulasolutions.com>
Mon, 3 Sep 2018 17:30:24 +0000 (23:00 +0530)
committerJagan Teki <jagan@amarulasolutions.com>
Wed, 10 Oct 2018 06:23:55 +0000 (11:53 +0530)
This patch add SPL DM support for da8xxevm boards
with SPL serial, SPI drivers supported via platdata.

Cc: Adam Ford <aford173@gmail.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
Tested-by: Adam Ford <aford173@gmail.com> #da850evm
board/davinci/da8xxevm/da850evm.c
configs/da850_am18xxevm_defconfig
configs/da850evm_defconfig
include/configs/da850evm.h

index e8ec553f99ef124f7be1dd6d32301d8b847a1095..b0b29b3887f54eb69d70be2a92357561a03f2a10 100644 (file)
@@ -49,6 +49,33 @@ DECLARE_GLOBAL_DATA_PTR;
 
 #define CFG_MAC_ADDR_OFFSET    (flash->size - SZ_64K)
 
+#ifdef CONFIG_SPL_BUILD
+#include <ns16550.h>
+#include <dm/platform_data/spi_davinci.h>
+
+static const struct ns16550_platdata da850evm_serial = {
+       .base = DAVINCI_UART2_BASE,
+       .reg_shift = 2,
+       .clock = 150000000,
+       .fcr = UART_FCR_DEFVAL,
+};
+
+U_BOOT_DEVICE(da850evm_uart) = {
+       .name = "ns16550_serial",
+       .platdata = &da850evm_serial,
+};
+
+static const struct davinci_spi_platdata davinci_spi_data = {
+        .regs = (struct davinci_spi_regs *)0x01f0e000,
+        .num_cs = 4,
+};
+
+U_BOOT_DEVICE(davinci_spi) = {
+        .name = "davinci_spi",
+        .platdata = &davinci_spi_data,
+};
+#endif
+
 #ifdef CONFIG_MAC_ADDR_IN_SPIFLASH
 static int get_mac_addr(u8 *addr)
 {
index 6745cd10fa93bbe098e86335d9905dfe400c237e..8487509259618a4da77e908f80dbce9ab1c33d82 100644 (file)
@@ -8,6 +8,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
+CONFIG_SPL_DM=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
@@ -35,6 +36,8 @@ CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
 CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_SPL_OF_PLATDATA=y
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
 CONFIG_DA8XX_GPIO=y
index 6dc70dd3871f1df727eb63e46da229c6a763010c..5df45ae85584634fa3e764967d2a0437af3f1f89 100644 (file)
@@ -7,6 +7,7 @@ CONFIG_SPL_LIBCOMMON_SUPPORT=y
 CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_SPL_SERIAL_SUPPORT=y
 CONFIG_SPL=y
+CONFIG_SPL_DM=y
 CONFIG_SPL_SPI_FLASH_SUPPORT=y
 CONFIG_SPL_SPI_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
@@ -37,6 +38,8 @@ CONFIG_MTDIDS_DEFAULT="nor0=spi0.0"
 CONFIG_MTDPARTS_DEFAULT="mtdparts=spi0.0:512k(u-boot.ais),64k(u-boot-env),7552k(kernel-spare),64k(MAC-Address)"
 CONFIG_CMD_DIAG=y
 CONFIG_OF_CONTROL=y
+CONFIG_SPL_OF_CONTROL=y
+CONFIG_SPL_OF_PLATDATA=y
 CONFIG_DEFAULT_DEVICE_TREE="da850-evm"
 CONFIG_ENV_IS_IN_SPI_FLASH=y
 CONFIG_DM=y
index 319f6aadf5be8473c13384eae1c346305fce599c..e685db1914567679ac07e8c9414ee94529d266e2 100644 (file)
@@ -23,8 +23,6 @@
 * 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
 
 #if !CONFIG_IS_ENABLED(DM_SERIAL)
 #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)