[U-Boot] [PATCH v3 06/14] dm: spl: Allow driver model to be used

Simon Glass sjg at chromium.org
Tue Nov 11 01:16:46 CET 2014


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 at chromium.org>
Acked-by: Tom Rini <trini at ti.com>
---

Changes in v3: None
Changes in v2: None

 common/spl/spl.c     | 5 +++++
 scripts/Makefile.spl | 1 +
 2 files changed, 6 insertions(+)

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 341287a..aef1c22 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -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;
@@ -142,6 +144,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
 	/*
diff --git a/scripts/Makefile.spl b/scripts/Makefile.spl
index 7afe437..20869fd 100644
--- a/scripts/Makefile.spl
+++ b/scripts/Makefile.spl
@@ -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/
-- 
2.1.0.rc2.206.gedb03e5



More information about the U-Boot mailing list