GNU Linux-libre 4.14.251-gnu1
[releases.git] / arch / tile / include / uapi / arch / chip_tilegx.h
1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2 /*
3  * Copyright 2011 Tilera Corporation. All Rights Reserved.
4  *
5  *   This program is free software; you can redistribute it and/or
6  *   modify it under the terms of the GNU General Public License
7  *   as published by the Free Software Foundation, version 2.
8  *
9  *   This program is distributed in the hope that it will be useful, but
10  *   WITHOUT ANY WARRANTY; without even the implied warranty of
11  *   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12  *   NON INFRINGEMENT.  See the GNU General Public License for
13  *   more details.
14  */
15
16 /*
17  * @file
18  * Global header file.
19  * This header file specifies defines for TILE-Gx.
20  */
21
22 #ifndef __ARCH_CHIP_H__
23 #define __ARCH_CHIP_H__
24
25 /** Specify chip version.
26  * When possible, prefer the CHIP_xxx symbols below for future-proofing.
27  * This is intended for cross-compiling; native compilation should
28  * use the predefined __tile_chip__ symbol.
29  */
30 #define TILE_CHIP 10
31
32 /** Specify chip revision.
33  * This provides for the case of a respin of a particular chip type;
34  * the normal value for this symbol is "0".
35  * This is intended for cross-compiling; native compilation should
36  * use the predefined __tile_chip_rev__ symbol.
37  */
38 #define TILE_CHIP_REV 0
39
40 /** The name of this architecture. */
41 #define CHIP_ARCH_NAME "tilegx"
42
43 /** The ELF e_machine type for binaries for this chip. */
44 #define CHIP_ELF_TYPE() EM_TILEGX
45
46 /** The alternate ELF e_machine type for binaries for this chip. */
47 #define CHIP_COMPAT_ELF_TYPE() 0x2597
48
49 /** What is the native word size of the machine? */
50 #define CHIP_WORD_SIZE() 64
51
52 /** How many bits of a virtual address are used. Extra bits must be
53  * the sign extension of the low bits.
54  */
55 #define CHIP_VA_WIDTH() 42
56
57 /** How many bits are in a physical address? */
58 #define CHIP_PA_WIDTH() 40
59
60 /** Size of the L2 cache, in bytes. */
61 #define CHIP_L2_CACHE_SIZE() 262144
62
63 /** Log size of an L2 cache line in bytes. */
64 #define CHIP_L2_LOG_LINE_SIZE() 6
65
66 /** Size of an L2 cache line, in bytes. */
67 #define CHIP_L2_LINE_SIZE() (1 << CHIP_L2_LOG_LINE_SIZE())
68
69 /** Associativity of the L2 cache. */
70 #define CHIP_L2_ASSOC() 8
71
72 /** Size of the L1 data cache, in bytes. */
73 #define CHIP_L1D_CACHE_SIZE() 32768
74
75 /** Log size of an L1 data cache line in bytes. */
76 #define CHIP_L1D_LOG_LINE_SIZE() 6
77
78 /** Size of an L1 data cache line, in bytes. */
79 #define CHIP_L1D_LINE_SIZE() (1 << CHIP_L1D_LOG_LINE_SIZE())
80
81 /** Associativity of the L1 data cache. */
82 #define CHIP_L1D_ASSOC() 2
83
84 /** Size of the L1 instruction cache, in bytes. */
85 #define CHIP_L1I_CACHE_SIZE() 32768
86
87 /** Log size of an L1 instruction cache line in bytes. */
88 #define CHIP_L1I_LOG_LINE_SIZE() 6
89
90 /** Size of an L1 instruction cache line, in bytes. */
91 #define CHIP_L1I_LINE_SIZE() (1 << CHIP_L1I_LOG_LINE_SIZE())
92
93 /** Associativity of the L1 instruction cache. */
94 #define CHIP_L1I_ASSOC() 2
95
96 /** Stride with which flush instructions must be issued. */
97 #define CHIP_FLUSH_STRIDE() CHIP_L2_LINE_SIZE()
98
99 /** Stride with which inv instructions must be issued. */
100 #define CHIP_INV_STRIDE() CHIP_L2_LINE_SIZE()
101
102 /** Stride with which finv instructions must be issued. */
103 #define CHIP_FINV_STRIDE() CHIP_L2_LINE_SIZE()
104
105 /** Can the local cache coherently cache data that is homed elsewhere? */
106 #define CHIP_HAS_COHERENT_LOCAL_CACHE() 1
107
108 /** How many simultaneous outstanding victims can the L2 cache have? */
109 #define CHIP_MAX_OUTSTANDING_VICTIMS() 128
110
111 /** Does the TLB support the NC and NOALLOC bits? */
112 #define CHIP_HAS_NC_AND_NOALLOC_BITS() 1
113
114 /** Does the chip support hash-for-home caching? */
115 #define CHIP_HAS_CBOX_HOME_MAP() 1
116
117 /** Number of entries in the chip's home map tables. */
118 #define CHIP_CBOX_HOME_MAP_SIZE() 128
119
120 /** Do uncacheable requests miss in the cache regardless of whether
121  * there is matching data? */
122 #define CHIP_HAS_ENFORCED_UNCACHEABLE_REQUESTS() 1
123
124 /** Does the mf instruction wait for victims? */
125 #define CHIP_HAS_MF_WAITS_FOR_VICTIMS() 0
126
127 /** Does the chip have an "inv" instruction that doesn't also flush? */
128 #define CHIP_HAS_INV() 1
129
130 /** Does the chip have a "wh64" instruction? */
131 #define CHIP_HAS_WH64() 1
132
133 /** Does this chip have a 'dword_align' instruction? */
134 #define CHIP_HAS_DWORD_ALIGN() 0
135
136 /** Number of performance counters. */
137 #define CHIP_PERFORMANCE_COUNTERS() 4
138
139 /** Does this chip have auxiliary performance counters? */
140 #define CHIP_HAS_AUX_PERF_COUNTERS() 1
141
142 /** Is the CBOX_MSR1 SPR supported? */
143 #define CHIP_HAS_CBOX_MSR1() 0
144
145 /** Is the TILE_RTF_HWM SPR supported? */
146 #define CHIP_HAS_TILE_RTF_HWM() 1
147
148 /** Is the TILE_WRITE_PENDING SPR supported? */
149 #define CHIP_HAS_TILE_WRITE_PENDING() 0
150
151 /** Is the PROC_STATUS SPR supported? */
152 #define CHIP_HAS_PROC_STATUS_SPR() 1
153
154 /** Is the DSTREAM_PF SPR supported? */
155 #define CHIP_HAS_DSTREAM_PF() 1
156
157 /** Log of the number of mshims we have. */
158 #define CHIP_LOG_NUM_MSHIMS() 2
159
160 /** Are the bases of the interrupt vector areas fixed? */
161 #define CHIP_HAS_FIXED_INTVEC_BASE() 0
162
163 /** Are the interrupt masks split up into 2 SPRs? */
164 #define CHIP_HAS_SPLIT_INTR_MASK() 0
165
166 /** Is the cycle count split up into 2 SPRs? */
167 #define CHIP_HAS_SPLIT_CYCLE() 0
168
169 /** Does the chip have a static network? */
170 #define CHIP_HAS_SN() 0
171
172 /** Does the chip have a static network processor? */
173 #define CHIP_HAS_SN_PROC() 0
174
175 /** Size of the L1 static network processor instruction cache, in bytes. */
176 /* #define CHIP_L1SNI_CACHE_SIZE() -- does not apply to chip 10 */
177
178 /** Does the chip have DMA support in each tile? */
179 #define CHIP_HAS_TILE_DMA() 0
180
181 /** Does the chip have the second revision of the directly accessible
182  *  dynamic networks?  This encapsulates a number of characteristics,
183  *  including the absence of the catch-all, the absence of inline message
184  *  tags, the absence of support for network context-switching, and so on.
185  */
186 #define CHIP_HAS_REV1_XDN() 1
187
188 /** Does the chip have cmpexch and similar (fetchadd, exch, etc.)? */
189 #define CHIP_HAS_CMPEXCH() 1
190
191 /** Does the chip have memory-mapped I/O support? */
192 #define CHIP_HAS_MMIO() 1
193
194 /** Does the chip have post-completion interrupts? */
195 #define CHIP_HAS_POST_COMPLETION_INTERRUPTS() 1
196
197 /** Does the chip have native single step support? */
198 #define CHIP_HAS_SINGLE_STEP() 1
199
200 #ifndef __OPEN_SOURCE__  /* features only relevant to hypervisor-level code */
201
202 /** How many entries are present in the instruction TLB? */
203 #define CHIP_ITLB_ENTRIES() 16
204
205 /** How many entries are present in the data TLB? */
206 #define CHIP_DTLB_ENTRIES() 32
207
208 /** How many MAF entries does the XAUI shim have? */
209 #define CHIP_XAUI_MAF_ENTRIES() 32
210
211 /** Does the memory shim have a source-id table? */
212 #define CHIP_HAS_MSHIM_SRCID_TABLE() 0
213
214 /** Does the L1 instruction cache clear on reset? */
215 #define CHIP_HAS_L1I_CLEAR_ON_RESET() 1
216
217 /** Does the chip come out of reset with valid coordinates on all tiles?
218  * Note that if defined, this also implies that the upper left is 1,1.
219  */
220 #define CHIP_HAS_VALID_TILE_COORD_RESET() 1
221
222 /** Does the chip have unified packet formats? */
223 #define CHIP_HAS_UNIFIED_PACKET_FORMATS() 1
224
225 /** Does the chip support write reordering? */
226 #define CHIP_HAS_WRITE_REORDERING() 1
227
228 /** Does the chip support Y-X routing as well as X-Y? */
229 #define CHIP_HAS_Y_X_ROUTING() 1
230
231 /** Is INTCTRL_3 managed with the correct MPL? */
232 #define CHIP_HAS_INTCTRL_3_STATUS_FIX() 1
233
234 /** Is it possible to configure the chip to be big-endian? */
235 #define CHIP_HAS_BIG_ENDIAN_CONFIG() 1
236
237 /** Is the CACHE_RED_WAY_OVERRIDDEN SPR supported? */
238 #define CHIP_HAS_CACHE_RED_WAY_OVERRIDDEN() 0
239
240 /** Is the DIAG_TRACE_WAY SPR supported? */
241 #define CHIP_HAS_DIAG_TRACE_WAY() 0
242
243 /** Is the MEM_STRIPE_CONFIG SPR supported? */
244 #define CHIP_HAS_MEM_STRIPE_CONFIG() 1
245
246 /** Are the TLB_PERF SPRs supported? */
247 #define CHIP_HAS_TLB_PERF() 1
248
249 /** Is the VDN_SNOOP_SHIM_CTL SPR supported? */
250 #define CHIP_HAS_VDN_SNOOP_SHIM_CTL() 0
251
252 /** Does the chip support rev1 DMA packets? */
253 #define CHIP_HAS_REV1_DMA_PACKETS() 1
254
255 /** Does the chip have an IPI shim? */
256 #define CHIP_HAS_IPI() 1
257
258 #endif /* !__OPEN_SOURCE__ */
259 #endif /* __ARCH_CHIP_H__ */