]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board_f: Move sram bdinfo assignments to generic code
authorOvidiu Panait <ovidiu.panait@windriver.com>
Fri, 24 Jul 2020 11:12:17 +0000 (14:12 +0300)
committerTom Rini <trini@konsulko.com>
Thu, 6 Aug 2020 18:26:35 +0000 (14:26 -0400)
Move sram related bdinfo from arch-specific setup_board_part1 to generic
code in setup_bdinfo. Also use "if (IS_ENABLED(CONFIG_SYS_HAS_SRAM))"
instead of "#ifdef CONFIG_SYS_SRAM_BASE".

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
common/board_f.c

index 3b11f08725d9de6d6998a981b6e858b854b9401b..e83bc2eb0563aaca8c0c2f9806910d5c01d16947 100644 (file)
@@ -610,6 +610,11 @@ int setup_bdinfo(void)
        bd->bi_memstart = gd->ram_base;  /* start of memory */
        bd->bi_memsize = gd->ram_size;   /* size in bytes */
 
+       if (IS_ENABLED(CONFIG_SYS_HAS_SRAM)) {
+               bd->bi_sramstart = CONFIG_SYS_SRAM_BASE; /* start of SRAM */
+               bd->bi_sramsize = CONFIG_SYS_SRAM_SIZE;  /* size  of SRAM */
+       }
+
        return arch_setup_bdinfo();
 }
 
@@ -619,11 +624,6 @@ static int setup_board_part1(void)
 {
        struct bd_info *bd = gd->bd;
 
-#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 */
-#endif
-
 #if defined(CONFIG_E500) || defined(CONFIG_MPC86xx)
        bd->bi_immr_base = CONFIG_SYS_IMMR;     /* base  of IMMR register     */
 #endif