diff options
author | Che-Liang Chiou <clchiou@chromium.org> | 2011-07-02 03:03:43 +0800 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:58:45 -0700 |
commit | 911729f73a1ad5183a411e52279066979207734c (patch) | |
tree | ae3401ef16430e59b38b6cf1bced9fc3b944669a /arch | |
parent | 12f3d7fc17ee799dee85e37669de6a53abb10f88 (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')
-rw-r--r-- | arch/arm/lib/bootm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c index ec104a07377..339cb08ae50 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; |