source: rtems/cpukit/score/cpu/mips/rtems/mips/idtcpu.h @ bf7cc57

4.104.115
Last change on this file since bf7cc57 was bf7cc57, checked in by Chris Johns <chrisj@…>, on 06/17/09 at 21:15:16

2009-06-18 Chris Johns <chrisj@…>

  • score/cpu/mips/rtems/mips/idtcpu.h: Missed another WAIT define. Removed.
  • Property mode set to 100644
File size: 24.0 KB
Line 
1/*
2
3Based upon IDT provided code with the following release:
4
5This source code has been made available to you by IDT on an AS-IS
6basis. Anyone receiving this source is licensed under IDT copyrights
7to use it in any way he or she deems fit, including copying it,
8modifying it, compiling it, and redistributing it either with or
9without modifications.  No license under IDT patents or patent
10applications is to be implied by the copyright license.
11
12Any user of this software should understand that IDT cannot provide
13technical support for this software and will not be responsible for
14any consequences resulting from the use of this software.
15
16Any person who transfers this source code or any derivative work must
17include the IDT copyright notice, this paragraph, and the preceeding
18two paragraphs in the transferred software.
19
20COPYRIGHT IDT CORPORATION 1996
21LICENSED MATERIAL - PROGRAM PROPERTY OF IDT
22
23  $Id$
24*/
25
26/*
27** idtcpu.h -- cpu related defines
28*/
29
30#ifndef _RTEMS_MIPS_IDTCPU_H
31#define _RTEMS_MIPS_IDTCPU_H
32
33/*
34 * 950313: Ketan added Register definition for XContext reg.
35 *               added define for WAIT instruction.
36 * 950421: Ketan added Register definition for Config reg (R3081)
37 */
38
39/*
40** memory configuration and mapping
41*/
42#define K0BASE  0x80000000
43#define K0SIZE  0x20000000
44#define K1BASE  0xa0000000
45#define K1SIZE  0x20000000
46#define K2BASE  0xc0000000
47#define K2SIZE  0x20000000
48#if  __mips == 3
49#define KSBASE  0xe0000000
50#define KSSIZE  0x20000000
51#endif
52
53#define KUBASE  0
54#define KUSIZE  0x80000000
55
56/*
57** Exception Vectors
58*/
59#if  __mips == 1
60#define UT_VEC  K0BASE                  /* utlbmiss vector */
61#define DB_VEC  (K0BASE+0x40)           /* debug vector */
62#define E_VEC   (K0BASE+0x80)           /* exception vector */
63#elif  __mips == 32
64#define T_VEC   (K0BASE+0x000)          /* tlbmiss vector */
65#define X_VEC   (K0BASE+0x080)          /* xtlbmiss vector */
66#define C_VEC   (K0BASE+0x100)          /* cache error vector */
67#define E_VEC   (K0BASE+0x180)          /* exception vector */
68#elif  __mips == 3
69#define T_VEC   (K0BASE+0x000)          /* tlbmiss vector */
70#define X_VEC   (K0BASE+0x080)          /* xtlbmiss vector */
71#define C_VEC   (K0BASE+0x100)          /* cache error vector */
72#define E_VEC   (K0BASE+0x180)          /* exception vector */
73#else
74#error "EXCEPTION VECTORS: unknown ISA level"
75#endif
76#define R_VEC   (K1BASE+0x1fc00000)     /* reset vector */
77
78/*
79** Address conversion macros
80*/
81#ifdef CLANGUAGE
82#define CAST(as) (as)
83#else
84#define CAST(as)
85#endif
86#define K0_TO_K1(x)     (CAST(unsigned)(x)|0xA0000000)  /* kseg0 to kseg1 */
87#define K1_TO_K0(x)     (CAST(unsigned)(x)&0x9FFFFFFF)  /* kseg1 to kseg0 */
88#define K0_TO_PHYS(x)   (CAST(unsigned)(x)&0x1FFFFFFF)  /* kseg0 to physical */
89#define K1_TO_PHYS(x)   (CAST(unsigned)(x)&0x1FFFFFFF)  /* kseg1 to physical */
90#define PHYS_TO_K0(x)   (CAST(unsigned)(x)|0x80000000)  /* physical to kseg0 */
91#define PHYS_TO_K1(x)   (CAST(unsigned)(x)|0xA0000000)  /* physical to kseg1 */
92
93/*
94**      Cache size constants
95*/
96#define MINCACHE        0x200           /* 512       For 3041. */
97#define MAXCACHE        0x40000         /* 256*1024   256k */   
98
99#if  __mips == 32
100/* R4000 configuration register definitions */
101#define CFG_CM          0x80000000      /* Master-Checker mode */
102#define CFG_ECMASK      0x70000000      /* System Clock Ratio */
103#define CFG_ECBY2       0x00000000      /* divide by 2 */
104#define CFG_ECBY3       0x10000000      /* divide by 3 */
105#define CFG_ECBY4       0x20000000      /* divide by 4 */
106#define CFG_EPMASK      0x0f000000      /* Transmit data pattern */
107#define CFG_EPD         0x00000000      /* D */
108#define CFG_EPDDX       0x01000000      /* DDX */
109#define CFG_EPDDXX      0x02000000      /* DDXX */
110#define CFG_EPDXDX      0x03000000      /* DXDX */
111#define CFG_EPDDXXX     0x04000000      /* DDXXX */
112#define CFG_EPDDXXXX    0x05000000      /* DDXXXX */
113#define CFG_EPDXXDXX    0x06000000      /* DXXDXX */
114#define CFG_EPDDXXXXX   0x07000000      /* DDXXXXX */
115#define CFG_EPDXXXDXXX  0x08000000      /* DXXXDXXX */
116#define CFG_SBMASK      0x00c00000      /* Secondary cache block size */
117#define CFG_SBSHIFT     22
118#define CFG_SB4         0x00000000      /* 4 words */
119#define CFG_SB8         0x00400000      /* 8 words */
120#define CFG_SB16        0x00800000      /* 16 words */
121#define CFG_SB32        0x00c00000      /* 32 words */
122#define CFG_SS          0x00200000      /* Split secondary cache */
123#define CFG_SW          0x00100000      /* Secondary cache port width */
124#define CFG_EWMASK      0x000c0000      /* System port width */
125#define CFG_EWSHIFT     18
126#define CFG_EW64        0x00000000      /* 64 bit */
127#define CFG_EW32        0x00010000      /* 32 bit */
128#define CFG_SC          0x00020000      /* Secondary cache absent */
129#define CFG_SM          0x00010000      /* Dirty Shared mode disabled */
130#define CFG_BE          0x00008000      /* Big Endian */
131#define CFG_EM          0x00004000      /* ECC mode enable */
132#define CFG_EB          0x00002000      /* Block ordering */
133#define CFG_ICMASK      0x00000e00      /* Instruction cache size */
134#define CFG_ICSHIFT     9
135#define CFG_DCMASK      0x000001c0      /* Data cache size */
136#define CFG_DCSHIFT     6
137#define CFG_IB          0x00000020      /* Instruction cache block size */
138#define CFG_DB          0x00000010      /* Data cache block size */
139#define CFG_CU          0x00000008      /* Update on Store Conditional */
140#define CFG_K0MASK      0x00000007      /* KSEG0 coherency algorithm */
141
142/*
143 * R4000 primary cache mode
144 */
145#define CFG_C_UNCACHED          2
146#define CFG_C_NONCOHERENT       3
147#define CFG_C_COHERENTXCL       4
148#define CFG_C_COHERENTXCLW      5
149#define CFG_C_COHERENTUPD       6
150
151/*
152 * R4000 cache operations (should be in assembler...?)
153 */
154#define Index_Invalidate_I               0x0         /* 0       0 */
155#define Index_Writeback_Inv_D            0x1         /* 0       1 */
156#define Index_Invalidate_SI              0x2         /* 0       2 */
157#define Index_Writeback_Inv_SD           0x3         /* 0       3 */
158#define Index_Load_Tag_I                 0x4         /* 1       0 */
159#define Index_Load_Tag_D                 0x5         /* 1       1 */
160#define Index_Load_Tag_SI                0x6         /* 1       2 */
161#define Index_Load_Tag_SD                0x7         /* 1       3 */
162#define Index_Store_Tag_I                0x8         /* 2       0 */
163#define Index_Store_Tag_D                0x9         /* 2       1 */
164#define Index_Store_Tag_SI               0xA         /* 2       2 */
165#define Index_Store_Tag_SD               0xB         /* 2       3 */
166#define Create_Dirty_Exc_D               0xD         /* 3       1 */
167#define Create_Dirty_Exc_SD              0xF         /* 3       3 */
168#define Hit_Invalidate_I                 0x10        /* 4       0 */
169#define Hit_Invalidate_D                 0x11        /* 4       1 */
170#define Hit_Invalidate_SI                0x12        /* 4       2 */
171#define Hit_Invalidate_SD                0x13        /* 4       3 */
172#define Hit_Writeback_Inv_D              0x15        /* 5       1 */
173#define Hit_Writeback_Inv_SD             0x17        /* 5       3 */
174#define Fill_I                           0x14        /* 5       0 */
175#define Hit_Writeback_D                  0x19        /* 6       1 */
176#define Hit_Writeback_SD                 0x1B        /* 6       3 */
177#define Hit_Writeback_I                  0x18        /* 6       0 */
178#define Hit_Set_Virtual_SI               0x1E        /* 7       2 */
179#define Hit_Set_Virtual_SD               0x1F        /* 7       3 */
180
181/* Disabled by chris -- horrible overload of common word.
182#ifndef WAIT
183#define WAIT .word 0x42000020
184#endif
185*/
186/* Disabled by joel -- horrible overload of common word.
187#ifndef wait
188#define wait .word 0x42000020
189#endif wait
190*/
191
192#endif
193
194#if  __mips == 3
195/* R4000 configuration register definitions */
196#define CFG_CM          0x80000000      /* Master-Checker mode */
197#define CFG_ECMASK      0x70000000      /* System Clock Ratio */
198#define CFG_ECBY2       0x00000000      /* divide by 2 */
199#define CFG_ECBY3       0x10000000      /* divide by 3 */
200#define CFG_ECBY4       0x20000000      /* divide by 4 */
201#define CFG_EPMASK      0x0f000000      /* Transmit data pattern */
202#define CFG_EPD         0x00000000      /* D */
203#define CFG_EPDDX       0x01000000      /* DDX */
204#define CFG_EPDDXX      0x02000000      /* DDXX */
205#define CFG_EPDXDX      0x03000000      /* DXDX */
206#define CFG_EPDDXXX     0x04000000      /* DDXXX */
207#define CFG_EPDDXXXX    0x05000000      /* DDXXXX */
208#define CFG_EPDXXDXX    0x06000000      /* DXXDXX */
209#define CFG_EPDDXXXXX   0x07000000      /* DDXXXXX */
210#define CFG_EPDXXXDXXX  0x08000000      /* DXXXDXXX */
211#define CFG_SBMASK      0x00c00000      /* Secondary cache block size */
212#define CFG_SBSHIFT     22
213#define CFG_SB4         0x00000000      /* 4 words */
214#define CFG_SB8         0x00400000      /* 8 words */
215#define CFG_SB16        0x00800000      /* 16 words */
216#define CFG_SB32        0x00c00000      /* 32 words */
217#define CFG_SS          0x00200000      /* Split secondary cache */
218#define CFG_SW          0x00100000      /* Secondary cache port width */
219#define CFG_EWMASK      0x000c0000      /* System port width */
220#define CFG_EWSHIFT     18
221#define CFG_EW64        0x00000000      /* 64 bit */
222#define CFG_EW32        0x00010000      /* 32 bit */
223#define CFG_SC          0x00020000      /* Secondary cache absent */
224#define CFG_SM          0x00010000      /* Dirty Shared mode disabled */
225#define CFG_BE          0x00008000      /* Big Endian */
226#define CFG_EM          0x00004000      /* ECC mode enable */
227#define CFG_EB          0x00002000      /* Block ordering */
228#define CFG_ICMASK      0x00000e00      /* Instruction cache size */
229#define CFG_ICSHIFT     9
230#define CFG_DCMASK      0x000001c0      /* Data cache size */
231#define CFG_DCSHIFT     6
232#define CFG_IB          0x00000020      /* Instruction cache block size */
233#define CFG_DB          0x00000010      /* Data cache block size */
234#define CFG_CU          0x00000008      /* Update on Store Conditional */
235#define CFG_K0MASK      0x00000007      /* KSEG0 coherency algorithm */
236
237/*
238 * R4000 primary cache mode
239 */
240#define CFG_C_UNCACHED          2
241#define CFG_C_NONCOHERENT       3
242#define CFG_C_COHERENTXCL       4
243#define CFG_C_COHERENTXCLW      5
244#define CFG_C_COHERENTUPD       6
245
246/*
247 * R4000 cache operations (should be in assembler...?)
248 */
249#define Index_Invalidate_I               0x0         /* 0       0 */
250#define Index_Writeback_Inv_D            0x1         /* 0       1 */
251#define Index_Invalidate_SI              0x2         /* 0       2 */
252#define Index_Writeback_Inv_SD           0x3         /* 0       3 */
253#define Index_Load_Tag_I                 0x4         /* 1       0 */
254#define Index_Load_Tag_D                 0x5         /* 1       1 */
255#define Index_Load_Tag_SI                0x6         /* 1       2 */
256#define Index_Load_Tag_SD                0x7         /* 1       3 */
257#define Index_Store_Tag_I                0x8         /* 2       0 */
258#define Index_Store_Tag_D                0x9         /* 2       1 */
259#define Index_Store_Tag_SI               0xA         /* 2       2 */
260#define Index_Store_Tag_SD               0xB         /* 2       3 */
261#define Create_Dirty_Exc_D               0xD         /* 3       1 */
262#define Create_Dirty_Exc_SD              0xF         /* 3       3 */
263#define Hit_Invalidate_I                 0x10        /* 4       0 */
264#define Hit_Invalidate_D                 0x11        /* 4       1 */
265#define Hit_Invalidate_SI                0x12        /* 4       2 */
266#define Hit_Invalidate_SD                0x13        /* 4       3 */
267#define Hit_Writeback_Inv_D              0x15        /* 5       1 */
268#define Hit_Writeback_Inv_SD             0x17        /* 5       3 */
269#define Fill_I                           0x14        /* 5       0 */
270#define Hit_Writeback_D                  0x19        /* 6       1 */
271#define Hit_Writeback_SD                 0x1B        /* 6       3 */
272#define Hit_Writeback_I                  0x18        /* 6       0 */
273#define Hit_Set_Virtual_SI               0x1E        /* 7       2 */
274#define Hit_Set_Virtual_SD               0x1F        /* 7       3 */
275
276/* Disabled by chris -- horrible overload of common word.
277#ifndef WAIT
278#define WAIT .word 0x42000020
279#endif
280*/
281/* Disabled by joel -- horrible overload of common word.
282#ifndef wait
283#define wait .word 0x42000020
284#endif wait
285*/
286
287#endif
288
289/*
290** TLB resource defines
291*/
292#if  __mips == 1
293#define N_TLB_ENTRIES   64
294#define TLB_PGSIZE      0x1000
295#define RANDBASE        8
296#define TLBLO_PFNMASK   0xfffff000
297#define TLBLO_PFNSHIFT  12
298#define TLBLO_N         0x800   /* non-cacheable */
299#define TLBLO_D         0x400   /* writeable */
300#define TLBLO_V         0x200   /* valid bit */
301#define TLBLO_G         0x100   /* global access bit */
302
303#define TLBHI_VPNMASK   0xfffff000
304#define TLBHI_VPNSHIFT  12
305#define TLBHI_PIDMASK   0xfc0
306#define TLBHI_PIDSHIFT  6
307#define TLBHI_NPID      64
308
309#define TLBINX_PROBE    0x80000000
310#define TLBINX_INXMASK  0x00003f00
311#define TLBINX_INXSHIFT 8
312
313#define TLBRAND_RANDMASK        0x00003f00
314#define TLBRAND_RANDSHIFT       8
315
316#define TLBCTXT_BASEMASK        0xffe00000
317#define TLBCTXT_BASESHIFT       21
318
319#define TLBCTXT_VPNMASK         0x001ffffc
320#define TLBCTXT_VPNSHIFT        2
321#endif
322#if  __mips == 3
323#define N_TLB_ENTRIES   48
324
325#define TLBHI_VPN2MASK  0xffffe000
326#define TLBHI_PIDMASK   0x000000ff
327#define TLBHI_NPID      256
328
329#define TLBLO_PFNMASK   0x3fffffc0
330#define TLBLO_PFNSHIFT  6
331#define TLBLO_D         0x00000004      /* writeable */
332#define TLBLO_V         0x00000002      /* valid bit */
333#define TLBLO_G         0x00000001      /* global access bit */
334#define TLBLO_CMASK     0x00000038      /* cache algorithm mask */
335#define TLBLO_CSHIFT    3
336
337#define TLBLO_UNCACHED          (CFG_C_UNCACHED<<TLBLO_CSHIFT)
338#define TLBLO_NONCOHERENT       (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
339#define TLBLO_COHERENTXCL       (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
340#define TLBLO_COHERENTXCLW      (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
341#define TLBLO_COHERENTUPD       (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
342
343#define TLBINX_PROBE    0x80000000
344#define TLBINX_INXMASK  0x0000003f
345
346#define TLBRAND_RANDMASK        0x0000003f
347
348#define TLBCTXT_BASEMASK        0xff800000
349#define TLBCTXT_BASESHIFT       23
350
351#define TLBCTXT_VPN2MASK        0x007ffff0
352#define TLBCTXT_VPN2SHIFT       4
353
354#define TLBPGMASK_MASK          0x01ffe000
355#endif
356
357#if  __mips == 32
358#define N_TLB_ENTRIES   16
359
360#define TLBHI_VPN2MASK  0xffffe000
361#define TLBHI_PIDMASK   0x000000ff
362#define TLBHI_NPID      256
363
364#define TLBLO_PFNMASK   0x3fffffc0
365#define TLBLO_PFNSHIFT  6
366#define TLBLO_D         0x00000004      /* writeable */
367#define TLBLO_V         0x00000002      /* valid bit */
368#define TLBLO_G         0x00000001      /* global access bit */
369#define TLBLO_CMASK     0x00000038      /* cache algorithm mask */
370#define TLBLO_CSHIFT    3
371
372#define TLBLO_UNCACHED          (CFG_C_UNCACHED<<TLBLO_CSHIFT)
373#define TLBLO_NONCOHERENT       (CFG_C_NONCOHERENT<<TLBLO_CSHIFT)
374#define TLBLO_COHERENTXCL       (CFG_C_COHERENTXCL<<TLBLO_CSHIFT)
375#define TLBLO_COHERENTXCLW      (CFG_C_COHERENTXCLW<<TLBLO_CSHIFT)
376#define TLBLO_COHERENTUPD       (CFG_C_COHERENTUPD<<TLBLO_CSHIFT)
377
378#define TLBINX_PROBE    0x80000000
379#define TLBINX_INXMASK  0x0000003f
380
381#define TLBRAND_RANDMASK        0x0000003f
382
383#define TLBCTXT_BASEMASK        0xff800000
384#define TLBCTXT_BASESHIFT       23
385
386#define TLBCTXT_VPN2MASK        0x007ffff0
387#define TLBCTXT_VPN2SHIFT       4
388
389#define TLBPGMASK_MASK          0x01ffe000
390#endif
391
392#if  __mips == 1
393
394
395/* definitions for Debug and Cache Invalidate control (DCIC) register bits */
396#define DCIC_TR         0x80000000      /* Trap enable */
397#define DCIC_UD         0x40000000      /* User debug enable */
398#define DCIC_KD         0x20000000      /* Kernel debug enable */
399#define DCIC_TE         0x10000000      /* Trace enable */
400#define DCIC_DW         0x08000000      /* Enable data breakpoints on write */
401#define DCIC_DR         0x04000000      /* Enable data breakpoints on read */
402#define DCIC_DAE        0x02000000      /* Enable data addresss breakpoints */
403#define DCIC_PCE        0x01000000      /* Enable instruction breakpoints */
404#define DCIC_DE         0x00800000      /* Debug enable */
405#define DCIC_DL         0x00008000      /* Data cache line invalidate */
406#define DCIC_IL         0x00004000      /* Instruction cache line invalidate */
407#define DCIC_D          0x00002000      /* Data cache invalidate enable */
408#define DCIC_I          0x00001000      /* Instr. cache invalidate enable */
409#define DCIC_T          0x00000020      /* Trace, set by CPU */
410#define DCIC_W          0x00000010      /* Write reference, set by CPU */
411#define DCIC_R          0x00000008      /* Read reference, set by CPU */
412#define DCIC_DA         0x00000004      /* Data address, set by CPU */
413#define DCIC_PC         0x00000002      /* Program counter, set by CPU */
414#define DCIC_DB         0x00000001      /* Debug, set by CPU */
415
416
417
418
419#define SR_CUMASK       0xf0000000      /* coproc usable bits */
420#define SR_CU3          0x80000000      /* Coprocessor 3 usable */
421#define SR_CU2          0x40000000      /* Coprocessor 2 usable */
422#define SR_CU1          0x20000000      /* Coprocessor 1 usable */
423#define SR_CU0          0x10000000      /* Coprocessor 0 usable */
424
425#define SR_BEV          0x00400000      /* use boot exception vectors */
426
427/* Cache control bits */
428#define SR_TS           0x00200000      /* TLB shutdown */
429#define SR_PE           0x00100000      /* cache parity error */
430#define SR_CM           0x00080000      /* cache miss */
431#define SR_PZ           0x00040000      /* cache parity zero */
432#define SR_SWC          0x00020000      /* swap cache */
433#define SR_ISC          0x00010000      /* Isolate data cache */
434
435/*
436**      status register interrupt masks and bits
437*/
438
439#define SR_IMASK        0x0000ff00      /* Interrupt mask */
440#define SR_IMASK8       0x00000000      /* mask level 8 */
441#define SR_IMASK7       0x00008000      /* mask level 7 */
442#define SR_IMASK6       0x0000c000      /* mask level 6 */
443#define SR_IMASK5       0x0000e000      /* mask level 5 */
444#define SR_IMASK4       0x0000f000      /* mask level 4 */
445#define SR_IMASK3       0x0000f800      /* mask level 3 */
446#define SR_IMASK2       0x0000fc00      /* mask level 2 */
447#define SR_IMASK1       0x0000fe00      /* mask level 1 */
448#define SR_IMASK0       0x0000ff00      /* mask level 0 */
449
450#define SR_IMASKSHIFT   8
451
452#define SR_IBIT8        0x00008000      /* bit level 8 */
453#define SR_IBIT7        0x00004000      /* bit level 7 */
454#define SR_IBIT6        0x00002000      /* bit level 6 */
455#define SR_IBIT5        0x00001000      /* bit level 5 */
456#define SR_IBIT4        0x00000800      /* bit level 4 */
457#define SR_IBIT3        0x00000400      /* bit level 3 */
458#define SR_IBIT2        0x00000200      /* bit level 2 */
459#define SR_IBIT1        0x00000100      /* bit level 1 */
460
461#define SR_KUO          0x00000020      /* old kernel/user, 0 => k, 1 => u */
462#define SR_IEO          0x00000010      /* old interrupt enable, 1 => enable */
463#define SR_KUP          0x00000008      /* prev kernel/user, 0 => k, 1 => u */
464#define SR_IEP          0x00000004      /* prev interrupt enable, 1 => enable */
465#define SR_KUC          0x00000002      /* cur kernel/user, 0 => k, 1 => u */
466#define SR_IEC          0x00000001      /* cur interrupt enable, 1 => enable */
467#endif
468
469#if  __mips == 3
470#define SR_CUMASK       0xf0000000      /* coproc usable bits */
471#define SR_CU3          0x80000000      /* Coprocessor 3 usable */
472#define SR_CU2          0x40000000      /* Coprocessor 2 usable */
473#define SR_CU1          0x20000000      /* Coprocessor 1 usable */
474#define SR_CU0          0x10000000      /* Coprocessor 0 usable */
475
476#define SR_RP           0x08000000      /* Reduced power operation */
477#define SR_FR           0x04000000      /* Additional floating point registers */
478#define SR_RE           0x02000000      /* Reverse endian in user mode */
479
480#define SR_BEV          0x00400000      /* Use boot exception vectors */
481#define SR_TS           0x00200000      /* TLB shutdown */
482#define SR_SR           0x00100000      /* Soft reset */
483#define SR_CH           0x00040000      /* Cache hit */
484#define SR_CE           0x00020000      /* Use cache ECC  */
485#define SR_DE           0x00010000      /* Disable cache exceptions */
486
487/*
488**      status register interrupt masks and bits
489*/
490
491#define SR_IMASK        0x0000ff00      /* Interrupt mask */
492#define SR_IMASK8       0x00000000      /* mask level 8 */
493#define SR_IMASK7       0x00008000      /* mask level 7 */
494#define SR_IMASK6       0x0000c000      /* mask level 6 */
495#define SR_IMASK5       0x0000e000      /* mask level 5 */
496#define SR_IMASK4       0x0000f000      /* mask level 4 */
497#define SR_IMASK3       0x0000f800      /* mask level 3 */
498#define SR_IMASK2       0x0000fc00      /* mask level 2 */
499#define SR_IMASK1       0x0000fe00      /* mask level 1 */
500#define SR_IMASK0       0x0000ff00      /* mask level 0 */
501
502#define SR_IMASKSHIFT   8
503
504#define SR_IBIT8        0x00008000      /* bit level 8 */
505#define SR_IBIT7        0x00004000      /* bit level 7 */
506#define SR_IBIT6        0x00002000      /* bit level 6 */
507#define SR_IBIT5        0x00001000      /* bit level 5 */
508#define SR_IBIT4        0x00000800      /* bit level 4 */
509#define SR_IBIT3        0x00000400      /* bit level 3 */
510#define SR_IBIT2        0x00000200      /* bit level 2 */
511#define SR_IBIT1        0x00000100      /* bit level 1 */
512
513#define SR_KSMASK       0x00000018      /* Kernel mode mask */
514#define SR_KSUSER       0x00000010      /* User mode */
515#define SR_KSSUPER      0x00000008      /* Supervisor mode */
516#define SR_KSKERNEL     0x00000000      /* Kernel mode */
517#define SR_ERL          0x00000004      /* Error level */
518#define SR_EXL          0x00000002      /* Exception level */
519#define SR_IE           0x00000001      /* Interrupts enabled */
520#endif
521
522#if  __mips == 32
523#define SR_CUMASK       0xf0000000      /* coproc usable bits */
524#define SR_CU3          0x80000000      /* Coprocessor 3 usable */
525#define SR_CU2          0x40000000      /* Coprocessor 2 usable */
526#define SR_CU1          0x20000000      /* Coprocessor 1 usable */
527#define SR_CU0          0x10000000      /* Coprocessor 0 usable */
528
529#define SR_RP           0x08000000      /* Reduced power operation */
530#define SR_FR           0x04000000      /* Additional floating point registers */
531#define SR_RE           0x02000000      /* Reverse endian in user mode */
532
533#define SR_BEV          0x00400000      /* Use boot exception vectors */
534#define SR_TS           0x00200000      /* TLB shutdown */
535#define SR_SR           0x00100000      /* Soft reset */
536#define SR_CH           0x00040000      /* Cache hit */
537#define SR_CE           0x00020000      /* Use cache ECC  */
538#define SR_DE           0x00010000      /* Disable cache exceptions */
539
540/*
541**      status register interrupt masks and bits
542*/
543
544#define SR_IMASK        0x0000ff00      /* Interrupt mask */
545#define SR_IMASK8       0x00000000      /* mask level 8 */
546#define SR_IMASK7       0x00008000      /* mask level 7 */
547#define SR_IMASK6       0x0000c000      /* mask level 6 */
548#define SR_IMASK5       0x0000e000      /* mask level 5 */
549#define SR_IMASK4       0x0000f000      /* mask level 4 */
550#define SR_IMASK3       0x0000f800      /* mask level 3 */
551#define SR_IMASK2       0x0000fc00      /* mask level 2 */
552#define SR_IMASK1       0x0000fe00      /* mask level 1 */
553#define SR_IMASK0       0x0000ff00      /* mask level 0 */
554
555#define SR_IMASKSHIFT   8
556
557#define SR_IBIT8        0x00008000      /* bit level 8 */
558#define SR_IBIT7        0x00004000      /* bit level 7 */
559#define SR_IBIT6        0x00002000      /* bit level 6 */
560#define SR_IBIT5        0x00001000      /* bit level 5 */
561#define SR_IBIT4        0x00000800      /* bit level 4 */
562#define SR_IBIT3        0x00000400      /* bit level 3 */
563#define SR_IBIT2        0x00000200      /* bit level 2 */
564#define SR_IBIT1        0x00000100      /* bit level 1 */
565
566#define SR_KSMASK       0x00000018      /* Kernel mode mask */
567#define SR_KSUSER       0x00000010      /* User mode */
568#define SR_KSSUPER      0x00000008      /* Supervisor mode */
569#define SR_KSKERNEL     0x00000000      /* Kernel mode */
570#define SR_ERL          0x00000004      /* Error level */
571#define SR_EXL          0x00000002      /* Exception level */
572#define SR_IE           0x00000001      /* Interrupts enabled */
573#endif
574
575/*
576 * Cause Register
577 */
578#define CAUSE_BD        0x80000000      /* Branch delay slot */
579#define CAUSE_BT        0x40000000      /* Branch Taken */
580#define CAUSE_CEMASK    0x30000000      /* coprocessor error */
581#define CAUSE_CESHIFT   28
582
583
584#define CAUSE_IPMASK    0x0000FF00      /* Pending interrupt mask */
585#define CAUSE_IPSHIFT   8
586
587#define CAUSE_EXCMASK   0x0000003C      /* Cause code bits */
588#define CAUSE_EXCSHIFT  2
589
590#ifndef XDS
591/*
592**  Coprocessor 0 registers
593*/
594#define C0_INX          $0              /* tlb index */
595#define C0_RAND         $1              /* tlb random */
596#if  __mips == 1
597#define C0_TLBLO        $2              /* tlb entry low */
598#endif
599#if  __mips == 3
600#define C0_TLBLO0       $2              /* tlb entry low 0 */
601#define C0_TLBLO1       $3              /* tlb entry low 1 */
602#endif
603
604#if  __mips == 32
605#define C0_TLBLO0       $2              /* tlb entry low 0 */
606#define C0_TLBLO1       $3              /* tlb entry low 1 */
607#endif
608
609
610#define C0_CTXT         $4              /* tlb context */
611
612#if  __mips == 3
613#define C0_PAGEMASK     $5              /* tlb page mask */
614#define C0_WIRED        $6              /* number of wired tlb entries */
615#endif
616
617#if  __mips == 32
618#define C0_PAGEMASK     $5              /* tlb page mask */
619#define C0_WIRED        $6              /* number of wired tlb entries */
620#endif
621
622#if  __mips == 1
623#define C0_TAR          $6
624#endif
625
626#define C0_BADVADDR     $8              /* bad virtual address */
627
628#if  __mips == 3
629#define C0_COUNT        $9              /* cycle count */
630#endif
631#if  __mips == 32
632#define C0_COUNT        $9              /* cycle count */
633#endif
634
635#define C0_TLBHI        $10             /* tlb entry hi */
636
637#if  __mips == 3
638#define C0_COMPARE      $11             /* cyccle count comparator  */
639#endif
640
641#if  __mips == 32
642#define C0_COMPARE      $11             /* cyccle count comparator  */
643#endif
644
645#define C0_SR           $12             /* status register */
646#define C0_CAUSE        $13             /* exception cause */
647#define C0_EPC          $14             /* exception pc */
648#define C0_PRID         $15             /* revision identifier */
649
650#if  __mips == 1
651#define C0_CONFIG   $3     /* configuration register R3081*/
652#endif
653
654#if  __mips == 3
655#define C0_CONFIG       $16             /* configuration register */
656#define C0_LLADDR       $17             /* linked load address */
657#define C0_WATCHLO      $18             /* watchpoint trap register */
658#define C0_WATCHHI      $19             /* watchpoint trap register */
659#define C0_XCTXT    $20     /* extended tlb context */
660#define C0_ECC          $26             /* secondary cache ECC control */
661#define C0_CACHEERR     $27             /* cache error status */
662#define C0_TAGLO        $28             /* cache tag lo */
663#define C0_TAGHI        $29             /* cache tag hi */
664#define C0_ERRPC        $30             /* cache error pc */
665#endif
666
667#if  __mips == 32
668#define C0_CONFIG       $16             /* configuration register */
669#define C0_LLADDR       $17             /* linked load address */
670#define C0_WATCHLO      $18             /* watchpoint trap register */
671#define C0_WATCHHI      $19             /* watchpoint trap register */
672#define C0_XCTXT    $20     /* extended tlb context */
673#define C0_ECC          $26             /* secondary cache ECC control */
674#define C0_CACHEERR     $27             /* cache error status */
675#define C0_TAGLO        $28             /* cache tag lo */
676#define C0_TAGHI        $29             /* cache tag hi */
677#define C0_ERRPC        $30             /* cache error pc */
678#endif
679
680
681#define C1_REVISION     $0
682#define C1_STATUS       $31
683
684#endif /* XDS */
685
686#ifdef R4650
687#define IWATCH $18
688#define DWATCH $19
689#define IBASE  $0
690#define IBOUND $1
691#define DBASE  $2
692#define DBOUND $3
693#define CALG    $17
694#endif
695
696#endif /* _RTEMS_MIPS_IDTCPU_H */
697
Note: See TracBrowser for help on using the repository browser.