Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-blackfin/cache.h |
| 3 | */ |
| 4 | #ifndef __ARCH_BLACKFIN_CACHE_H |
| 5 | #define __ARCH_BLACKFIN_CACHE_H |
| 6 | |
| 7 | /* |
| 8 | * Bytes per L1 cache line |
| 9 | * Blackfin loads 32 bytes for cache |
| 10 | */ |
| 11 | #define L1_CACHE_SHIFT 5 |
| 12 | #define L1_CACHE_BYTES (1 << L1_CACHE_SHIFT) |
| 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
| 14 | |
Graf Yang | 6b3087c | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 15 | #ifdef CONFIG_SMP |
| 16 | #define __cacheline_aligned |
| 17 | #else |
| 18 | #define ____cacheline_aligned |
| 19 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 20 | /* |
| 21 | * Put cacheline_aliged data to L1 data memory |
| 22 | */ |
| 23 | #ifdef CONFIG_CACHELINE_ALIGNED_L1 |
| 24 | #define __cacheline_aligned \ |
| 25 | __attribute__((__aligned__(L1_CACHE_BYTES), \ |
| 26 | __section__(".data_l1.cacheline_aligned"))) |
| 27 | #endif |
| 28 | |
Graf Yang | 6b3087c | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 29 | #endif |
| 30 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 31 | /* |
| 32 | * largest L1 which this arch supports |
| 33 | */ |
| 34 | #define L1_CACHE_SHIFT_MAX 5 |
| 35 | |
Graf Yang | 6b3087c | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 36 | #if defined(CONFIG_SMP) && \ |
Sonic Zhang | 47e9ded | 2009-06-10 08:57:08 +0000 | [diff] [blame] | 37 | !defined(CONFIG_BFIN_CACHE_COHERENT) |
Jie Zhang | 41ba653 | 2009-06-16 09:48:33 +0000 | [diff] [blame] | 38 | # if defined(CONFIG_BFIN_ICACHEABLE) || defined(CONFIG_BFIN_L2_ICACHEABLE) |
Sonic Zhang | 47e9ded | 2009-06-10 08:57:08 +0000 | [diff] [blame] | 39 | # define __ARCH_SYNC_CORE_ICACHE |
| 40 | # endif |
Jie Zhang | 41ba653 | 2009-06-16 09:48:33 +0000 | [diff] [blame] | 41 | # if defined(CONFIG_BFIN_DCACHEABLE) || defined(CONFIG_BFIN_L2_DCACHEABLE) |
Sonic Zhang | 47e9ded | 2009-06-10 08:57:08 +0000 | [diff] [blame] | 42 | # define __ARCH_SYNC_CORE_DCACHE |
| 43 | # endif |
Graf Yang | 6b3087c | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 44 | #ifndef __ASSEMBLY__ |
| 45 | asmlinkage void __raw_smp_mark_barrier_asm(void); |
| 46 | asmlinkage void __raw_smp_check_barrier_asm(void); |
| 47 | |
| 48 | static inline void smp_mark_barrier(void) |
| 49 | { |
| 50 | __raw_smp_mark_barrier_asm(); |
| 51 | } |
| 52 | static inline void smp_check_barrier(void) |
| 53 | { |
| 54 | __raw_smp_check_barrier_asm(); |
| 55 | } |
| 56 | |
| 57 | void resync_core_dcache(void); |
Sonic Zhang | 47e9ded | 2009-06-10 08:57:08 +0000 | [diff] [blame] | 58 | void resync_core_icache(void); |
Graf Yang | 6b3087c | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 59 | #endif |
| 60 | #endif |
| 61 | |
| 62 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 63 | #endif |