mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-09-29 08:00:26 +09:00
common: board_f: Use IS_ENABLED(CONFIG_OF_EMBED) in reserve_fdt, reloc_fdt
Use IS_ENABLED(CONFIG_OF_EMBED) in instead of #ifdefs in reserve_fdt, reloc_fdt functions. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
3671668676
commit
19b18daa29
@ -514,21 +514,21 @@ static int reserve_global_data(void)
|
|||||||
|
|
||||||
static int reserve_fdt(void)
|
static int reserve_fdt(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_OF_EMBED
|
if (!IS_ENABLED(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
|
||||||
* must relocate it. If it is embedded in the data section, then it
|
* then we must relocate it. If it is embedded in the data
|
||||||
* will be relocated with other data.
|
* section, then it will be relocated with other data.
|
||||||
*/
|
*/
|
||||||
if (gd->fdt_blob) {
|
if (gd->fdt_blob) {
|
||||||
gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob), 32);
|
gd->fdt_size = ALIGN(fdt_totalsize(gd->fdt_blob), 32);
|
||||||
|
|
||||||
gd->start_addr_sp = reserve_stack_aligned(gd->fdt_size);
|
gd->start_addr_sp = reserve_stack_aligned(gd->fdt_size);
|
||||||
gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);
|
gd->new_fdt = map_sysmem(gd->start_addr_sp, gd->fdt_size);
|
||||||
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;
|
||||||
}
|
}
|
||||||
@ -616,14 +616,15 @@ static int init_post(void)
|
|||||||
|
|
||||||
static int reloc_fdt(void)
|
static int reloc_fdt(void)
|
||||||
{
|
{
|
||||||
#ifndef CONFIG_OF_EMBED
|
if (!IS_ENABLED(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, fdt_totalsize(gd->fdt_blob));
|
memcpy(gd->new_fdt, gd->fdt_blob,
|
||||||
gd->fdt_blob = gd->new_fdt;
|
fdt_totalsize(gd->fdt_blob));
|
||||||
|
gd->fdt_blob = gd->new_fdt;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user