1 /* 2 ** asm/bootinfo.h -- Definition of the Linux/m68k boot information structure 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; renamed to bootinfo.h again 20 ** 27/11/96 Geert Uytterhoeven: 21 ** Backwards compatibility with bootinfo interface version 1.0 22 */ 23 24 #ifndef _M68K_BOOTINFO_H 25 #define _M68K_BOOTINFO_H 26 27 28 /* 29 * Bootinfo definitions 30 * 31 * This is an easily parsable and extendable structure containing all 32 * information to be passed from the bootstrap to the kernel. 33 * 34 * This way I hope to keep all future changes back/forewards compatible. 35 * Thus, keep your fingers crossed... 36 * 37 * This structure is copied right after the kernel bss by the bootstrap 38 * routine. 39 */ 40 41 #ifndef __ASSEMBLY__ 42 43 struct bi_record { 44 unsigned short tag; /* tag ID */ 45 unsigned short size; /* size of record (in bytes) */ 46 unsigned long data[0]; /* data */ 47 }; 48 49 #endif /* __ASSEMBLY__ */ 50 51 52 /* 53 * Tag Definitions 54 * 55 * Machine independent tags start counting from 0x0000 56 * Machine dependent tags start counting from 0x8000 57 */ 58 59 #define BI_LAST 0x0000 /* last record (sentinel) */ 60 #define BI_MACHTYPE 0x0001 /* machine type (u_long) */ 61 #define BI_CPUTYPE 0x0002 /* cpu type (u_long) */ 62 #define BI_FPUTYPE 0x0003 /* fpu type (u_long) */ 63 #define BI_MMUTYPE 0x0004 /* mmu type (u_long) */ 64 #define BI_MEMCHUNK 0x0005 /* memory chunk address and size */ 65 /* (struct mem_info) */ 66 #define BI_RAMDISK 0x0006 /* ramdisk address and size */ 67 /* (struct mem_info) */ 68 #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */ 69 /* (string) */ 70 71 /* 72 * Amiga-specific tags 73 */ 74 75 #define BI_AMIGA_MODEL 0x8000 /* model (u_long) */ 76 #define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */ 77 /* (struct ConfigDev) */ 78 #define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */ 79 #define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */ 80 #define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */ 81 #define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */ 82 #define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */ 83 #define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */ 84 85 /* 86 * Atari-specific tags 87 */ 88 89 #define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */ 90 #define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */ 91 /* (values are ATARI_MACH_* defines */ 92 93 /* mch_cookie values (upper word) */ 94 #define ATARI_MCH_ST 0 95 #define ATARI_MCH_STE 1 96 #define ATARI_MCH_TT 2 97 #define ATARI_MCH_FALCON 3 98 99 /* mch_type values */ 100 #define ATARI_MACH_NORMAL 0 /* no special machine type */ 101 #define ATARI_MACH_MEDUSA 1 /* Medusa 040 */ 102 #define ATARI_MACH_HADES 2 /* Hades 040 or 060 */ 103 #define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */ 104 105 /* 106 * VME-specific tags 107 */ 108 109 #define BI_VME_TYPE 0x8000 /* VME sub-architecture (u_long) */ 110 #define BI_VME_BRDINFO 0x8001 /* VME board information (struct) */ 111 112 /* BI_VME_TYPE codes */ 113 #define VME_TYPE_TP34V 0x0034 /* Tadpole TP34V */ 114 #define VME_TYPE_MVME147 0x0147 /* Motorola MVME147 */ 115 #define VME_TYPE_MVME162 0x0162 /* Motorola MVME162 */ 116 #define VME_TYPE_MVME166 0x0166 /* Motorola MVME166 */ 117 #define VME_TYPE_MVME167 0x0167 /* Motorola MVME167 */ 118 #define VME_TYPE_MVME172 0x0172 /* Motorola MVME172 */ 119 #define VME_TYPE_MVME177 0x0177 /* Motorola MVME177 */ 120 #define VME_TYPE_BVME4000 0x4000 /* BVM Ltd. BVME4000 */ 121 #define VME_TYPE_BVME6000 0x6000 /* BVM Ltd. BVME6000 */ 122 123 /* BI_VME_BRDINFO is a 32 byte struct as returned by the Bug code on 124 * Motorola VME boards. Contains board number, Bug version, board 125 * configuration options, etc. See include/asm/mvme16xhw.h for details. 126 */ 127 128 129 /* 130 * Macintosh-specific tags (all u_long) 131 */ 132 133 #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */ 134 #define BI_MAC_VADDR 0x8001 /* Mac video base address */ 135 #define BI_MAC_VDEPTH 0x8002 /* Mac video depth */ 136 #define BI_MAC_VROW 0x8003 /* Mac video rowbytes */ 137 #define BI_MAC_VDIM 0x8004 /* Mac video dimensions */ 138 #define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */ 139 #define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */ 140 #define BI_MAC_BTIME 0x8007 /* Mac boot time */ 141 #define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */ 142 #define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */ 143 #define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */ 144 #define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */ 145 146 /* 147 * Macintosh hardware profile data - unused, see macintosh.h for 148 * resonable type values 149 */ 150 151 #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */ 152 #define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */ 153 #define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */ 154 #define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */ 155 #define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */ 156 #define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */ 157 #define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */ 158 #define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */ 159 #define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */ 160 #define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */ 161 #define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */ 162 #define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */ 163 #define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */ 164 #define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */ 165 #define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */ 166 #define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */ 167 #define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */ 168 #define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */ 169 170 /* 171 * Mac: compatibility with old booter data format (temporarily) 172 * Fields unused with the new bootinfo can be deleted now; instead of 173 * adding new fields the struct might be splitted into a hardware address 174 * part and a hardware type part 175 */ 176 177 #ifndef __ASSEMBLY__ 178 179 struct mac_booter_data 180 { 181 unsigned long videoaddr; 182 unsigned long videorow; 183 unsigned long videodepth; 184 unsigned long dimensions; 185 unsigned long args; 186 unsigned long boottime; 187 unsigned long gmtbias; 188 unsigned long bootver; 189 unsigned long videological; 190 unsigned long sccbase; 191 unsigned long id; 192 unsigned long memsize; 193 unsigned long serialmf; 194 unsigned long serialhsk; 195 unsigned long serialgpi; 196 unsigned long printmf; 197 unsigned long printhsk; 198 unsigned long printgpi; 199 unsigned long cpuid; 200 unsigned long rombase; 201 unsigned long adbdelay; 202 unsigned long timedbra; 203 }; 204 205 extern struct mac_booter_data 206 mac_bi_data; 207 208 #endif 209 210 /* 211 * Apollo-specific tags 212 */ 213 214 #define BI_APOLLO_MODEL 0x8000 /* model (u_long) */ 215 216 217 218 /* 219 * Stuff for bootinfo interface versioning 220 * 221 * At the start of kernel code, a 'struct bootversion' is located. 222 * bootstrap checks for a matching version of the interface before booting 223 * a kernel, to avoid user confusion if kernel and bootstrap don't work 224 * together :-) 225 * 226 * If incompatible changes are made to the bootinfo interface, the major 227 * number below should be stepped (and the minor reset to 0) for the 228 * appropriate machine. If a change is backward-compatible, the minor 229 * should be stepped. "Backwards-compatible" means that booting will work, 230 * but certain features may not. 231 */ 232 233 #define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */ 234 #define MK_BI_VERSION(major,minor) (((major)<<16)+(minor)) 235 #define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff) 236 #define BI_VERSION_MINOR(v) ((v) & 0xffff) 237 238 #ifndef __ASSEMBLY__ 239 240 struct bootversion { 241 unsigned short branch; 242 unsigned long magic; 243 struct { 244 unsigned long machtype; 245 unsigned long version; 246 } machversions[0]; 247 }; 248 249 #endif /* __ASSEMBLY__ */ 250 251 #define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) 252 #define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 ) 253 #define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) 254 #define MVME147_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) 255 #define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) 256 #define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) 257 #define Q40_BOOTI_VERSION MK_BI_VERSION( 2, 0 ) 258 259 #ifdef BOOTINFO_COMPAT_1_0 260 261 /* 262 * Backwards compatibility with bootinfo interface version 1.0 263 */ 264 265 #define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) 266 #define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) 267 #define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 ) 268 269 #include <linux/zorro.h> 270 271 #define COMPAT_NUM_AUTO 16 272 273 struct compat_bi_Amiga { 274 int model; 275 int num_autocon; 276 struct ConfigDev autocon[COMPAT_NUM_AUTO]; 277 unsigned long chip_size; 278 unsigned char vblank; 279 unsigned char psfreq; 280 unsigned long eclock; 281 unsigned long chipset; 282 unsigned long hw_present; 283 }; 284 285 struct compat_bi_Atari { 286 unsigned long hw_present; 287 unsigned long mch_cookie; 288 }; 289 290 #ifndef __ASSEMBLY__ 291 292 struct compat_bi_Macintosh 293 { 294 unsigned long videoaddr; 295 unsigned long videorow; 296 unsigned long videodepth; 297 unsigned long dimensions; 298 unsigned long args; 299 unsigned long boottime; 300 unsigned long gmtbias; 301 unsigned long bootver; 302 unsigned long videological; 303 unsigned long sccbase; 304 unsigned long id; 305 unsigned long memsize; 306 unsigned long serialmf; 307 unsigned long serialhsk; 308 unsigned long serialgpi; 309 unsigned long printmf; 310 unsigned long printhsk; 311 unsigned long printgpi; 312 unsigned long cpuid; 313 unsigned long rombase; 314 unsigned long adbdelay; 315 unsigned long timedbra; 316 }; 317 318 #endif 319 320 struct compat_mem_info { 321 unsigned long addr; 322 unsigned long size; 323 }; 324 325 #define COMPAT_NUM_MEMINFO 4 326 327 #define COMPAT_CPUB_68020 0 328 #define COMPAT_CPUB_68030 1 329 #define COMPAT_CPUB_68040 2 330 #define COMPAT_CPUB_68060 3 331 #define COMPAT_FPUB_68881 5 332 #define COMPAT_FPUB_68882 6 333 #define COMPAT_FPUB_68040 7 334 #define COMPAT_FPUB_68060 8 335 336 #define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020) 337 #define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030) 338 #define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040) 339 #define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060) 340 #define COMPAT_CPU_MASK (31) 341 #define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881) 342 #define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882) 343 #define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040) 344 #define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060) 345 #define COMPAT_FPU_MASK (0xfe0) 346 347 #define COMPAT_CL_SIZE (256) 348 349 struct compat_bootinfo { 350 unsigned long machtype; 351 unsigned long cputype; 352 struct compat_mem_info memory[COMPAT_NUM_MEMINFO]; 353 int num_memory; 354 unsigned long ramdisk_size; 355 unsigned long ramdisk_addr; 356 char command_line[COMPAT_CL_SIZE]; 357 union { 358 struct compat_bi_Amiga bi_ami; 359 struct compat_bi_Atari bi_ata; 360 struct compat_bi_Macintosh bi_mac; 361 } bi_un; 362 }; 363 364 #define bi_amiga bi_un.bi_ami 365 #define bi_atari bi_un.bi_ata 366 #define bi_mac bi_un.bi_mac 367 368 #endif /* BOOTINFO_COMPAT_1_0 */ 369 370 371 #endif /* _M68K_BOOTINFO_H */ 372