[PATCH v3 08/17] board_f: Introduce board_setup_bdinfo_mem initcall

Simon Glass sjg at chromium.org
Tue Jul 21 16:07:04 CEST 2020


Hi Ovidiu,

On Mon, 20 Jul 2020 at 08:20, Ovidiu Panait <ovidiu.panait at windriver.com> wrote:
>
> In most cases (arc, ppc, mips, sh, m68k) gd->bd->bi_memsize and
> gd->bd->bi_memstart are populated in a similar fashion:
>
>     bd->bi_memstart = CONFIG_SYS_SDRAM_BASE;
>     bd->bi_memsize = gd->ram_size;
>
> However, there is a special case in board/cadence/xtfpga/xtfpga.c that
> populates those fields in a board specific manner:
>
>     gd->bd->bi_memstart = PHYSADDR(CONFIG_SYS_SDRAM_BASE);
>     gd->bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE;
>
> Due to this fact, a weak board-specific routine is introduced to take care
> of this scenario. Also, move all assignments to bi_mem* fields to
> setup_bdinfo initcall.
>
> Use gd->ram_base to populate bi_memstart to avoid an ifdef.
>
> Signed-off-by: Ovidiu Panait <ovidiu.panait at windriver.com>
> ---
>
>  arch/arc/lib/cpu.c            |  2 --
>  board/cadence/xtfpga/xtfpga.c |  7 ++++++-
>  common/board_f.c              | 21 +++++++++++++++------
>  include/init.h                | 12 ++++++++++++
>  4 files changed, 33 insertions(+), 9 deletions(-)

Reviewed-by: Simon Glass <sjg at chromium.org>

This is unfortunate and I would much rather that some board-specific
code fix it up earlier or later. But I can't see an obvious place to
do this.

Regards,
Simon


More information about the U-Boot mailing list