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