summaryrefslogtreecommitdiff
path: root/arch/m68k/lib/cache.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-07-03 14:42:11 -0600
committerTom Rini <trini@konsulko.com>2024-07-03 14:42:11 -0600
commitf0a259c25f60f4da72707a54dbd2f990d24d0d82 (patch)
treea30ef3441fb7d8289c84d38ad0cc04552840c6b2 /arch/m68k/lib/cache.c
parent005105b11cefe694dcd40572639973fbb9b31646 (diff)
parent7d6cee2cd0e2e2507aca1e3a6fe0e2cb241a116e (diff)
Merge patch series "m68k: Implement a default flush_dcache_all"
Tom Rini <trini@konsulko.com> says: Prior to this series we had some de-facto required cache functions that were either unimplemented on some architectures or differently named. This would lead in some cases to having multiple "weak" functions available as well. Rework things so that an architecture must provide these functions and it is up to that architecture if a "weak" default function makes sense, or not.
Diffstat (limited to 'arch/m68k/lib/cache.c')
-rw-r--r--arch/m68k/lib/cache.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
index de04124404c..370ad40f142 100644
--- a/arch/m68k/lib/cache.c
+++ b/arch/m68k/lib/cache.c
@@ -29,7 +29,7 @@ int dcache_status(void)
void icache_enable(void)
{
- icache_invalid();
+ invalidate_icache_all();
*cf_icache_status = 1;
@@ -53,7 +53,7 @@ void icache_disable(void)
u32 temp = 0;
*cf_icache_status = 0;
- icache_invalid();
+ invalidate_icache_all();
#if defined(CONFIG_CF_V4) || defined(CFG_CF_V4E)
__asm__ __volatile__("movec %0, %%acr2"::"r"(temp));
@@ -68,7 +68,7 @@ void icache_disable(void)
#endif
}
-void icache_invalid(void)
+void invalidate_icache_all(void)
{
u32 temp;
@@ -134,6 +134,15 @@ void dcache_invalid(void)
#endif
}
+/*
+ * Default implementation:
+ * do a range flush for the entire range
+ */
+__weak void flush_dcache_all(void)
+{
+ flush_dcache_range(0, ~0);
+}
+
__weak void invalidate_dcache_range(unsigned long start, unsigned long stop)
{
/* An empty stub, real implementation should be in platform code */