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>
* SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
+#include <dm.h>
#include <spl.h>
#include <asm/u-boot.h>
#include <nand.h>
#include <i2c.h>
#include <image.h>
#include <malloc.h>
+#include <dm/root.h>
#include <linux/compiler.h>
DECLARE_GLOBAL_DATA_PTR;
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
/*
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/