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 #ifndef _M68K_SETUP_H
23 #define _M68K_SETUP_H
24 
25 #include <uapi/asm/bootinfo.h>
26 #include <uapi/asm/setup.h>
27 
28 
29 #define CL_SIZE COMMAND_LINE_SIZE
30 
31 #ifndef __ASSEMBLY__
32 extern unsigned long m68k_machtype;
33 #endif /* !__ASSEMBLY__ */
34 
35 #if !defined(CONFIG_AMIGA)
36 #  define MACH_IS_AMIGA (0)
37 #elif defined(CONFIG_ATARI) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
38 	|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)               \
39 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                      \
40 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
41 #  define MACH_IS_AMIGA (m68k_machtype == MACH_AMIGA)
42 #else
43 #  define MACH_AMIGA_ONLY
44 #  define MACH_IS_AMIGA (1)
45 #  define MACH_TYPE (MACH_AMIGA)
46 #endif
47 
48 #if !defined(CONFIG_ATARI)
49 #  define MACH_IS_ATARI (0)
50 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_APOLLO) \
51 	|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)               \
52 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                      \
53 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
54 #  define MACH_IS_ATARI (m68k_machtype == MACH_ATARI)
55 #else
56 #  define MACH_ATARI_ONLY
57 #  define MACH_IS_ATARI (1)
58 #  define MACH_TYPE (MACH_ATARI)
59 #endif
60 
61 #if !defined(CONFIG_MAC)
62 #  define MACH_IS_MAC (0)
63 #elif defined(CONFIG_AMIGA) || defined(CONFIG_ATARI) || defined(CONFIG_APOLLO) \
64 	|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)                 \
65 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                        \
66 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
67 #  define MACH_IS_MAC (m68k_machtype == MACH_MAC)
68 #else
69 #  define MACH_MAC_ONLY
70 #  define MACH_IS_MAC (1)
71 #  define MACH_TYPE (MACH_MAC)
72 #endif
73 
74 #if defined(CONFIG_SUN3)
75 #define MACH_IS_SUN3 (1)
76 #define MACH_SUN3_ONLY (1)
77 #define MACH_TYPE (MACH_SUN3)
78 #else
79 #define MACH_IS_SUN3 (0)
80 #endif
81 
82 #if !defined (CONFIG_APOLLO)
83 #  define MACH_IS_APOLLO (0)
84 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
85 	|| defined(CONFIG_MVME16x) || defined(CONFIG_BVME6000)              \
86 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
87 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
88 #  define MACH_IS_APOLLO (m68k_machtype == MACH_APOLLO)
89 #else
90 #  define MACH_APOLLO_ONLY
91 #  define MACH_IS_APOLLO (1)
92 #  define MACH_TYPE (MACH_APOLLO)
93 #endif
94 
95 #if !defined (CONFIG_MVME147)
96 #  define MACH_IS_MVME147 (0)
97 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
98 	|| defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000)               \
99 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
100 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME16x)
101 #  define MACH_IS_MVME147 (m68k_machtype == MACH_MVME147)
102 #else
103 #  define MACH_MVME147_ONLY
104 #  define MACH_IS_MVME147 (1)
105 #  define MACH_TYPE (MACH_MVME147)
106 #endif
107 
108 #if !defined (CONFIG_MVME16x)
109 #  define MACH_IS_MVME16x (0)
110 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
111 	|| defined(CONFIG_APOLLO) || defined(CONFIG_BVME6000)               \
112 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
113 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
114 #  define MACH_IS_MVME16x (m68k_machtype == MACH_MVME16x)
115 #else
116 #  define MACH_MVME16x_ONLY
117 #  define MACH_IS_MVME16x (1)
118 #  define MACH_TYPE (MACH_MVME16x)
119 #endif
120 
121 #if !defined (CONFIG_BVME6000)
122 #  define MACH_IS_BVME6000 (0)
123 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
124 	|| defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)                \
125 	|| defined(CONFIG_HP300) || defined(CONFIG_Q40)                     \
126 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
127 #  define MACH_IS_BVME6000 (m68k_machtype == MACH_BVME6000)
128 #else
129 #  define MACH_BVME6000_ONLY
130 #  define MACH_IS_BVME6000 (1)
131 #  define MACH_TYPE (MACH_BVME6000)
132 #endif
133 
134 #if !defined (CONFIG_HP300)
135 #  define MACH_IS_HP300 (0)
136 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
137 	|| defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x) \
138 	|| defined(CONFIG_BVME6000) || defined(CONFIG_Q40) \
139 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
140 #  define MACH_IS_HP300 (m68k_machtype == MACH_HP300)
141 #else
142 #  define MACH_HP300_ONLY
143 #  define MACH_IS_HP300 (1)
144 #  define MACH_TYPE (MACH_HP300)
145 #endif
146 
147 #if !defined (CONFIG_Q40)
148 #  define MACH_IS_Q40 (0)
149 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
150 	|| defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)                \
151 	|| defined(CONFIG_BVME6000) || defined(CONFIG_HP300)                \
152 	|| defined(CONFIG_SUN3X) || defined(CONFIG_MVME147)
153 #  define MACH_IS_Q40 (m68k_machtype == MACH_Q40)
154 #else
155 #  define MACH_Q40_ONLY
156 #  define MACH_IS_Q40 (1)
157 #  define MACH_TYPE (MACH_Q40)
158 #endif
159 
160 #if !defined (CONFIG_SUN3X)
161 #  define MACH_IS_SUN3X (0)
162 #elif defined(CONFIG_AMIGA) || defined(CONFIG_MAC) || defined(CONFIG_ATARI) \
163 	|| defined(CONFIG_APOLLO) || defined(CONFIG_MVME16x)                \
164 	|| defined(CONFIG_BVME6000) || defined(CONFIG_HP300)                \
165 	|| defined(CONFIG_Q40) || defined(CONFIG_MVME147)
166 #  define MACH_IS_SUN3X (m68k_machtype == MACH_SUN3X)
167 #else
168 #  define CONFIG_SUN3X_ONLY
169 #  define MACH_IS_SUN3X (1)
170 #  define MACH_TYPE (MACH_SUN3X)
171 #endif
172 
173 #ifndef MACH_TYPE
174 #  define MACH_TYPE (m68k_machtype)
175 #endif
176 
177 
178 #ifndef __ASSEMBLY__
179 extern unsigned long m68k_cputype;
180 extern unsigned long m68k_fputype;
181 extern unsigned long m68k_mmutype;
182 #ifdef CONFIG_VME
183 extern unsigned long vme_brdtype;
184 #endif
185 
186     /*
187      *  m68k_is040or060 is != 0 for a '040 or higher;
188      *  used numbers are 4 for 68040 and 6 for 68060.
189      */
190 
191 extern int m68k_is040or060;
192 #endif /* !__ASSEMBLY__ */
193 
194 #if !defined(CONFIG_M68020)
195 #  define CPU_IS_020 (0)
196 #  define MMU_IS_851 (0)
197 #  define MMU_IS_SUN3 (0)
198 #elif defined(CONFIG_M68030) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
199 #  define CPU_IS_020 (m68k_cputype & CPU_68020)
200 #  define MMU_IS_851 (m68k_mmutype & MMU_68851)
201 #  define MMU_IS_SUN3 (0)	/* Sun3 not supported with other CPU enabled */
202 #else
203 #  define CPU_M68020_ONLY
204 #  define CPU_IS_020 (1)
205 #ifdef MACH_SUN3_ONLY
206 #  define MMU_IS_SUN3 (1)
207 #  define MMU_IS_851 (0)
208 #else
209 #  define MMU_IS_SUN3 (0)
210 #  define MMU_IS_851 (1)
211 #endif
212 #endif
213 
214 #if !defined(CONFIG_M68030)
215 #  define CPU_IS_030 (0)
216 #  define MMU_IS_030 (0)
217 #elif defined(CONFIG_M68020) || defined(CONFIG_M68040) || defined(CONFIG_M68060)
218 #  define CPU_IS_030 (m68k_cputype & CPU_68030)
219 #  define MMU_IS_030 (m68k_mmutype & MMU_68030)
220 #else
221 #  define CPU_M68030_ONLY
222 #  define CPU_IS_030 (1)
223 #  define MMU_IS_030 (1)
224 #endif
225 
226 #if !defined(CONFIG_M68040)
227 #  define CPU_IS_040 (0)
228 #  define MMU_IS_040 (0)
229 #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68060)
230 #  define CPU_IS_040 (m68k_cputype & CPU_68040)
231 #  define MMU_IS_040 (m68k_mmutype & MMU_68040)
232 #else
233 #  define CPU_M68040_ONLY
234 #  define CPU_IS_040 (1)
235 #  define MMU_IS_040 (1)
236 #endif
237 
238 #if !defined(CONFIG_M68060)
239 #  define CPU_IS_060 (0)
240 #  define MMU_IS_060 (0)
241 #elif defined(CONFIG_M68020) || defined(CONFIG_M68030) || defined(CONFIG_M68040)
242 #  define CPU_IS_060 (m68k_cputype & CPU_68060)
243 #  define MMU_IS_060 (m68k_mmutype & MMU_68060)
244 #else
245 #  define CPU_M68060_ONLY
246 #  define CPU_IS_060 (1)
247 #  define MMU_IS_060 (1)
248 #endif
249 
250 #if !defined(CONFIG_M68020) && !defined(CONFIG_M68030)
251 #  define CPU_IS_020_OR_030 (0)
252 #else
253 #  define CPU_M68020_OR_M68030
254 #  if defined(CONFIG_M68040) || defined(CONFIG_M68060)
255 #    define CPU_IS_020_OR_030 (!m68k_is040or060)
256 #  else
257 #    define CPU_M68020_OR_M68030_ONLY
258 #    define CPU_IS_020_OR_030 (1)
259 #  endif
260 #endif
261 
262 #if !defined(CONFIG_M68040) && !defined(CONFIG_M68060)
263 #  define CPU_IS_040_OR_060 (0)
264 #else
265 #  define CPU_M68040_OR_M68060
266 #  if defined(CONFIG_M68020) || defined(CONFIG_M68030)
267 #    define CPU_IS_040_OR_060 (m68k_is040or060)
268 #  else
269 #    define CPU_M68040_OR_M68060_ONLY
270 #    define CPU_IS_040_OR_060 (1)
271 #  endif
272 #endif
273 
274 #if !defined(CONFIG_COLDFIRE)
275 #  define CPU_IS_COLDFIRE (0)
276 #else
277 #  define CPU_IS_COLDFIRE (1)
278 #  define MMU_IS_COLDFIRE (1)
279 #endif
280 
281 #define CPU_TYPE (m68k_cputype)
282 
283 #ifdef CONFIG_M68KFPU_EMU
284 #  ifdef CONFIG_M68KFPU_EMU_ONLY
285 #    define FPU_IS_EMU (1)
286 #  else
287 #    define FPU_IS_EMU (!m68k_fputype)
288 #  endif
289 #else
290 #  define FPU_IS_EMU (0)
291 #endif
292 
293 
294     /*
295      *  Miscellaneous
296      */
297 
298 #define NUM_MEMINFO	4
299 
300 #ifndef __ASSEMBLY__
301 struct m68k_mem_info {
302 	unsigned long addr;		/* physical address of memory chunk */
303 	unsigned long size;		/* length of memory chunk (in bytes) */
304 };
305 
306 extern int m68k_num_memory;		/* # of memory blocks found (and used) */
307 extern int m68k_realnum_memory;		/* real # of memory blocks found */
308 extern struct m68k_mem_info m68k_memory[NUM_MEMINFO];/* memory description */
309 #endif
310 
311 #endif /* _M68K_SETUP_H */
312