]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
dm: spl: Allow driver model to be used
authorSimon Glass <sjg@chromium.org>
Tue, 11 Nov 2014 00:16:46 +0000 (17:16 -0700)
committerSimon Glass <sjg@chromium.org>
Fri, 21 Nov 2014 07:12:55 +0000 (08:12 +0100)
When enabled, set up driver model for SPL. This allows SPL to use the same
drivers as the main U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tom Rini <trini@ti.com>
common/spl/spl.c
scripts/Makefile.spl

index 6b90ad8841d33858d79b7504f8fc0df5b9a17720..3cd19f0e186fb9c9bcc71dbc6d48689af7b5b7e5 100644 (file)
@@ -7,6 +7,7 @@
  * SPDX-License-Identifier:    GPL-2.0+
  */
 #include <common.h>
+#include <dm.h>
 #include <spl.h>
 #include <asm/u-boot.h>
 #include <nand.h>
@@ -15,6 +16,7 @@
 #include <i2c.h>
 #include <image.h>
 #include <malloc.h>
+#include <dm/root.h>
 #include <linux/compiler.h>
 
 DECLARE_GLOBAL_DATA_PTR;
@@ -147,6 +149,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        gd->malloc_limit = gd->malloc_base + CONFIG_SYS_MALLOC_F_LEN;
        gd->malloc_ptr = 0;
 #endif
+#ifdef CONFIG_SPL_DM
+       dm_init_and_scan(true);
+#endif
 
 #ifndef CONFIG_PPC
        /*
index 07db0bff8dfb364195bdf08529d1f30d342bdaee..6e13f68d99554c88e68eb52c263748a3ecd3ab3e 100644 (file)
@@ -69,6 +69,7 @@ libs-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/
 libs-$(CONFIG_SPL_FRAMEWORK) += common/spl/
 libs-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/
 libs-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/
+libs-$(CONFIG_SPL_DM) += drivers/core/
 libs-$(CONFIG_SPL_I2C_SUPPORT) += drivers/i2c/
 libs-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/
 libs-$(CONFIG_SPL_MMC_SUPPORT) += drivers/mmc/