]> git.saurik.com Git - apple/xnu.git/blob - pexpert/pexpert/arm64/boot.h
1bcf4990e4fad01622e643eebd7fa501aedf07cd
[apple/xnu.git] / pexpert / pexpert / arm64 / boot.h
1 /*
2 * Copyright (c) 2007-2009 Apple Inc. All rights reserved.
3 * Copyright (c) 2000-2006 Apple Computer, Inc. All rights reserved.
4 */
5 /*
6 * @OSF_COPYRIGHT@
7 */
8
9 #ifndef _PEXPERT_ARM64_BOOT_H_
10 #define _PEXPERT_ARM64_BOOT_H_
11
12 #ifdef KERNEL
13 #include <kern/kern_types.h>
14 #endif
15 #include <pexpert/arm/consistent_debug.h>
16 #include <pexpert/arm/protos.h>
17
18 /*
19 * Maximum size of an environment variable value. This particular value is
20 * chosen to accommodate the maximum encoded size of the system token as
21 * computed in https://confluence.sd.apple.com/display/TK/System+Token.
22 *
23 * This value matches iBoot's IBOOT_MAX_ENV_VAR_DATA_SIZE.
24 * There are no iBoot headers so have to duplicate it here for now.
25 */
26 #define BOOT_LINE_LENGTH 608
27
28 /*
29 * Video information..
30 */
31
32 struct Boot_Video {
33 unsigned long v_baseAddr; /* Base address of video memory */
34 unsigned long v_display; /* Display Code (if Applicable */
35 unsigned long v_rowBytes; /* Number of bytes per pixel row */
36 unsigned long v_width; /* Width */
37 unsigned long v_height; /* Height */
38 unsigned long v_depth; /* Pixel Depth and other parameters */
39 };
40
41 #define kBootVideoDepthMask (0xFF)
42 #define kBootVideoDepthDepthShift (0)
43 #define kBootVideoDepthRotateShift (8)
44 #define kBootVideoDepthScaleShift (16)
45
46 #define kBootFlagsDarkBoot (1ULL << 0)
47
48 typedef struct Boot_Video Boot_Video;
49
50 /* Boot argument structure - passed into Mach kernel at boot time.
51 */
52 #define kBootArgsRevision 1
53 #define kBootArgsRevision2 2 /* added boot_args.bootFlags */
54 #define kBootArgsVersion1 1
55 #define kBootArgsVersion2 2
56
57 typedef struct boot_args {
58 uint16_t Revision; /* Revision of boot_args structure */
59 uint16_t Version; /* Version of boot_args structure */
60 uint64_t virtBase; /* Virtual base of memory */
61 uint64_t physBase; /* Physical base of memory */
62 uint64_t memSize; /* Size of memory */
63 uint64_t topOfKernelData; /* Highest physical address used in kernel data area */
64 Boot_Video Video; /* Video Information */
65 uint32_t machineType; /* Machine Type */
66 void *deviceTreeP; /* Base of flattened device tree */
67 uint32_t deviceTreeLength; /* Length of flattened tree */
68 char CommandLine[BOOT_LINE_LENGTH]; /* Passed in command line */
69 uint64_t bootFlags; /* Additional flags specified by the bootloader */
70 uint64_t memSizeActual; /* Actual size of memory */
71 } boot_args;
72
73 #define SOC_DEVICE_TYPE_BUFFER_SIZE 32
74
75 #define PC_TRACE_BUF_SIZE 1024
76
77 #if SHMCON
78 #define SHMCON_MEM 0x4000
79 #else
80 #define SHMCON_MEM 0
81 #endif
82
83 #define CDBG_MEM ((sizeof(dbg_registry_t) + PAGE_SIZE - 1) & ~PAGE_MASK)
84
85 #define PE_EARLY_BOOT_VA (SHMCON_MEM + CDBG_MEM)
86
87 #endif /* _PEXPERT_ARM64_BOOT_H_ */