bootx.h 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /*
  2. * This file describes the structure passed from the BootX application
  3. * (for MacOS) when it is used to boot Linux.
  4. *
  5. * Written by Benjamin Herrenschmidt.
  6. */
  7. #ifndef __ASM_BOOTX_H__
  8. #define __ASM_BOOTX_H__
  9. #ifdef macintosh
  10. #include <Types.h>
  11. #include "linux_type_defs.h"
  12. #endif
  13. #ifdef macintosh
  14. /* All this requires PowerPC alignment */
  15. #pragma options align=power
  16. #endif
  17. /* On kernel entry:
  18. *
  19. * r3 = 0x426f6f58 ('BooX')
  20. * r4 = pointer to boot_infos
  21. * r5 = NULL
  22. *
  23. * Data and instruction translation disabled, interrupts
  24. * disabled, kernel loaded at physical 0x00000000 on PCI
  25. * machines (will be different on NuBus).
  26. */
  27. #define BOOT_INFO_VERSION 5
  28. #define BOOT_INFO_COMPATIBLE_VERSION 1
  29. /* Bit in the architecture flag mask. More to be defined in
  30. future versions. Note that either BOOT_ARCH_PCI or
  31. BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are
  32. set additionally when BOOT_ARCH_NUBUS is set.
  33. */
  34. #define BOOT_ARCH_PCI 0x00000001UL
  35. #define BOOT_ARCH_NUBUS 0x00000002UL
  36. #define BOOT_ARCH_NUBUS_PDM 0x00000010UL
  37. #define BOOT_ARCH_NUBUS_PERFORMA 0x00000020UL
  38. #define BOOT_ARCH_NUBUS_POWERBOOK 0x00000040UL
  39. /* Maximum number of ranges in phys memory map */
  40. #define MAX_MEM_MAP_SIZE 26
  41. /* This is the format of an element in the physical memory map. Note that
  42. the map is optional and current BootX will only build it for pre-PCI
  43. machines */
  44. typedef struct boot_info_map_entry
  45. {
  46. __u32 physAddr; /* Physical starting address */
  47. __u32 size; /* Size in bytes */
  48. } boot_info_map_entry_t;
  49. /* Here are the boot informations that are passed to the bootstrap
  50. * Note that the kernel arguments and the device tree are appended
  51. * at the end of this structure. */
  52. typedef struct boot_infos
  53. {
  54. /* Version of this structure */
  55. __u32 version;
  56. /* backward compatible down to version: */
  57. __u32 compatible_version;
  58. /* NEW (vers. 2) this holds the current _logical_ base addr of
  59. the frame buffer (for use by early boot message) */
  60. __u8* logicalDisplayBase;
  61. /* NEW (vers. 4) Apple's machine identification */
  62. __u32 machineID;
  63. /* NEW (vers. 4) Detected hw architecture */
  64. __u32 architecture;
  65. /* The device tree (internal addresses relative to the beginning of the tree,
  66. * device tree offset relative to the beginning of this structure).
  67. * On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this
  68. * field is 0.
  69. */
  70. __u32 deviceTreeOffset; /* Device tree offset */
  71. __u32 deviceTreeSize; /* Size of the device tree */
  72. /* Some infos about the current MacOS display */
  73. __u32 dispDeviceRect[4]; /* left,top,right,bottom */
  74. __u32 dispDeviceDepth; /* (8, 16 or 32) */
  75. __u8* dispDeviceBase; /* base address (physical) */
  76. __u32 dispDeviceRowBytes; /* rowbytes (in bytes) */
  77. __u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */
  78. /* Optional offset in the registry to the current
  79. * MacOS display. (Can be 0 when not detected) */
  80. __u32 dispDeviceRegEntryOffset;
  81. /* Optional pointer to boot ramdisk (offset from this structure) */
  82. __u32 ramDisk;
  83. __u32 ramDiskSize; /* size of ramdisk image */
  84. /* Kernel command line arguments (offset from this structure) */
  85. __u32 kernelParamsOffset;
  86. /* ALL BELOW NEW (vers. 4) */
  87. /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
  88. (non-PCI) only. On PCI, memory is contiguous and it's size is in the
  89. device-tree. */
  90. boot_info_map_entry_t
  91. physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
  92. __u32 physMemoryMapSize; /* How many entries in map */
  93. /* The framebuffer size (optional, currently 0) */
  94. __u32 frameBufferSize; /* Represents a max size, can be 0. */
  95. /* NEW (vers. 5) */
  96. /* Total params size (args + colormap + device tree + ramdisk) */
  97. __u32 totalParamsSize;
  98. } boot_infos_t;
  99. /* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index
  100. * is represented by 3 short words containing a 16 bits (unsigned) color
  101. * component. Later versions may contain the gamma table for direct-color
  102. * devices here.
  103. */
  104. #define BOOTX_COLORTABLE_SIZE (256UL*3UL*2UL)
  105. /* BootX passes the device-tree using a format that comes from earlier
  106. * ppc32 kernels. This used to match what is in prom.h, but not anymore
  107. * so we now define it here
  108. */
  109. struct bootx_dt_prop {
  110. u32 name;
  111. int length;
  112. u32 value;
  113. u32 next;
  114. };
  115. struct bootx_dt_node {
  116. u32 unused0;
  117. u32 unused1;
  118. u32 phandle; /* not really available */
  119. u32 unused2;
  120. u32 unused3;
  121. u32 unused4;
  122. u32 unused5;
  123. u32 full_name;
  124. u32 properties;
  125. u32 parent;
  126. u32 child;
  127. u32 sibling;
  128. u32 next;
  129. u32 allnext;
  130. };
  131. extern void bootx_init(unsigned long r4, unsigned long phys);
  132. #ifdef macintosh
  133. #pragma options align=reset
  134. #endif
  135. #endif