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