X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=arch%2Farm%2Flib%2Fcache.c;h=8b1c8ed4bfcc92e5f5ac62970adf9c4676a44aa7;hb=f0df254663d44f7fd4b714542bb4602626837465;hp=61ee9d3b13b96bfc5b8387a78de4edf990a5b166;hpb=83653121d7382fccfe329cb732f77f116341ef1d;p=platform%2Fkernel%2Fu-boot.git diff --git a/arch/arm/lib/cache.c b/arch/arm/lib/cache.c index 61ee9d3..8b1c8ed 100644 --- a/arch/arm/lib/cache.c +++ b/arch/arm/lib/cache.c @@ -25,12 +25,43 @@ #include -void flush_cache (unsigned long dummy1, unsigned long dummy2) +void __flush_cache(unsigned long start, unsigned long size) { -#ifdef CONFIG_OMAP2420 +#if defined(CONFIG_ARM1136) void arm1136_cache_flush(void); arm1136_cache_flush(); #endif +#ifdef CONFIG_ARM926EJS + /* test and clean, page 2-23 of arm926ejs manual */ + asm("0: mrc p15, 0, r15, c7, c10, 3\n\t" "bne 0b\n" : : : "memory"); + /* disable write buffer as well (page 2-22) */ + asm("mcr p15, 0, %0, c7, c10, 4" : : "r" (0)); +#endif return; } +void flush_cache(unsigned long start, unsigned long size) + __attribute__((weak, alias("__flush_cache"))); + +/* + * Default implementation: + * do a range flush for the entire range + */ +void __flush_dcache_all(void) +{ + flush_cache(0, ~0); +} +void flush_dcache_all(void) + __attribute__((weak, alias("__flush_dcache_all"))); + + +/* + * Default implementation of enable_caches() + * Real implementation should be in platform code + */ +void __enable_caches(void) +{ + puts("WARNING: Caches not enabled\n"); +} +void enable_caches(void) + __attribute__((weak, alias("__enable_caches")));