OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [rtos/] [ecos-2.0/] [packages/] [hal/] [powerpc/] [mpc8xx/] [v2_0/] [include/] [var_regs.h] - Blame information for rev 584

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 27 unneback
#ifndef CYGONCE_HAL_VAR_REGS_H
2
#define CYGONCE_HAL_VAR_REGS_H
3
 
4
//==========================================================================
5
//
6
//      var_regs.h
7
//
8
//      PowerPC 8xx variant CPU definitions
9
//
10
//==========================================================================
11
//####ECOSGPLCOPYRIGHTBEGIN####
12
// -------------------------------------------
13
// This file is part of eCos, the Embedded Configurable Operating System.
14
// Copyright (C) 1998, 1999, 2000, 2001, 2002 Red Hat, Inc.
15
// Copyright (C) 2002 Gary Thomas
16
//
17
// eCos is free software; you can redistribute it and/or modify it under
18
// the terms of the GNU General Public License as published by the Free
19
// Software Foundation; either version 2 or (at your option) any later version.
20
//
21
// eCos is distributed in the hope that it will be useful, but WITHOUT ANY
22
// WARRANTY; without even the implied warranty of MERCHANTABILITY or
23
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
24
// for more details.
25
//
26
// You should have received a copy of the GNU General Public License along
27
// with eCos; if not, write to the Free Software Foundation, Inc.,
28
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
29
//
30
// As a special exception, if other files instantiate templates or use macros
31
// or inline functions from this file, or you compile this file and link it
32
// with other works to produce a work based on this file, this file does not
33
// by itself cause the resulting work to be covered by the GNU General Public
34
// License. However the source code for this file must still be made available
35
// in accordance with section (3) of the GNU General Public License.
36
//
37
// This exception does not invalidate any other reasons why a work based on
38
// this file might be covered by the GNU General Public License.
39
//
40
// Alternative licenses for eCos may be arranged by contacting Red Hat, Inc.
41
// at http://sources.redhat.com/ecos/ecos-license/
42
// -------------------------------------------
43
//####ECOSGPLCOPYRIGHTEND####
44
//==========================================================================
45
//#####DESCRIPTIONBEGIN####
46
//
47
// Author(s):    jskov
48
// Contributors: jskov, gthomas
49
// Date:         2000-02-04
50
// Purpose:      Provide MPC8xx register definitions
51
// Description:  Provide MPC8xx register definitions
52
//               The short difinitions (sans CYGARC_REG_) are exported only
53
//               if CYGARC_HAL_COMMON_EXPORT_CPU_MACROS is defined.
54
// Usage:        Included via the acrhitecture register header:
55
//               #include <cyg/hal/ppc_regs.h>
56
//               ...
57
//              
58
//
59
//####DESCRIPTIONEND####
60
//
61
//==========================================================================
62
 
63
#include <cyg/hal/plf_regs.h>
64
 
65
//--------------------------------------------------------------------------
66
// Instruction cache control.
67
#define CYGARC_REG_IC_CST          560
68
#define CYGARC_REG_IC_ADR          561
69
#define CYGARC_REG_IC_DAT          562
70
 
71
#define CYGARC_REG_IC_CMD_CE       0x02000000      // cache enable
72
#define CYGARC_REG_IC_CMD_CD       0x04000000      // cache disable
73
#define CYGARC_REG_IC_CMD_LL       0x06000000      // load & lock
74
#define CYGARC_REG_IC_CMD_UL       0x08000000      // unlock line
75
#define CYGARC_REG_IC_CMD_UA       0x0a000000      // unlock all
76
#define CYGARC_REG_IC_CMD_IA       0x0c000000      // invalidate all
77
 
78
#define CYGARC_REG_IC_ADR_SETID_SHIFT 4            // set id is bits 21-27
79
#define CYGARC_REG_IC_ADR_WAY0     0x00000000      // select way0
80
#define CYGARC_REG_IC_ADR_WAY1     0x00001000      // select way1
81
 
82
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
83
#define IC_CST          CYGARC_REG_IC_CST
84
#define IC_ADR          CYGARC_REG_IC_ADR
85
#define IC_DAT          CYGARC_REG_IC_DAT
86
 
87
#define IC_CMD_CE       CYGARC_REG_IC_CMD_CE
88
#define IC_CMD_CD       CYGARC_REG_IC_CMD_CD
89
#define IC_CMD_LL       CYGARC_REG_IC_CMD_LL
90
#define IC_CMD_UL       CYGARC_REG_IC_CMD_UL
91
#define IC_CMD_UA       CYGARC_REG_IC_CMD_UA
92
#define IC_CMD_IA       CYGARC_REG_IC_CMD_IA
93
 
94
#define IC_ADR_SETID_SHIFT CYGARC_REG_IC_ADR_SETID_SHIFT
95
#define IC_ADR_WAY0        CYGARC_REG_IC_ADR_WAY0
96
#define IC_ADR_WAY1        CYGARC_REG_IC_ADR_WAY1
97
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
98
 
99
//--------------------------------------------------------------------------
100
// Data cache control.
101
#define CYGARC_REG_DC_CST          568
102
#define CYGARC_REG_DC_ADR          569
103
#define CYGARC_REG_DC_DAT          570
104
 
105
#define CYGARC_REG_DC_CMD_CE       0x02000000      // cache enable
106
#define CYGARC_REG_DC_CMD_CD       0x04000000      // cache disable
107
#define CYGARC_REG_DC_CMD_LL       0x06000000      // lock line
108
#define CYGARC_REG_DC_CMD_UL       0x08000000      // unlock line
109
#define CYGARC_REG_DC_CMD_UA       0x0a000000      // unlock all
110
#define CYGARC_REG_DC_CMD_IA       0x0c000000      // invalidate all
111
#define CYGARC_REG_DC_CMD_FL       0x0e000000      // flush line
112
#define CYGARC_REG_DC_CMD_SW       0x01000000      // set writethrough
113
#define CYGARC_REG_DC_CMD_CW       0x03000000      // clear writethrough
114
#define CYGARC_REG_DC_CMD_SS       0x05000000      // set little endian swap
115
#define CYGARC_REG_DC_CMD_CS       0x07000000      // clear little endian swap
116
 
117
#define CYGARC_REG_DC_ADR_SETID_SHIFT 4            // set id is bits 21-27
118
#define CYGARC_REG_DC_ADR_WAY0     0x00000000      // select way0
119
#define CYGARC_REG_DC_ADR_WAY1     0x00001000      // select way1
120
 
121
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
122
#define DC_CST             CYGARC_REG_DC_CST
123
#define DC_ADR             CYGARC_REG_DC_ADR
124
#define DC_DAT             CYGARC_REG_DC_DAT
125
 
126
#define DC_CMD_CE          CYGARC_REG_DC_CMD_CE
127
#define DC_CMD_CD          CYGARC_REG_DC_CMD_CD
128
#define DC_CMD_LL          CYGARC_REG_DC_CMD_LL
129
#define DC_CMD_UL          CYGARC_REG_DC_CMD_UL
130
#define DC_CMD_UA          CYGARC_REG_DC_CMD_UA
131
#define DC_CMD_IA          CYGARC_REG_DC_CMD_IA
132
#define DC_CMD_FL          CYGARC_REG_DC_CMD_FL
133
#define DC_CMD_SW          CYGARC_REG_DC_CMD_SW
134
#define DC_CMD_CW          CYGARC_REG_DC_CMD_CW
135
#define DC_CMD_SS          CYGARC_REG_DC_CMD_SS
136
#define DC_CMD_CS          CYGARC_REG_DC_CMD_CS
137
 
138
#define DC_ADR_SETID_SHIFT CYGARC_REG_DC_ADR_SETID_SHIFT
139
#define DC_ADR_WAY0        CYGARC_REG_DC_ADR_WAY0
140
#define DC_ADR_WAY1        CYGARC_REG_DC_ADR_WAY1
141
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
142
 
143
//--------------------------------------------------------------------------
144
// MMU control.
145
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
146
#define M_CASID         793             // current address space id register
147
 
148
#define MI_CTR          784             // instruction MMU control
149
#define MI_EPN          787             // instruction MMU effective page num
150
#define MI_TWC          789             // instruction MMU tablewalk count
151
#define MI_RPN          790             // instruction MMU real page num
152
#define MI_DCAM         816             // instruction MMU CAM read
153
#define MI_DRAM0        817             // instruction MMU RAM read 0
154
#define MI_DRAM1        818             // instruction MMU RAM read 1
155
 
156
#define MI_EPN_EPNMASK  0xfffff000      // effective page no mask
157
#define MI_EPN_EV       0x00000200      // entry valid
158
 
159
#define MI_RPN_RPNMASK  0xfffff000      // real page no mask
160
#define MI_RPN_PPRWRW   0x000008f0      // page protection (rw/rw, page valid)
161
#define MI_RPN_LPS      0x0000000C      // large page size
162
#define MI_RPN_SH       0x00000004      // shared page (1 = no ASID cmp)
163
#define MI_RPN_CI       0x00000002      // cache inhibited
164
#define MI_RPN_V        0x00000001      // entry valid
165
 
166
#define MI_TWC_PS8MB    0x0000000c      // page size = 8MB
167
#define MI_TWC_G        0x00000010      // guarded
168
#define MI_TWC_WT       0x00000002      // writethrough
169
#define MI_TWC_V        0x00000001      // entry valid
170
 
171
#define MI_CTR_INDX_SHIFT 8             // the ITLB_INDX starts at bit 23
172
 
173
#define MD_CTR          792             // data MMU control
174
#define MD_EPN          795             // data MMU effective page num
175
#define MD_TWC          797             // data MMU tablewalk count
176
#define MD_RPN          798             // data MMU real page num
177
#define MD_DCAM         824             // data MMU CAM read
178
#define MD_DRAM0        825             // data MMU RAM read 0
179
#define MD_DRAM1        826             // data MMU RAM read 1
180
 
181
#define MD_RPN_CHANGED  0x00000100      // page changed
182
 
183
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
184
 
185
#define CYGARC_REG_MI_CTR         784
186
#define CYGARC_REG_MI_CTR_CIDEF   0x20000000
187
 
188
#define CYGARC_REG_MD_CTR         792
189
#define CYGARC_REG_MD_CTR_CIDEF   0x20000000
190
#define CYGARC_REG_MD_CTR_WTDEF   0x10000000
191
 
192
//--------------------------------------------------------------------------
193
// Internal Memory Map.
194
#define CYGARC_REG_IMMR            638  // internal memory map base register
195
#define CYGARC_REG_IMMR_BASEMASK   0xffff0000 // imm base location mask (rw)
196
#define CYGARC_REG_IMMR_PARTNUM    0x0000ff00 // part number mask (ro)
197
#define CYGARC_REG_IMMR_MASKNUM    0x000000ff // mask number mask (ro)
198
 
199
#ifndef CYGARC_REG_IMM_BASE        // Can be defined by platform
200
#define CYGARC_REG_IMM_BASE        0xfa200000 // the internal memory map base
201
#endif
202
 
203
// CP Microcode Revision Number
204
#define CYGARC_REG_REV_NUM         (CYGARC_REG_IMM_BASE + 0x3cb0)
205
 
206
// system protection control
207
#define CYGARC_REG_IMM_SYPCR       (CYGARC_REG_IMM_BASE + 0x004)
208
#define CYGARC_REG_IMM_SYPCR_SWTC_MASK 0xffff0000
209
#define CYGARC_REG_IMM_SYPCR_BMT_MASK  0x0000ff00
210
#define CYGARC_REG_IMM_SYPCR_BME       0x00000080
211
#define CYGARC_REG_IMM_SYPCR_SWF       0x00000008
212
#define CYGARC_REG_IMM_SYPCR_SWE       0x00000004
213
#define CYGARC_REG_IMM_SYPCR_SWRI      0x00000002
214
#define CYGARC_REG_IMM_SYPCR_SWP       0x00000001
215
 
216
// interrupt pend register
217
#define CYGARC_REG_IMM_SIPEND      (CYGARC_REG_IMM_BASE + 0x010)
218
#define CYGARC_REG_IMM_SIPEND_IRQ0 0x80000000 // irq0 is bit 0...
219
 
220
// interrupt mask
221
#define CYGARC_REG_IMM_SIMASK      (CYGARC_REG_IMM_BASE + 0x014)
222
#define CYGARC_REG_IMM_SIMASK_IRQ0 0x80000000 // ... irq n is bit n*2
223
 
224
// interrupt edge level mask
225
#define CYGARC_REG_IMM_SIEL        (CYGARC_REG_IMM_BASE + 0x018)
226
#define CYGARC_REG_IMM_SIEL_IRQ0   0x80000000
227
 
228
// interrupt vector
229
#define CYGARC_REG_IMM_SIVEC       (CYGARC_REG_IMM_BASE + 0x01c)
230
 
231
// memory controller
232
#define CYGARC_REG_IMM_BR0         (CYGARC_REG_IMM_BASE + 0x100)
233
#define CYGARC_REG_IMM_OR0         (CYGARC_REG_IMM_BASE + 0x104)
234
#define CYGARC_REG_IMM_BR1         (CYGARC_REG_IMM_BASE + 0x108)
235
#define CYGARC_REG_IMM_OR1         (CYGARC_REG_IMM_BASE + 0x10c)
236
#define CYGARC_REG_IMM_BR2         (CYGARC_REG_IMM_BASE + 0x110)
237
#define CYGARC_REG_IMM_OR2         (CYGARC_REG_IMM_BASE + 0x114)
238
#define CYGARC_REG_IMM_BR3         (CYGARC_REG_IMM_BASE + 0x118)
239
#define CYGARC_REG_IMM_OR3         (CYGARC_REG_IMM_BASE + 0x11c)
240
#define CYGARC_REG_IMM_BR4         (CYGARC_REG_IMM_BASE + 0x120)
241
#define CYGARC_REG_IMM_OR4         (CYGARC_REG_IMM_BASE + 0x124)
242
#define CYGARC_REG_IMM_BR5         (CYGARC_REG_IMM_BASE + 0x128)
243
#define CYGARC_REG_IMM_OR5         (CYGARC_REG_IMM_BASE + 0x12c)
244
#define CYGARC_REG_IMM_BR6         (CYGARC_REG_IMM_BASE + 0x130)
245
#define CYGARC_REG_IMM_OR6         (CYGARC_REG_IMM_BASE + 0x134)
246
#define CYGARC_REG_IMM_BR7         (CYGARC_REG_IMM_BASE + 0x138)
247
#define CYGARC_REG_IMM_OR7         (CYGARC_REG_IMM_BASE + 0x13c)
248
 
249
#define CYGARC_REG_IMM_BR_BA_MASK  0xffff8000 // base address
250
#define CYGARC_REG_IMM_BR_AT_MASK  0x00007000 // address type
251
#define CYGARC_REG_IMM_BR_PS_8     0x00000400 // port size 8 bits
252
#define CYGARC_REG_IMM_BR_PS_16    0x00000800 // port size 16 bits
253
#define CYGARC_REG_IMM_BR_PS_32    0x00000000 // port size 32 bits
254
#define CYGARC_REG_IMM_BR_PARE     0x00000200 // parity enable 
255
#define CYGARC_REG_IMM_BR_WP       0x00000100 // write protect  
256
#define CYGARC_REG_IMM_BR_MS_GPCM  0x00000000 // machine select G.P.C.M
257
#define CYGARC_REG_IMM_BR_MS_UPMA  0x00000080 // machine select U.P.M.A
258
#define CYGARC_REG_IMM_BR_MS_UPMB  0x000000c0 // machine select U.P.M.B
259
#define CYGARC_REG_IMM_BR_V        0x00000001 // valid bit
260
 
261
#define CYGARC_REG_IMM_OR_AM     0xffff8000 // address mask
262
#define CYGARC_REG_IMM_OR_ATM    0x00007000 // address type mask
263
#define CYGARC_REG_IMM_OR_CSNT   0x00000800 // GPCM:chip select negation time
264
#define CYGARC_REG_IMM_OR_SAM    0x00000800 // UPMx:start address multiplex
265
#define CYGARC_REG_IMM_OR_ACS_0  0x00000000 // GPCM:CS output immediately
266
#define CYGARC_REG_IMM_OR_ACS_4  0x00000400 // GPCM:CS output 1/4 clock later
267
#define CYGARC_REG_IMM_OR_ACS_2  0x00000600 // GPCM:CS output 1/2 clock later
268
#define CYGARC_REG_IMM_OR_G5LA   0x00000400 // UPMx:general-purpose line 5 A
269
#define CYGARC_REG_IMM_OR_G5LS   0x00000200 // UPMx:general-purpose line 5 S
270
#define CYGARC_REG_IMM_OR_BI     0x00000100 // burst inhibit
271
#define CYGARC_REG_IMM_OR_SCY_MASK 0x000000f0 // cycle length in clocks
272
#define CYGARC_REG_IMM_OR_SCY_SHIFT 4
273
#define CYGARC_REG_IMM_OR_SETA     0x00000008 // external transfer ack
274
#define CYGARC_REG_IMM_OR_TRLX     0x00000004 // timing relaxed
275
#define CYGARC_REG_IMM_OR_EHTR     0x00000002 // extended hold time on read
276
 
277
// timebase status and control
278
#define CYGARC_REG_IMM_TBSCR       (CYGARC_REG_IMM_BASE + 0x200) 
279
#define CYGARC_REG_IMM_TBSCR_REFA  0x0080 // reference interrupt status A
280
#define CYGARC_REG_IMM_TBSCR_REFB  0x0040 // reference interrupt status B
281
#define CYGARC_REG_IMM_TBSCR_REFAE 0x0008 // reference interrupt enable A
282
#define CYGARC_REG_IMM_TBSCR_REFBE 0x0004 // reference interrupt enable B
283
#define CYGARC_REG_IMM_TBSCR_TBF   0x0002 // timebase freeze
284
#define CYGARC_REG_IMM_TBSCR_TBE   0x0001 // timebase enable
285
#define CYGARC_REG_IMM_TBSCR_IRQ0  0x8000 // highest interrupt level
286
#define CYGARC_REG_IMM_TBSCR_IRQMASK 0xff00 // irq priority mask
287
 
288
// timebase reference register 0
289
#define CYGARC_REG_IMM_TBREF0      (CYGARC_REG_IMM_BASE + 0x204)
290
// timebase reference register 1
291
#define CYGARC_REG_IMM_TBREF1      (CYGARC_REG_IMM_BASE + 0x208)
292
 
293
// real time clock
294
#define CYGARC_REG_IMM_RTCSC       (CYGARC_REG_IMM_BASE + 0x220)
295
#define CYGARC_REG_IMM_RTCSC_SEC   0x0080 // once per second interrupt
296
#define CYGARC_REG_IMM_RTCSC_ALR   0x0040 // alarm interrupt
297
#define CYGARC_REG_IMM_RTCSC_38K   0x0010 // source select
298
#define CYGARC_REG_IMM_RTCSC_SIE   0x0008 // second interrupt enable
299
#define CYGARC_REG_IMM_RTCSC_ALE   0x0004 // alarm interrupt enable
300
#define CYGARC_REG_IMM_RTCSC_RTF   0x0002 // real time clock freeze
301
#define CYGARC_REG_IMM_RTCSC_RTE   0x0001 // real time clock enable
302
#define CYGARC_REG_IMM_RTCSC_IRQ0  0x8000 // highest interrupt level
303
#define CYGARC_REG_IMM_RTCSC_IRQMASK 0xff00 // irq priority mask
304
 
305
// periodic interrupt status & ctrl
306
#define CYGARC_REG_IMM_PISCR       (CYGARC_REG_IMM_BASE + 0x240)
307
#define CYGARC_REG_IMM_PISCR_PS    0x0080 // periodic interrupt status
308
#define CYGARC_REG_IMM_PISCR_PIE   0x0004 // periodic interrupt enable
309
#define CYGARC_REG_IMM_PISCR_PITF  0x0002 // periodic interrupt timer freeze
310
#define CYGARC_REG_IMM_PISCR_PTE   0x0001 // periodic timer enable
311
#define CYGARC_REG_IMM_PISCR_IRQ0  0x8000 // highest interrupt level
312
#define CYGARC_REG_IMM_PISCR_IRQMASK 0xff00 // irq priority mask
313
 
314
// periodic interrupt timer count
315
#define CYGARC_REG_IMM_PITC        (CYGARC_REG_IMM_BASE + 0x244)
316
#define CYGARC_REG_IMM_PITC_COUNT_SHIFT 16 // count is stored in bits 0-15
317
 
318
// system clock control
319
#define CYGARC_REG_IMM_SCCR        (CYGARC_REG_IMM_BASE + 0x280)
320
#define CYGARC_REG_IMM_SCCR_TBS    0x02000000 // timebase source
321
#define CYGARC_REG_IMM_SCCR_RTDIV  0x01000000 // rtc clock divide
322
#define CYGARC_REG_IMM_SCCR_RTSEL  0x00800000 // rtc clock select
323
 
324
// CPM interrupt vector register
325
#define CYGARC_REG_IMM_CIVR        (CYGARC_REG_IMM_BASE + 0x930)
326
#define CYGARC_REG_IMM_CIVR_IACK   0x0001 // set this to update register
327
#define CYGARC_REG_IMM_CIVR_VECTOR_SHIFT 11 // vector is at bits 0-4
328
 
329
// CPM interrupt configuration reg
330
#define CYGARC_REG_IMM_CICR        (CYGARC_REG_IMM_BASE + 0x940)
331
#define CYGARC_REG_IMM_CICR_IEN    0x00000080      // interrupt enable
332
#define CYGARC_REG_IMM_CICR_IRQMASK 0x0000e000     // irq priority mask
333
#define CYGARC_REG_IMM_CICR_IRQ_SHIFT 13
334
 
335
// CPM interrupt in-pending register
336
#define CYGARC_REG_IMM_CIPR        (CYGARC_REG_IMM_BASE + 0x944)
337
// CPM interrupt mask register
338
#define CYGARC_REG_IMM_CIMR        (CYGARC_REG_IMM_BASE + 0x948)
339
// CPM interrupt in-service register
340
#define CYGARC_REG_IMM_CISR        (CYGARC_REG_IMM_BASE + 0x94C)
341
 
342
 
343
#define CYGARC_SIU_PRIORITY_LOW    7 // the lowest irq priority
344
#define CYGARC_SIU_PRIORITY_HIGH   0 // the highest irq priority
345
 
346
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
347
 
348
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
349
 
350
//-----------------------------------------------------------------------------
351
// Development Support.
352
#define CYGARC_REG_DER             149
353
 
354
#define CYGARC_REG_ICTRL           158  // instruction support control reg
355
#define CYGARC_REG_ICTRL_SERSHOW   0x00000000 // serialized, show cycles
356
#define CYGARC_REG_ICTRL_NOSERSHOW 0x00000007 //non-serialized&no show cycles
357
 
358
#ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
359
#define DER             CYGARC_REG_DER
360
 
361
#define ICTRL           CYGARC_REG_ICTRL
362
#define ICTRL_SERSHOW   CYGARC_REG_ICTRL_SERSHOW
363
#define ICTRL_NOSERSHOW CYGARC_REG_ICTRL_NOSERSHOW
364
#endif // ifdef CYGARC_HAL_COMMON_EXPORT_CPU_MACROS
365
 
366
//-----------------------------------------------------------------------------
367
#endif // ifdef CYGONCE_HAL_VAR_REGS_H
368
// End of var_regs.h

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.