MIPS: add compile time definition of L2 cache size
authorRamon Fried <rfried.dev@gmail.com>
Mon, 10 Jun 2019 18:05:26 +0000 (21:05 +0300)
committerDaniel Schwierzeck <daniel.schwierzeck@gmail.com>
Fri, 25 Oct 2019 15:20:43 +0000 (17:20 +0200)
If configuration is set to skip low level init, automatic
probe of L2 cache size is not performed and the size is set to 0.
Flushing or invalidating the L2 cache will fail in this case.

Add a static configuration (SYS_DCACHE_LINE_SIZE) with default set to 0.

Signed-off-by: Ramon Fried <rfried.dev@gmail.com>
arch/mips/Kconfig
arch/mips/lib/cache.c

index e3e79455679912361d8ff9722928dddcb57b385c..f5d81b822c48d5500cf805a3ae7e8c311737f379 100644 (file)
@@ -408,9 +408,17 @@ config SYS_ICACHE_LINE_SIZE
        help
          The size of L1 Icache lines, if known at compile time.
 
+config SYS_SCACHE_LINE_SIZE
+       int
+       default 0
+       help
+         The size of L2 cache lines, if known at compile time.
+
+
 config SYS_CACHE_SIZE_AUTO
        def_bool y if SYS_DCACHE_SIZE = 0 && SYS_ICACHE_SIZE = 0 && \
-               SYS_DCACHE_LINE_SIZE = 0 && SYS_ICACHE_LINE_SIZE = 0
+               SYS_DCACHE_LINE_SIZE = 0 && SYS_ICACHE_LINE_SIZE = 0 && \
+               SYS_SCACHE_LINE_SIZE = 0
        help
          Select this (or let it be auto-selected by not defining any cache
          sizes) in order to allow U-Boot to automatically detect the sizes
index d56fd1e0f4c7e0761f2f36d5b39d38c42245b133..0ddae30f2c5b7e5559528a114fa88d4527bb8168 100644 (file)
@@ -87,7 +87,7 @@ static inline unsigned long scache_line_size(void)
 #ifdef CONFIG_MIPS_L2_CACHE
        return gd->arch.l2_line_size;
 #else
-       return 0;
+       return CONFIG_SYS_SCACHE_LINE_SIZE;
 #endif
 }