]> git.ipfire.org Git - u-boot.git/commitdiff
dm: Build a live tree after relocation
authorSimon Glass <sjg@chromium.org>
Fri, 19 May 2017 02:08:56 +0000 (20:08 -0600)
committerSimon Glass <sjg@chromium.org>
Thu, 1 Jun 2017 13:03:06 +0000 (07:03 -0600)
If enabled, build a live device tree after relocation. This can then be
used by driver model.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/board_r.c

index fe7a70b58944f314edca384d7ebc4e254299f7ea..00ba319ca77ba16434a71a29b57febb01acedf4d 100644 (file)
@@ -40,6 +40,7 @@
 #endif
 #include <mmc.h>
 #include <nand.h>
+#include <of_live.h>
 #include <onenand_uboot.h>
 #include <scsi.h>
 #include <serial.h>
@@ -292,6 +293,14 @@ static int initr_noncached(void)
 }
 #endif
 
+#ifdef CONFIG_OF_LIVE
+static int initr_of_live(void)
+{
+       return of_live_build(gd->fdt_blob,
+                             (struct device_node **)&gd->of_root);
+}
+#endif
+
 #ifdef CONFIG_DM
 static int initr_dm(void)
 {
@@ -722,6 +731,9 @@ static init_fnc_t init_sequence_r[] = {
        initr_noncached,
 #endif
        bootstage_relocate,
+#ifdef CONFIG_OF_LIVE
+       initr_of_live,
+#endif
 #ifdef CONFIG_DM
        initr_dm,
 #endif