bootinfo.h 12 KB

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