1
2
3
4 #ifndef __NDS32_BITFIELD_H__
5 #define __NDS32_BITFIELD_H__
6
7
8
9 #define CPU_VER_offCFGID 0
10 #define CPU_VER_offREV 16
11 #define CPU_VER_offCPUID 24
12
13 #define CPU_VER_mskCFGID ( 0xFFFF << CPU_VER_offCFGID )
14 #define CPU_VER_mskREV ( 0xFF << CPU_VER_offREV )
15 #define CPU_VER_mskCPUID ( 0xFF << CPU_VER_offCPUID )
16
17
18
19
20 #define ICM_CFG_offISET 0
21 #define ICM_CFG_offIWAY 3
22 #define ICM_CFG_offISZ 6
23 #define ICM_CFG_offILCK 9
24 #define ICM_CFG_offILMB 10
25 #define ICM_CFG_offBSAV 13
26
27
28 #define ICM_CFG_mskISET ( 0x7 << ICM_CFG_offISET )
29 #define ICM_CFG_mskIWAY ( 0x7 << ICM_CFG_offIWAY )
30 #define ICM_CFG_mskISZ ( 0x7 << ICM_CFG_offISZ )
31 #define ICM_CFG_mskILCK ( 0x1 << ICM_CFG_offILCK )
32 #define ICM_CFG_mskILMB ( 0x7 << ICM_CFG_offILMB )
33 #define ICM_CFG_mskBSAV ( 0x3 << ICM_CFG_offBSAV )
34
35
36
37
38 #define DCM_CFG_offDSET 0
39 #define DCM_CFG_offDWAY 3
40 #define DCM_CFG_offDSZ 6
41 #define DCM_CFG_offDLCK 9
42 #define DCM_CFG_offDLMB 10
43 #define DCM_CFG_offBSAV 13
44
45
46 #define DCM_CFG_mskDSET ( 0x7 << DCM_CFG_offDSET )
47 #define DCM_CFG_mskDWAY ( 0x7 << DCM_CFG_offDWAY )
48 #define DCM_CFG_mskDSZ ( 0x7 << DCM_CFG_offDSZ )
49 #define DCM_CFG_mskDLCK ( 0x1 << DCM_CFG_offDLCK )
50 #define DCM_CFG_mskDLMB ( 0x7 << DCM_CFG_offDLMB )
51 #define DCM_CFG_mskBSAV ( 0x3 << DCM_CFG_offBSAV )
52
53
54
55
56 #define MMU_CFG_offMMPS 0
57 #define MMU_CFG_offMMPV 2
58 #define MMU_CFG_offFATB 7
59
60 #define MMU_CFG_offTBW 8
61 #define MMU_CFG_offTBS 11
62
63
64 #define MMU_CFG_offEP8MIN4 15
65 #define MMU_CFG_offfEPSZ 16
66 #define MMU_CFG_offTLBLCK 24
67 #define MMU_CFG_offHPTWK 25
68 #define MMU_CFG_offDE 26
69 #define MMU_CFG_offNTPT 27
70 #define MMU_CFG_offIVTB 28
71 #define MMU_CFG_offVLPT 29
72 #define MMU_CFG_offNTME 30
73
74
75 #define MMU_CFG_mskMMPS ( 0x3 << MMU_CFG_offMMPS )
76 #define MMU_CFG_mskMMPV ( 0x1F << MMU_CFG_offMMPV )
77 #define MMU_CFG_mskFATB ( 0x1 << MMU_CFG_offFATB )
78 #define MMU_CFG_mskTBW ( 0x7 << MMU_CFG_offTBW )
79 #define MMU_CFG_mskTBS ( 0x7 << MMU_CFG_offTBS )
80 #define MMU_CFG_mskEP8MIN4 ( 0x1 << MMU_CFG_offEP8MIN4 )
81 #define MMU_CFG_mskfEPSZ ( 0xFF << MMU_CFG_offfEPSZ )
82 #define MMU_CFG_mskTLBLCK ( 0x1 << MMU_CFG_offTLBLCK )
83 #define MMU_CFG_mskHPTWK ( 0x1 << MMU_CFG_offHPTWK )
84 #define MMU_CFG_mskDE ( 0x1 << MMU_CFG_offDE )
85 #define MMU_CFG_mskNTPT ( 0x1 << MMU_CFG_offNTPT )
86 #define MMU_CFG_mskIVTB ( 0x1 << MMU_CFG_offIVTB )
87 #define MMU_CFG_mskVLPT ( 0x1 << MMU_CFG_offVLPT )
88 #define MMU_CFG_mskNTME ( 0x1 << MMU_CFG_offNTME )
89
90
91
92
93 #define MSC_CFG_offEDM 0
94 #define MSC_CFG_offLMDMA 1
95 #define MSC_CFG_offPFM 2
96 #define MSC_CFG_offHSMP 3
97 #define MSC_CFG_offTRACE 4
98 #define MSC_CFG_offDIV 5
99 #define MSC_CFG_offMAC 6
100 #define MSC_CFG_offAUDIO 7
101 #define MSC_CFG_offL2C 9
102 #define MSC_CFG_offRDREG 10
103 #define MSC_CFG_offADR24 11
104 #define MSC_CFG_offINTLC 12
105 #define MSC_CFG_offBASEV 13
106 #define MSC_CFG_offNOD 16
107
108
109 #define MSC_CFG_mskEDM ( 0x1 << MSC_CFG_offEDM )
110 #define MSC_CFG_mskLMDMA ( 0x1 << MSC_CFG_offLMDMA )
111 #define MSC_CFG_mskPFM ( 0x1 << MSC_CFG_offPFM )
112 #define MSC_CFG_mskHSMP ( 0x1 << MSC_CFG_offHSMP )
113 #define MSC_CFG_mskTRACE ( 0x1 << MSC_CFG_offTRACE )
114 #define MSC_CFG_mskDIV ( 0x1 << MSC_CFG_offDIV )
115 #define MSC_CFG_mskMAC ( 0x1 << MSC_CFG_offMAC )
116 #define MSC_CFG_mskAUDIO ( 0x3 << MSC_CFG_offAUDIO )
117 #define MSC_CFG_mskL2C ( 0x1 << MSC_CFG_offL2C )
118 #define MSC_CFG_mskRDREG ( 0x1 << MSC_CFG_offRDREG )
119 #define MSC_CFG_mskADR24 ( 0x1 << MSC_CFG_offADR24 )
120 #define MSC_CFG_mskINTLC ( 0x1 << MSC_CFG_offINTLC )
121 #define MSC_CFG_mskBASEV ( 0x7 << MSC_CFG_offBASEV )
122 #define MSC_CFG_mskNOD ( 0x1 << MSC_CFG_offNOD )
123
124
125
126
127 #define CORE_ID_offCOREID 0
128
129
130 #define CORE_ID_mskCOREID ( 0xF << CORE_ID_offCOREID )
131
132
133
134
135 #define FUCOP_EXIST_offCP0EX 0
136 #define FUCOP_EXIST_offCP1EX 1
137 #define FUCOP_EXIST_offCP2EX 2
138 #define FUCOP_EXIST_offCP3EX 3
139 #define FUCOP_EXIST_offCP0ISFPU 31
140
141 #define FUCOP_EXIST_mskCP0EX ( 0x1 << FUCOP_EXIST_offCP0EX )
142 #define FUCOP_EXIST_mskCP1EX ( 0x1 << FUCOP_EXIST_offCP1EX )
143 #define FUCOP_EXIST_mskCP2EX ( 0x1 << FUCOP_EXIST_offCP2EX )
144 #define FUCOP_EXIST_mskCP3EX ( 0x1 << FUCOP_EXIST_offCP3EX )
145 #define FUCOP_EXIST_mskCP0ISFPU ( 0x1 << FUCOP_EXIST_offCP0ISFPU )
146
147
148
149
150
151
152 #define PSW_offGIE 0
153 #define PSW_offINTL 1
154 #define PSW_offPOM 3
155 #define PSW_offBE 5
156 #define PSW_offIT 6
157 #define PSW_offDT 7
158 #define PSW_offIME 8
159 #define PSW_offDME 9
160 #define PSW_offDEX 10
161 #define PSW_offHSS 11
162 #define PSW_offDRBE 12
163 #define PSW_offAEN 13
164 #define PSW_offWBNA 14
165 #define PSW_offIFCON 15
166 #define PSW_offCPL 16
167
168
169 #define PSW_mskGIE ( 0x1 << PSW_offGIE )
170 #define PSW_mskINTL ( 0x3 << PSW_offINTL )
171 #define PSW_mskPOM ( 0x3 << PSW_offPOM )
172 #define PSW_mskBE ( 0x1 << PSW_offBE )
173 #define PSW_mskIT ( 0x1 << PSW_offIT )
174 #define PSW_mskDT ( 0x1 << PSW_offDT )
175 #define PSW_mskIME ( 0x1 << PSW_offIME )
176 #define PSW_mskDME ( 0x1 << PSW_offDME )
177 #define PSW_mskDEX ( 0x1 << PSW_offDEX )
178 #define PSW_mskHSS ( 0x1 << PSW_offHSS )
179 #define PSW_mskDRBE ( 0x1 << PSW_offDRBE )
180 #define PSW_mskAEN ( 0x1 << PSW_offAEN )
181 #define PSW_mskWBNA ( 0x1 << PSW_offWBNA )
182 #define PSW_mskIFCON ( 0x1 << PSW_offIFCON )
183 #define PSW_mskCPL ( 0x7 << PSW_offCPL )
184
185 #define PSW_SYSTEM ( 1 << PSW_offPOM )
186 #define PSW_INTL_1 ( 1 << PSW_offINTL )
187 #define PSW_CPL_NO ( 0 << PSW_offCPL )
188 #define PSW_CPL_ANY ( 7 << PSW_offCPL )
189
190 #define PSW_clr (PSW_mskGIE|PSW_mskINTL|PSW_mskPOM|PSW_mskIT|PSW_mskDT|PSW_mskIME|PSW_mskWBNA)
191 #ifdef __NDS32_EB__
192 #ifdef CONFIG_WBNA
193 #define PSW_init (PSW_mskWBNA|(1<<PSW_offINTL)|(1<<PSW_offPOM)|PSW_mskIT|PSW_mskDT|PSW_mskBE)
194 #else
195 #define PSW_init ((1<<PSW_offINTL)|(1<<PSW_offPOM)|PSW_mskIT|PSW_mskDT|PSW_mskBE)
196 #endif
197 #else
198 #ifdef CONFIG_WBNA
199 #define PSW_init (PSW_mskWBNA|(1<<PSW_offINTL)|(1<<PSW_offPOM)|PSW_mskIT|PSW_mskDT)
200 #else
201 #define PSW_init ((1<<PSW_offINTL)|(1<<PSW_offPOM)|PSW_mskIT|PSW_mskDT)
202 #endif
203 #endif
204
205
206
207
208 #define IVB_offNIVIC 1
209 #define IVB_offIVIC_VER 11
210 #define IVB_offEVIC 13
211 #define IVB_offESZ 14
212 #define IVB_offIVBASE 16
213
214 #define IVB_mskNIVIC ( 0x7 << IVB_offNIVIC )
215 #define IVB_mskIVIC_VER ( 0x3 << IVB_offIVIC_VER )
216 #define IVB_mskEVIC ( 0x1 << IVB_offEVIC )
217 #define IVB_mskESZ ( 0x3 << IVB_offESZ )
218 #define IVB_mskIVBASE ( 0xFFFF << IVB_offIVBASE )
219
220 #define IVB_valESZ4 0
221 #define IVB_valESZ16 1
222 #define IVB_valESZ64 2
223 #define IVB_valESZ256 3
224
225
226
227
228
229
230
231
232
233
234
235 #define ITYPE_offETYPE 0
236 #define ITYPE_offINST 4
237
238 #define ITYPE_offVECTOR 5
239 #define ITYPE_offSWID 16
240
241
242 #define ITYPE_mskETYPE ( 0xF << ITYPE_offETYPE )
243 #define ITYPE_mskINST ( 0x1 << ITYPE_offINST )
244 #define ITYPE_mskVECTOR ( 0x7F << ITYPE_offVECTOR )
245 #define ITYPE_mskSWID ( 0x7FFF << ITYPE_offSWID )
246
247
248 #define ITYPE_offSTYPE 16
249 #define ITYPE_offCPID 20
250
251 #define ITYPE_mskSTYPE ( 0xF << ITYPE_offSTYPE )
252 #define ITYPE_mskCPID ( 0x3 << ITYPE_offCPID )
253
254
255 #define FPU_DISABLE_EXCEPTION (0x1 << ITYPE_offSTYPE)
256 #define FPU_EXCEPTION (0x2 << ITYPE_offSTYPE)
257 #define FPU_CPID 0
258
259 #define NDS32_VECTOR_mskNONEXCEPTION 0x78
260 #define NDS32_VECTOR_offEXCEPTION 8
261 #define NDS32_VECTOR_offINTERRUPT 9
262
263
264 #define ENTRY_RESET_NMI 0
265 #define ENTRY_TLB_FILL 1
266 #define ENTRY_PTE_NOT_PRESENT 2
267 #define ENTRY_TLB_MISC 3
268 #define ENTRY_TLB_VLPT_MISS 4
269 #define ENTRY_MACHINE_ERROR 5
270 #define ENTRY_DEBUG_RELATED 6
271 #define ENTRY_GENERAL_EXCPETION 7
272 #define ENTRY_SYSCALL 8
273
274
275 #define ETYPE_NON_LEAF_PTE_NOT_PRESENT 0
276 #define ETYPE_LEAF_PTE_NOT_PRESENT 1
277
278
279 #define ETYPE_ALIGNMENT_CHECK 0
280 #define ETYPE_RESERVED_INSTRUCTION 1
281 #define ETYPE_TRAP 2
282 #define ETYPE_ARITHMETIC 3
283 #define ETYPE_PRECISE_BUS_ERROR 4
284 #define ETYPE_IMPRECISE_BUS_ERROR 5
285 #define ETYPE_COPROCESSOR 6
286 #define ETYPE_RESERVED_VALUE 7
287 #define ETYPE_NONEXISTENT_MEM_ADDRESS 8
288 #define ETYPE_MPZIU_CONTROL 9
289 #define ETYPE_NEXT_PRECISE_STACK_OFL 10
290
291
292 #define SWID_RAISE_INTERRUPT_LEVEL 0x1a
293
294
295
296
297
298
299
300 #define MERR_offBUSERR 31
301
302 #define MERR_mskBUSERR ( 0x1 << MERR_offBUSERR )
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322 #define INT_MASK_offH0IM 0
323 #define INT_MASK_offH1IM 1
324 #define INT_MASK_offH2IM 2
325 #define INT_MASK_offH3IM 3
326 #define INT_MASK_offH4IM 4
327 #define INT_MASK_offH5IM 5
328
329 #define INT_MASK_offSIM 16
330
331 #define INT_MASK_offIDIVZE 30
332 #define INT_MASK_offDSSIM 31
333
334 #define INT_MASK_mskH0IM ( 0x1 << INT_MASK_offH0IM )
335 #define INT_MASK_mskH1IM ( 0x1 << INT_MASK_offH1IM )
336 #define INT_MASK_mskH2IM ( 0x1 << INT_MASK_offH2IM )
337 #define INT_MASK_mskH3IM ( 0x1 << INT_MASK_offH3IM )
338 #define INT_MASK_mskH4IM ( 0x1 << INT_MASK_offH4IM )
339 #define INT_MASK_mskH5IM ( 0x1 << INT_MASK_offH5IM )
340 #define INT_MASK_mskSIM ( 0x1 << INT_MASK_offSIM )
341 #define INT_MASK_mskIDIVZE ( 0x1 << INT_MASK_offIDIVZE )
342 #define INT_MASK_mskDSSIM ( 0x1 << INT_MASK_offDSSIM )
343
344 #define INT_MASK_INITAIAL_VAL (INT_MASK_mskDSSIM|INT_MASK_mskIDIVZE)
345
346
347
348
349 #define INT_PEND_offH0I 0
350 #define INT_PEND_offH1I 1
351 #define INT_PEND_offH2I 2
352 #define INT_PEND_offH3I 3
353 #define INT_PEND_offH4I 4
354 #define INT_PEND_offH5I 5
355
356 #define INT_PEND_offCIPL 0
357
358
359 #define INT_PEND_offSWI 16
360
361
362 #define INT_PEND_mskH0I ( 0x1 << INT_PEND_offH0I )
363 #define INT_PEND_mskH1I ( 0x1 << INT_PEND_offH1I )
364 #define INT_PEND_mskH2I ( 0x1 << INT_PEND_offH2I )
365 #define INT_PEND_mskH3I ( 0x1 << INT_PEND_offH3I )
366 #define INT_PEND_mskH4I ( 0x1 << INT_PEND_offH4I )
367 #define INT_PEND_mskH5I ( 0x1 << INT_PEND_offH5I )
368 #define INT_PEND_mskCIPL ( 0x1 << INT_PEND_offCIPL )
369 #define INT_PEND_mskSWI ( 0x1 << INT_PEND_offSWI )
370
371
372
373
374 #define MMU_CTL_offD 0
375 #define MMU_CTL_offNTC0 1
376 #define MMU_CTL_offNTC1 3
377 #define MMU_CTL_offNTC2 5
378 #define MMU_CTL_offNTC3 7
379 #define MMU_CTL_offTBALCK 9
380 #define MMU_CTL_offMPZIU 10
381 #define MMU_CTL_offNTM0 11
382 #define MMU_CTL_offNTM1 13
383 #define MMU_CTL_offNTM2 15
384 #define MMU_CTL_offNTM3 17
385 #define MMU_CTL_offUNA 23
386
387
388 #define MMU_CTL_mskD ( 0x1 << MMU_CTL_offD )
389 #define MMU_CTL_mskNTC0 ( 0x3 << MMU_CTL_offNTC0 )
390 #define MMU_CTL_mskNTC1 ( 0x3 << MMU_CTL_offNTC1 )
391 #define MMU_CTL_mskNTC2 ( 0x3 << MMU_CTL_offNTC2 )
392 #define MMU_CTL_mskNTC3 ( 0x3 << MMU_CTL_offNTC3 )
393 #define MMU_CTL_mskTBALCK ( 0x1 << MMU_CTL_offTBALCK )
394 #define MMU_CTL_mskMPZIU ( 0x1 << MMU_CTL_offMPZIU )
395 #define MMU_CTL_mskNTM0 ( 0x3 << MMU_CTL_offNTM0 )
396 #define MMU_CTL_mskNTM1 ( 0x3 << MMU_CTL_offNTM1 )
397 #define MMU_CTL_mskNTM2 ( 0x3 << MMU_CTL_offNTM2 )
398 #define MMU_CTL_mskNTM3 ( 0x3 << MMU_CTL_offNTM3 )
399
400 #define MMU_CTL_D4KB 0
401 #define MMU_CTL_D8KB 1
402 #define MMU_CTL_UNA ( 0x1 << MMU_CTL_offUNA )
403
404 #define MMU_CTL_CACHEABLE_NON 0
405 #define MMU_CTL_CACHEABLE_WB 2
406 #define MMU_CTL_CACHEABLE_WT 3
407
408
409
410
411 #define L1_PPTB_offNV 0
412
413 #define L1_PPTB_offBASE 12
414
415 #define L1_PPTB_mskNV ( 0x1 << L1_PPTB_offNV )
416 #define L1_PPTB_mskBASE ( 0xFFFFF << L1_PPTB_offBASE )
417
418
419
420
421
422 #define TLB_VPN_offVPN 12
423
424 #define TLB_VPN_mskVPN ( 0xFFFFF << TLB_VPN_offVPN )
425
426
427
428
429 #define TLB_DATA_offV 0
430 #define TLB_DATA_offM 1
431 #define TLB_DATA_offD 4
432 #define TLB_DATA_offX 5
433 #define TLB_DATA_offA 6
434 #define TLB_DATA_offG 7
435 #define TLB_DATA_offC 8
436
437 #define TLB_DATA_offPPN 12
438
439 #define TLB_DATA_mskV ( 0x1 << TLB_DATA_offV )
440 #define TLB_DATA_mskM ( 0x7 << TLB_DATA_offM )
441 #define TLB_DATA_mskD ( 0x1 << TLB_DATA_offD )
442 #define TLB_DATA_mskX ( 0x1 << TLB_DATA_offX )
443 #define TLB_DATA_mskA ( 0x1 << TLB_DATA_offA )
444 #define TLB_DATA_mskG ( 0x1 << TLB_DATA_offG )
445 #define TLB_DATA_mskC ( 0x7 << TLB_DATA_offC )
446 #define TLB_DATA_mskPPN ( 0xFFFFF << TLB_DATA_offPPN )
447
448 #ifdef CONFIG_CPU_DCACHE_WRITETHROUGH
449 #define TLB_DATA_kernel_text_attr (TLB_DATA_mskV|TLB_DATA_mskM|TLB_DATA_mskD|TLB_DATA_mskX|TLB_DATA_mskG|TLB_DATA_mskC)
450 #else
451 #define TLB_DATA_kernel_text_attr (TLB_DATA_mskV|TLB_DATA_mskM|TLB_DATA_mskD|TLB_DATA_mskX|TLB_DATA_mskG|(0x6 << TLB_DATA_offC))
452 #endif
453
454
455
456
457 #define TLB_MISC_offACC_PSZ 0
458 #define TLB_MISC_offCID 4
459
460
461 #define TLB_MISC_mskACC_PSZ ( 0xF << TLB_MISC_offACC_PSZ )
462 #define TLB_MISC_mskCID ( 0x1FF << TLB_MISC_offCID )
463
464
465
466
467 #define VLPT_IDX_offZERO 0
468 #define VLPT_IDX_offEVPN 2
469 #define VLPT_IDX_offVLPTB 22
470
471 #define VLPT_IDX_mskZERO ( 0x3 << VLPT_IDX_offZERO )
472 #define VLPT_IDX_mskEVPN ( 0xFFFFF << VLPT_IDX_offEVPN )
473 #define VLPT_IDX_mskVLPTB ( 0x3FF << VLPT_IDX_offVLPTB )
474
475
476
477
478 #define ILMB_offIEN 0
479 #define ILMB_offILMSZ 1
480
481 #define ILMB_offIBPA 20
482
483 #define ILMB_mskIEN ( 0x1 << ILMB_offIEN )
484 #define ILMB_mskILMSZ ( 0xF << ILMB_offILMSZ )
485 #define ILMB_mskIBPA ( 0xFFF << ILMB_offIBPA )
486
487
488
489
490 #define DLMB_offDEN 0
491 #define DLMB_offDLMSZ 1
492 #define DLMB_offDBM 5
493 #define DLMB_offDBB 6
494
495 #define DLMB_offDBPA 20
496
497 #define DLMB_mskDEN ( 0x1 << DLMB_offDEN )
498 #define DLMB_mskDLMSZ ( 0xF << DLMB_offDLMSZ )
499 #define DLMB_mskDBM ( 0x1 << DLMB_offDBM )
500 #define DLMB_mskDBB ( 0x1 << DLMB_offDBB )
501 #define DLMB_mskDBPA ( 0xFFF << DLMB_offDBPA )
502
503
504
505
506 #define CACHE_CTL_offIC_EN 0
507 #define CACHE_CTL_offDC_EN 1
508 #define CACHE_CTL_offICALCK 2
509 #define CACHE_CTL_offDCALCK 3
510 #define CACHE_CTL_offDCCWF 4
511 #define CACHE_CTL_offDCPMW 5
512
513
514 #define CACHE_CTL_mskIC_EN ( 0x1 << CACHE_CTL_offIC_EN )
515 #define CACHE_CTL_mskDC_EN ( 0x1 << CACHE_CTL_offDC_EN )
516 #define CACHE_CTL_mskICALCK ( 0x1 << CACHE_CTL_offICALCK )
517 #define CACHE_CTL_mskDCALCK ( 0x1 << CACHE_CTL_offDCALCK )
518 #define CACHE_CTL_mskDCCWF ( 0x1 << CACHE_CTL_offDCCWF )
519 #define CACHE_CTL_mskDCPMW ( 0x1 << CACHE_CTL_offDCPMW )
520
521
522
523
524 #define HSMP_SADDR_offEN 0
525
526
527 #define HSMP_SADDR_offRANGE 1
528 #define HSMP_SADDR_offSADDR 20
529
530 #define HSMP_SADDR_mskEN ( 0x1 << HSMP_SADDR_offEN )
531 #define HSMP_SADDR_mskRANGE ( 0xFFF << HSMP_SADDR_offRANGE )
532 #define HSMP_SADDR_mskSADDR ( 0xFFF << HSMP_SADDR_offSADDR )
533
534
535
536
537
538 #define HSMP_EADDR_offEADDR 20
539
540 #define HSMP_EADDR_mskEADDR ( 0xFFF << HSMP_EADDR_offEADDR )
541
542
543
544
545 #define BPC_offWP 0
546 #define BPC_offEL 1
547 #define BPC_offS 2
548 #define BPC_offP 3
549 #define BPC_offC 4
550 #define BPC_offBE0 5
551 #define BPC_offBE1 6
552 #define BPC_offBE2 7
553 #define BPC_offBE3 8
554 #define BPC_offT 9
555
556 #define BPC_mskWP ( 0x1 << BPC_offWP )
557 #define BPC_mskEL ( 0x1 << BPC_offEL )
558 #define BPC_mskS ( 0x1 << BPC_offS )
559 #define BPC_mskP ( 0x1 << BPC_offP )
560 #define BPC_mskC ( 0x1 << BPC_offC )
561 #define BPC_mskBE0 ( 0x1 << BPC_offBE0 )
562 #define BPC_mskBE1 ( 0x1 << BPC_offBE1 )
563 #define BPC_mskBE2 ( 0x1 << BPC_offBE2 )
564 #define BPC_mskBE3 ( 0x1 << BPC_offBE3 )
565 #define BPC_mskT ( 0x1 << BPC_offT )
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589 #define BPCID_offCID 0
590
591
592 #define BPCID_mskCID ( 0x1FF << BPCID_offCID )
593
594
595
596
597 #define EDM_CFG_offBC 0
598 #define EDM_CFG_offDIMU 3
599
600 #define EDM_CFG_offVER 16
601
602 #define EDM_CFG_mskBC ( 0x7 << EDM_CFG_offBC )
603 #define EDM_CFG_mskDIMU ( 0x1 << EDM_CFG_offDIMU )
604 #define EDM_CFG_mskVER ( 0xFFFF << EDM_CFG_offVER )
605
606
607
608
609 #define EDMSW_offWV 0
610 #define EDMSW_offRV 1
611 #define EDMSW_offDE 2
612
613
614 #define EDMSW_mskWV ( 0x1 << EDMSW_offWV )
615 #define EDMSW_mskRV ( 0x1 << EDMSW_offRV )
616 #define EDMSW_mskDE ( 0x1 << EDMSW_offDE )
617
618
619
620
621
622 #define EDM_CTL_offV3_EDM_MODE 6
623 #define EDM_CTL_offDEH_SEL 31
624
625 #define EDM_CTL_mskV3_EDM_MODE ( 0x1 << EDM_CTL_offV3_EDM_MODE )
626 #define EDM_CTL_mskDEH_SEL ( 0x1 << EDM_CTL_offDEH_SEL )
627
628
629
630
631
632
633
634
635
636
637
638 #define BPMTC_offBPMTC 0
639
640
641 #define BPMTC_mskBPMTC ( 0xFFFF << BPMTC_offBPMTC )
642
643
644
645
646
647 #define DIMBR_offDIMB 12
648 #define DIMBR_mskDIMB ( 0xFFFFF << DIMBR_offDIMB )
649
650
651
652
653
654 #define TECR_offBP 0
655 #define TECR_offNMI 8
656 #define TECR_offHWINT 9
657 #define TECR_offEVIC 15
658 #define TECR_offSYS 16
659 #define TECR_offDBG 17
660 #define TECR_offMRE 18
661 #define TECR_offE 19
662
663 #define TECR_offL 31
664
665 #define TECR_mskBP ( 0xFF << TECR_offBP )
666 #define TECR_mskNMI ( 0x1 << TECR_offBNMI )
667 #define TECR_mskHWINT ( 0x3F << TECR_offBHWINT )
668 #define TECR_mskEVIC ( 0x1 << TECR_offBEVIC )
669 #define TECR_mskSYS ( 0x1 << TECR_offBSYS )
670 #define TECR_mskDBG ( 0x1 << TECR_offBDBG )
671 #define TECR_mskMRE ( 0x1 << TECR_offBMRE )
672 #define TECR_mskE ( 0x1 << TECR_offE )
673 #define TECR_mskL ( 0x1 << TECR_offL )
674
675
676
677
678
679
680
681
682
683
684 #define PFM_CTL_offEN0 0
685 #define PFM_CTL_offEN1 1
686 #define PFM_CTL_offEN2 2
687 #define PFM_CTL_offIE0 3
688 #define PFM_CTL_offIE1 4
689 #define PFM_CTL_offIE2 5
690 #define PFM_CTL_offOVF0 6
691 #define PFM_CTL_offOVF1 7
692 #define PFM_CTL_offOVF2 8
693 #define PFM_CTL_offKS0 9
694 #define PFM_CTL_offKS1 10
695 #define PFM_CTL_offKS2 11
696 #define PFM_CTL_offKU0 12
697 #define PFM_CTL_offKU1 13
698 #define PFM_CTL_offKU2 14
699 #define PFM_CTL_offSEL0 15
700 #define PFM_CTL_offSEL1 16
701 #define PFM_CTL_offSEL2 22
702
703
704 #define PFM_CTL_mskEN0 ( 0x01 << PFM_CTL_offEN0 )
705 #define PFM_CTL_mskEN1 ( 0x01 << PFM_CTL_offEN1 )
706 #define PFM_CTL_mskEN2 ( 0x01 << PFM_CTL_offEN2 )
707 #define PFM_CTL_mskIE0 ( 0x01 << PFM_CTL_offIE0 )
708 #define PFM_CTL_mskIE1 ( 0x01 << PFM_CTL_offIE1 )
709 #define PFM_CTL_mskIE2 ( 0x01 << PFM_CTL_offIE2 )
710 #define PFM_CTL_mskOVF0 ( 0x01 << PFM_CTL_offOVF0 )
711 #define PFM_CTL_mskOVF1 ( 0x01 << PFM_CTL_offOVF1 )
712 #define PFM_CTL_mskOVF2 ( 0x01 << PFM_CTL_offOVF2 )
713 #define PFM_CTL_mskKS0 ( 0x01 << PFM_CTL_offKS0 )
714 #define PFM_CTL_mskKS1 ( 0x01 << PFM_CTL_offKS1 )
715 #define PFM_CTL_mskKS2 ( 0x01 << PFM_CTL_offKS2 )
716 #define PFM_CTL_mskKU0 ( 0x01 << PFM_CTL_offKU0 )
717 #define PFM_CTL_mskKU1 ( 0x01 << PFM_CTL_offKU1 )
718 #define PFM_CTL_mskKU2 ( 0x01 << PFM_CTL_offKU2 )
719 #define PFM_CTL_mskSEL0 ( 0x01 << PFM_CTL_offSEL0 )
720 #define PFM_CTL_mskSEL1 ( 0x3F << PFM_CTL_offSEL1 )
721 #define PFM_CTL_mskSEL2 ( 0x3F << PFM_CTL_offSEL2 )
722
723
724
725
726 #define SDZ_CTL_offICDZ 0
727 #define SDZ_CTL_offDCDZ 3
728 #define SDZ_CTL_offMTBDZ 6
729 #define SDZ_CTL_offBTBDZ 9
730
731 #define SDZ_CTL_mskICDZ ( 0x07 << SDZ_CTL_offICDZ )
732 #define SDZ_CTL_mskDCDZ ( 0x07 << SDZ_CTL_offDCDZ )
733 #define SDZ_CTL_mskMTBDZ ( 0x07 << SDZ_CTL_offMTBDZ )
734 #define SDZ_CTL_mskBTBDZ ( 0x07 << SDZ_CTL_offBTBDZ )
735
736
737
738
739 #define N13MISC_CTL_offBTB 0
740 #define N13MISC_CTL_offRTP 1
741 #define N13MISC_CTL_offPTEPF 2
742 #define N13MISC_CTL_offSP_SHADOW_EN 4
743 #define MISC_CTL_offHWPRE 11
744
745
746 #define N13MISC_CTL_makBTB ( 0x1 << N13MISC_CTL_offBTB )
747 #define N13MISC_CTL_makRTP ( 0x1 << N13MISC_CTL_offRTP )
748 #define N13MISC_CTL_makPTEPF ( 0x1 << N13MISC_CTL_offPTEPF )
749 #define N13MISC_CTL_makSP_SHADOW_EN ( 0x1 << N13MISC_CTL_offSP_SHADOW_EN )
750 #define MISC_CTL_makHWPRE_EN ( 0x1 << MISC_CTL_offHWPRE )
751
752 #ifdef CONFIG_HW_PRE
753 #define MISC_init (N13MISC_CTL_makBTB|N13MISC_CTL_makRTP|N13MISC_CTL_makSP_SHADOW_EN|MISC_CTL_makHWPRE_EN)
754 #else
755 #define MISC_init (N13MISC_CTL_makBTB|N13MISC_CTL_makRTP|N13MISC_CTL_makSP_SHADOW_EN)
756 #endif
757
758
759
760
761 #define PRUSR_ACC_CTL_offDMA_EN 0
762 #define PRUSR_ACC_CTL_offPFM_EN 1
763
764 #define PRUSR_ACC_CTL_mskDMA_EN ( 0x1 << PRUSR_ACC_CTL_offDMA_EN )
765 #define PRUSR_ACC_CTL_mskPFM_EN ( 0x1 << PRUSR_ACC_CTL_offPFM_EN )
766
767
768
769
770 #define DMA_CFG_offNCHN 0
771 #define DMA_CFG_offUNEA 2
772 #define DMA_CFG_off2DET 3
773
774 #define DMA_CFG_offVER 16
775
776 #define DMA_CFG_mskNCHN ( 0x3 << DMA_CFG_offNCHN )
777 #define DMA_CFG_mskUNEA ( 0x1 << DMA_CFG_offUNEA )
778 #define DMA_CFG_msk2DET ( 0x1 << DMA_CFG_off2DET )
779 #define DMA_CFG_mskVER ( 0xFFFF << DMA_CFG_offVER )
780
781
782
783
784 #define DMA_GCSW_offC0STAT 0
785 #define DMA_GCSW_offC1STAT 3
786
787 #define DMA_GCSW_offC0INT 12
788 #define DMA_GCSW_offC1INT 13
789
790 #define DMA_GCSW_offEN 31
791
792 #define DMA_GCSW_mskC0STAT ( 0x7 << DMA_GCSW_offC0STAT )
793 #define DMA_GCSW_mskC1STAT ( 0x7 << DMA_GCSW_offC1STAT )
794 #define DMA_GCSW_mskC0INT ( 0x1 << DMA_GCSW_offC0INT )
795 #define DMA_GCSW_mskC1INT ( 0x1 << DMA_GCSW_offC1INT )
796 #define DMA_GCSW_mskEN ( 0x1 << DMA_GCSW_offEN )
797
798
799
800
801 #define DMA_CHNSEL_offCHAN 0
802
803
804 #define DMA_CHNSEL_mskCHAN ( 0x3 << DMA_CHNSEL_offCHAN )
805
806
807
808
809 #define DMA_ACT_offACMD 0
810
811 #define DMA_ACT_mskACMD ( 0x3 << DMA_ACT_offACMD )
812
813
814
815
816 #define DMA_SETUP_offLM 0
817 #define DMA_SETUP_offTDIR 1
818 #define DMA_SETUP_offTES 2
819 #define DMA_SETUP_offESTR 4
820 #define DMA_SETUP_offCIE 16
821 #define DMA_SETUP_offSIE 17
822 #define DMA_SETUP_offEIE 18
823 #define DMA_SETUP_offUE 19
824 #define DMA_SETUP_off2DE 20
825 #define DMA_SETUP_offCOA 21
826
827
828 #define DMA_SETUP_mskLM ( 0x1 << DMA_SETUP_offLM )
829 #define DMA_SETUP_mskTDIR ( 0x1 << DMA_SETUP_offTDIR )
830 #define DMA_SETUP_mskTES ( 0x3 << DMA_SETUP_offTES )
831 #define DMA_SETUP_mskESTR ( 0xFFF << DMA_SETUP_offESTR )
832 #define DMA_SETUP_mskCIE ( 0x1 << DMA_SETUP_offCIE )
833 #define DMA_SETUP_mskSIE ( 0x1 << DMA_SETUP_offSIE )
834 #define DMA_SETUP_mskEIE ( 0x1 << DMA_SETUP_offEIE )
835 #define DMA_SETUP_mskUE ( 0x1 << DMA_SETUP_offUE )
836 #define DMA_SETUP_msk2DE ( 0x1 << DMA_SETUP_off2DE )
837 #define DMA_SETUP_mskCOA ( 0x1 << DMA_SETUP_offCOA )
838
839
840
841
842 #define DMA_ISADDR_offISADDR 0
843
844 #define DMA_ISADDR_mskISADDR ( 0xFFFFF << DMA_ISADDR_offISADDR )
845
846
847
848
849
850
851
852
853
854 #define DMA_TCNT_offTCNT 0
855
856 #define DMA_TCNT_mskTCNT ( 0x3FFFF << DMA_TCNT_offTCNT )
857
858
859
860
861 #define DMA_STATUS_offSTAT 0
862 #define DMA_STATUS_offSTUNA 3
863 #define DMA_STATUS_offDERR 4
864 #define DMA_STATUS_offEUNA 5
865 #define DMA_STATUS_offIUNA 6
866 #define DMA_STATUS_offIOOR 7
867 #define DMA_STATUS_offEBUS 8
868 #define DMA_STATUS_offESUP 9
869
870
871 #define DMA_STATUS_mskSTAT ( 0x7 << DMA_STATUS_offSTAT )
872 #define DMA_STATUS_mskSTUNA ( 0x1 << DMDMA_STATUS_offSTUNA )
873 #define DMA_STATUS_mskDERR ( 0x1 << DMDMA_STATUS_offDERR )
874 #define DMA_STATUS_mskEUNA ( 0x1 << DMDMA_STATUS_offEUNA )
875 #define DMA_STATUS_mskIUNA ( 0x1 << DMDMA_STATUS_offIUNA )
876 #define DMA_STATUS_mskIOOR ( 0x1 << DMDMA_STATUS_offIOOR )
877 #define DMA_STATUS_mskEBUS ( 0x1 << DMDMA_STATUS_offEBUS )
878 #define DMA_STATUS_mskESUP ( 0x1 << DMDMA_STATUS_offESUP )
879
880
881
882
883 #define DMA_2DSET_offWECNT 0
884 #define DMA_2DSET_offHTSTR 16
885
886 #define DMA_2DSET_mskHTSTR ( 0xFFFF << DMA_2DSET_offHTSTR )
887 #define DMA_2DSET_mskWECNT ( 0xFFFF << DMA_2DSET_offWECNT )
888
889
890
891
892 #define DMA_2DSCTL_offSTWECNT 0
893
894
895 #define DMA_2DSCTL_mskSTWECNT ( 0xFFFF << DMA_2DSCTL_offSTWECNT )
896
897
898
899
900 #define FPCSR_offRM 0
901 #define FPCSR_offIVO 2
902 #define FPCSR_offDBZ 3
903 #define FPCSR_offOVF 4
904 #define FPCSR_offUDF 5
905 #define FPCSR_offIEX 6
906 #define FPCSR_offIVOE 7
907 #define FPCSR_offDBZE 8
908 #define FPCSR_offOVFE 9
909 #define FPCSR_offUDFE 10
910 #define FPCSR_offIEXE 11
911 #define FPCSR_offDNZ 12
912 #define FPCSR_offIVOT 13
913 #define FPCSR_offDBZT 14
914 #define FPCSR_offOVFT 15
915 #define FPCSR_offUDFT 16
916 #define FPCSR_offIEXT 17
917 #define FPCSR_offDNIT 18
918 #define FPCSR_offRIT 19
919
920 #define FPCSR_mskRM ( 0x3 << FPCSR_offRM )
921 #define FPCSR_mskIVO ( 0x1 << FPCSR_offIVO )
922 #define FPCSR_mskDBZ ( 0x1 << FPCSR_offDBZ )
923 #define FPCSR_mskOVF ( 0x1 << FPCSR_offOVF )
924 #define FPCSR_mskUDF ( 0x1 << FPCSR_offUDF )
925 #define FPCSR_mskIEX ( 0x1 << FPCSR_offIEX )
926 #define FPCSR_mskIVOE ( 0x1 << FPCSR_offIVOE )
927 #define FPCSR_mskDBZE ( 0x1 << FPCSR_offDBZE )
928 #define FPCSR_mskOVFE ( 0x1 << FPCSR_offOVFE )
929 #define FPCSR_mskUDFE ( 0x1 << FPCSR_offUDFE )
930 #define FPCSR_mskIEXE ( 0x1 << FPCSR_offIEXE )
931 #define FPCSR_mskDNZ ( 0x1 << FPCSR_offDNZ )
932 #define FPCSR_mskIVOT ( 0x1 << FPCSR_offIVOT )
933 #define FPCSR_mskDBZT ( 0x1 << FPCSR_offDBZT )
934 #define FPCSR_mskOVFT ( 0x1 << FPCSR_offOVFT )
935 #define FPCSR_mskUDFT ( 0x1 << FPCSR_offUDFT )
936 #define FPCSR_mskIEXT ( 0x1 << FPCSR_offIEXT )
937 #define FPCSR_mskDNIT ( 0x1 << FPCSR_offDNIT )
938 #define FPCSR_mskRIT ( 0x1 << FPCSR_offRIT )
939 #define FPCSR_mskALL (FPCSR_mskIVO | FPCSR_mskDBZ | FPCSR_mskOVF | FPCSR_mskUDF | FPCSR_mskIEX)
940 #define FPCSR_mskALLE_NO_UDF_IEXE (FPCSR_mskIVOE | FPCSR_mskDBZE | FPCSR_mskOVFE)
941 #define FPCSR_mskALLE (FPCSR_mskIVOE | FPCSR_mskDBZE | FPCSR_mskOVFE | FPCSR_mskUDFE | FPCSR_mskIEXE)
942 #define FPCSR_mskALLT (FPCSR_mskIVOT | FPCSR_mskDBZT | FPCSR_mskOVFT | FPCSR_mskUDFT | FPCSR_mskIEXT |FPCSR_mskDNIT | FPCSR_mskRIT)
943
944
945
946
947 #define FPCFG_offSP 0
948 #define FPCFG_offDP 1
949 #define FPCFG_offFREG 2
950 #define FPCFG_offFMA 4
951 #define FPCFG_offIMVER 22
952 #define FPCFG_offAVER 27
953
954 #define FPCFG_mskSP ( 0x1 << FPCFG_offSP )
955 #define FPCFG_mskDP ( 0x1 << FPCFG_offDP )
956 #define FPCFG_mskFREG ( 0x3 << FPCFG_offFREG )
957 #define FPCFG_mskFMA ( 0x1 << FPCFG_offFMA )
958 #define FPCFG_mskIMVER ( 0x1F << FPCFG_offIMVER )
959 #define FPCFG_mskAVER ( 0x1F << FPCFG_offAVER )
960
961
962 #define SP8_DP4_reg 0
963
964 #define SP16_DP8_reg 1
965
966 #define SP32_DP16_reg 2
967
968 #define SP32_DP32_reg 3
969
970
971
972
973 #define FUCOP_CTL_offCP0EN 0
974 #define FUCOP_CTL_offCP1EN 1
975 #define FUCOP_CTL_offCP2EN 2
976 #define FUCOP_CTL_offCP3EN 3
977 #define FUCOP_CTL_offAUEN 31
978
979 #define FUCOP_CTL_mskCP0EN ( 0x1 << FUCOP_CTL_offCP0EN )
980 #define FUCOP_CTL_mskCP1EN ( 0x1 << FUCOP_CTL_offCP1EN )
981 #define FUCOP_CTL_mskCP2EN ( 0x1 << FUCOP_CTL_offCP2EN )
982 #define FUCOP_CTL_mskCP3EN ( 0x1 << FUCOP_CTL_offCP3EN )
983 #define FUCOP_CTL_mskAUEN ( 0x1 << FUCOP_CTL_offAUEN )
984
985 #endif