Commit 3af86a4e23bba49b573aabeb83bb41c199686ef6
1 parent
8b50d526ea
Exists in
smarc_8mq_lf_v2020.04
and in
17 other branches
dm: Build a live tree after relocation
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>
Showing 1 changed file with 12 additions and 0 deletions Side-by-side Diff
common/board_r.c
... | ... | @@ -40,6 +40,7 @@ |
40 | 40 | #endif |
41 | 41 | #include <mmc.h> |
42 | 42 | #include <nand.h> |
43 | +#include <of_live.h> | |
43 | 44 | #include <onenand_uboot.h> |
44 | 45 | #include <scsi.h> |
45 | 46 | #include <serial.h> |
... | ... | @@ -292,6 +293,14 @@ |
292 | 293 | } |
293 | 294 | #endif |
294 | 295 | |
296 | +#ifdef CONFIG_OF_LIVE | |
297 | +static int initr_of_live(void) | |
298 | +{ | |
299 | + return of_live_build(gd->fdt_blob, | |
300 | + (struct device_node **)&gd->of_root); | |
301 | +} | |
302 | +#endif | |
303 | + | |
295 | 304 | #ifdef CONFIG_DM |
296 | 305 | static int initr_dm(void) |
297 | 306 | { |
... | ... | @@ -722,6 +731,9 @@ |
722 | 731 | initr_noncached, |
723 | 732 | #endif |
724 | 733 | bootstage_relocate, |
734 | +#ifdef CONFIG_OF_LIVE | |
735 | + initr_of_live, | |
736 | +#endif | |
725 | 737 | #ifdef CONFIG_DM |
726 | 738 | initr_dm, |
727 | 739 | #endif |