summaryrefslogtreecommitdiff
path: root/arch/arm/lib
diff options
context:
space:
mode:
authorChe-Liang Chiou <clchiou@chromium.org>2011-07-02 03:03:43 +0800
committerSimon Glass <sjg@chromium.org>2011-08-29 10:58:45 -0700
commit911729f73a1ad5183a411e52279066979207734c (patch)
treeae3401ef16430e59b38b6cf1bced9fc3b944669a /arch/arm/lib
parent12f3d7fc17ee799dee85e37669de6a53abb10f88 (diff)
fdt: update fdt before passing it to kernel
A new flag CONFIG_OF_UPDATE_FDT_BEFORE_BOOT is added to control whether the device tree is updated before passing it to kernel. The (partial) calling sequence is: do_bootm() | +--> bootm_linux_fdt() | +--> fit_update_fdt_before_boot() | +--> boot_relocate_fdt() | +--> fdt_chosen() The fit_update_fdt_before_boot() is called before boot_relocate_fdt() because the device tree could be enlarged after updating, and so it has to be called earlier than relocation (otherwise it might not boot). BUG=chromium-os:15744 TEST=make Change-Id: Id2abe13e177ac1561f5c5e035acc5e115dba5640 Reviewed-on: http://gerrit.chromium.org/gerrit/3625 Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Che-Liang Chiou <clchiou@chromium.org>
Diffstat (limited to 'arch/arm/lib')
-rw-r--r--arch/arm/lib/bootm.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index ec104a0737..339cb08ae5 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -210,6 +210,13 @@ static int bootm_linux_fdt(int machid, bootm_headers_t *images)
if (ret)
return ret;
+#ifdef CONFIG_OF_UPDATE_FDT_BEFORE_BOOT
+ /* this must be earlier than boot_relocate_fdt */
+ ret = fit_update_fdt_before_boot(*of_flat_tree, &of_size);
+ if (ret)
+ return ret;
+#endif
+
ret = boot_relocate_fdt(lmb, of_flat_tree, &of_size);
if (ret)
return ret;