Introduce generic pre-relocation board_f.c

This file handles common pre-relocation init for boards which use
the generic framework.

It starts up the console, DRAM, performs relocation and then jumps
to post-relocation init.

Signed-off-by: Simon Glass <sjg@chromium.org>
Tested-by: Wolfgang Denk <wd@denx.de>
Acked-by: Wolfgang Denk <wd@denx.de>
This commit is contained in:
Simon Glass 2013-03-11 06:49:53 +00:00 committed by Tom Rini
parent a6741bce50
commit 1938f4a5b6
7 changed files with 591 additions and 6 deletions

View file

@ -49,15 +49,15 @@ int copy_uboot_to_ram(void)
int copy_fdt_to_ram(void)
{
if (gd->arch.new_fdt) {
if (gd->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);
memcpy(gd->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;
gd->fdt_blob, gd->new_fdt, fdt_size);
gd->fdt_blob = gd->new_fdt;
}
return 0;