diff mbox series

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

Message ID 20200720141407.30241-9-ovidiu.panait@windriver.com
State Superseded
Delegated to: Tom Rini
Headers show
Series [v3,01/17] Kconfig: Introduce CONFIG_SYS_HAS_SRAM | expand

Commit Message

Ovidiu Panait July 20, 2020, 2:13 p.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".

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---

 common/board_f.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

Comments

Simon Glass July 21, 2020, 2:17 p.m. UTC | #1
On Mon, 20 Jul 2020 at 08:20, Ovidiu Panait <ovidiu.panait@windriver.com> 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".
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
> ---
>
>  common/board_f.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/common/board_f.c b/common/board_f.c
index ac72096e3a..1befab5446 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -618,8 +618,15 @@  __weak int arch_setup_bdinfo(void)
 
 int setup_bdinfo(void)
 {
+	struct bd_info *bd = gd->bd;
+
 	board_setup_bdinfo_mem();
 
+	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();
 }
 
@@ -629,11 +636,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