[PATCH 03/18] mips: mtmips: fix dram size detection in dram_init

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH 03/18] mips: mtmips: fix dram size detection in dram_init

Weijie Gao-2
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.

Signed-off-by: Weijie Gao <[hidden email]>
---
 arch/mips/mach-mtmips/cpu.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

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 <common.h>
 #include <init.h>
 #include <malloc.h>
+#include <asm/addrspace.h>
 #include <linux/bitops.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
@@ -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;
 }
--
2.17.1
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH 03/18] mips: mtmips: fix dram size detection in dram_init

Stefan Roese
On 16.10.20 09:35, Weijie Gao wrote:
> 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.
>
> Signed-off-by: Weijie Gao <[hidden email]>

Reviewed-by: Stefan Roese <[hidden email]>

Thanks,
Stefan

> ---
>   arch/mips/mach-mtmips/cpu.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> 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 <common.h>
>   #include <init.h>
>   #include <malloc.h>
> +#include <asm/addrspace.h>
>   #include <linux/bitops.h>
>   #include <linux/io.h>
>   #include <linux/sizes.h>
> @@ -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;
>   }
>


Viele Grüße,
Stefan

--
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [hidden email]