diff options
author | Simon Glass <sjg@chromium.org> | 2013-02-28 19:26:15 +0000 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2013-03-04 15:57:47 -0800 |
commit | f697d528caba0c30382b7269fd36f1111e51810d (patch) | |
tree | d2dceffbd191c1e1a3481c06a32597af9d580a98 /arch/x86/lib/relocate.c | |
parent | f82d15ead1badc329c4c804f0405e32289f46dd8 (diff) | |
download | u-boot-imx-f697d528caba0c30382b7269fd36f1111e51810d.zip u-boot-imx-f697d528caba0c30382b7269fd36f1111e51810d.tar.gz u-boot-imx-f697d528caba0c30382b7269fd36f1111e51810d.tar.bz2 |
x86: Support relocation of FDT on start-up
With CONFIG_OF_CONTROL we may have an FDT in the BSS region. Relocate
it up with the rest of U-Boot to keep the rest of memory free.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/x86/lib/relocate.c')
-rw-r--r-- | arch/x86/lib/relocate.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/arch/x86/lib/relocate.c b/arch/x86/lib/relocate.c index 23edca9..3a38e52 100644 --- a/arch/x86/lib/relocate.c +++ b/arch/x86/lib/relocate.c @@ -32,6 +32,7 @@ */ #include <common.h> +#include <libfdt.h> #include <malloc.h> #include <asm/u-boot-x86.h> #include <asm/relocate.h> @@ -46,6 +47,22 @@ int copy_uboot_to_ram(void) return 0; } +int copy_fdt_to_ram(void) +{ + if (gd->arch.new_fdt) { + ulong fdt_size; + + fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob) + 0x1000, 32); + + memcpy(gd->arch.new_fdt, gd->fdt_blob, fdt_size); + debug("Relocated fdt from %p to %p, size %lx\n", + gd->fdt_blob, gd->arch.new_fdt, fdt_size); + gd->fdt_blob = gd->arch.new_fdt; + } + + return 0; +} + int clear_bss(void) { ulong dst_addr = (ulong)&__bss_start + gd->reloc_off; |