]> Git Repo - u-boot.git/commitdiff
ARM1136: Fix cache range checks
authorBenoît Thébaudeau <[email protected]>
Thu, 19 Jul 2012 01:35:32 +0000 (01:35 +0000)
committerAlbert ARIBAUD <[email protected]>
Sat, 21 Jul 2012 21:24:25 +0000 (23:24 +0200)
bad_cache_range actually returned true if the range was OK, but it was used
according to its name, which resulted in all valid dcache range invalidate/flush
operations being dropped. Hence, most DMA transfers resulted in garbage data.

This patch renames this function according to what it does, and it fixes the
interpretation of its return value by other functions. The chosen naming is the
same as for ARM926EJ-S in order to be consistent.

Signed-off-by: Benoît Thébaudeau <[email protected]>
Cc: Albert Aribaud <[email protected]>
Acked-by: Stefano Babic <[email protected]>
arch/arm/cpu/arm1136/cpu.c

index f72bab6693cdaba3f4126ddedfa29e3d11339569..b98e3d9face97006d5588901eecb152b2d799701 100644 (file)
@@ -95,7 +95,7 @@ void flush_dcache_all(void)
        asm volatile("mcr p15, 0, %0, c7, c10, 4" : : "r" (0));
 }
 
-static inline int bad_cache_range(unsigned long start, unsigned long stop)
+static int check_cache_range(unsigned long start, unsigned long stop)
 {
        int ok = 1;
 
@@ -114,7 +114,7 @@ static inline int bad_cache_range(unsigned long start, unsigned long stop)
 
 void invalidate_dcache_range(unsigned long start, unsigned long stop)
 {
-       if (bad_cache_range(start, stop))
+       if (!check_cache_range(start, stop))
                return;
 
        while (start < stop) {
@@ -125,7 +125,7 @@ void invalidate_dcache_range(unsigned long start, unsigned long stop)
 
 void flush_dcache_range(unsigned long start, unsigned long stop)
 {
-       if (bad_cache_range(start, stop))
+       if (!check_cache_range(start, stop))
                return;
 
        while (start < stop) {
This page took 0.035668 seconds and 4 git commands to generate.