bootx_powerpc.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2. /*
  3. * This file describes the structure passed from the BootX application
  4. * (for MacOS) when it is used to boot Linux.
  5. *
  6. * Written by Benjamin Herrenschmidt.
  7. */
  8. #ifndef __ASM_BOOTX_H__
  9. #define __ASM_BOOTX_H__
  10. #include <linux/types.h>
  11. #ifdef macintosh
  12. #include <Types.h>
  13. #include "linux_type_defs.h"
  14. #endif
  15. #ifdef macintosh
  16. /* All this requires PowerPC alignment */
  17. #pragma options align=power
  18. #endif
  19. /* On kernel entry:
  20. *
  21. * r3 = 0x426f6f58 ('BooX')
  22. * r4 = pointer to boot_infos
  23. * r5 = NULL
  24. *
  25. * Data and instruction translation disabled, interrupts
  26. * disabled, kernel loaded at physical 0x00000000 on PCI
  27. * machines (will be different on NuBus).
  28. */
  29. #define BOOT_INFO_VERSION 5
  30. #define BOOT_INFO_COMPATIBLE_VERSION 1
  31. /* Bit in the architecture flag mask. More to be defined in
  32. future versions. Note that either BOOT_ARCH_PCI or
  33. BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are
  34. set additionally when BOOT_ARCH_NUBUS is set.
  35. */
  36. #define BOOT_ARCH_PCI 0x00000001UL
  37. #define BOOT_ARCH_NUBUS 0x00000002UL
  38. #define BOOT_ARCH_NUBUS_PDM 0x00000010UL
  39. #define BOOT_ARCH_NUBUS_PERFORMA 0x00000020UL
  40. #define BOOT_ARCH_NUBUS_POWERBOOK 0x00000040UL
  41. /* Maximum number of ranges in phys memory map */
  42. #define MAX_MEM_MAP_SIZE 26
  43. /* This is the format of an element in the physical memory map. Note that
  44. the map is optional and current BootX will only build it for pre-PCI
  45. machines */
  46. typedef struct boot_info_map_entry
  47. {
  48. __u32 physAddr; /* Physical starting address */
  49. __u32 size; /* Size in bytes */
  50. } boot_info_map_entry_t;
  51. /* Here are the boot informations that are passed to the bootstrap
  52. * Note that the kernel arguments and the device tree are appended
  53. * at the end of this structure. */
  54. typedef struct boot_infos
  55. {
  56. /* Version of this structure */
  57. __u32 version;
  58. /* backward compatible down to version: */
  59. __u32 compatible_version;
  60. /* NEW (vers. 2) this holds the current _logical_ base addr of
  61. the frame buffer (for use by early boot message) */
  62. __u8* logicalDisplayBase;
  63. /* NEW (vers. 4) Apple's machine identification */
  64. __u32 machineID;
  65. /* NEW (vers. 4) Detected hw architecture */
  66. __u32 architecture;
  67. /* The device tree (internal addresses relative to the beginning of the tree,
  68. * device tree offset relative to the beginning of this structure).
  69. * On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this
  70. * field is 0.
  71. */
  72. __u32 deviceTreeOffset; /* Device tree offset */
  73. __u32 deviceTreeSize; /* Size of the device tree */
  74. /* Some infos about the current MacOS display */
  75. __u32 dispDeviceRect[4]; /* left,top,right,bottom */
  76. __u32 dispDeviceDepth; /* (8, 16 or 32) */
  77. __u8* dispDeviceBase; /* base address (physical) */
  78. __u32 dispDeviceRowBytes; /* rowbytes (in bytes) */
  79. __u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */
  80. /* Optional offset in the registry to the current
  81. * MacOS display. (Can be 0 when not detected) */
  82. __u32 dispDeviceRegEntryOffset;
  83. /* Optional pointer to boot ramdisk (offset from this structure) */
  84. __u32 ramDisk;
  85. __u32 ramDiskSize; /* size of ramdisk image */
  86. /* Kernel command line arguments (offset from this structure) */
  87. __u32 kernelParamsOffset;
  88. /* ALL BELOW NEW (vers. 4) */
  89. /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
  90. (non-PCI) only. On PCI, memory is contiguous and it's size is in the
  91. device-tree. */
  92. boot_info_map_entry_t
  93. physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
  94. __u32 physMemoryMapSize; /* How many entries in map */
  95. /* The framebuffer size (optional, currently 0) */
  96. __u32 frameBufferSize; /* Represents a max size, can be 0. */
  97. /* NEW (vers. 5) */
  98. /* Total params size (args + colormap + device tree + ramdisk) */
  99. __u32 totalParamsSize;
  100. } boot_infos_t;
  101. #ifdef macintosh
  102. #pragma options align=reset
  103. #endif
  104. #endif /* __ASM_BOOTX_H__ */