Patchwork [U-Boot] arm, post, memory: fix bug if sdram base != 0x00000000

login
register
mail settings
Submitter Heiko Schocher
Date Oct. 7, 2011, 6:40 a.m.
Message ID <1317969600-32496-1-git-send-email-hs@denx.de>
Download mbox | patch
Permalink /patch/118208/
State Accepted
Commit 7b5d61b5a3dd6c6f8f0723941beb700277de9407
Headers show

Comments

Heiko Schocher - Oct. 7, 2011, 6:40 a.m.
commit 8d3fcb5e60b6c8e1d530dbc2e2e33ec6a44670da breaks post
memory support for sdram base != 0x00000000. Fix this.

Signed-off-by: Heiko Schocher <hs@denx.de>
Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
Cc: Holger Brunck <holger.brunck@keymile.com>
---
$ /home/git/linux-denx/scripts/checkpatch.pl 0001-arm-post-memory-fix-bug-if-sdram-base-0x00000000.patch
total: 0 errors, 0 warnings, 14 lines checked

0001-arm-post-memory-fix-bug-if-sdram-base-0x00000000.patch has no obvious style problems and is ready for submission.

 post/drivers/memory.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
Valentin Longchamp - Oct. 7, 2011, 6:53 a.m.
On 10/07/2011 08:40 AM, Heiko Schocher wrote:
> commit 8d3fcb5e60b6c8e1d530dbc2e2e33ec6a44670da breaks post
> memory support for sdram base != 0x00000000. Fix this.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> Cc: Holger Brunck <holger.brunck@keymile.com>
> ---
> $ /home/git/linux-denx/scripts/checkpatch.pl 0001-arm-post-memory-fix-bug-if-sdram-base-0x00000000.patch
> total: 0 errors, 0 warnings, 14 lines checked
> 
> 0001-arm-post-memory-fix-bug-if-sdram-base-0x00000000.patch has no obvious style problems and is ready for submission.
> 
>  post/drivers/memory.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/post/drivers/memory.c b/post/drivers/memory.c
> index 69973c0..d25e323 100644
> --- a/post/drivers/memory.c
> +++ b/post/drivers/memory.c
> @@ -466,10 +466,11 @@ static int memory_post_test_regions(unsigned long start, unsigned long size)
>  
>  	for (i = 0; i < (size >> 20) && (!ret); i++) {
>  		if (!ret)
> -			ret = memory_post_test_patterns(i << 20, 0x800);
> -		if (!ret)
> -			ret = memory_post_test_patterns((i << 20) + 0xff800,
> +			ret = memory_post_test_patterns(start + (i << 20),
>  				0x800);
> +		if (!ret)
> +			ret = memory_post_test_patterns(start + (i << 20) +
> +				0xff800, 0x800);
>  	}
>  
>  	return ret;

Thanks for fixing that Heiko: we only have boards starting @0x00000000 so I did
not notice this bug.

Ackey-by: Valentin Longchamp <valentin.longchamp@keymile.com>

Valentin
Mike Frysinger - Oct. 7, 2011, 5:19 p.m.
Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
Wolfgang Denk - Oct. 23, 2011, 8:14 p.m.
Dear Heiko Schocher,

In message <1317969600-32496-1-git-send-email-hs@denx.de> you wrote:
> commit 8d3fcb5e60b6c8e1d530dbc2e2e33ec6a44670da breaks post
> memory support for sdram base != 0x00000000. Fix this.
> 
> Signed-off-by: Heiko Schocher <hs@denx.de>
> Cc: Valentin Longchamp <valentin.longchamp@keymile.com>
> Cc: Holger Brunck <holger.brunck@keymile.com>
> ---
> $ /home/git/linux-denx/scripts/checkpatch.pl 0001-arm-post-memory-fix-bug-if-sdram-base-0x00000000.patch
> total: 0 errors, 0 warnings, 14 lines checked
> 
> 0001-arm-post-memory-fix-bug-if-sdram-base-0x00000000.patch has no obvious style problems and is ready for submission.
> 
>  post/drivers/memory.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Patch

diff --git a/post/drivers/memory.c b/post/drivers/memory.c
index 69973c0..d25e323 100644
--- a/post/drivers/memory.c
+++ b/post/drivers/memory.c
@@ -466,10 +466,11 @@  static int memory_post_test_regions(unsigned long start, unsigned long size)
 
 	for (i = 0; i < (size >> 20) && (!ret); i++) {
 		if (!ret)
-			ret = memory_post_test_patterns(i << 20, 0x800);
-		if (!ret)
-			ret = memory_post_test_patterns((i << 20) + 0xff800,
+			ret = memory_post_test_patterns(start + (i << 20),
 				0x800);
+		if (!ret)
+			ret = memory_post_test_patterns(start + (i << 20) +
+				0xff800, 0x800);
 	}
 
 	return ret;