2
0

bootinfo.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. * SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note
  3. *
  4. * Bootinfo tags from linux bootinfo.h and bootinfo-mac.h:
  5. * This is an easily parsable and extendable structure containing all
  6. * information to be passed from the bootstrap to the kernel
  7. *
  8. * This structure is copied right after the kernel by the bootstrap
  9. * routine.
  10. */
  11. #ifndef HW_M68K_BOOTINFO_H
  12. #define HW_M68K_BOOTINFO_H
  13. struct bi_record {
  14. uint16_t tag; /* tag ID */
  15. uint16_t size; /* size of record */
  16. uint32_t data[0]; /* data */
  17. };
  18. /* machine independent tags */
  19. #define BI_LAST 0x0000 /* last record */
  20. #define BI_MACHTYPE 0x0001 /* machine type (u_long) */
  21. #define BI_CPUTYPE 0x0002 /* cpu type (u_long) */
  22. #define BI_FPUTYPE 0x0003 /* fpu type (u_long) */
  23. #define BI_MMUTYPE 0x0004 /* mmu type (u_long) */
  24. #define BI_MEMCHUNK 0x0005 /* memory chunk address and size */
  25. /* (struct mem_info) */
  26. #define BI_RAMDISK 0x0006 /* ramdisk address and size */
  27. /* (struct mem_info) */
  28. #define BI_COMMAND_LINE 0x0007 /* kernel command line parameters */
  29. /* (string) */
  30. /* Macintosh-specific tags (all u_long) */
  31. #define BI_MAC_MODEL 0x8000 /* Mac Gestalt ID (model type) */
  32. #define BI_MAC_VADDR 0x8001 /* Mac video base address */
  33. #define BI_MAC_VDEPTH 0x8002 /* Mac video depth */
  34. #define BI_MAC_VROW 0x8003 /* Mac video rowbytes */
  35. #define BI_MAC_VDIM 0x8004 /* Mac video dimensions */
  36. #define BI_MAC_VLOGICAL 0x8005 /* Mac video logical base */
  37. #define BI_MAC_SCCBASE 0x8006 /* Mac SCC base address */
  38. #define BI_MAC_BTIME 0x8007 /* Mac boot time */
  39. #define BI_MAC_GMTBIAS 0x8008 /* Mac GMT timezone offset */
  40. #define BI_MAC_MEMSIZE 0x8009 /* Mac RAM size (sanity check) */
  41. #define BI_MAC_CPUID 0x800a /* Mac CPU type (sanity check) */
  42. #define BI_MAC_ROMBASE 0x800b /* Mac system ROM base address */
  43. /* Macintosh hardware profile data */
  44. #define BI_MAC_VIA1BASE 0x8010 /* Mac VIA1 base address (always present) */
  45. #define BI_MAC_VIA2BASE 0x8011 /* Mac VIA2 base address (type varies) */
  46. #define BI_MAC_VIA2TYPE 0x8012 /* Mac VIA2 type (VIA, RBV, OSS) */
  47. #define BI_MAC_ADBTYPE 0x8013 /* Mac ADB interface type */
  48. #define BI_MAC_ASCBASE 0x8014 /* Mac Apple Sound Chip base address */
  49. #define BI_MAC_SCSI5380 0x8015 /* Mac NCR 5380 SCSI (base address, multi) */
  50. #define BI_MAC_SCSIDMA 0x8016 /* Mac SCSI DMA (base address) */
  51. #define BI_MAC_SCSI5396 0x8017 /* Mac NCR 53C96 SCSI (base address, multi) */
  52. #define BI_MAC_IDETYPE 0x8018 /* Mac IDE interface type */
  53. #define BI_MAC_IDEBASE 0x8019 /* Mac IDE interface base address */
  54. #define BI_MAC_NUBUS 0x801a /* Mac Nubus type (none, regular, pseudo) */
  55. #define BI_MAC_SLOTMASK 0x801b /* Mac Nubus slots present */
  56. #define BI_MAC_SCCTYPE 0x801c /* Mac SCC serial type (normal, IOP) */
  57. #define BI_MAC_ETHTYPE 0x801d /* Mac builtin ethernet type (Sonic, MACE */
  58. #define BI_MAC_ETHBASE 0x801e /* Mac builtin ethernet base address */
  59. #define BI_MAC_PMU 0x801f /* Mac power management / poweroff hardware */
  60. #define BI_MAC_IOP_SWIM 0x8020 /* Mac SWIM floppy IOP */
  61. #define BI_MAC_IOP_ADB 0x8021 /* Mac ADB IOP */
  62. #define BOOTINFO0(as, base, id) \
  63. do { \
  64. stw_phys(as, base, id); \
  65. base += 2; \
  66. stw_phys(as, base, sizeof(struct bi_record)); \
  67. base += 2; \
  68. } while (0)
  69. #define BOOTINFO1(as, base, id, value) \
  70. do { \
  71. stw_phys(as, base, id); \
  72. base += 2; \
  73. stw_phys(as, base, sizeof(struct bi_record) + 4); \
  74. base += 2; \
  75. stl_phys(as, base, value); \
  76. base += 4; \
  77. } while (0)
  78. #define BOOTINFO2(as, base, id, value1, value2) \
  79. do { \
  80. stw_phys(as, base, id); \
  81. base += 2; \
  82. stw_phys(as, base, sizeof(struct bi_record) + 8); \
  83. base += 2; \
  84. stl_phys(as, base, value1); \
  85. base += 4; \
  86. stl_phys(as, base, value2); \
  87. base += 4; \
  88. } while (0)
  89. #define BOOTINFOSTR(as, base, id, string) \
  90. do { \
  91. int i; \
  92. stw_phys(as, base, id); \
  93. base += 2; \
  94. stw_phys(as, base, \
  95. (sizeof(struct bi_record) + strlen(string) + 2) & ~1); \
  96. base += 2; \
  97. for (i = 0; string[i]; i++) { \
  98. stb_phys(as, base++, string[i]); \
  99. } \
  100. stb_phys(as, base++, 0); \
  101. base = (parameters_base + 1) & ~1; \
  102. } while (0)
  103. #endif