bootx.h 5.1 KB

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