1 | /* ppc.h |
---|
2 | * |
---|
3 | * This file contains definitions for the IBM/Motorola PowerPC |
---|
4 | * family members. |
---|
5 | * |
---|
6 | * Author: Andrew Bray <andy@i-cubed.co.uk> |
---|
7 | * |
---|
8 | * COPYRIGHT (c) 1995 by i-cubed ltd. |
---|
9 | * |
---|
10 | * To anyone who acknowledges that this file is provided "AS IS" |
---|
11 | * without any express or implied warranty: |
---|
12 | * permission to use, copy, modify, and distribute this file |
---|
13 | * for any purpose is hereby granted without fee, provided that |
---|
14 | * the above copyright notice and this notice appears in all |
---|
15 | * copies, and that the name of i-cubed limited not be used in |
---|
16 | * advertising or publicity pertaining to distribution of the |
---|
17 | * software without specific, written prior permission. |
---|
18 | * i-cubed limited makes no representations about the suitability |
---|
19 | * of this software for any purpose. |
---|
20 | * |
---|
21 | * Derived from c/src/exec/cpu/no_cpu/no_cpu.h: |
---|
22 | * |
---|
23 | * COPYRIGHT (c) 1989, 1990, 1991, 1992, 1993, 1994. |
---|
24 | * On-Line Applications Research Corporation (OAR). |
---|
25 | * |
---|
26 | * This material may be reproduced by or for the U.S. Government pursuant |
---|
27 | * to the copyright license under the clause at DFARS 252.227-7013. This |
---|
28 | * notice must appear in all copies of this file and its derivatives. |
---|
29 | * |
---|
30 | * |
---|
31 | * Note: |
---|
32 | * This file is included by both C and assembler code ( -DASM ) |
---|
33 | * |
---|
34 | * $Id$ |
---|
35 | */ |
---|
36 | |
---|
37 | #ifndef _INCLUDE_PPC_h |
---|
38 | #define _INCLUDE_PPC_h |
---|
39 | |
---|
40 | #ifdef __cplusplus |
---|
41 | extern "C" { |
---|
42 | #endif |
---|
43 | |
---|
44 | /* |
---|
45 | * The following define the CPU Family and Model within the family |
---|
46 | * |
---|
47 | * NOTE: The string "REPLACE_THIS_WITH_THE_CPU_MODEL" is replaced |
---|
48 | * with the name of the appropriate macro for this target CPU. |
---|
49 | */ |
---|
50 | |
---|
51 | #ifdef ppc |
---|
52 | #undef ppc |
---|
53 | #endif |
---|
54 | #define ppc |
---|
55 | |
---|
56 | #ifdef REPLACE_THIS_WITH_THE_CPU_MODEL |
---|
57 | #undef REPLACE_THIS_WITH_THE_CPU_MODEL |
---|
58 | #endif |
---|
59 | #define REPLACE_THIS_WITH_THE_CPU_MODEL |
---|
60 | |
---|
61 | #ifdef REPLACE_THIS_WITH_THE_BSP |
---|
62 | #undef REPLACE_THIS_WITH_THE_BSP |
---|
63 | #endif |
---|
64 | #define REPLACE_THIS_WITH_THE_BSP |
---|
65 | |
---|
66 | /* |
---|
67 | * This file contains the information required to build |
---|
68 | * RTEMS for a particular member of the "no cpu" |
---|
69 | * family when executing in protected mode. It does |
---|
70 | * this by setting variables to indicate which implementation |
---|
71 | * dependent features are present in a particular member |
---|
72 | * of the family. |
---|
73 | */ |
---|
74 | |
---|
75 | #if defined(ppc403) |
---|
76 | |
---|
77 | #define CPU_MODEL_NAME "PowerPC 403" |
---|
78 | |
---|
79 | #define PPC_ALIGNMENT 4 |
---|
80 | #define PPC_CACHE_ALIGNMENT 16 |
---|
81 | #define PPC_CACHE_ALIGN_POWER 4 |
---|
82 | #define PPC_INTERRUPT_MAX 16 |
---|
83 | #define PPC_HAS_FPU 0 |
---|
84 | #define PPC_HAS_DOUBLE 0 |
---|
85 | #define PPC_HAS_RFCI 1 |
---|
86 | #define PPC_MSR_DISABLE_MASK 0x00029200 |
---|
87 | #define PPC_MSR_INITIAL 0x00000000 |
---|
88 | #define PPC_INIT_FPSCR 0x00000000 |
---|
89 | #define PPC_USE_MULTIPLE 1 |
---|
90 | #define PPC_I_CACHE 2048 |
---|
91 | #define PPC_D_CACHE 1024 |
---|
92 | |
---|
93 | #define PPC_MSR_0 0x00029200 |
---|
94 | #define PPC_MSR_1 0x00021200 |
---|
95 | #define PPC_MSR_2 0x00021000 |
---|
96 | #define PPC_MSR_3 0x00000000 |
---|
97 | |
---|
98 | #elif defined(ppc601) |
---|
99 | |
---|
100 | #define CPU_MODEL_NAME "PowerPC 601" |
---|
101 | |
---|
102 | #define PPC_ALIGNMENT 8 |
---|
103 | #define PPC_CACHE_ALIGNMENT 32 |
---|
104 | #define PPC_CACHE_ALIGN_POWER 5 |
---|
105 | #define PPC_INTERRUPT_MAX 16 |
---|
106 | #define PPC_HAS_FPU 1 |
---|
107 | #define PPC_HAS_DOUBLE 1 |
---|
108 | #define PPC_HAS_RFCI 0 |
---|
109 | #define PPC_MSR_DISABLE_MASK 0x00009900 |
---|
110 | #define PPC_MSR_INITIAL 0x00002000 |
---|
111 | #define PPC_INIT_FPSCR 0x000000f8 |
---|
112 | #define PPC_USE_MULTIPLE 1 |
---|
113 | #define PPC_I_CACHE 0 |
---|
114 | #define PPC_D_CACHE 32768 |
---|
115 | |
---|
116 | #define PPC_MSR_0 0x00009900 |
---|
117 | #define PPC_MSR_1 0x00001000 |
---|
118 | #define PPC_MSR_2 0x00001000 |
---|
119 | #define PPC_MSR_3 0x00000000 |
---|
120 | |
---|
121 | #elif defined(ppc602) |
---|
122 | |
---|
123 | #define CPU_MODEL_NAME "PowerPC 602" |
---|
124 | |
---|
125 | #define PPC_ALIGNMENT 4 |
---|
126 | #define PPC_CACHE_ALIGNMENT 32 |
---|
127 | #define PPC_CACHE_ALIGN_POWER 5 |
---|
128 | #define PPC_INTERRUPT_MAX 16 |
---|
129 | #define PPC_HAS_FPU 1 |
---|
130 | #define PPC_HAS_DOUBLE 0 |
---|
131 | #define PPC_HAS_RFCI 0 |
---|
132 | #define PPC_MSR_DISABLE_MASK |
---|
133 | #define PPC_MSR_INITIAL |
---|
134 | #define PPC_INIT_FPSCR |
---|
135 | #define PPC_USE_MULTIPLE 0 |
---|
136 | #define PPC_I_CACHE 4096 |
---|
137 | #define PPC_D_CACHE 4096 |
---|
138 | |
---|
139 | #elif defined(ppc603) |
---|
140 | |
---|
141 | #define CPU_MODEL_NAME "PowerPC 603" |
---|
142 | |
---|
143 | #define PPC_ALIGNMENT 8 |
---|
144 | #define PPC_CACHE_ALIGNMENT 32 |
---|
145 | #define PPC_CACHE_ALIGN_POWER 5 |
---|
146 | #define PPC_INTERRUPT_MAX 16 |
---|
147 | #define PPC_HAS_FPU 1 |
---|
148 | #define PPC_HAS_DOUBLE 1 |
---|
149 | #define PPC_HAS_RFCI 0 |
---|
150 | #define PPC_MSR_DISABLE_MASK 0x00009900 |
---|
151 | #define PPC_MSR_INITIAL 0x00002000 |
---|
152 | #define PPC_INIT_FPSCR 0x000000f8 |
---|
153 | #define PPC_USE_MULTIPLE 0 |
---|
154 | #define PPC_I_CACHE 8192 |
---|
155 | #define PPC_D_CACHE 8192 |
---|
156 | |
---|
157 | #define PPC_MSR_0 0x00009900 |
---|
158 | #define PPC_MSR_1 0x00001000 |
---|
159 | #define PPC_MSR_2 0x00001000 |
---|
160 | #define PPC_MSR_3 0x00000000 |
---|
161 | |
---|
162 | #elif defined(ppc603e) |
---|
163 | |
---|
164 | #define CPU_MODEL_NAME "PowerPC 603e" |
---|
165 | |
---|
166 | #define PPC_ALIGNMENT 8 |
---|
167 | #define PPC_CACHE_ALIGNMENT 32 |
---|
168 | #define PPC_CACHE_ALIGN_POWER 5 |
---|
169 | #define PPC_INTERRUPT_MAX 16 |
---|
170 | #define PPC_HAS_FPU 1 |
---|
171 | #define PPC_HAS_DOUBLE 1 |
---|
172 | #define PPC_HAS_RFCI 0 |
---|
173 | #define PPC_MSR_DISABLE_MASK 0x00009900 |
---|
174 | #define PPC_MSR_INITIAL 0x00002000 |
---|
175 | #define PPC_INIT_FPSCR 0x000000f8 |
---|
176 | #define PPC_USE_MULTIPLE 0 |
---|
177 | #define PPC_I_CACHE 16384 |
---|
178 | #define PPC_D_CACHE 16384 |
---|
179 | |
---|
180 | #define PPC_MSR_0 0x00009900 |
---|
181 | #define PPC_MSR_1 0x00001000 |
---|
182 | #define PPC_MSR_2 0x00001000 |
---|
183 | #define PPC_MSR_3 0x00000000 |
---|
184 | |
---|
185 | #elif defined(ppc604) |
---|
186 | |
---|
187 | #define CPU_MODEL_NAME "PowerPC 604" |
---|
188 | |
---|
189 | #define PPC_ALIGNMENT 8 |
---|
190 | #define PPC_CACHE_ALIGNMENT 32 |
---|
191 | #define PPC_CACHE_ALIGN_POWER 5 |
---|
192 | #define PPC_INTERRUPT_MAX 16 |
---|
193 | #define PPC_HAS_FPU 1 |
---|
194 | #define PPC_HAS_DOUBLE 1 |
---|
195 | #define PPC_HAS_RFCI 0 |
---|
196 | #define PPC_MSR_DISABLE_MASK 0x00009900 |
---|
197 | #define PPC_MSR_INITIAL 0x00002000 |
---|
198 | #define PPC_INIT_FPSCR 0x000000f8 |
---|
199 | #define PPC_USE_MULTIPLE 0 |
---|
200 | #define PPC_I_CACHE 16384 |
---|
201 | #define PPC_D_CACHE 16384 |
---|
202 | |
---|
203 | #define PPC_MSR_0 0x00009900 |
---|
204 | #define PPC_MSR_1 0x00001000 |
---|
205 | #define PPC_MSR_2 0x00001000 |
---|
206 | #define PPC_MSR_3 0x00000000 |
---|
207 | |
---|
208 | #else |
---|
209 | |
---|
210 | #error "Unsupported CPU Model" |
---|
211 | |
---|
212 | #endif |
---|
213 | |
---|
214 | /* |
---|
215 | * Application binary interfaces. |
---|
216 | * PPC_ABI MUST be defined as one of these. |
---|
217 | * Only PPC_ABI_POWEROPEN is currently fully supported. |
---|
218 | * Only EABI will be supported in the end when |
---|
219 | * the tools are there. |
---|
220 | * Only big endian is currently supported. |
---|
221 | */ |
---|
222 | /* |
---|
223 | * PowerOpen ABI. This is Andy's hack of the |
---|
224 | * PowerOpen ABI to ELF. ELF rather than a |
---|
225 | * XCOFF assembler is used. This may work |
---|
226 | * if PPC_ASM == PPC_ASM_XCOFF is defined. |
---|
227 | */ |
---|
228 | #define PPC_ABI_POWEROPEN 0 |
---|
229 | /* |
---|
230 | * GCC 2.7.0 munched version of EABI, with |
---|
231 | * PowerOpen calling convention and stack frames, |
---|
232 | * but EABI style indirect function calls. |
---|
233 | */ |
---|
234 | #define PPC_ABI_GCC27 1 |
---|
235 | /* |
---|
236 | * SVR4 ABI |
---|
237 | */ |
---|
238 | #define PPC_ABI_SVR4 2 |
---|
239 | /* |
---|
240 | * Embedded ABI |
---|
241 | */ |
---|
242 | #define PPC_ABI_EABI 3 |
---|
243 | |
---|
244 | #if (PPC_ABI == PPC_ABI_POWEROPEN) |
---|
245 | #define PPC_STACK_ALIGNMENT 8 |
---|
246 | #elif (PPC_ABI == PPC_ABI_GCC27) |
---|
247 | #define PPC_STACK_ALIGNMENT 8 |
---|
248 | #elif (PPC_ABI == PPC_ABI_SVR4) |
---|
249 | #define PPC_STACK_ALIGNMENT 16 |
---|
250 | #elif (PPC_ABI == PPC_ABI_EABI) |
---|
251 | #define PPC_STACK_ALIGNMENT 8 |
---|
252 | #else |
---|
253 | #error "PPC_ABI is not properly defined" |
---|
254 | #endif |
---|
255 | #ifndef PPC_ABI |
---|
256 | #error "PPC_ABI is not properly defined" |
---|
257 | #endif |
---|
258 | |
---|
259 | /* |
---|
260 | * Assemblers. |
---|
261 | * PPC_ASM MUST be defined as one of these. |
---|
262 | * Only PPC_ABI_ELF is currently fully supported. |
---|
263 | */ |
---|
264 | /* |
---|
265 | * ELF assembler. Currently used for all ABIs. |
---|
266 | */ |
---|
267 | #define PPC_ASM_ELF 0 |
---|
268 | /* |
---|
269 | * XCOFF assembler, may be needed for PowerOpen ABI. |
---|
270 | */ |
---|
271 | #define PPC_ASM_XCOFF 1 |
---|
272 | |
---|
273 | /* |
---|
274 | * Define the name of the CPU family. |
---|
275 | */ |
---|
276 | |
---|
277 | #define CPU_NAME "PowerPC" |
---|
278 | |
---|
279 | /* |
---|
280 | * Interrupt vectors. |
---|
281 | */ |
---|
282 | /* Machine check */ |
---|
283 | #define PPC_IRQ_MCHECK 0 |
---|
284 | /* Protection violation */ |
---|
285 | #define PPC_IRQ_PROTECT 1 |
---|
286 | /* External interrupt */ |
---|
287 | #define PPC_IRQ_EXTERNAL 2 |
---|
288 | /* Program exception */ |
---|
289 | #define PPC_IRQ_PROGRAM 3 |
---|
290 | /* System call */ |
---|
291 | #define PPC_IRQ_SCALL 4 |
---|
292 | /* Floating point unavailable */ |
---|
293 | #define PPC_IRQ_NOFP 5 |
---|
294 | /* Program interval timer */ |
---|
295 | #define PPC_IRQ_PIT 6 |
---|
296 | /* Fixed interval timer */ |
---|
297 | #define PPC_IRQ_FIT 7 |
---|
298 | /* Critical interrupt pin */ |
---|
299 | #define PPC_IRQ_CRIT 8 |
---|
300 | /* Watchdog timer */ |
---|
301 | #define PPC_IRQ_WATCHDOG 9 |
---|
302 | /* Debug exceptions */ |
---|
303 | #define PPC_IRQ_DEBUG 10 |
---|
304 | |
---|
305 | /* |
---|
306 | * The following exceptions are not maskable, and are not |
---|
307 | * necessarily predictable, so cannot be offered to RTEMS: |
---|
308 | * Alignment exception - handled by the CPU module |
---|
309 | * Data exceptions. |
---|
310 | * Instruction exceptions. |
---|
311 | */ |
---|
312 | |
---|
313 | #ifdef __cplusplus |
---|
314 | } |
---|
315 | #endif |
---|
316 | |
---|
317 | #endif /* ! _INCLUDE_PPC_h */ |
---|
318 | /* end of include file */ |
---|