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