1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _ASM_SN_SN0_HUBMD_H
20 #define _ASM_SN_SN0_HUBMD_H
21 #define CACHE_SLINE_SIZE 128
22 #define MAX_REGIONS 64
23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24 #define MD_PAGE_SIZE 4096
25 #define MD_PAGE_NUM_SHFT 12
26 #define MD_BASE 0x200000
27 #define MD_BASE_PERF 0x210000
28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29 #define MD_BASE_JUNK 0x220000
30 #define MD_IO_PROTECT 0x200000
31 #define MD_IO_PROT_OVRRD 0x200008
32 #define MD_HSPEC_PROTECT 0x200010
33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34 #define MD_MEMORY_CONFIG 0x200018
35 #define MD_REFRESH_CONTROL 0x200020
36 #define MD_FANDOP_CAC_STAT 0x200028
37 #define MD_MIG_DIFF_THRESH 0x200030
38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39 #define MD_MIG_VALUE_THRESH 0x200038
40 #define MD_MIG_CANDIDATE 0x200040
41 #define MD_MIG_CANDIDATE_CLR 0x200048
42 #define MD_DIR_ERROR 0x200050
43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
44 #define MD_DIR_ERROR_CLR 0x200058
45 #define MD_PROTOCOL_ERROR 0x200060
46 #define MD_PROTOCOL_ERROR_CLR 0x200068
47 #define MD_MEM_ERROR 0x200070
48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49 #define MD_MEM_ERROR_CLR 0x200078
50 #define MD_MISC_ERROR 0x200080
51 #define MD_MISC_ERROR_CLR 0x200088
52 #define MD_MEM_DIMM_INIT 0x200090
53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
54 #define MD_DIR_DIMM_INIT 0x200098
55 #define MD_MOQ_SIZE 0x2000a0
56 #define MD_MLAN_CTL 0x2000a8
57 #define MD_PERF_SEL 0x210000
58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59 #define MD_PERF_CNT0 0x210010
60 #define MD_PERF_CNT1 0x210018
61 #define MD_PERF_CNT2 0x210020
62 #define MD_PERF_CNT3 0x210028
63 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64 #define MD_PERF_CNT4 0x210030
65 #define MD_PERF_CNT5 0x210038
66 #define MD_UREG0_0 0x220000
67 #define MD_UREG0_1 0x220008
68 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69 #define MD_UREG0_2 0x220010
70 #define MD_UREG0_3 0x220018
71 #define MD_UREG0_4 0x220020
72 #define MD_UREG0_5 0x220028
73 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
74 #define MD_UREG0_6 0x220030
75 #define MD_UREG0_7 0x220038
76 #define MD_SLOTID_USTAT 0x220048
77 #define MD_LED0 0x220050
78 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
79 #define MD_LED1 0x220058
80 #define MD_UREG1_0 0x220080
81 #define MD_UREG1_1 0x220088
82 #define MD_UREG1_2 0x220090
83 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
84 #define MD_UREG1_3 0x220098
85 #define MD_UREG1_4 0x2200a0
86 #define MD_UREG1_5 0x2200a8
87 #define MD_UREG1_6 0x2200b0
88 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
89 #define MD_UREG1_7 0x2200b8
90 #define MD_UREG1_8 0x2200c0
91 #define MD_UREG1_9 0x2200c8
92 #define MD_UREG1_10 0x2200d0
93 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
94 #define MD_UREG1_11 0x2200d8
95 #define MD_UREG1_12 0x2200e0
96 #define MD_UREG1_13 0x2200e8
97 #define MD_UREG1_14 0x2200f0
98 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
99 #define MD_UREG1_15 0x2200f8
100 #define MD_MEM_BANKS 8
101 #define MD_SIZE_EMPTY 0
102 #define MD_SIZE_8MB 1
103 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
104 #define MD_SIZE_16MB 2
105 #define MD_SIZE_32MB 3
106 #define MD_SIZE_64MB 4
107 #define MD_SIZE_128MB 5
108 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
109 #define MD_SIZE_256MB 6
110 #define MD_SIZE_512MB 7
111 #define MD_SIZE_1GB 8
112 #define MD_SIZE_2GB 9
113 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
114 #define MD_SIZE_4GB 10
115 #define MD_SIZE_BYTES(size) ((size) == 0 ? 0 : 0x400000L << (size))
116 #define MD_SIZE_MBYTES(size) ((size) == 0 ? 0 : 4 << (size))
117 #define MMC_FPROM_CYC_SHFT 49
118 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
119 #define MMC_FPROM_CYC_MASK (UINT64_CAST 31 << 49)
120 #define MMC_FPROM_WR_SHFT 44
121 #define MMC_FPROM_WR_MASK (UINT64_CAST 31 << 44)
122 #define MMC_UCTLR_CYC_SHFT 39
123 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
124 #define MMC_UCTLR_CYC_MASK (UINT64_CAST 31 << 39)
125 #define MMC_UCTLR_WR_SHFT 34
126 #define MMC_UCTLR_WR_MASK (UINT64_CAST 31 << 34)
127 #define MMC_DIMM0_SEL_SHFT 32
128 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
129 #define MMC_DIMM0_SEL_MASK (UINT64_CAST 3 << 32)
130 #define MMC_IO_PROT_EN_SHFT 31
131 #define MMC_IO_PROT_EN_MASK (UINT64_CAST 1 << 31)
132 #define MMC_IO_PROT (UINT64_CAST 1 << 31)
133 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
134 #define MMC_ARB_MLSS_SHFT 30
135 #define MMC_ARB_MLSS_MASK (UINT64_CAST 1 << 30)
136 #define MMC_ARB_MLSS (UINT64_CAST 1 << 30)
137 #define MMC_IGNORE_ECC_SHFT 29
138 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
139 #define MMC_IGNORE_ECC_MASK (UINT64_CAST 1 << 29)
140 #define MMC_IGNORE_ECC (UINT64_CAST 1 << 29)
141 #define MMC_DIR_PREMIUM_SHFT 28
142 #define MMC_DIR_PREMIUM_MASK (UINT64_CAST 1 << 28)
143 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
144 #define MMC_DIR_PREMIUM (UINT64_CAST 1 << 28)
145 #define MMC_REPLY_GUAR_SHFT 24
146 #define MMC_REPLY_GUAR_MASK (UINT64_CAST 15 << 24)
147 #define MMC_BANK_SHFT(_b) ((_b) * 3)
148 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
149 #define MMC_BANK_MASK(_b) (UINT64_CAST 7 << MMC_BANK_SHFT(_b))
150 #define MMC_BANK_ALL_MASK 0xffffff
151 #define MMC_RESET_DEFAULTS (UINT64_CAST 0x0f << MMC_FPROM_CYC_SHFT |   UINT64_CAST 0x07 << MMC_FPROM_WR_SHFT |   UINT64_CAST 0x1f << MMC_UCTLR_CYC_SHFT |   UINT64_CAST 0x0f << MMC_UCTLR_WR_SHFT |   MMC_IGNORE_ECC | MMC_DIR_PREMIUM |   UINT64_CAST 0x0f << MMC_REPLY_GUAR_SHFT |   MMC_BANK_ALL_MASK)
152 #define MRC_ENABLE_SHFT 63
153 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
154 #define MRC_ENABLE_MASK (UINT64_CAST 1 << 63)
155 #define MRC_ENABLE (UINT64_CAST 1 << 63)
156 #define MRC_COUNTER_SHFT 12
157 #define MRC_COUNTER_MASK (UINT64_CAST 0xfff << 12)
158 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
159 #define MRC_CNT_THRESH_MASK 0xfff
160 #define MRC_RESET_DEFAULTS (UINT64_CAST 0x400)
161 #define MDI_SELECT_SHFT 32
162 #define MDI_SELECT_MASK (UINT64_CAST 0x0f << 32)
163 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
164 #define MDI_DIMM_MODE_MASK (UINT64_CAST 0xfff)
165 #define MMS_RP_SIZE_SHFT 8
166 #define MMS_RP_SIZE_MASK (UINT64_CAST 0x3f << 8)
167 #define MMS_RQ_SIZE_SHFT 0
168 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
169 #define MMS_RQ_SIZE_MASK (UINT64_CAST 0x1f)
170 #define MMS_RESET_DEFAULTS (0x32 << 8 | 0x12)
171 #define MFC_VALID_SHFT 63
172 #define MFC_VALID_MASK (UINT64_CAST 1 << 63)
173 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
174 #define MFC_VALID (UINT64_CAST 1 << 63)
175 #define MFC_ADDR_SHFT 6
176 #define MFC_ADDR_MASK (UINT64_CAST 0x3ffffff)
177 #define MLAN_PHI1_SHFT 27
178 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
179 #define MLAN_PHI1_MASK (UINT64_CAST 0x7f << 27)
180 #define MLAN_PHI0_SHFT 20
181 #define MLAN_PHI0_MASK (UINT64_CAST 0x7f << 27)
182 #define MLAN_PULSE_SHFT 10
183 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
184 #define MLAN_PULSE_MASK (UINT64_CAST 0x3ff << 10)
185 #define MLAN_SAMPLE_SHFT 2
186 #define MLAN_SAMPLE_MASK (UINT64_CAST 0xff << 2)
187 #define MLAN_DONE_SHFT 1
188 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
189 #define MLAN_DONE_MASK 2
190 #define MLAN_DONE (UINT64_CAST 0x02)
191 #define MLAN_RD_DATA (UINT64_CAST 0x01)
192 #define MLAN_RESET_DEFAULTS (UINT64_CAST 0x31 << MLAN_PHI1_SHFT |   UINT64_CAST 0x31 << MLAN_PHI0_SHFT)
193 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
194 #define MSU_CORECLK_TST_SHFT 7
195 #define MSU_CORECLK_TST_MASK (UINT64_CAST 1 << 7)
196 #define MSU_CORECLK_TST (UINT64_CAST 1 << 7)
197 #define MSU_CORECLK_SHFT 6
198 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
199 #define MSU_CORECLK_MASK (UINT64_CAST 1 << 6)
200 #define MSU_CORECLK (UINT64_CAST 1 << 6)
201 #define MSU_NETSYNC_SHFT 5
202 #define MSU_NETSYNC_MASK (UINT64_CAST 1 << 5)
203 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
204 #define MSU_NETSYNC (UINT64_CAST 1 << 5)
205 #define MSU_FPROMRDY_SHFT 4
206 #define MSU_FPROMRDY_MASK (UINT64_CAST 1 << 4)
207 #define MSU_FPROMRDY (UINT64_CAST 1 << 4)
208 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
209 #define MSU_I2CINTR_SHFT 3
210 #define MSU_I2CINTR_MASK (UINT64_CAST 1 << 3)
211 #define MSU_I2CINTR (UINT64_CAST 1 << 3)
212 #define MSU_SLOTID_MASK 0xff
213 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
214 #define MSU_SN0_SLOTID_SHFT 0
215 #define MSU_SN0_SLOTID_MASK (UINT64_CAST 7)
216 #define MSU_SN00_SLOTID_SHFT 7
217 #define MSU_SN00_SLOTID_MASK (UINT64_CAST 0x80)
218 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
219 #define MSU_PIMM_PSC_SHFT 4
220 #define MSU_PIMM_PSC_MASK (0xf << MSU_PIMM_PSC_SHFT)
221 #define MD_MIG_DIFF_THRES_VALID_MASK (UINT64_CAST 0x1 << 63)
222 #define MD_MIG_DIFF_THRES_VALID_SHFT 63
223 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
224 #define MD_MIG_DIFF_THRES_VALUE_MASK (UINT64_CAST 0xfffff)
225 #define MD_MIG_VALUE_THRES_VALID_MASK (UINT64_CAST 0x1 << 63)
226 #define MD_MIG_VALUE_THRES_VALID_SHFT 63
227 #define MD_MIG_VALUE_THRES_VALUE_MASK (UINT64_CAST 0xfffff)
228 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
229 #define MD_MIG_CANDIDATE_VALID_MASK (UINT64_CAST 0x1 << 63)
230 #define MD_MIG_CANDIDATE_VALID_SHFT 63
231 #define MD_MIG_CANDIDATE_TYPE_MASK (UINT64_CAST 0x1 << 30)
232 #define MD_MIG_CANDIDATE_TYPE_SHFT 30
233 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
234 #define MD_MIG_CANDIDATE_OVERRUN_MASK (UINT64_CAST 0x1 << 29)
235 #define MD_MIG_CANDIDATE_OVERRUN_SHFT 29
236 #define MD_MIG_CANDIDATE_INITIATOR_MASK (UINT64_CAST 0x7ff << 18)
237 #define MD_MIG_CANDIDATE_INITIATOR_SHFT 18
238 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
239 #define MD_MIG_CANDIDATE_NODEID_MASK (UINT64_CAST 0x1ff << 20)
240 #define MD_MIG_CANDIDATE_NODEID_SHFT 20
241 #define MD_MIG_CANDIDATE_ADDR_MASK (UINT64_CAST 0x3ffff)
242 #define MD_MIG_CANDIDATE_ADDR_SHFT 14
243 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
244 #define MD_BANK_SHFT 29
245 #define MD_BANK_MASK (UINT64_CAST 7 << 29)
246 #define MD_BANK_SIZE (UINT64_CAST 1 << MD_BANK_SHFT)
247 #define MD_BANK_OFFSET(_b) (UINT64_CAST (_b) << MD_BANK_SHFT)
248 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
249 #define MD_DIR_SHARED (UINT64_CAST 0x0)
250 #define MD_DIR_POISONED (UINT64_CAST 0x1)
251 #define MD_DIR_EXCLUSIVE (UINT64_CAST 0x2)
252 #define MD_DIR_BUSY_SHARED (UINT64_CAST 0x3)
253 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
254 #define MD_DIR_BUSY_EXCL (UINT64_CAST 0x4)
255 #define MD_DIR_WAIT (UINT64_CAST 0x5)
256 #define MD_DIR_UNOWNED (UINT64_CAST 0x7)
257 #define MD_DIR_FORCE_ECC (UINT64_CAST 1 << 63)
258 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
259 #define MD_PDIR_MASK 0xffffffffffff
260 #define MD_PDIR_ECC_SHFT 0
261 #define MD_PDIR_ECC_MASK 0x7f
262 #define MD_PDIR_PRIO_SHFT 8
263 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
264 #define MD_PDIR_PRIO_MASK (0xf << 8)
265 #define MD_PDIR_AX_SHFT 7
266 #define MD_PDIR_AX_MASK (1 << 7)
267 #define MD_PDIR_AX (1 << 7)
268 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
269 #define MD_PDIR_FINE_SHFT 12
270 #define MD_PDIR_FINE_MASK (1 << 12)
271 #define MD_PDIR_FINE (1 << 12)
272 #define MD_PDIR_OCT_SHFT 13
273 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
274 #define MD_PDIR_OCT_MASK (7 << 13)
275 #define MD_PDIR_STATE_SHFT 13
276 #define MD_PDIR_STATE_MASK (7 << 13)
277 #define MD_PDIR_ONECNT_SHFT 16
278 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
279 #define MD_PDIR_ONECNT_MASK (0x3f << 16)
280 #define MD_PDIR_PTR_SHFT 22
281 #define MD_PDIR_PTR_MASK (UINT64_CAST 0x7ff << 22)
282 #define MD_PDIR_VECMSB_SHFT 22
283 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
284 #define MD_PDIR_VECMSB_BITMASK 0x3ffffff
285 #define MD_PDIR_VECMSB_BITSHFT 27
286 #define MD_PDIR_VECMSB_MASK (UINT64_CAST MD_PDIR_VECMSB_BITMASK << 22)
287 #define MD_PDIR_CWOFF_SHFT 7
288 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
289 #define MD_PDIR_CWOFF_MASK (7 << 7)
290 #define MD_PDIR_VECLSB_SHFT 10
291 #define MD_PDIR_VECLSB_BITMASK (UINT64_CAST 0x3fffffffff)
292 #define MD_PDIR_VECLSB_BITSHFT 0
293 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
294 #define MD_PDIR_VECLSB_MASK (MD_PDIR_VECLSB_BITMASK << 10)
295 #define MD_PDIR_INIT_LO (MD_DIR_UNOWNED << MD_PDIR_STATE_SHFT |   MD_PDIR_AX)
296 #define MD_PDIR_INIT_HI 0
297 #define MD_PDIR_INIT_PROT (MD_PROT_RW << MD_PPROT_IO_SHFT |   MD_PROT_RW << MD_PPROT_SHFT)
298 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
299 #define MD_SDIR_MASK 0xffff
300 #define MD_SDIR_ECC_SHFT 0
301 #define MD_SDIR_ECC_MASK 0x1f
302 #define MD_SDIR_PRIO_SHFT 6
303 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
304 #define MD_SDIR_PRIO_MASK (1 << 6)
305 #define MD_SDIR_AX_SHFT 5
306 #define MD_SDIR_AX_MASK (1 << 5)
307 #define MD_SDIR_AX (1 << 5)
308 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
309 #define MD_SDIR_STATE_SHFT 7
310 #define MD_SDIR_STATE_MASK (7 << 7)
311 #define MD_SDIR_PTR_SHFT 10
312 #define MD_SDIR_PTR_MASK (0x3f << 10)
313 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
314 #define MD_SDIR_CWOFF_SHFT 5
315 #define MD_SDIR_CWOFF_MASK (7 << 5)
316 #define MD_SDIR_VECMSB_SHFT 11
317 #define MD_SDIR_VECMSB_BITMASK 0x1f
318 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
319 #define MD_SDIR_VECMSB_BITSHFT 7
320 #define MD_SDIR_VECMSB_MASK (MD_SDIR_VECMSB_BITMASK << 11)
321 #define MD_SDIR_VECLSB_SHFT 5
322 #define MD_SDIR_VECLSB_BITMASK 0x7ff
323 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
324 #define MD_SDIR_VECLSB_BITSHFT 0
325 #define MD_SDIR_VECLSB_MASK (MD_SDIR_VECLSB_BITMASK << 5)
326 #define MD_SDIR_INIT_LO (MD_DIR_UNOWNED << MD_SDIR_STATE_SHFT |   MD_SDIR_AX)
327 #define MD_SDIR_INIT_HI 0
328 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
329 #define MD_SDIR_INIT_PROT (MD_PROT_RW << MD_SPROT_SHFT)
330 #define MD_PROT_RW (UINT64_CAST 0x6)
331 #define MD_PROT_RO (UINT64_CAST 0x3)
332 #define MD_PROT_NO (UINT64_CAST 0x0)
333 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
334 #define MD_PROT_BAD (UINT64_CAST 0x5)
335 #define MD_PPROT_SHFT 0
336 #define MD_PPROT_MASK 7
337 #define MD_PPROT_MIGMD_SHFT 3
338 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
339 #define MD_PPROT_MIGMD_MASK (3 << 3)
340 #define MD_PPROT_REFCNT_SHFT 5
341 #define MD_PPROT_REFCNT_WIDTH 0x7ffff
342 #define MD_PPROT_REFCNT_MASK (MD_PPROT_REFCNT_WIDTH << 5)
343 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
344 #define MD_PPROT_IO_SHFT 45
345 #define MD_PPROT_IO_MASK (UINT64_CAST 7 << 45)
346 #define MD_SPROT_SHFT 0
347 #define MD_SPROT_MASK 7
348 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
349 #define MD_SPROT_MIGMD_SHFT 3
350 #define MD_SPROT_MIGMD_MASK (3 << 3)
351 #define MD_SPROT_REFCNT_SHFT 5
352 #define MD_SPROT_REFCNT_WIDTH 0x7ff
353 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
354 #define MD_SPROT_REFCNT_MASK (MD_SPROT_REFCNT_WIDTH << 5)
355 #define MD_PROT_MIGMD_IREL (UINT64_CAST 0x3 << 3)
356 #define MD_PROT_MIGMD_IABS (UINT64_CAST 0x2 << 3)
357 #define MD_PROT_MIGMD_PREL (UINT64_CAST 0x1 << 3)
358 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
359 #define MD_PROT_MIGMD_OFF (UINT64_CAST 0x0 << 3)
360 #ifndef __ASSEMBLY__
361 #define CPU_LED_ADDR(_nasid, _slice)   (private.p_sn00 ?   REMOTE_HUB_ADDR((_nasid), MD_UREG1_0 + ((_slice) << 5)) :   REMOTE_HUB_ADDR((_nasid), MD_LED0 + ((_slice) << 3)))
362 #define SET_CPU_LEDS(_nasid, _slice, _val)   (HUB_S(CPU_LED_ADDR(_nasid, _slice), (_val)))
363 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
364 #define SET_MY_LEDS(_v)   SET_CPU_LEDS(get_nasid(), get_slice(), (_v))
365 #define DIRTYPE_PREMIUM 1
366 #define DIRTYPE_STANDARD 0
367 #define MD_MEMORY_CONFIG_DIR_TYPE_GET(region) (  (REMOTE_HUB_L(region, MD_MEMORY_CONFIG) & MMC_DIR_PREMIUM_MASK) >>   MMC_DIR_PREMIUM_SHFT)
368 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
369 #define MD_MIG_DIFF_THRESH_GET(region) (   REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) &   MD_MIG_DIFF_THRES_VALUE_MASK)
370 #define MD_MIG_DIFF_THRESH_SET(region, value) (   REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH,   MD_MIG_DIFF_THRES_VALID_MASK | (value)))
371 #define MD_MIG_DIFF_THRESH_DISABLE(region) (   REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH,   REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH)   & ~MD_MIG_DIFF_THRES_VALID_MASK))
372 #define MD_MIG_DIFF_THRESH_ENABLE(region) (   REMOTE_HUB_S((region), MD_MIG_DIFF_THRESH,   REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH)   | MD_MIG_DIFF_THRES_VALID_MASK))
373 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
374 #define MD_MIG_DIFF_THRESH_IS_ENABLED(region) (   REMOTE_HUB_L((region), MD_MIG_DIFF_THRESH) &   MD_MIG_DIFF_THRES_VALID_MASK)
375 #define MD_MIG_VALUE_THRESH_GET(region) (   REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) &   MD_MIG_VALUE_THRES_VALUE_MASK)
376 #define MD_MIG_VALUE_THRESH_SET(region, value) (   REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH,   MD_MIG_VALUE_THRES_VALID_MASK | (value)))
377 #define MD_MIG_VALUE_THRESH_DISABLE(region) (   REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH,   REMOTE_HUB_L(region, MD_MIG_VALUE_THRESH)   & ~MD_MIG_VALUE_THRES_VALID_MASK))
378 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
379 #define MD_MIG_VALUE_THRESH_ENABLE(region) (   REMOTE_HUB_S((region), MD_MIG_VALUE_THRESH,   REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH)   | MD_MIG_VALUE_THRES_VALID_MASK))
380 #define MD_MIG_VALUE_THRESH_IS_ENABLED(region) (   REMOTE_HUB_L((region), MD_MIG_VALUE_THRESH) &   MD_MIG_VALUE_THRES_VALID_MASK)
381 #define MD_MIG_CANDIDATE_GET(my_region_id) (   REMOTE_HUB_L((my_region_id), MD_MIG_CANDIDATE_CLR))
382 #define MD_MIG_CANDIDATE_HWPFN(value) ((value) & MD_MIG_CANDIDATE_ADDR_MASK)
383 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
384 #define MD_MIG_CANDIDATE_NODEID(value) (   ((value) & MD_MIG_CANDIDATE_NODEID_MASK) >> MD_MIG_CANDIDATE_NODEID_SHFT)
385 #define MD_MIG_CANDIDATE_TYPE(value) (   ((value) & MD_MIG_CANDIDATE_TYPE_MASK) >> MD_MIG_CANDIDATE_TYPE_SHFT)
386 #define MD_MIG_CANDIDATE_VALID(value) (   ((value) & MD_MIG_CANDIDATE_VALID_MASK) >> MD_MIG_CANDIDATE_VALID_SHFT)
387 #define MD_PPROT_REFCNT_GET(value) (   ((value) & MD_PPROT_REFCNT_MASK) >> MD_PPROT_REFCNT_SHFT)
388 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
389 #define MD_PPROT_MIGMD_GET(value) (   ((value) & MD_PPROT_MIGMD_MASK) >> MD_PPROT_MIGMD_SHFT)
390 #define MD_SPROT_REFCNT_GET(value) (   ((value) & MD_SPROT_REFCNT_MASK) >> MD_SPROT_REFCNT_SHFT)
391 #define MD_SPROT_MIGMD_GET(value) (   ((value) & MD_SPROT_MIGMD_MASK) >> MD_SPROT_MIGMD_SHFT)
392 struct dir_error_reg {
393 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
394  u64 uce_vld: 1,
395  ae_vld: 1,
396  ce_vld: 1,
397  rsvd1: 19,
398 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
399  bad_prot: 3,
400  bad_syn: 7,
401  rsvd2: 2,
402  hspec_addr:27,
403 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
404  uce_ovr: 1,
405  ae_ovr: 1,
406  ce_ovr: 1;
407 };
408 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
409 typedef union md_dir_error {
410  u64 derr_reg;
411  struct dir_error_reg derr_fmt;
412 } md_dir_error_t;
413 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
414 struct mem_error_reg {
415  u64 uce_vld: 1,
416  ce_vld: 1,
417  rsvd1: 22,
418 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
419  bad_syn: 8,
420  address: 29,
421  rsvd2: 1,
422  uce_ovr: 1,
423 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
424  ce_ovr: 1;
425 };
426 typedef union md_mem_error {
427  u64 merr_reg;
428 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
429  struct mem_error_reg merr_fmt;
430 } md_mem_error_t;
431 struct proto_error_reg {
432  u64 valid: 1,
433 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
434  rsvd1: 2,
435  initiator:11,
436  backoff: 2,
437  msg_type: 8,
438 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
439  access: 2,
440  priority: 1,
441  dir_state: 4,
442  pointer_me:1,
443 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
444  address: 29,
445  rsvd2: 2,
446  overrun: 1;
447 };
448 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
449 typedef union md_proto_error {
450  u64 perr_reg;
451  struct proto_error_reg perr_fmt;
452 } md_proto_error_t;
453 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
454 struct md_sdir_high_fmt {
455  unsigned short sd_hi_bvec : 11,
456  sd_hi_ecc : 5;
457 };
458 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
459 typedef union md_sdir_high {
460  unsigned short sd_hi_val;
461  struct md_sdir_high_fmt sd_hi_fmt;
462 }md_sdir_high_t;
463 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
464 struct md_sdir_low_shared_fmt {
465  unsigned short sds_lo_bvec : 5,
466  sds_lo_unused: 1,
467  sds_lo_state : 3,
468 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
469  sds_lo_prio : 1,
470  sds_lo_ax : 1,
471  sds_lo_ecc : 5;
472 };
473 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
474 struct md_sdir_low_exclusive_fmt {
475  unsigned short sde_lo_ptr : 6,
476  sde_lo_state : 3,
477  sde_lo_prio : 1,
478 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
479  sde_lo_ax : 1,
480  sde_lo_ecc : 5;
481 };
482 typedef union md_sdir_low {
483 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
484  unsigned short sd_lo_val;
485  struct md_sdir_low_exclusive_fmt sde_lo_fmt;
486  struct md_sdir_low_shared_fmt sds_lo_fmt;
487 }md_sdir_low_t;
488 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
489 struct md_pdir_high_fmt {
490  u64 pd_hi_unused : 16,
491  pd_hi_bvec : 38,
492  pd_hi_unused1 : 3,
493 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
494  pd_hi_ecc : 7;
495 };
496 typedef union md_pdir_high {
497  u64 pd_hi_val;
498 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
499  struct md_pdir_high_fmt pd_hi_fmt;
500 }md_pdir_high_t;
501 struct md_pdir_low_shared_fmt {
502  u64 pds_lo_unused : 16,
503 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
504  pds_lo_bvec : 26,
505  pds_lo_cnt : 6,
506  pds_lo_state : 3,
507  pds_lo_ste : 1,
508 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
509  pds_lo_prio : 4,
510  pds_lo_ax : 1,
511  pds_lo_ecc : 7;
512 };
513 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
514 struct md_pdir_low_exclusive_fmt {
515  u64 pde_lo_unused : 31,
516  pde_lo_ptr : 11,
517  pde_lo_unused1 : 6,
518 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
519  pde_lo_state : 3,
520  pde_lo_ste : 1,
521  pde_lo_prio : 4,
522  pde_lo_ax : 1,
523 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
524  pde_lo_ecc : 7;
525 };
526 typedef union md_pdir_loent {
527  u64 pd_lo_val;
528 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
529  struct md_pdir_low_exclusive_fmt pde_lo_fmt;
530  struct md_pdir_low_shared_fmt pds_lo_fmt;
531 }md_pdir_low_t;
532 typedef union md_dir_high {
533 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
534  md_sdir_high_t md_sdir_high;
535  md_pdir_high_t md_pdir_high;
536 } md_dir_high_t;
537 typedef union md_dir_low {
538 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
539  md_sdir_low_t md_sdir_low;
540  md_pdir_low_t md_pdir_low;
541 } md_dir_low_t;
542 typedef struct bddir_entry {
543 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
544  md_dir_low_t md_dir_low;
545  md_dir_high_t md_dir_high;
546 } bddir_entry_t;
547 typedef struct dir_mem_entry {
548 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
549  u64 prcpf[MAX_REGIONS];
550  bddir_entry_t directory_words[MD_PAGE_SIZE/CACHE_SLINE_SIZE];
551 } dir_mem_entry_t;
552 typedef union md_perf_sel {
553 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
554  u64 perf_sel_reg;
555  struct {
556  u64 perf_rsvd : 60,
557  perf_en : 1,
558 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
559  perf_sel : 3;
560  } perf_sel_bits;
561 } md_perf_sel_t;
562 typedef union md_perf_cnt {
563 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
564  u64 perf_cnt;
565  struct {
566  u64 perf_rsvd : 44,
567  perf_cnt : 20;
568 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
569  } perf_cnt_bits;
570 } md_perf_cnt_t;
571 #endif
572 #define DIR_ERROR_VALID_MASK 0xe000000000000000
573 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
574 #define DIR_ERROR_VALID_SHFT 61
575 #define DIR_ERROR_VALID_UCE 0x8000000000000000
576 #define DIR_ERROR_VALID_AE 0x4000000000000000
577 #define DIR_ERROR_VALID_CE 0x2000000000000000
578 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
579 #define MEM_ERROR_VALID_MASK 0xc000000000000000
580 #define MEM_ERROR_VALID_SHFT 62
581 #define MEM_ERROR_VALID_UCE 0x8000000000000000
582 #define MEM_ERROR_VALID_CE 0x4000000000000000
583 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
584 #define PROTO_ERROR_VALID_MASK 0x8000000000000000
585 #define MISC_ERROR_VALID_MASK 0x3ff
586 #define DIR_ERR_HSPEC_MASK 0x3ffffff8
587 #define ERROR_HSPEC_MASK 0x3ffffff8
588 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
589 #define ERROR_HSPEC_SHFT 3
590 #define ERROR_ADDR_MASK 0xfffffff8
591 #define ERROR_ADDR_SHFT 3
592 #define MMCE_VALID_MASK 0x3ff
593 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
594 #define MMCE_ILL_MSG_SHFT 8
595 #define MMCE_ILL_MSG_MASK (UINT64_CAST 0x03 << MMCE_ILL_MSG_SHFT)
596 #define MMCE_ILL_REV_SHFT 6
597 #define MMCE_ILL_REV_MASK (UINT64_CAST 0x03 << MMCE_ILL_REV_SHFT)
598 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
599 #define MMCE_LONG_PACK_SHFT 4
600 #define MMCE_LONG_PACK_MASK (UINT64_CAST 0x03 << MMCE_lONG_PACK_SHFT)
601 #define MMCE_SHORT_PACK_SHFT 2
602 #define MMCE_SHORT_PACK_MASK (UINT64_CAST 0x03 << MMCE_SHORT_PACK_SHFT)
603 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
604 #define MMCE_BAD_DATA_SHFT 0
605 #define MMCE_BAD_DATA_MASK (UINT64_CAST 0x03 << MMCE_BAD_DATA_SHFT)
606 #define MD_PERF_COUNTERS 6
607 #define MD_PERF_SETS 6
608 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
609 #define MEM_DIMM_MASK 0xe0000000
610 #define MEM_DIMM_SHFT 29
611 #endif
612