From: Weijie Gao Date: Thu, 12 Nov 2020 08:35:33 +0000 (+0800) Subject: mips: mtmips: fix dram size detection in dram_init X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=9bf72ba6f68f7c96b0913bfc35ae423e9b1895d5;p=u-boot.git mips: mtmips: fix dram size detection in dram_init CONFIG_SYS_SDRAM_BASE points to cached memory, i.e. KSEG0, which is not suitable for detecting memory size. Replace CONFIG_SYS_SDRAM_BASE with KSEG1, and make dram_init() always do memory size detection in any stage. Reviewed-by: Stefan Roese Signed-off-by: Weijie Gao --- diff --git a/arch/mips/mach-mtmips/cpu.c b/arch/mips/mach-mtmips/cpu.c index 2ddf8cb096..ca1967055a 100644 --- a/arch/mips/mach-mtmips/cpu.c +++ b/arch/mips/mach-mtmips/cpu.c @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -14,9 +15,7 @@ DECLARE_GLOBAL_DATA_PTR; int dram_init(void) { -#ifdef CONFIG_SKIP_LOWLEVEL_INIT - gd->ram_size = get_ram_size((void *)CONFIG_SYS_SDRAM_BASE, SZ_256M); -#endif + gd->ram_size = get_ram_size((void *)KSEG1, SZ_256M); return 0; }