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