Skip to content
Snippets Groups Projects
Commit f3d46bd6 authored by Simon Glass's avatar Simon Glass
Browse files

dm: Init device tree as well as driver model in SPL


If enabled, make sure that the device tree is available in SPL before
setting up driver model.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
parent b2b0d3e7
No related branches found
No related tags found
No related merge requests found
...@@ -151,6 +151,8 @@ static void spl_ram_load_image(void) ...@@ -151,6 +151,8 @@ static void spl_ram_load_image(void)
void board_init_r(gd_t *dummy1, ulong dummy2) void board_init_r(gd_t *dummy1, ulong dummy2)
{ {
u32 boot_device; u32 boot_device;
int ret;
debug(">>spl:board_init_r()\n"); debug(">>spl:board_init_r()\n");
#if defined(CONFIG_SYS_SPL_MALLOC_START) #if defined(CONFIG_SYS_SPL_MALLOC_START)
...@@ -161,9 +163,21 @@ void board_init_r(gd_t *dummy1, ulong dummy2) ...@@ -161,9 +163,21 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN; gd->malloc_limit = CONFIG_SYS_MALLOC_F_LEN;
gd->malloc_ptr = 0; gd->malloc_ptr = 0;
#endif #endif
#ifdef CONFIG_SPL_DM if (IS_ENABLED(CONFIG_OF_CONTROL) &&
dm_init_and_scan(true); !IS_ENABLED(CONFIG_SPL_DISABLE_OF_CONTROL)) {
#endif ret = fdtdec_setup();
if (ret) {
debug("fdtdec_setup() returned error %d\n", ret);
hang();
}
}
if (IS_ENABLED(CONFIG_SPL_DM)) {
ret = dm_init_and_scan(true);
if (ret) {
debug("dm_init_and_scan() returned error %d\n", ret);
hang();
}
}
#ifndef CONFIG_PPC #ifndef CONFIG_PPC
/* /*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment