Path: blob/master/arch/powerpc/include/asm/bootx.h
15117 views
/*1* This file describes the structure passed from the BootX application2* (for MacOS) when it is used to boot Linux.3*4* Written by Benjamin Herrenschmidt.5*/678#ifndef __ASM_BOOTX_H__9#define __ASM_BOOTX_H__1011#include <linux/types.h>1213#ifdef macintosh14#include <Types.h>15#include "linux_type_defs.h"16#endif1718#ifdef macintosh19/* All this requires PowerPC alignment */20#pragma options align=power21#endif2223/* On kernel entry:24*25* r3 = 0x426f6f58 ('BooX')26* r4 = pointer to boot_infos27* r5 = NULL28*29* Data and instruction translation disabled, interrupts30* disabled, kernel loaded at physical 0x00000000 on PCI31* machines (will be different on NuBus).32*/3334#define BOOT_INFO_VERSION 535#define BOOT_INFO_COMPATIBLE_VERSION 13637/* Bit in the architecture flag mask. More to be defined in38future versions. Note that either BOOT_ARCH_PCI or39BOOT_ARCH_NUBUS is set. The other BOOT_ARCH_NUBUS_xxx are40set additionally when BOOT_ARCH_NUBUS is set.41*/42#define BOOT_ARCH_PCI 0x00000001UL43#define BOOT_ARCH_NUBUS 0x00000002UL44#define BOOT_ARCH_NUBUS_PDM 0x00000010UL45#define BOOT_ARCH_NUBUS_PERFORMA 0x00000020UL46#define BOOT_ARCH_NUBUS_POWERBOOK 0x00000040UL4748/* Maximum number of ranges in phys memory map */49#define MAX_MEM_MAP_SIZE 265051/* This is the format of an element in the physical memory map. Note that52the map is optional and current BootX will only build it for pre-PCI53machines */54typedef struct boot_info_map_entry55{56__u32 physAddr; /* Physical starting address */57__u32 size; /* Size in bytes */58} boot_info_map_entry_t;596061/* Here are the boot informations that are passed to the bootstrap62* Note that the kernel arguments and the device tree are appended63* at the end of this structure. */64typedef struct boot_infos65{66/* Version of this structure */67__u32 version;68/* backward compatible down to version: */69__u32 compatible_version;7071/* NEW (vers. 2) this holds the current _logical_ base addr of72the frame buffer (for use by early boot message) */73__u8* logicalDisplayBase;7475/* NEW (vers. 4) Apple's machine identification */76__u32 machineID;7778/* NEW (vers. 4) Detected hw architecture */79__u32 architecture;8081/* The device tree (internal addresses relative to the beginning of the tree,82* device tree offset relative to the beginning of this structure).83* On pre-PCI macintosh (BOOT_ARCH_PCI bit set to 0 in architecture), this84* field is 0.85*/86__u32 deviceTreeOffset; /* Device tree offset */87__u32 deviceTreeSize; /* Size of the device tree */8889/* Some infos about the current MacOS display */90__u32 dispDeviceRect[4]; /* left,top,right,bottom */91__u32 dispDeviceDepth; /* (8, 16 or 32) */92__u8* dispDeviceBase; /* base address (physical) */93__u32 dispDeviceRowBytes; /* rowbytes (in bytes) */94__u32 dispDeviceColorsOffset; /* Colormap (8 bits only) or 0 (*) */95/* Optional offset in the registry to the current96* MacOS display. (Can be 0 when not detected) */97__u32 dispDeviceRegEntryOffset;9899/* Optional pointer to boot ramdisk (offset from this structure) */100__u32 ramDisk;101__u32 ramDiskSize; /* size of ramdisk image */102103/* Kernel command line arguments (offset from this structure) */104__u32 kernelParamsOffset;105106/* ALL BELOW NEW (vers. 4) */107108/* This defines the physical memory. Valid with BOOT_ARCH_NUBUS flag109(non-PCI) only. On PCI, memory is contiguous and it's size is in the110device-tree. */111boot_info_map_entry_t112physMemoryMap[MAX_MEM_MAP_SIZE]; /* Where the phys memory is */113__u32 physMemoryMapSize; /* How many entries in map */114115116/* The framebuffer size (optional, currently 0) */117__u32 frameBufferSize; /* Represents a max size, can be 0. */118119/* NEW (vers. 5) */120121/* Total params size (args + colormap + device tree + ramdisk) */122__u32 totalParamsSize;123124} boot_infos_t;125126#ifdef __KERNEL__127/* (*) The format of the colormap is 256 * 3 * 2 bytes. Each color index128* is represented by 3 short words containing a 16 bits (unsigned) color129* component. Later versions may contain the gamma table for direct-color130* devices here.131*/132#define BOOTX_COLORTABLE_SIZE (256UL*3UL*2UL)133134/* BootX passes the device-tree using a format that comes from earlier135* ppc32 kernels. This used to match what is in prom.h, but not anymore136* so we now define it here137*/138struct bootx_dt_prop {139u32 name;140int length;141u32 value;142u32 next;143};144145struct bootx_dt_node {146u32 unused0;147u32 unused1;148u32 phandle; /* not really available */149u32 unused2;150u32 unused3;151u32 unused4;152u32 unused5;153u32 full_name;154u32 properties;155u32 parent;156u32 child;157u32 sibling;158u32 next;159u32 allnext;160};161162extern void bootx_init(unsigned long r4, unsigned long phys);163164#endif /* __KERNEL__ */165166#ifdef macintosh167#pragma options align=reset168#endif169170#endif171172173