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