aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/cache.h
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@c-s.fr>2019-05-14 09:05:15 +0000
committerMichael Ellerman <mpe@ellerman.id.au>2019-07-05 02:06:37 +1000
commitd98fc70fc139b72ae098d24fde42ad70c8ff2f81 (patch)
treef968d93729af83cf24f7eaa62b91f01d1a11ed65 /arch/powerpc/include/asm/cache.h
parentpowerpc/64: flush_inval_dcache_range() becomes flush_dcache_range() (diff)
downloadlinux-dev-d98fc70fc139b72ae098d24fde42ad70c8ff2f81.tar.xz
linux-dev-d98fc70fc139b72ae098d24fde42ad70c8ff2f81.zip
powerpc/32: define helpers to get L1 cache sizes.
This patch defines C helpers to retrieve the size of cache blocks and uses them in the cacheflush functions. Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/include/asm/cache.h')
-rw-r--r--arch/powerpc/include/asm/cache.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/arch/powerpc/include/asm/cache.h b/arch/powerpc/include/asm/cache.h
index df8e4c407366..e84d1622eeb6 100644
--- a/arch/powerpc/include/asm/cache.h
+++ b/arch/powerpc/include/asm/cache.h
@@ -33,7 +33,8 @@
#define IFETCH_ALIGN_BYTES (1 << IFETCH_ALIGN_SHIFT)
-#if defined(__powerpc64__) && !defined(__ASSEMBLY__)
+#if !defined(__ASSEMBLY__)
+#ifdef CONFIG_PPC64
struct ppc_cache_info {
u32 size;
@@ -53,7 +54,18 @@ struct ppc64_caches {
};
extern struct ppc64_caches ppc64_caches;
-#endif /* __powerpc64__ && ! __ASSEMBLY__ */
+#else
+static inline u32 l1_cache_shift(void)
+{
+ return L1_CACHE_SHIFT;
+}
+
+static inline u32 l1_cache_bytes(void)
+{
+ return L1_CACHE_BYTES;
+}
+#endif
+#endif /* ! __ASSEMBLY__ */
#if defined(__ASSEMBLY__)
/*