From: Simon Glass Date: Tue, 17 Jan 2017 22:51:43 -0700 Subject: [U-Boot] [PATCH 07/22] dm: Build a live tree after relocation In-Reply-To: <20170118055200.6825-6-sjg@chromium.org> References: <20170118055200.6825-6-sjg@chromium.org> Message-ID: <20170118055200.6825-8-sjg@chromium.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de If enabled, build a live device tree after relocation. This can then be used by driver model. Signed-off-by: Simon Glass --- common/board_r.c | 12 ++++++++++++ include/livetree.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/common/board_r.c b/common/board_r.c index a3733526c69..3c865720036 100644 --- a/common/board_r.c +++ b/common/board_r.c @@ -33,6 +33,7 @@ #if defined(CONFIG_CMD_KGDB) #include #endif +#include #include #include #include @@ -314,6 +315,14 @@ static int initr_noncached(void) } #endif +#ifdef CONFIG_OF_LIVE +static int initr_livetree(void) +{ + return livetree_build(gd->fdt_blob, + (struct device_node **)&gd->of_root); +} +#endif + #ifdef CONFIG_DM static int initr_dm(void) { @@ -781,6 +790,9 @@ init_fnc_t init_sequence_r[] = { initr_noncached, #endif bootstage_relocate, +#ifdef CONFIG_OF_LIVE + initr_livetree, +#endif #ifdef CONFIG_DM initr_dm, #endif diff --git a/include/livetree.h b/include/livetree.h index aa0a8687c1b..8f8fee73114 100644 --- a/include/livetree.h +++ b/include/livetree.h @@ -10,6 +10,8 @@ #ifndef _LIVETREE_H #define _LIVETREE_H +struct device_node; + /** * livetree_build() - build a live (hierarchical) tree from a flat DT * -- 2.11.0.483.g087da7b7c-goog