]> rtime.felk.cvut.cz Git - mcf548x/linux.git/blob - arch/m68k/include/asm/setup.h
Various compilation fixes.
[mcf548x/linux.git] / arch / m68k / include / asm / setup.h
1 /*
2 ** asm/setup.h -- Definition of the Linux/m68k setup information
3 **
4 ** Copyright 1992 by Greg Harp
5 **
6 ** This file is subject to the terms and conditions of the GNU General Public
7 ** License.  See the file COPYING in the main directory of this archive
8 ** for more details.
9 **
10 ** Created 09/29/92 by Greg Harp
11 **
12 ** 5/2/94 Roman Hodek:
13 **   Added bi_atari part of the machine dependent union bi_un; for now it
14 **   contains just a model field to distinguish between TT and Falcon.
15 ** 26/7/96 Roman Zippel:
16 **   Renamed to setup.h; added some useful macros to allow gcc some
17 **   optimizations if possible.
18 ** 5/10/96 Geert Uytterhoeven:
19 **   Redesign of the boot information structure; moved boot information
20 **   structure to bootinfo.h
21 */
22
23 #ifndef _M68K_SETUP_H
24 #define _M68K_SETUP_H
25
26
27
28     /*
29      *  Linux/m68k Architectures
30      */
31
32 #define MACH_AMIGA    1
33 #define MACH_ATARI    2
34 #define MACH_MAC      3
35 #define MACH_APOLLO   4
36 #define MACH_SUN3     5
37 #define MACH_MVME147  6
38 #define MACH_MVME16x  7
39 #define MACH_BVME6000 8
40 #define MACH_HP300    9
41 #define MACH_Q40     10
42 #define MACH_SUN3X   11
43 #define MACH_CFMMU   12
44
45 #define COMMAND_LINE_SIZE 256
46
47 #ifdef __KERNEL__
48
49 #define CL_SIZE COMMAND_LINE_SIZE
50
51 #ifndef __ASSEMBLY__
52 extern unsigned long m68k_machtype;
53 #endif /* !__ASSEMBLY__ */
54
55 #if !defined(CONFIG_AMIGA)
56 #  define MACH_IS_AMIGA (0)
57 #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
58         || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)               \
59         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                      \
60         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
61 #  define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
62 #else
63 #  define MACH_AMIGA_ONLY
64 #  define MACH_IS_AMIGA (1)
65 #  define MACH_TYPE (MACH_AMIGA)
66 #endif
67
68 #if !defined(CONFIG_ATARI)
69 #  define MACH_IS_ATARI (0)
70 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
71         || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)               \
72         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                      \
73         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
74 #  define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
75 #else
76 #  define MACH_ATARI_ONLY
77 #  define MACH_IS_ATARI (1)
78 #  define MACH_TYPE (MACH_ATARI)
79 #endif
80
81 #if !defined(CONFIG_MAC)
82 #  define MACH_IS_MAC (0)
83 #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
84         || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)                 \
85         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                        \
86         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
87 #  define MACH_IS_MAC (m68k_machtype == MACH_MAC)
88 #else
89 #  define MACH_MAC_ONLY
90 #  define MACH_IS_MAC (1)
91 #  define MACH_TYPE (MACH_MAC)
92 #endif
93
94 #if defined(CONFIG_SUN3)
95 #define MACH_IS_SUN3 (1)
96 #define MACH_SUN3_ONLY (1)
97 #define MACH_TYPE (MACH_SUN3)
98 #else
99 #define MACH_IS_SUN3 (0)
100 #endif
101
102 #if !defined (CONFIG_APOLLO)
103 #  define MACH_IS_APOLLO (0)
104 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
105         || defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)              \
106         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
107         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
108 #  define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
109 #else
110 #  define MACH_APOLLO_ONLY
111 #  define MACH_IS_APOLLO (1)
112 #  define MACH_TYPE (MACH_APOLLO)
113 #endif
114
115 #if !defined (CONFIG_MVME147)
116 #  define MACH_IS_MVME147 (0)
117 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
118         || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000)               \
119         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
120         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x)
121 #  define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147)
122 #else
123 #  define MACH_MVME147_ONLY
124 #  define MACH_IS_MVME147 (1)
125 #  define MACH_TYPE (MACH_MVME147)
126 #endif
127
128 #if !defined (CONFIG_MVME16x)
129 #  define MACH_IS_MVME16x (0)
130 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
131         || defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000)               \
132         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
133         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
134 #  define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
135 #else
136 #  define MACH_MVME16x_ONLY
137 #  define MACH_IS_MVME16x (1)
138 #  define MACH_TYPE (MACH_MVME16x)
139 #endif
140
141 #if !defined (CONFIG_BVME6000)
142 #  define MACH_IS_BVME6000 (0)
143 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
144         || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)                \
145         || defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
146         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
147 #  define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
148 #else
149 #  define MACH_BVME6000_ONLY
150 #  define MACH_IS_BVME6000 (1)
151 #  define MACH_TYPE (MACH_BVME6000)
152 #endif
153
154 #if !defined (CONFIG_HP300)
155 #  define MACH_IS_HP300 (0)
156 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
157         || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
158         || defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
159         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
160 #  define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
161 #else
162 #  define MACH_HP300_ONLY
163 #  define MACH_IS_HP300 (1)
164 #  define MACH_TYPE (MACH_HP300)
165 #endif
166
167 #if !defined (CONFIG_Q40)
168 #  define MACH_IS_Q40 (0)
169 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
170         || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)                \
171         || defined(CONFIG_BVME6000) || defined(CONFIG_HP300)                \
172         || defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
173 #  define MACH_IS_Q40 (m68k_machtype == MACH_Q40)
174 #else
175 #  define MACH_Q40_ONLY
176 #  define MACH_IS_Q40 (1)
177 #  define MACH_TYPE (MACH_Q40)
178 #endif
179
180 #if !defined (CONFIG_SUN3X)
181 #  define MACH_IS_SUN3X (0)
182 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
183         || defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)                \
184         || defined(CONFIG_BVME6000) || defined(CONFIG_HP300)                \
185         || defined(CONFIG_Q40) || defined(CONFIG_MVME147)
186 #  define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X)
187 #else
188 #  define CONFIG_SUN3X_ONLY
189 #  define MACH_IS_SUN3X (1)
190 #  define MACH_TYPE (MACH_SUN3X)
191 #endif
192
193 #if !defined(CONFIG_COLDFIRE)
194 #  define MACH_IS_COLDFIRE (0)
195 #else
196 #  define CONFIG_COLDFIRE_ONLY
197 #  define MACH_IS_COLDFIRE (1)
198 #  define MACH_TYPE (MACH_CFMMU)
199 #endif
200
201 #ifndef MACH_TYPE
202 #  define MACH_TYPE (m68k_machtype)
203 #endif
204
205 #endif /* __KERNEL__ */
206
207
208     /*
209      *  CPU, FPU and MMU types
210      *
211      *  Note: we may rely on the following equalities:
212      *
213      *      CPU_68020 == MMU_68851
214      *      CPU_68030 == MMU_68030
215      *      CPU_68040 == FPU_68040 == MMU_68040
216      *      CPU_68060 == FPU_68060 == MMU_68060
217      */
218
219 #define CPUB_68020     0
220 #define CPUB_68030     1
221 #define CPUB_68040     2
222 #define CPUB_68060     3
223 #define CPUB_CFV4E     4
224
225 #define CPU_68020      (1<<CPUB_68020)
226 #define CPU_68030      (1<<CPUB_68030)
227 #define CPU_68040      (1<<CPUB_68040)
228 #define CPU_68060      (1<<CPUB_68060)
229 #define CPU_CFV4E      (1<<CPUB_CFV4E)
230
231 #define FPUB_68881     0
232 #define FPUB_68882     1
233 #define FPUB_68040     2                       /* Internal FPU */
234 #define FPUB_68060     3                       /* Internal FPU */
235 #define FPUB_SUNFPA    4                       /* Sun-3 FPA */
236 #define FPUB_CFV4E     5
237
238 #define FPU_68881      (1<<FPUB_68881)
239 #define FPU_68882      (1<<FPUB_68882)
240 #define FPU_68040      (1<<FPUB_68040)
241 #define FPU_68060      (1<<FPUB_68060)
242 #define FPU_SUNFPA     (1<<FPUB_SUNFPA)
243 #ifndef CONFIG_M5445X
244 #define FPU_CFV4E      (1<<FPUB_CFV4E)                          /* No FPU on M5445X */
245 #else
246 #define FPU_CFV4E      0
247 #endif
248
249 #define MMUB_68851     0
250 #define MMUB_68030     1                       /* Internal MMU */
251 #define MMUB_68040     2                       /* Internal MMU */
252 #define MMUB_68060     3                       /* Internal MMU */
253 #define MMUB_APOLLO    4                       /* Custom Apollo */
254 #define MMUB_SUN3      5                       /* Custom Sun-3 */
255 #define MMUB_CFV4E     6
256
257 #define MMU_68851      (1<<MMUB_68851)
258 #define MMU_68030      (1<<MMUB_68030)
259 #define MMU_68040      (1<<MMUB_68040)
260 #define MMU_68060      (1<<MMUB_68060)
261 #define MMU_SUN3       (1<<MMUB_SUN3)
262 #define MMU_APOLLO     (1<<MMUB_APOLLO)
263 #define MMU_CFV4E      (1<<MMUB_CFV4E)
264
265 #ifdef __KERNEL__
266
267 #ifndef __ASSEMBLY__
268 extern unsigned long m68k_cputype;
269 extern unsigned long m68k_fputype;
270 extern unsigned long m68k_mmutype;
271 #ifdef CONFIG_VME
272 extern unsigned long vme_brdtype;
273 #endif
274
275     /*
276      *  m68k_is040or060 is != 0 for a '040 or higher;
277      *  used numbers are 4 for 68040 and 6 for 68060.
278      */
279
280 extern int m68k_is040or060;
281 #endif /* !__ASSEMBLY__ */
282
283 #if !defined(CONFIG_M68020)
284 #  define CPU_IS_020 (0)
285 #  define MMU_IS_851 (0)
286 #  define MMU_IS_SUN3 (0)
287 #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
288 #  define CPU_IS_020 (m68k_cputype & CPU_68020)
289 #  define MMU_IS_851 (m68k_mmutype & MMU_68851)
290 #  define MMU_IS_SUN3 (0)       /* Sun3 not supported with other CPU enabled */
291 #else
292 #  define CPU_M68020_ONLY
293 #  define CPU_IS_020 (1)
294 #ifdef MACH_SUN3_ONLY
295 #  define MMU_IS_SUN3 (1)
296 #  define MMU_IS_851 (0)
297 #else
298 #  define MMU_IS_SUN3 (0)
299 #  define MMU_IS_851 (1)
300 #endif
301 #endif
302
303 #if !defined(CONFIG_M68030)
304 #  define CPU_IS_030 (0)
305 #  define MMU_IS_030 (0)
306 #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
307 #  define CPU_IS_030 (m68k_cputype & CPU_68030)
308 #  define MMU_IS_030 (m68k_mmutype & MMU_68030)
309 #else
310 #  define CPU_M68030_ONLY
311 #  define CPU_IS_030 (1)
312 #  define MMU_IS_030 (1)
313 #endif
314
315 #if !defined(CONFIG_M68040)
316 #  define CPU_IS_040 (0)
317 #  define MMU_IS_040 (0)
318 #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
319 #  define CPU_IS_040 (m68k_cputype & CPU_68040)
320 #  define MMU_IS_040 (m68k_mmutype & MMU_68040)
321 #else
322 #  define CPU_M68040_ONLY
323 #  define CPU_IS_040 (1)
324 #  define MMU_IS_040 (1)
325 #endif
326
327 #if !defined(CONFIG_M68060)
328 #  define CPU_IS_060 (0)
329 #  define MMU_IS_060 (0)
330 #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
331 #  define CPU_IS_060 (m68k_cputype & CPU_68060)
332 #  define MMU_IS_060 (m68k_mmutype & MMU_68060)
333 #else
334 #  define CPU_M68060_ONLY
335 #  define CPU_IS_060 (1)
336 #  define MMU_IS_060 (1)
337 #endif
338
339 #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
340 #  define CPU_IS_020_OR_030 (0)
341 #else
342 #  define CPU_M68020_OR_M68030
343 #  if defined(CONFIG_M68040) || defined(CONFIG_M68060)
344 #    define CPU_IS_020_OR_030 (!m68k_is040or060)
345 #  else
346 #    define CPU_M68020_OR_M68030_ONLY
347 #    define CPU_IS_020_OR_030 (1)
348 #  endif
349 #endif
350
351 #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
352 #  define CPU_IS_040_OR_060 (0)
353 #else
354 #  define CPU_M68040_OR_M68060
355 #  if defined(CONFIG_M68020) || defined(CONFIG_M68030)
356 #    define CPU_IS_040_OR_060 (m68k_is040or060)
357 #  else
358 #    define CPU_M68040_OR_M68060_ONLY
359 #    define CPU_IS_040_OR_060 (1)
360 #  endif
361 #endif
362
363 #if !defined(CONFIG_CFV4E)
364 #  define CPU_IS_COLDFIRE (0)
365 #else
366 #  define CPU_IS_COLDFIRE (1)
367 #  define CPU_IS_CFV4E    (1)
368 #  define MMU_IS_CFV4E    (1)
369 #endif
370
371 #define CPU_TYPE (m68k_cputype)
372
373 #ifdef CONFIG_M68KFPU_EMU
374 #  ifdef CONFIG_M68KFPU_EMU_ONLY
375 #    define FPU_IS_EMU (1)
376 #  else
377 #    define FPU_IS_EMU (!m68k_fputype)
378 #  endif
379 #else
380 #  define FPU_IS_EMU (0)
381 #endif
382
383
384     /*
385      *  Miscellaneous
386      */
387
388 #define NUM_MEMINFO     4
389
390 #ifndef __ASSEMBLY__
391 struct mem_info {
392         unsigned long addr;             /* physical address of memory chunk */
393         unsigned long size;             /* length of memory chunk (in bytes) */
394 };
395
396 extern int m68k_num_memory;             /* # of memory blocks found (and used) */
397 extern int m68k_realnum_memory;         /* real # of memory blocks found */
398 extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */
399 #endif
400
401 #endif /* __KERNEL__ */
402
403 #endif /* _M68K_SETUP_H */