Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * include/asm-parisc/cache.h |
| 3 | */ |
| 4 | |
| 5 | #ifndef __ARCH_PARISC_CACHE_H |
| 6 | #define __ARCH_PARISC_CACHE_H |
| 7 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | |
| 9 | /* |
John David Anglin | a01fece | 2015-10-14 20:32:11 -0400 | [diff] [blame] | 10 | * PA 2.0 processors have 64 and 128-byte L2 cachelines; PA 1.1 processors |
| 11 | * have 32-byte cachelines. The L1 length appears to be 16 bytes but this |
| 12 | * is not clearly documented. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | */ |
John David Anglin | a01fece | 2015-10-14 20:32:11 -0400 | [diff] [blame] | 14 | #define L1_CACHE_BYTES 16 |
| 15 | #define L1_CACHE_SHIFT 4 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
| 17 | #ifndef __ASSEMBLY__ |
| 18 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
FUJITA Tomonori | 7896bfa | 2010-08-10 18:03:23 -0700 | [diff] [blame] | 21 | #define ARCH_DMA_MINALIGN L1_CACHE_BYTES |
| 22 | |
Denys Vlasenko | 54cb27a | 2010-02-20 01:03:44 +0100 | [diff] [blame] | 23 | #define __read_mostly __attribute__((__section__(".data..read_mostly"))) |
Kyle McMartin | 804f159 | 2006-03-23 03:00:16 -0800 | [diff] [blame] | 24 | |
Randolph Chung | d6ce862 | 2006-12-12 05:51:54 -0800 | [diff] [blame] | 25 | void parisc_cache_init(void); /* initializes cache-flushing */ |
| 26 | void disable_sr_hashing_asm(int); /* low level support for above */ |
| 27 | void disable_sr_hashing(void); /* turns off space register hashing */ |
| 28 | void free_sid(unsigned long); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | unsigned long alloc_sid(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | |
| 31 | struct seq_file; |
| 32 | extern void show_cache_info(struct seq_file *m); |
| 33 | |
| 34 | extern int split_tlb; |
| 35 | extern int dcache_stride; |
| 36 | extern int icache_stride; |
| 37 | extern struct pdc_cache_info cache_info; |
Randolph Chung | d6ce862 | 2006-12-12 05:51:54 -0800 | [diff] [blame] | 38 | void parisc_setup_cache_timing(void); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
| 40 | #define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr)); |
| 41 | #define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr)); |
| 42 | #define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr)); |
| 43 | |
| 44 | #endif /* ! __ASSEMBLY__ */ |
| 45 | |
| 46 | /* Classes of processor wrt: disabling space register hashing */ |
| 47 | |
| 48 | #define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */ |
| 49 | #define SRHASH_PCXL 1 /* pcxl */ |
| 50 | #define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */ |
| 51 | |
| 52 | #endif |