[U-Boot,04/11] Orion5x: bugfix: window size (mis)calculation

Submitted by Rogan Dawes on March 18, 2011, 8:04 a.m.

Details

Message ID 1300435500-4909-5-git-send-email-rogan@dawes.za.net
State Accepted
Commit 4e4479a8922833025a8aac4f33fff9fa1e294ac9
Headers show

Commit Message

Rogan Dawes March 18, 2011, 8:04 a.m.
From: Albert Aribaud <albert.aribaud@free.fr>

Fix orion5x_winctrl_calcsize() off-by-1 bug which caused mapping
windows to be cut by half. This afected all windows including NOR
flash (causing half the flash to be unaccessible) but DRAM was and
still is fine as its size is determined otherwise.

Signed-off-by: Albert Aribaud <albert.aribaud@free.fr>
---
 arch/arm/cpu/arm926ejs/orion5x/cpu.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Prafulla Wadaskar March 18, 2011, 11 a.m.
> -----Original Message-----
> From: u-boot-bounces@lists.denx.de [mailto:u-boot-bounces@lists.denx.de]
> On Behalf Of rogan@dawes.za.net
> Sent: Friday, March 18, 2011 1:35 PM
> To: u-boot@lists.denx.de
> Subject: [U-Boot] [PATCH 04/11] Orion5x: bugfix: window size
> (mis)calculation
> 
> From: Albert Aribaud <albert.aribaud@free.fr>

BTW: who has send this patch? I think not Albert?

Regards..
Prafulla . .

Patch hide | download patch | download mbox

diff --git a/arch/arm/cpu/arm926ejs/orion5x/cpu.c b/arch/arm/cpu/arm926ejs/orion5x/cpu.c
index 3740e33..260f88b 100644
--- a/arch/arm/cpu/arm926ejs/orion5x/cpu.c
+++ b/arch/arm/cpu/arm926ejs/orion5x/cpu.c
@@ -61,7 +61,7 @@  unsigned int orion5x_winctrl_calcsize(unsigned int sizeval)
 	unsigned int j = 0;
 	u32 val = sizeval >> 1;
 
-	for (i = 0; val > 0x10000; i++) {
+	for (i = 0; val >= 0x10000; i++) {
 		j |= (1 << i);
 		val = val >> 1;
 	}