diff mbox series

[v4,09/17] board_f: Move sram bdinfo assignments to generic code

Message ID 20200724111225.12513-9-ovidiu.panait@windriver.com
State Accepted
Commit 4912224216e80df09e3e141c23b6107a58072ae4
Delegated to: Tom Rini
Headers show
Series [v4,01/17] Kconfig: Introduce CONFIG_SYS_HAS_SRAM | expand

Commit Message

Ovidiu Panait July 24, 2020, 11:12 a.m. UTC
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 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Tom Rini Aug. 7, 2020, 2:15 a.m. UTC | #1
On Fri, Jul 24, 2020 at 02:12:17PM +0300, Ovidiu Panait wrote:

> 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>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/board_f.c b/common/board_f.c
index 3b11f08725..e83bc2eb05 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -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