6 #ifndef _SPARC64_SPITFIRE_H
7 #define _SPARC64_SPITFIRE_H
17 #define TSB_TAG_TARGET 0x0000000000000000
18 #define TLB_SFSR 0x0000000000000018
19 #define TSB_REG 0x0000000000000028
20 #define TLB_TAG_ACCESS 0x0000000000000030
21 #define VIRT_WATCHPOINT 0x0000000000000038
22 #define PHYS_WATCHPOINT 0x0000000000000040
23 #define TSB_EXTENSION_P 0x0000000000000048
24 #define TSB_EXTENSION_S 0x0000000000000050
25 #define TSB_EXTENSION_N 0x0000000000000058
26 #define TLB_TAG_ACCESS_EXT 0x0000000000000060
31 #define PRIMARY_CONTEXT 0x0000000000000008
32 #define SECONDARY_CONTEXT 0x0000000000000010
33 #define DMMU_SFAR 0x0000000000000020
34 #define VIRT_WATCHPOINT 0x0000000000000038
35 #define PHYS_WATCHPOINT 0x0000000000000040
37 #define SPITFIRE_HIGHEST_LOCKED_TLBENT (64 - 1)
38 #define CHEETAH_HIGHEST_LOCKED_TLBENT (16 - 1)
40 #define L1DCACHE_SIZE 0x4000
42 #define SUN4V_CHIP_INVALID 0x00
43 #define SUN4V_CHIP_NIAGARA1 0x01
44 #define SUN4V_CHIP_NIAGARA2 0x02
45 #define SUN4V_CHIP_NIAGARA3 0x03
46 #define SUN4V_CHIP_NIAGARA4 0x04
47 #define SUN4V_CHIP_NIAGARA5 0x05
48 #define SUN4V_CHIP_UNKNOWN 0xff
52 enum ultra_tlb_layout {
59 extern enum ultra_tlb_layout
tlb_type;
61 extern int sun4v_chip_type;
66 #define sparc64_highest_locked_tlbent() \
67 (tlb_type == spitfire ? \
68 SPITFIRE_HIGHEST_LOCKED_TLBENT : \
69 CHEETAH_HIGHEST_LOCKED_TLBENT)
76 static inline void spitfire_put_dcache_tag(
unsigned long addr,
unsigned long tag)
78 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
90 static inline void spitfire_put_icache_tag(
unsigned long addr,
unsigned long tag)
92 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
98 static inline unsigned long spitfire_get_dtlb_data(
int entry)
102 __asm__ __volatile__(
"ldxa [%1] %2, %0"
107 data &= ~0x0003fe0000000000
UL;
112 static inline unsigned long spitfire_get_dtlb_tag(
int entry)
116 __asm__ __volatile__(
"ldxa [%1] %2, %0"
122 static inline void spitfire_put_dtlb_data(
int entry,
unsigned long data)
124 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
127 :
"r" (data),
"r" (entry << 3),
131 static inline unsigned long spitfire_get_itlb_data(
int entry)
135 __asm__ __volatile__(
"ldxa [%1] %2, %0"
140 data &= ~0x0003fe0000000000
UL;
145 static inline unsigned long spitfire_get_itlb_tag(
int entry)
149 __asm__ __volatile__(
"ldxa [%1] %2, %0"
155 static inline void spitfire_put_itlb_data(
int entry,
unsigned long data)
157 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
160 :
"r" (data),
"r" (entry << 3),
164 static inline void spitfire_flush_dtlb_nucleus_page(
unsigned long page)
166 __asm__ __volatile__(
"stxa %%g0, [%0] %1\n\t"
172 static inline void spitfire_flush_itlb_nucleus_page(
unsigned long page)
174 __asm__ __volatile__(
"stxa %%g0, [%0] %1\n\t"
181 static inline void cheetah_flush_dtlb_all(
void)
183 __asm__ __volatile__(
"stxa %%g0, [%0] %1\n\t"
189 static inline void cheetah_flush_itlb_all(
void)
191 __asm__ __volatile__(
"stxa %%g0, [%0] %1\n\t"
211 static inline unsigned long cheetah_get_ldtlb_data(
int entry)
215 __asm__ __volatile__(
"ldxa [%1] %2, %%g0\n\t"
218 :
"r" ((0 << 16) | (entry << 3)),
224 static inline unsigned long cheetah_get_litlb_data(
int entry)
228 __asm__ __volatile__(
"ldxa [%1] %2, %%g0\n\t"
231 :
"r" ((0 << 16) | (entry << 3)),
237 static inline unsigned long cheetah_get_ldtlb_tag(
int entry)
241 __asm__ __volatile__(
"ldxa [%1] %2, %0"
243 :
"r" ((0 << 16) | (entry << 3)),
249 static inline unsigned long cheetah_get_litlb_tag(
int entry)
253 __asm__ __volatile__(
"ldxa [%1] %2, %0"
255 :
"r" ((0 << 16) | (entry << 3)),
261 static inline void cheetah_put_ldtlb_data(
int entry,
unsigned long data)
263 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
267 "r" ((0 << 16) | (entry << 3)),
271 static inline void cheetah_put_litlb_data(
int entry,
unsigned long data)
273 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
277 "r" ((0 << 16) | (entry << 3)),
281 static inline unsigned long cheetah_get_dtlb_data(
int entry,
int tlb)
285 __asm__ __volatile__(
"ldxa [%1] %2, %%g0\n\t"
293 static inline unsigned long cheetah_get_dtlb_tag(
int entry,
int tlb)
297 __asm__ __volatile__(
"ldxa [%1] %2, %0"
303 static inline void cheetah_put_dtlb_data(
int entry,
unsigned long data,
int tlb)
305 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
309 "r" ((tlb << 16) | (entry << 3)),
313 static inline unsigned long cheetah_get_itlb_data(
int entry)
317 __asm__ __volatile__(
"ldxa [%1] %2, %%g0\n\t"
320 :
"r" ((2 << 16) | (entry << 3)),
326 static inline unsigned long cheetah_get_itlb_tag(
int entry)
330 __asm__ __volatile__(
"ldxa [%1] %2, %0"
336 static inline void cheetah_put_itlb_data(
int entry,
unsigned long data)
338 __asm__ __volatile__(
"stxa %0, [%1] %2\n\t"
341 :
"r" (data),
"r" ((2 << 16) | (entry << 3)),