Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * This file describes the structure passed from the BootX application
0004  * (for MacOS) when it is used to boot Linux.
0005  *
0006  * Written by Benjamin Herrenschmidt.
0007  */
0008 
0009 
0010 #ifndef _UAPI__ASM_BOOTX_H__
0011 #define _UAPI__ASM_BOOTX_H__
0012 
0013 #include <linux/types.h>
0014 
0015 #ifdef macintosh
0016 #include <Types.h>
0017 #include "linux_type_defs.h"
0018 #endif
0019 
0020 #ifdef macintosh
0021 /* All this requires PowerPC alignment */
0022 #pragma options align=power
0023 #endif
0024 
0025 /* On kernel entry:
0026  *
0027  * r3 = 0x426f6f58    ('BooX')
0028  * r4 = pointer to boot_infos
0029  * r5 = NULL
0030  *
0031  * Data and instruction translation disabled, interrupts
0032  * disabled, kernel loaded at physical 0x00000000 on PCI
0033  * machines (will be different on NuBus).
0034  */
0035 
0036 #define BOOT_INFO_VERSION               5
0037 #define BOOT_INFO_COMPATIBLE_VERSION    1
0038 
0039 /* Bit in the architecture flag mask. More to be defined in
0040    future versions. Note that either BOOT_ARCH_PCI or
0041    BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are
0042    set additionally when BOOT_ARCH_NUBUS is set.
0043  */
0044 #define BOOT_ARCH_PCI                   0x00000001UL
0045 #define BOOT_ARCH_NUBUS                 0x00000002UL
0046 #define BOOT_ARCH_NUBUS_PDM             0x00000010UL
0047 #define BOOT_ARCH_NUBUS_PERFORMA        0x00000020UL
0048 #define BOOT_ARCH_NUBUS_POWERBOOK       0x00000040UL
0049 
0050 /*  Maximum number of ranges in phys memory map */
0051 #define MAX_MEM_MAP_SIZE                26
0052 
0053 /* This is the format of an element in the physical memory map. Note that
0054    the map is optional and current BootX will only build it for pre-PCI
0055    machines */
0056 typedef struct boot_info_map_entry
0057 {
0058     __u32       physAddr;                /* Physical starting address */
0059     __u32       size;                    /* Size in bytes */
0060 } boot_info_map_entry_t;
0061 
0062 
0063 /* Here are the boot informations that are passed to the bootstrap
0064  * Note that the kernel arguments and the device tree are appended
0065  * at the end of this structure. */
0066 typedef struct boot_infos
0067 {
0068     /* Version of this structure */
0069     __u32       version;
0070     /* backward compatible down to version: */
0071     __u32       compatible_version;
0072 
0073     /* NEW (vers. 2) this holds the current _logical_ base addr of
0074        the frame buffer (for use by early boot message) */
0075     __u8*       logicalDisplayBase;
0076 
0077     /* NEW (vers. 4) Apple's machine identification */
0078     __u32       machineID;
0079 
0080     /* NEW (vers. 4) Detected hw architecture */
0081     __u32       architecture;
0082 
0083     /* The device tree (internal addresses relative to the beginning of the tree,
0084      * device tree offset relative to the beginning of this structure).
0085      * On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this
0086      * field is 0.
0087      */
0088     __u32       deviceTreeOffset;        /* Device tree offset */
0089     __u32       deviceTreeSize;          /* Size of the device tree */
0090 
0091     /* Some infos about the current MacOS display */
0092     __u32       dispDeviceRect[4];       /* left,top,right,bottom */
0093     __u32       dispDeviceDepth;         /* (8, 16 or 32) */
0094     __u8*       dispDeviceBase;          /* base address (physical) */
0095     __u32       dispDeviceRowBytes;      /* rowbytes (in bytes) */
0096     __u32       dispDeviceColorsOffset;  /* Colormap (8 bits only) or 0 (*) */
0097     /* Optional offset in the registry to the current
0098      * MacOS display. (Can be 0 when not detected) */
0099      __u32      dispDeviceRegEntryOffset;
0100 
0101     /* Optional pointer to boot ramdisk (offset from this structure) */
0102     __u32       ramDisk;
0103     __u32       ramDiskSize;             /* size of ramdisk image */
0104 
0105     /* Kernel command line arguments (offset from this structure) */
0106     __u32       kernelParamsOffset;
0107 
0108     /* ALL BELOW NEW (vers. 4) */
0109 
0110     /* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag
0111        (non-PCI) only. On PCI, memory is contiguous and it's size is in the
0112        device-tree. */
0113     boot_info_map_entry_t
0114                 physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */
0115     __u32       physMemoryMapSize;               /* How many entries in map */
0116 
0117 
0118     /* The framebuffer size (optional, currently 0) */
0119     __u32       frameBufferSize;         /* Represents a max size, can be 0. */
0120 
0121     /* NEW (vers. 5) */
0122 
0123     /* Total params size (args + colormap + device tree + ramdisk) */
0124     __u32       totalParamsSize;
0125 
0126 } boot_infos_t;
0127 
0128 
0129 #ifdef macintosh
0130 #pragma options align=reset
0131 #endif
0132 
0133 #endif /* _UAPI__ASM_BOOTX_H__ */