1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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
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
188
189
190
191 extern int m68k_is040or060;
192 #endif
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)
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
296
297
298 #define NUM_MEMINFO 4
299
300 #ifndef __ASSEMBLY__
301 struct m68k_mem_info {
302 unsigned long addr;
303 unsigned long size;
304 };
305
306 extern int m68k_num_memory;
307 extern int m68k_realnum_memory;
308 extern struct m68k_mem_info m68k_memory[NUM_MEMINFO];
309 #endif
310
311 #endif