Import 2.3.18pre1
[davej-history.git] / include / asm-ppc / bootinfo.h
blob8d78bb9cb96d63ea0c4c938b62949b190dfa5a91
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
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
24 #ifndef _BOOTINFO_H
25 #define _BOOTINFO_H
29 * Bootinfo definitions
31 * This is an easily parsable and extendable structure containing all
32 * information to be passed from the bootstrap to the kernel.
34 * This way I hope to keep all future changes back/forewards compatible.
35 * Thus, keep your fingers crossed...
37 * This structure is copied right after the kernel bss by the bootstrap
38 * routine.
41 #ifndef __ASSEMBLY__
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 */
49 #else /* __ASSEMBLY__ */
51 BIR_tag = 0
52 BIR_size = BIR_tag+2
53 BIR_data = BIR_size+2
55 #endif /* __ASSEMBLY__ */
59 * Tag Definitions
61 * Machine independent tags start counting from 0x0000
62 * Machine dependent tags start counting from 0x8000
65 #define BI_LAST 0x0000 /* last record (sentinel) */
66 #define BI_MACHTYPE 0x0001 /* machine type (u_long) */
67 #define BI_CPUTYPE 0x0002 /* cpu type (u_long) */
68 #define BI_FPUTYPE 0x0003 /* fpu type (u_long) */
69 #define BI_MMUTYPE 0x0004 /* mmu type (u_long) */
70 #define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
71 /* (struct mem_info) */
72 #define BI_RAMDISK 0x0006 /* ramdisk address and size */
73 /* (struct mem_info) */
74 #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
75 /* (string) */
78 * Amiga-specific tags
81 #define BI_AMIGA_MODEL 0x8000 /* model (u_long) */
82 #define BI_AMIGA_AUTOCON 0x8001 /* AutoConfig device */
83 /* (struct ConfigDev) */
84 #define BI_AMIGA_CHIP_SIZE 0x8002 /* size of Chip RAM (u_long) */
85 #define BI_AMIGA_VBLANK 0x8003 /* VBLANK frequency (u_char) */
86 #define BI_AMIGA_PSFREQ 0x8004 /* power supply frequency (u_char) */
87 #define BI_AMIGA_ECLOCK 0x8005 /* EClock frequency (u_long) */
88 #define BI_AMIGA_CHIPSET 0x8006 /* native chipset present (u_long) */
89 #define BI_AMIGA_SERPER 0x8007 /* serial port period (u_short) */
92 * Atari-specific tags
95 #define BI_ATARI_MCH_COOKIE 0x8000 /* _MCH cookie from TOS (u_long) */
96 #define BI_ATARI_MCH_TYPE 0x8001 /* special machine type (u_long) */
97 /* (values are ATARI_MACH_* defines */
99 /* mch_cookie values (upper word) */
100 #define ATARI_MCH_ST 0
101 #define ATARI_MCH_STE 1
102 #define ATARI_MCH_TT 2
103 #define ATARI_MCH_FALCON 3
105 /* mch_type values */
106 #define ATARI_MACH_NORMAL 0 /* no special machine type */
107 #define ATARI_MACH_MEDUSA 1 /* Medusa 040 */
108 #define ATARI_MACH_HADES 2 /* Hades 040 or 060 */
109 #define ATARI_MACH_AB40 3 /* Afterburner040 on Falcon */
112 * Macintosh-specific tags (all u_long)
115 #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
116 #define BI_MAC_VADDR 0x8001 /* Mac video base address */
117 #define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
118 #define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
119 #define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
120 #define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
121 #define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
122 #define BI_MAC_BTIME 0x8007 /* Mac boot time */
123 #define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
124 #define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
125 #define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
126 #define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */
129 * Macintosh hardware profile data - unused, see macintosh.h for
130 * resonable type values
133 #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */
134 #define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */
135 #define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */
136 #define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */
137 #define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */
138 #define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */
139 #define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */
140 #define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */
141 #define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */
142 #define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */
143 #define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */
144 #define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */
145 #define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */
146 #define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */
147 #define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */
148 #define BI_MAC_PMU 0x801f /* Mac power managment / poweroff hardware */
149 #define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */
150 #define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */
153 * Mac: compatibility with old booter data format (temporarily)
154 * Fields unused with the new bootinfo can be deleted now; instead of
155 * adding new fields the struct might be splitted into a hardware address
156 * part and a hardware type part
159 #ifndef __ASSEMBLY__
161 struct mac_booter_data
163 unsigned long videoaddr;
164 unsigned long videorow;
165 unsigned long videodepth;
166 unsigned long dimensions;
167 unsigned long args;
168 unsigned long boottime;
169 unsigned long gmtbias;
170 unsigned long bootver;
171 unsigned long videological;
172 unsigned long sccbase;
173 unsigned long id;
174 unsigned long memsize;
175 unsigned long serialmf;
176 unsigned long serialhsk;
177 unsigned long serialgpi;
178 unsigned long printmf;
179 unsigned long printhsk;
180 unsigned long printgpi;
181 unsigned long cpuid;
182 unsigned long rombase;
183 unsigned long adbdelay;
184 unsigned long timedbra;
187 extern struct mac_booter_data
188 mac_bi_data;
190 #endif
193 * Stuff for bootinfo interface versioning
195 * At the start of kernel code, a 'struct bootversion' is located.
196 * bootstrap checks for a matching version of the interface before booting
197 * a kernel, to avoid user confusion if kernel and bootstrap don't work
198 * together :-)
200 * If incompatible changes are made to the bootinfo interface, the major
201 * number below should be stepped (and the minor reset to 0) for the
202 * appropriate machine. If a change is backward-compatible, the minor
203 * should be stepped. "Backwards-compatible" means that booting will work,
204 * but certain features may not.
207 #define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */
208 #define MK_BI_VERSION(major,minor) (((major)<<16)+(minor))
209 #define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
210 #define BI_VERSION_MINOR(v) ((v) & 0xffff)
212 #ifndef __ASSEMBLY__
214 struct bootversion {
215 unsigned short branch;
216 unsigned long magic;
217 struct {
218 unsigned long machtype;
219 unsigned long version;
220 } machversions[0];
223 #endif /* __ASSEMBLY__ */
225 #define AMIGA_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
226 #define ATARI_BOOTI_VERSION MK_BI_VERSION( 2, 1 )
227 #define MAC_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
228 #define MVME16x_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
229 #define BVME6000_BOOTI_VERSION MK_BI_VERSION( 2, 0 )
232 #ifdef BOOTINFO_COMPAT_1_0
235 * Backwards compatibility with bootinfo interface version 1.0
238 #define COMPAT_AMIGA_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
239 #define COMPAT_ATARI_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
240 #define COMPAT_MAC_BOOTI_VERSION MK_BI_VERSION( 1, 0 )
242 #include <linux/zorro.h>
244 #define COMPAT_NUM_AUTO 16
246 struct compat_bi_Amiga {
247 int model;
248 int num_autocon;
249 struct ConfigDev autocon[COMPAT_NUM_AUTO];
250 unsigned long chip_size;
251 unsigned char vblank;
252 unsigned char psfreq;
253 unsigned long eclock;
254 unsigned long chipset;
255 unsigned long hw_present;
258 struct compat_bi_Atari {
259 unsigned long hw_present;
260 unsigned long mch_cookie;
263 #ifndef __ASSEMBLY__
265 #define MACHW_DECLARE(name) unsigned name : 1
266 #define MACHW_SET(name) (boot_info.bi_mac.hw_present.name = 1)
267 #define MACHW_PRESENT(name) (boot_info.bi_mac.hw_present.name)
269 struct compat_bi_Macintosh
271 unsigned long videoaddr;
272 unsigned long videorow;
273 unsigned long videodepth;
274 unsigned long dimensions;
275 unsigned long args;
276 unsigned long boottime;
277 unsigned long gmtbias;
278 unsigned long bootver;
279 unsigned long videological;
280 unsigned long sccbase;
281 unsigned long id;
282 unsigned long memsize;
283 unsigned long serialmf;
284 unsigned long serialhsk;
285 unsigned long serialgpi;
286 unsigned long printmf;
287 unsigned long printhsk;
288 unsigned long printgpi;
289 unsigned long cpuid;
290 unsigned long rombase;
291 unsigned long adbdelay;
292 unsigned long timedbra;
293 struct {
294 /* video hardware */
295 /* sound hardware */
296 /* disk storage interfaces */
297 MACHW_DECLARE(MAC_SCSI); /* Directly mapped NCR5380 */
298 MACHW_DECLARE(IDE); /* IDE Interface */
299 /* other I/O hardware */
300 MACHW_DECLARE(SCC); /* Serial Communications Contr. */
301 /* DMA */
302 MACHW_DECLARE(SCSI_DMA); /* DMA for the NCR5380 */
303 /* real time clocks */
304 MACHW_DECLARE(RTC_CLK); /* clock chip */
305 /* supporting hardware */
306 MACHW_DECLARE(VIA1); /* Versatile Interface Ad. 1 */
307 MACHW_DECLARE(VIA2); /* Versatile Interface Ad. 2 */
308 MACHW_DECLARE(RBV); /* Versatile Interface Ad. 2+ */
309 /* NUBUS */
310 MACHW_DECLARE(NUBUS); /* NUBUS */
311 } hw_present;
313 #else
315 #define BI_videoaddr BI_un
316 #define BI_videorow BI_videoaddr+4
317 #define BI_videodepth BI_videorow+4
318 #define BI_dimensions BI_videodepth+4
319 #define BI_args BI_dimensions+4
320 #define BI_cpuid BI_args+56
322 #endif
324 struct compat_mem_info {
325 unsigned long addr;
326 unsigned long size;
329 #define COMPAT_NUM_MEMINFO 4
331 #define COMPAT_CPUB_68020 0
332 #define COMPAT_CPUB_68030 1
333 #define COMPAT_CPUB_68040 2
334 #define COMPAT_CPUB_68060 3
335 #define COMPAT_FPUB_68881 5
336 #define COMPAT_FPUB_68882 6
337 #define COMPAT_FPUB_68040 7
338 #define COMPAT_FPUB_68060 8
340 #define COMPAT_CPU_68020 (1<<COMPAT_CPUB_68020)
341 #define COMPAT_CPU_68030 (1<<COMPAT_CPUB_68030)
342 #define COMPAT_CPU_68040 (1<<COMPAT_CPUB_68040)
343 #define COMPAT_CPU_68060 (1<<COMPAT_CPUB_68060)
344 #define COMPAT_CPU_MASK (31)
345 #define COMPAT_FPU_68881 (1<<COMPAT_FPUB_68881)
346 #define COMPAT_FPU_68882 (1<<COMPAT_FPUB_68882)
347 #define COMPAT_FPU_68040 (1<<COMPAT_FPUB_68040)
348 #define COMPAT_FPU_68060 (1<<COMPAT_FPUB_68060)
349 #define COMPAT_FPU_MASK (0xfe0)
351 #define COMPAT_CL_SIZE (256)
353 struct compat_bootinfo {
354 unsigned long machtype;
355 unsigned long cputype;
356 struct compat_mem_info memory[COMPAT_NUM_MEMINFO];
357 int num_memory;
358 unsigned long ramdisk_size;
359 unsigned long ramdisk_addr;
360 char command_line[COMPAT_CL_SIZE];
361 union {
362 struct compat_bi_Amiga bi_ami;
363 struct compat_bi_Atari bi_ata;
364 struct compat_bi_Macintosh bi_mac;
365 } bi_un;
368 #define bi_amiga bi_un.bi_ami
369 #define bi_atari bi_un.bi_ata
370 #define bi_mac bi_un.bi_mac
372 #endif /* BOOTINFO_COMPAT_1_0 */
375 #endif /* _BOOTINFO_H */