Skip to content

Commit

Permalink
m68knommu: reorganize the no-MMU cache flushing to match m68k
Browse files Browse the repository at this point in the history
Introduce cache_push() and cache_clear() functions for the non-MMU m68k
devices. With these in place we can more easily merge some of the common
m68k arch code.

In particular by reorganizing the __flush_cache_all() code and separating
the cache push and clear functions it becomes trivial to implement the
new cache_push() and cache_clear() functions.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
  • Loading branch information
Greg Ungerer committed May 20, 2012
1 parent 453549d commit 1744bd9
Showing 1 changed file with 28 additions and 4 deletions.
32 changes: 28 additions & 4 deletions arch/m68k/include/asm/cacheflush_no.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,8 @@

void mcf_cache_push(void);

static inline void __flush_cache_all(void)
static inline void __clear_cache_all(void)
{
#ifdef CACHE_PUSH
mcf_cache_push();
#endif
#ifdef CACHE_INVALIDATE
__asm__ __volatile__ (
"movel %0, %%d0\n\t"
Expand All @@ -44,6 +41,14 @@ static inline void __flush_cache_all(void)
#endif
}

static inline void __flush_cache_all(void)
{
#ifdef CACHE_PUSH
mcf_cache_push();
#endif
__clear_cache_all();
}

/*
* Some ColdFire parts implement separate instruction and data caches,
* on those we should just flush the appropriate cache. If we don't need
Expand Down Expand Up @@ -76,4 +81,23 @@ static inline void __flush_dcache_all(void)
__asm__ __volatile__ ( "nop" );
#endif
}

/*
* Push cache entries at supplied address. We want to write back any dirty
* data and the invalidate the cache lines associated with this address.
*/
static inline void cache_push(unsigned long paddr, int len)
{
__flush_cache_all();
}

/*
* Clear cache entries at supplied address (that is don't write back any
* dirty data).
*/
static inline void cache_clear(unsigned long paddr, int len)
{
__clear_cache_all();
}

#endif /* _M68KNOMMU_CACHEFLUSH_H */

0 comments on commit 1744bd9

Please sign in to comment.