ramips: use uncached address in detect_mem_size
authorGabor Juhos <juhosg@openwrt.org>
Sat, 11 Feb 2012 15:11:45 +0000 (15:11 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sat, 11 Feb 2012 15:11:45 +0000 (15:11 +0000)
SVN-Revision: 30438

target/linux/ramips/files/arch/mips/ralink/common/setup.c

index e8126b11c8e74b6eae3b6c73bb1019b3e50fade3..5f7cf14a76214cc98a12ff8fe9fefcb113197bd3 100644 (file)
@@ -31,11 +31,12 @@ const char *get_system_type(void)
 static void __init detect_mem_size(void)
 {
        unsigned long size;
+       void *base;
 
+       base = (void *) KSEG1ADDR(detect_mem_size);
        for (size = RALINK_SOC_MEM_SIZE_MIN; size < RALINK_SOC_MEM_SIZE_MAX;
             size <<= 1 ) {
-               if (!memcmp(detect_mem_size,
-                           detect_mem_size + size, 1024))
+               if (!memcmp(base, base + size, 1024))
                        break;
        }