summaryrefslogtreecommitdiff
path: root/common/board_r.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2013-05-27 00:37:30 +0000
committerTom Rini <trini@ti.com>2013-06-07 14:17:01 -0400
commita0ba279ac6b6b83b48dee609d7a34fc29b520ebc (patch)
tree57674579ed66013cc92c952817fc3958dd33fc20 /common/board_r.c
parent12d7a474204a667a7f94e3904e5d4062e3115894 (diff)
downloadu-boot-imx-a0ba279ac6b6b83b48dee609d7a34fc29b520ebc.zip
u-boot-imx-a0ba279ac6b6b83b48dee609d7a34fc29b520ebc.tar.gz
u-boot-imx-a0ba279ac6b6b83b48dee609d7a34fc29b520ebc.tar.bz2
generic_board: reduce the redundancy of gd_t struct members
This commit refactors common/board_f.c and common/board_r.c in order to delete the dest_addr and dest_addr_sp from gd_t struct. As mentioned as follows in include/asm-generic/global_data.h, /* TODO: is this the same as relocaddr, or something else? */ unsigned long dest_addr; /* Post-relocation address of U-Boot */ dest_addr is the same as relocaddr. Likewise, dest_addr_sp is the same as start_addr_sp. It seemed dest_addr/dest_addr_sp was used only as a scratch variable to calculate relocaddr/start_addr_sp, respectively. With a little refactoring, we can delete dest_addr and dest_addr_sp. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_r.c')
-rw-r--r--common/board_r.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/common/board_r.c b/common/board_r.c
index fd1fd31..f5649c9 100644
--- a/common/board_r.c
+++ b/common/board_r.c
@@ -137,7 +137,7 @@ static int initr_reloc_global_data(void)
#ifdef CONFIG_SYS_SYM_OFFSETS
monitor_flash_len = _end_ofs;
#elif !defined(CONFIG_SANDBOX)
- monitor_flash_len = (ulong)&__init_end - gd->dest_addr;
+ monitor_flash_len = (ulong)&__init_end - gd->relocaddr;
#endif
#if defined(CONFIG_MPC85xx) || defined(CONFIG_MPC86xx)
/*
@@ -145,7 +145,7 @@ static int initr_reloc_global_data(void)
* We need to update it to point to the same CPU entry in RAM.
* TODO: why not just add gd->reloc_ofs?
*/
- gd->arch.cpu += gd->dest_addr - CONFIG_SYS_MONITOR_BASE;
+ gd->arch.cpu += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
/*
* If we didn't know the cpu mask & # cores, we can save them of
@@ -161,7 +161,7 @@ static int initr_reloc_global_data(void)
* in SRAM mode and initialize that cache from SRAM mode back to being
* a cache in cpu_init_r.
*/
- gd->env_addr += gd->dest_addr - CONFIG_SYS_MONITOR_BASE;
+ gd->env_addr += gd->relocaddr - CONFIG_SYS_MONITOR_BASE;
#endif
return 0;
}
@@ -178,7 +178,7 @@ static int initr_trap(void)
/*
* Setup trap handlers
*/
- trap_init(gd->dest_addr);
+ trap_init(gd->relocaddr);
return 0;
}
@@ -263,7 +263,7 @@ static int initr_malloc(void)
ulong malloc_start;
/* The malloc area is immediately below the monitor copy in DRAM */
- malloc_start = gd->dest_addr - TOTAL_MALLOC_LEN;
+ malloc_start = gd->relocaddr - TOTAL_MALLOC_LEN;
mem_malloc_init((ulong)map_sysmem(malloc_start, TOTAL_MALLOC_LEN),
TOTAL_MALLOC_LEN);
return 0;
@@ -276,7 +276,7 @@ __weak int power_init_board(void)
static int initr_announce(void)
{
- debug("Now running in RAM - U-Boot at: %08lx\n", gd->dest_addr);
+ debug("Now running in RAM - U-Boot at: %08lx\n", gd->relocaddr);
return 0;
}