diff mbox

[U-Boot,v3,1/4] m68k: cache: add an empty stub functions for invalidate/flush dcache

Message ID 1437968418-21319-2-git-send-email-josh.wu@atmel.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Josh Wu July 27, 2015, 3:40 a.m. UTC
Since some driver like ohci, lcd used dcache functions. But m68k don't
implement the invalidate_dcache_range()/flush_dcache_range() functions.

To avoid compiling errors this patch adds an weak empty stub function
for all m68k cpu.

Also each cpu can implement its own implementation. If not implemented
then by default is using an empty function.

Signed-off-by: Josh Wu <josh.wu@atmel.com>
Acked-by: Angelo Dureghello <angelo@sysam.it>
---

Changes in v3:
- add Angelo's Acked-by.

Changes in v2:
- new added.

 arch/m68k/lib/cache.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Tom Rini Aug. 13, 2015, 1:20 p.m. UTC | #1
On Mon, Jul 27, 2015 at 11:40:15AM +0800, Wu, Josh wrote:

> Since some driver like ohci, lcd used dcache functions. But m68k don't
> implement the invalidate_dcache_range()/flush_dcache_range() functions.
> 
> To avoid compiling errors this patch adds an weak empty stub function
> for all m68k cpu.
> 
> Also each cpu can implement its own implementation. If not implemented
> then by default is using an empty function.
> 
> Signed-off-by: Josh Wu <josh.wu@atmel.com>
> Acked-by: Angelo Dureghello <angelo@sysam.it>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/arch/m68k/lib/cache.c b/arch/m68k/lib/cache.c
index 21daf3d..ace791b 100644
--- a/arch/m68k/lib/cache.c
+++ b/arch/m68k/lib/cache.c
@@ -132,3 +132,12 @@  void dcache_invalid(void)
 	__asm__ __volatile__("movec %0, %%cacr"::"r"(temp));
 #endif
 }
+
+__weak void invalidate_dcache_range(unsigned long start, unsigned long stop)
+{
+	/* An empty stub, real implementation should be in platform code */
+}
+__weak void flush_dcache_range(unsigned long start, unsigned long stop)
+{
+	/* An empty stub, real implementation should be in platform code */
+}