summaryrefslogtreecommitdiff
path: root/common/main.c
diff options
context:
space:
mode:
authorGabe Black <gabeblack@chromium.org>2011-07-28 04:18:05 -0700
committerSimon Glass <sjg@chromium.org>2011-08-29 10:59:20 -0700
commit13167acf89bd1b15ca2c5bc73063f54250267cee (patch)
tree68acfcc28681266e82219723610a61474650e52b /common/main.c
parent6a16c08e6693d343fb370896542c1db4e9f367fc (diff)
Tell the FDT library where the device tree is automatically on bringup
This change adds a call to set_working_fdt_addr near the end of u-boot initialization which tells the fdt command/library where the device tree is. This makes it possible to use the fdt command to look at the active device tree since otherwise there would be no way to know what address it was at to set things up manually. BUG=chrome-os-partner:4993 TEST=Built for coreboot/Alex, booted, and used fdt to look at the device tree. Change-Id: Iccd93af0c3934de5f284b76f8c894adc9dbd7f88 Signed-off-by: Gabe Black <gabeblack@google.com> Reviewed-on: http://gerrit.chromium.org/gerrit/4919 Reviewed-by: Gabe Black <gabeblack@chromium.org> Tested-by: Gabe Black <gabeblack@chromium.org>
Diffstat (limited to 'common/main.c')
-rw-r--r--common/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/common/main.c b/common/main.c
index 1cb247e00b..8ef099e85f 100644
--- a/common/main.c
+++ b/common/main.c
@@ -42,6 +42,10 @@
#include <fdt_decode.h>
#endif /* CONFIG_OF_CONTROL */
+#ifdef CONFIG_OF_LIBFDT
+#include <fdt_support.h>
+#endif /* CONFIG_OF_LIBFDT */
+
#include <post.h>
#if defined(CONFIG_SILENT_CONSOLE) || defined(CONFIG_POST) || defined(CONFIG_CMDLINE_EDITING)
@@ -484,6 +488,10 @@ void main_loop (void)
#endif /* CONFIG_MENUKEY */
#endif /* CONFIG_BOOTDELAY */
+#if defined CONFIG_OF_CONTROL
+ set_working_fdt_addr((void *)gd->blob);
+#endif /* CONFIG_OF_CONTROL */
+
/*
* Main Loop for Monitor Command Processing
*/