From 8cb4817d0f076605c5126f0925f6c7fdb0461bf6 Mon Sep 17 00:00:00 2001 From: Paul Burton Date: Wed, 21 Sep 2016 11:18:48 +0100 Subject: MIPS: Probe cache line sizes once during boot Rather than probing the cache line sizes on every call of any cache maintenance function, probe them once during boot & store the values in the global data structure for later use. This will reduce the overhead of the cache maintenance functions, which isn't a big deal yet but becomes more important once L2 caches which may expose their properties via coprocessor 2 or the CM are supported. Signed-off-by: Paul Burton --- arch/mips/include/asm/cache.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arch/mips/include/asm/cache.h') diff --git a/arch/mips/include/asm/cache.h b/arch/mips/include/asm/cache.h index 0cea581e5d..669c362a52 100644 --- a/arch/mips/include/asm/cache.h +++ b/arch/mips/include/asm/cache.h @@ -19,4 +19,13 @@ */ #define CONFIG_SYS_CACHELINE_SIZE ARCH_DMA_MINALIGN +/** + * mips_cache_probe() - Probe the properties of the caches + * + * Call this to probe the properties such as line sizes of the caches + * present in the system, if any. This must be done before cache maintenance + * functions such as flush_cache may be called. + */ +void mips_cache_probe(void); + #endif /* __MIPS_CACHE_H__ */ -- cgit v1.2.3