From a4aa188948e637fe5951a59958ae1ed5c2f8271b Mon Sep 17 00:00:00 2001 From: Ovidiu Panait Date: Fri, 24 Jul 2020 14:12:16 +0300 Subject: 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 Acked-by: Alexey Brodkin Reviewed-by: Simon Glass --- arch/xtensa/lib/Makefile | 2 +- arch/xtensa/lib/bdinfo.c | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 arch/xtensa/lib/bdinfo.c (limited to 'arch/xtensa') diff --git a/arch/xtensa/lib/Makefile b/arch/xtensa/lib/Makefile index c59df7d372..ceee59b9bd 100644 --- a/arch/xtensa/lib/Makefile +++ b/arch/xtensa/lib/Makefile @@ -5,4 +5,4 @@ obj-$(CONFIG_CMD_BOOTM) += bootm.o -obj-y += cache.o misc.o relocate.o time.o +obj-y += cache.o misc.o relocate.o time.o bdinfo.o diff --git a/arch/xtensa/lib/bdinfo.c b/arch/xtensa/lib/bdinfo.c new file mode 100644 index 0000000000..4ec8529521 --- /dev/null +++ b/arch/xtensa/lib/bdinfo.c @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * XTENSA-specific information for the 'bd' command + * + * (C) Copyright 2003 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + */ + +#include +#include + +DECLARE_GLOBAL_DATA_PTR; + +int arch_setup_bdinfo(void) +{ + struct bd_info *bd = gd->bd; + + bd->bi_memstart = PHYSADDR(CONFIG_SYS_SDRAM_BASE); + bd->bi_memsize = CONFIG_SYS_SDRAM_SIZE; + + return 0; +} -- cgit v1.2.3