Skip to content
Snippets Groups Projects
Commit e9acb9ea authored by Siva Durga Prasad Paladugu's avatar Siva Durga Prasad Paladugu Committed by Tom Rini
Browse files

common: board: Dont relocate FDT incase of CONFIG_OF_EMBED


Don't relocate fdt in case of CONFIG_OF EMBED as the fdt is
already embedded with u-boot image.
Update fdt_blob after relocation as the fdt will be copied
during u-boot relocation.

Signed-off-by: default avatarSiva Durga Prasad Paladugu <sivadur@xilinx.com>
Signed-off-by: default avatarMichal Simek <michal.simek@xilinx.com>
Reviewed-by: default avatarAlexey Brodkin <abrodkin@synopsys.com>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
Tested-by: Bin Meng <bmeng.cn@gmail.com> (QEMU x86)
Tested-by: Thomas Chou <thomas@wytron.com.tw> (Nios2)
Acked-by: default avatarThomas Chou <thomas@wytron.com.tw>
Acked-by: default avatarSimon Glass <sjg@chromium.org>
parent b4857aa9
No related branches found
No related tags found
No related merge requests found
...@@ -524,6 +524,7 @@ static int reserve_global_data(void) ...@@ -524,6 +524,7 @@ static int reserve_global_data(void)
static int reserve_fdt(void) static int reserve_fdt(void)
{ {
#ifndef CONFIG_OF_EMBED
/* /*
* If the device tree is sitting immediately above our image then we * If the device tree is sitting immediately above our image then we
* must relocate it. If it is embedded in the data section, then it * must relocate it. If it is embedded in the data section, then it
...@@ -537,6 +538,7 @@ static int reserve_fdt(void) ...@@ -537,6 +538,7 @@ static int reserve_fdt(void)
debug("Reserving %lu Bytes for FDT at: %08lx\n", debug("Reserving %lu Bytes for FDT at: %08lx\n",
gd->fdt_size, gd->start_addr_sp); gd->fdt_size, gd->start_addr_sp);
} }
#endif
return 0; return 0;
} }
...@@ -674,12 +676,14 @@ static int setup_dram_config(void) ...@@ -674,12 +676,14 @@ static int setup_dram_config(void)
static int reloc_fdt(void) static int reloc_fdt(void)
{ {
#ifndef CONFIG_OF_EMBED
if (gd->flags & GD_FLG_SKIP_RELOC) if (gd->flags & GD_FLG_SKIP_RELOC)
return 0; return 0;
if (gd->new_fdt) { if (gd->new_fdt) {
memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size); memcpy(gd->new_fdt, gd->fdt_blob, gd->fdt_size);
gd->fdt_blob = gd->new_fdt; gd->fdt_blob = gd->new_fdt;
} }
#endif
return 0; return 0;
} }
......
...@@ -168,6 +168,14 @@ static int initr_reloc_global_data(void) ...@@ -168,6 +168,14 @@ static int initr_reloc_global_data(void)
*/ */
gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE; gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
#endif #endif
#ifdef CONFIG_OF_EMBED
/*
* The fdt_blob needs to be moved to new relocation address
* incase of FDT blob is embedded with in image
*/
gd->fdt_blob += gd->reloc_off;
#endif
return 0; return 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment