Pārlūkot izejas kodu

Orion5x: bugfix: window size (mis)calculation

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>
Albert Aribaud 14 gadi atpakaļ
vecāks
revīzija
4e4479a892
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      arch/arm/cpu/arm926ejs/orion5x/cpu.c

+ 1 - 1
arch/arm/cpu/arm926ejs/orion5x/cpu.c

@@ -61,7 +61,7 @@ unsigned int orion5x_winctrl_calcsize(unsigned int sizeval)
 	unsigned int j = 0;
 	unsigned int j = 0;
 	u32 val = sizeval >> 1;
 	u32 val = sizeval >> 1;
 
 
-	for (i = 0; val > 0x10000; i++) {
+	for (i = 0; val >= 0x10000; i++) {
 		j |= (1 << i);
 		j |= (1 << i);
 		val = val >> 1;
 		val = val >> 1;
 	}
 	}