bootinfo.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * asm/bootinfo.h -- Definition of the Linux/m68k boot information structure
  4. *
  5. * Copyright 1992 by Greg Harp
  6. *
  7. * This file is subject to the terms and conditions of the GNU General Public
  8. * License. See the file COPYING in the main directory of this archive
  9. * for more details.
  10. */
  11. #ifndef _UAPI_ASM_M68K_BOOTINFO_H
  12. #define _UAPI_ASM_M68K_BOOTINFO_H
  13. #include <linux/types.h>
  14. #ifndef __ASSEMBLY__
  15. /*
  16. * Bootinfo definitions
  17. *
  18. * This is an easily parsable and extendable structure containing all
  19. * information to be passed from the bootstrap to the kernel.
  20. *
  21. * This way I hope to keep all future changes back/forewards compatible.
  22. * Thus, keep your fingers crossed...
  23. *
  24. * This structure is copied right after the kernel by the bootstrap
  25. * routine.
  26. */
  27. struct bi_record {
  28. __be16 tag; /* tag ID */
  29. __be16 size; /* size of record (in bytes) */
  30. __be32 data[]; /* data */
  31. };
  32. struct mem_info {
  33. __be32 addr; /* physical address of memory chunk */
  34. __be32 size; /* length of memory chunk (in bytes) */
  35. };
  36. #endif /* __ASSEMBLY__ */
  37. /*
  38. * Tag Definitions
  39. *
  40. * Machine independent tags start counting from 0x0000
  41. * Machine dependent tags start counting from 0x8000
  42. */
  43. #define BI_LAST 0x0000 /* last record (sentinel) */
  44. #define BI_MACHTYPE 0x0001 /* machine type (__be32) */
  45. #define BI_CPUTYPE 0x0002 /* cpu type (__be32) */
  46. #define BI_FPUTYPE 0x0003 /* fpu type (__be32) */
  47. #define BI_MMUTYPE 0x0004 /* mmu type (__be32) */
  48. #define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
  49. /* (struct mem_info) */
  50. #define BI_RAMDISK 0x0006 /* ramdisk address and size */
  51. /* (struct mem_info) */
  52. #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
  53. /* (string) */
  54. /*
  55. * A random seed used to initialize the RNG. Record format:
  56. *
  57. * - length [ 2 bytes, 16-bit big endian ]
  58. * - seed data [ `length` bytes, padded to preserve 4-byte struct alignment ]
  59. */
  60. #define BI_RNG_SEED 0x0008
  61. /*
  62. * Linux/m68k Architectures (BI_MACHTYPE)
  63. */
  64. #define MACH_AMIGA 1
  65. #define MACH_ATARI 2
  66. #define MACH_MAC 3
  67. #define MACH_APOLLO 4
  68. #define MACH_SUN3 5
  69. #define MACH_MVME147 6
  70. #define MACH_MVME16x 7
  71. #define MACH_BVME6000 8
  72. #define MACH_HP300 9
  73. #define MACH_Q40 10
  74. #define MACH_SUN3X 11
  75. #define MACH_M54XX 12
  76. #define MACH_M5441X 13
  77. #define MACH_VIRT 14
  78. /*
  79. * CPU, FPU and MMU types (BI_CPUTYPE, BI_FPUTYPE, BI_MMUTYPE)
  80. *
  81. * Note: we may rely on the following equalities:
  82. *
  83. * CPU_68020 == MMU_68851
  84. * CPU_68030 == MMU_68030
  85. * CPU_68040 == FPU_68040 == MMU_68040
  86. * CPU_68060 == FPU_68060 == MMU_68060
  87. */
  88. #define CPUB_68020 0
  89. #define CPUB_68030 1
  90. #define CPUB_68040 2
  91. #define CPUB_68060 3
  92. #define CPUB_COLDFIRE 4
  93. #define CPU_68020 (1 << CPUB_68020)
  94. #define CPU_68030 (1 << CPUB_68030)
  95. #define CPU_68040 (1 << CPUB_68040)
  96. #define CPU_68060 (1 << CPUB_68060)
  97. #define CPU_COLDFIRE (1 << CPUB_COLDFIRE)
  98. #define FPUB_68881 0
  99. #define FPUB_68882 1
  100. #define FPUB_68040 2 /* Internal FPU */
  101. #define FPUB_68060 3 /* Internal FPU */
  102. #define FPUB_SUNFPA 4 /* Sun-3 FPA */
  103. #define FPUB_COLDFIRE 5 /* ColdFire FPU */
  104. #define FPU_68881 (1 << FPUB_68881)
  105. #define FPU_68882 (1 << FPUB_68882)
  106. #define FPU_68040 (1 << FPUB_68040)
  107. #define FPU_68060 (1 << FPUB_68060)
  108. #define FPU_SUNFPA (1 << FPUB_SUNFPA)
  109. #define FPU_COLDFIRE (1 << FPUB_COLDFIRE)
  110. #define MMUB_68851 0
  111. #define MMUB_68030 1 /* Internal MMU */
  112. #define MMUB_68040 2 /* Internal MMU */
  113. #define MMUB_68060 3 /* Internal MMU */
  114. #define MMUB_APOLLO 4 /* Custom Apollo */
  115. #define MMUB_SUN3 5 /* Custom Sun-3 */
  116. #define MMUB_COLDFIRE 6 /* Internal MMU */
  117. #define MMU_68851 (1 << MMUB_68851)
  118. #define MMU_68030 (1 << MMUB_68030)
  119. #define MMU_68040 (1 << MMUB_68040)
  120. #define MMU_68060 (1 << MMUB_68060)
  121. #define MMU_SUN3 (1 << MMUB_SUN3)
  122. #define MMU_APOLLO (1 << MMUB_APOLLO)
  123. #define MMU_COLDFIRE (1 << MMUB_COLDFIRE)
  124. /*
  125. * Stuff for bootinfo interface versioning
  126. *
  127. * At the start of kernel code, a 'struct bootversion' is located.
  128. * bootstrap checks for a matching version of the interface before booting
  129. * a kernel, to avoid user confusion if kernel and bootstrap don't work
  130. * together :-)
  131. *
  132. * If incompatible changes are made to the bootinfo interface, the major
  133. * number below should be stepped (and the minor reset to 0) for the
  134. * appropriate machine. If a change is backward-compatible, the minor
  135. * should be stepped. "Backwards-compatible" means that booting will work,
  136. * but certain features may not.
  137. */
  138. #define BOOTINFOV_MAGIC 0x4249561A /* 'BIV^Z' */
  139. #define MK_BI_VERSION(major, minor) (((major) << 16) + (minor))
  140. #define BI_VERSION_MAJOR(v) (((v) >> 16) & 0xffff)
  141. #define BI_VERSION_MINOR(v) ((v) & 0xffff)
  142. #ifndef __ASSEMBLY__
  143. struct bootversion {
  144. __be16 branch;
  145. __be32 magic;
  146. struct {
  147. __be32 machtype;
  148. __be32 version;
  149. } machversions[];
  150. } __packed;
  151. #endif /* __ASSEMBLY__ */
  152. #endif /* _UAPI_ASM_M68K_BOOTINFO_H */