blob: 039880e7d2c977593f178753ff513d920c2b9a2a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * include/asm-parisc/cache.h
3 */
4
5#ifndef __ARCH_PARISC_CACHE_H
6#define __ARCH_PARISC_CACHE_H
7
Linus Torvalds1da177e2005-04-16 15:20:36 -07008
9/*
10 * PA 2.0 processors have 64-byte cachelines; PA 1.1 processors have
11 * 32-byte cachelines. The default configuration is not for SMP anyway,
12 * so if you're building for SMP, you should select the appropriate
13 * processor type. There is a potential livelock danger when running
14 * a machine with this value set too small, but it's more probable you'll
15 * just ruin performance.
16 */
17#ifdef CONFIG_PA20
18#define L1_CACHE_BYTES 64
19#define L1_CACHE_SHIFT 6
20#else
21#define L1_CACHE_BYTES 32
22#define L1_CACHE_SHIFT 5
23#endif
24
25#ifndef __ASSEMBLY__
26
27#define L1_CACHE_ALIGN(x) (((x)+(L1_CACHE_BYTES-1))&~(L1_CACHE_BYTES-1))
28
29#define SMP_CACHE_BYTES L1_CACHE_BYTES
Linus Torvalds1da177e2005-04-16 15:20:36 -070030
FUJITA Tomonori7896bfa2010-08-10 18:03:23 -070031#define ARCH_DMA_MINALIGN L1_CACHE_BYTES
32
Denys Vlasenko54cb27a2010-02-20 01:03:44 +010033#define __read_mostly __attribute__((__section__(".data..read_mostly")))
Kyle McMartin804f1592006-03-23 03:00:16 -080034
Randolph Chungd6ce8622006-12-12 05:51:54 -080035void parisc_cache_init(void); /* initializes cache-flushing */
36void disable_sr_hashing_asm(int); /* low level support for above */
37void disable_sr_hashing(void); /* turns off space register hashing */
38void free_sid(unsigned long);
Linus Torvalds1da177e2005-04-16 15:20:36 -070039unsigned long alloc_sid(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41struct seq_file;
42extern void show_cache_info(struct seq_file *m);
43
44extern int split_tlb;
45extern int dcache_stride;
46extern int icache_stride;
47extern struct pdc_cache_info cache_info;
Randolph Chungd6ce8622006-12-12 05:51:54 -080048void parisc_setup_cache_timing(void);
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
50#define pdtlb(addr) asm volatile("pdtlb 0(%%sr1,%0)" : : "r" (addr));
51#define pitlb(addr) asm volatile("pitlb 0(%%sr1,%0)" : : "r" (addr));
52#define pdtlb_kernel(addr) asm volatile("pdtlb 0(%0)" : : "r" (addr));
53
54#endif /* ! __ASSEMBLY__ */
55
56/* Classes of processor wrt: disabling space register hashing */
57
58#define SRHASH_PCXST 0 /* pcxs, pcxt, pcxt_ */
59#define SRHASH_PCXL 1 /* pcxl */
60#define SRHASH_PA20 2 /* pcxu, pcxu_, pcxw, pcxw_ */
61
62#endif