diff options
author | Ovidiu Panait <ovidiu.panait@windriver.com> | 2020-07-24 14:12:16 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-08-06 14:26:35 -0400 |
commit | a4aa188948e637fe5951a59958ae1ed5c2f8271b (patch) | |
tree | 468f7450dc405ef1794ed99c6ff477f9c5763167 /common | |
parent | 81e7cb1e71fb216589b4e2fd3eb498ec72489a09 (diff) | |
download | u-boot-a4aa188948e637fe5951a59958ae1ed5c2f8271b.tar.gz u-boot-a4aa188948e637fe5951a59958ae1ed5c2f8271b.tar.bz2 u-boot-a4aa188948e637fe5951a59958ae1ed5c2f8271b.zip |
board_f: Factor out bdinfo bi_mem{start, size} to setup_bdinfo
Move all assignments to gd->bd->bi_mem{start,size} to generic code in
setup_bdinfo.
Xtensa architecture is special in this regard as it defines its own
handling of gd->bd->bi_mem{start,size} fields. In order to avoid defining
a weak SDRAM function, let arch_setup_bdinfo overwrite the generic flags.
For ARC architecture, remove ARCH_EARLY_INIT_R from Kconfig since it is
not needed anymore.
Also, use gd->ram_base to populate bi_memstart to avoid an ifdef.
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Acked-by: Alexey Brodkin <abrokdin@synopsys.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/common/board_f.c b/common/board_f.c index 4356431488..3b11f08725 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -605,6 +605,11 @@ __weak int arch_setup_bdinfo(void) int setup_bdinfo(void) { + struct bd_info *bd = gd->bd; + + bd->bi_memstart = gd->ram_base; /* start of memory */ + bd->bi_memsize = gd->ram_size; /* size in bytes */ + return arch_setup_bdinfo(); } @@ -614,12 +619,6 @@ static int setup_board_part1(void) { struct bd_info *bd = gd->bd; - /* - * Save local variables to board info struct - */ - bd->bi_memstart = CONFIG_SYS_SDRAM_BASE; /* start of memory */ - bd->bi_memsize = gd->ram_size; /* size in bytes */ - #ifdef CONFIG_SYS_SRAM_BASE bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */ bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE; /* size of SRAM */ |