diff mbox

[U-Boot] mx28evk: Scan only first 512 MB of DRAM to avoid memory wraparound

Message ID 1336838852-14235-1-git-send-email-festevam@gmail.com
State Changes Requested
Delegated to: Stefano Babic
Headers show

Commit Message

Fabio Estevam May 12, 2012, 4:07 p.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

Scan only first 512 MB of DRAM to avoid memory wraparound.

This fixes mx28evk boot and it follows the same idea of commit
19a2066b57 (M28: Scan only first 512 MB of DRAM to avoid memory wraparound)

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 include/configs/mx28evk.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Marek Vasut May 12, 2012, 4:10 p.m. UTC | #1
Dear Fabio Estevam,

> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Scan only first 512 MB of DRAM to avoid memory wraparound.
> 
> This fixes mx28evk boot and it follows the same idea of commit
> 19a2066b57 (M28: Scan only first 512 MB of DRAM to avoid memory wraparound)

Thanks, sorry for the breakage.

Acked-by: Marek Vasut <marex@denx.de>

btw. I think Otavio was working on some common config, wasn't he?
btw2. won't there ever be MX28EVK with more than 512MB of DRAM?

> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  include/configs/mx28evk.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
> index 0c18e50..a4ea12d 100644
> --- a/include/configs/mx28evk.h
> +++ b/include/configs/mx28evk.h
> @@ -75,7 +75,7 @@
>   */
>  #define CONFIG_NR_DRAM_BANKS		1		/* 1 bank of DRAM */
>  #define PHYS_SDRAM_1			0x40000000	/* Base address */
> -#define PHYS_SDRAM_1_SIZE		0x40000000	/* Max 1 GB RAM */
> +#define PHYS_SDRAM_1_SIZE		0x20000000	/* Max 512MB RAM */
>  #define CONFIG_STACKSIZE		(128 * 1024)	/* 128 KB stack */
>  #define CONFIG_SYS_MALLOC_LEN		0x00400000	/* 4 MB for 
malloc */
>  #define CONFIG_SYS_MEMTEST_START	0x40000000	/* Memtest start adr */

Best regards,
Marek Vasut
Fabio Estevam May 12, 2012, 4:14 p.m. UTC | #2
On Sat, May 12, 2012 at 1:10 PM, Marek Vasut <marex@denx.de> wrote:

> Thanks, sorry for the breakage.
>
> Acked-by: Marek Vasut <marex@denx.de>
>
> btw. I think Otavio was working on some common config, wasn't he?

Yes, I think Otavio is working on that.

> btw2. won't there ever be MX28EVK with more than 512MB of DRAM?

I don't think there will be other revision of mx28evk board.

Regards,

Fabio Estevam
Marek Vasut May 12, 2012, 4:19 p.m. UTC | #3
Dear Fabio Estevam,

> On Sat, May 12, 2012 at 1:10 PM, Marek Vasut <marex@denx.de> wrote:
> > Thanks, sorry for the breakage.
> > 
> > Acked-by: Marek Vasut <marex@denx.de>
> > 
> > btw. I think Otavio was working on some common config, wasn't he?
> 
> Yes, I think Otavio is working on that.

That'd be so cool ... :)

> 
> > btw2. won't there ever be MX28EVK with more than 512MB of DRAM?
> 
> I don't think there will be other revision of mx28evk board.

All right, this approach is valid then. Btw. Fabio, can you verify that you 
don't see any memory aliasing now (just to avoid trouble).

> Regards,
> 
> Fabio Estevam

Best regards,
Marek Vasut
Fabio Estevam May 12, 2012, 4:40 p.m. UTC | #4
On Sat, May 12, 2012 at 1:19 PM, Marek Vasut <marex@denx.de> wrote:

> All right, this approach is valid then. Btw. Fabio, can you verify that you
> don't see any memory aliasing now (just to avoid trouble).

How can I verify this, please?

Regards,

Fabio Estevam
Fabio Estevam May 12, 2012, 4:51 p.m. UTC | #5
On Sat, May 12, 2012 at 1:19 PM, Marek Vasut <marex@denx.de> wrote:

> All right, this approach is valid then. Btw. Fabio, can you verify that you
> don't see any memory aliasing now (just to avoid trouble).

Actually I think it would be better to define the total size of RAM
for mx28evk as 128MB.

Do you agree?

Regards,

Fabio Estevam
Marek Vasut May 12, 2012, 5:06 p.m. UTC | #6
Dear Fabio Estevam,

> On Sat, May 12, 2012 at 1:19 PM, Marek Vasut <marex@denx.de> wrote:
> > All right, this approach is valid then. Btw. Fabio, can you verify that
> > you don't see any memory aliasing now (just to avoid trouble).
> 
> How can I verify this, please?

Try writing some pattern into DRAM at "offset-sizeof(pattern area)" and try 
reading it from "2*offset + sizeof(pattern area)" ... try doing the same for 
4*offset etc.

You might also be able to read data from memory behind what uboot considers as 
detected DRAM which will have the same contents as the detected DRAM etc. 

> 
> Regards,
> 
> Fabio Estevam

Best regards,
Marek Vasut
Marek Vasut May 12, 2012, 5:07 p.m. UTC | #7
Dear Fabio Estevam,

> On Sat, May 12, 2012 at 1:19 PM, Marek Vasut <marex@denx.de> wrote:
> > All right, this approach is valid then. Btw. Fabio, can you verify that
> > you don't see any memory aliasing now (just to avoid trouble).
> 
> Actually I think it would be better to define the total size of RAM
> for mx28evk as 128MB.
> 
> Do you agree?

Yes, it's fine with me.

> 
> Regards,
> 
> Fabio Estevam

Best regards,
Marek Vasut
Wolfgang Denk May 12, 2012, 9:22 p.m. UTC | #8
Dear Fabio Estevam,

In message <1336838852-14235-1-git-send-email-festevam@gmail.com> you wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> Scan only first 512 MB of DRAM to avoid memory wraparound.
> 
> This fixes mx28evk boot and it follows the same idea of commit
> 19a2066b57 (M28: Scan only first 512 MB of DRAM to avoid memory wraparound)

Actually I think this should not be needed.  Such wrap-arounds are
supposed to be detected by get_ram_size(), which should result in
properly sized RAM mappings.

Why is this failing here?

Best regards,

Wolfgang Denk
diff mbox

Patch

diff --git a/include/configs/mx28evk.h b/include/configs/mx28evk.h
index 0c18e50..a4ea12d 100644
--- a/include/configs/mx28evk.h
+++ b/include/configs/mx28evk.h
@@ -75,7 +75,7 @@ 
  */
 #define CONFIG_NR_DRAM_BANKS		1		/* 1 bank of DRAM */
 #define PHYS_SDRAM_1			0x40000000	/* Base address */
-#define PHYS_SDRAM_1_SIZE		0x40000000	/* Max 1 GB RAM */
+#define PHYS_SDRAM_1_SIZE		0x20000000	/* Max 512MB RAM */
 #define CONFIG_STACKSIZE		(128 * 1024)	/* 128 KB stack */
 #define CONFIG_SYS_MALLOC_LEN		0x00400000	/* 4 MB for malloc */
 #define CONFIG_SYS_MEMTEST_START	0x40000000	/* Memtest start adr */