This source file includes following definitions.
- turbosparc_inv_insn_tag
- turbosparc_inv_data_tag
- turbosparc_flush_icache
- turbosparc_flush_dcache
- turbosparc_idflash_clear
- turbosparc_set_ccreg
- turbosparc_get_ccreg
1
2
3
4
5
6
7
8 #ifndef _SPARC_TURBOSPARC_H
9 #define _SPARC_TURBOSPARC_H
10
11 #include <asm/asi.h>
12 #include <asm/pgtsrmmu.h>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36 #define TURBOSPARC_MMUENABLE 0x00000001
37 #define TURBOSPARC_NOFAULT 0x00000002
38 #define TURBOSPARC_ICSNOOP 0x00000004
39 #define TURBOSPARC_PSO 0x00000080
40 #define TURBOSPARC_DCENABLE 0x00000100
41 #define TURBOSPARC_ICENABLE 0x00000200
42 #define TURBOSPARC_BMODE 0x00004000
43 #define TURBOSPARC_PARITYODD 0x00020000
44 #define TURBOSPARC_PCENABLE 0x00040000
45
46
47
48
49
50
51
52
53
54
55 #define TURBOSPARC_SCENABLE 0x00000008
56 #define TURBOSPARC_uS2 0x00000010
57 #define TURBOSPARC_WTENABLE 0x00000020
58 #define TURBOSPARC_SNENABLE 0x40000000
59
60 #ifndef __ASSEMBLY__
61
62
63 static inline void turbosparc_inv_insn_tag(unsigned long addr)
64 {
65 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
66 :
67 : "r" (addr), "i" (ASI_M_TXTC_TAG)
68 : "memory");
69 }
70
71
72 static inline void turbosparc_inv_data_tag(unsigned long addr)
73 {
74 __asm__ __volatile__("sta %%g0, [%0] %1\n\t"
75 :
76 : "r" (addr), "i" (ASI_M_DATAC_TAG)
77 : "memory");
78 }
79
80 static inline void turbosparc_flush_icache(void)
81 {
82 unsigned long addr;
83
84 for (addr = 0; addr < 0x4000; addr += 0x20)
85 turbosparc_inv_insn_tag(addr);
86 }
87
88 static inline void turbosparc_flush_dcache(void)
89 {
90 unsigned long addr;
91
92 for (addr = 0; addr < 0x4000; addr += 0x20)
93 turbosparc_inv_data_tag(addr);
94 }
95
96 static inline void turbosparc_idflash_clear(void)
97 {
98 unsigned long addr;
99
100 for (addr = 0; addr < 0x4000; addr += 0x20) {
101 turbosparc_inv_insn_tag(addr);
102 turbosparc_inv_data_tag(addr);
103 }
104 }
105
106 static inline void turbosparc_set_ccreg(unsigned long regval)
107 {
108 __asm__ __volatile__("sta %0, [%1] %2\n\t"
109 :
110 : "r" (regval), "r" (0x600), "i" (ASI_M_MMUREGS)
111 : "memory");
112 }
113
114 static inline unsigned long turbosparc_get_ccreg(void)
115 {
116 unsigned long regval;
117
118 __asm__ __volatile__("lda [%1] %2, %0\n\t"
119 : "=r" (regval)
120 : "r" (0x600), "i" (ASI_M_MMUREGS));
121 return regval;
122 }
123
124 #endif
125
126 #endif