blob: ac4865300f1b5143969a83bb424b521a746c6ed9 [file] [log] [blame]
Graeme Russ95ffaba2010-04-24 00:05:49 +10001#ifndef _ASM_X86_BOOTPARAM_H
2#define _ASM_X86_BOOTPARAM_H
3
4#include <linux/types.h>
5#include <linux/screen_info.h>
6#include <linux/apm_bios.h>
7#include <linux/edd.h>
8#include <asm/e820.h>
9#include <asm/ist.h>
10#include <asm/video/edid.h>
11
Simon Glass90f2b5a2023-03-20 08:30:06 +130012/* setup_data/setup_indirect types */
13#define SETUP_NONE 0
14#define SETUP_E820_EXT 1
15#define SETUP_DTB 2
16#define SETUP_PCI 3
17#define SETUP_EFI 4
18#define SETUP_APPLE_PROPERTIES 5
19#define SETUP_JAILHOUSE 6
20#define SETUP_CC_BLOB 7
21#define SETUP_IMA 8
22#define SETUP_RNG_SEED 9
23#define SETUP_ENUM_MAX SETUP_RNG_SEED
24
25#define SETUP_INDIRECT BIT(31)
26#define SETUP_TYPE_MAX (SETUP_ENUM_MAX | SETUP_INDIRECT)
27
28/* ram_size flags */
29#define RAMDISK_IMAGE_START_MASK 0x07FF
30#define RAMDISK_PROMPT_FLAG 0x8000
31#define RAMDISK_LOAD_FLAG 0x4000
32
33/* loadflags */
34#define LOADED_HIGH BIT(0)
35#define KASLR_FLAG BIT(1)
36#define QUIET_FLAG BIT(5)
37#define KEEP_SEGMENTS BIT(6)
38#define CAN_USE_HEAP BIT(7)
39
40#define XLF_KERNEL_64 BIT(0)
41#define XLF_CAN_BE_LOADED_ABOVE_4G BIT(1)
42#define XLF_EFI_HANDOVER_32 BIT(2)
43#define XLF_EFI_HANDOVER_64 BIT(3)
44#define XLF_EFI_KEXEC BIT(4)
Graeme Russ95ffaba2010-04-24 00:05:49 +100045
46/* extensible setup data list node */
47struct setup_data {
48 __u64 next;
49 __u32 type;
50 __u32 len;
Simon Glass90f2b5a2023-03-20 08:30:06 +130051 __u8 data[];
52};
53
54/* extensible setup indirect data node */
55struct setup_indirect {
56 __u32 type;
57 __u32 reserved; /* Reserved, must be set to zero. */
58 __u64 len;
59 __u64 addr;
Graeme Russ95ffaba2010-04-24 00:05:49 +100060};
61
Simon Glass6e04cb72020-09-05 14:50:37 -060062/**
63 * struct setup_header - Information needed by Linux to boot
64 *
Paul Barker0ef63432023-07-07 07:51:42 +010065 * See https://www.kernel.org/doc/html/latest/arch/x86/boot.html
Simon Glass6e04cb72020-09-05 14:50:37 -060066 */
Graeme Russ95ffaba2010-04-24 00:05:49 +100067struct setup_header {
68 __u8 setup_sects;
69 __u16 root_flags;
70 __u32 syssize;
71 __u16 ram_size;
Graeme Russ95ffaba2010-04-24 00:05:49 +100072 __u16 vid_mode;
73 __u16 root_dev;
74 __u16 boot_flag;
75 __u16 jump;
76 __u32 header;
77 __u16 version;
78 __u32 realmode_swtch;
Simon Glass90f2b5a2023-03-20 08:30:06 +130079 __u16 start_sys_seg;
Graeme Russ95ffaba2010-04-24 00:05:49 +100080 __u16 kernel_version;
81 __u8 type_of_loader;
82 __u8 loadflags;
Graeme Russ95ffaba2010-04-24 00:05:49 +100083 __u16 setup_move_size;
84 __u32 code32_start;
85 __u32 ramdisk_image;
86 __u32 ramdisk_size;
Simon Glass6e04cb72020-09-05 14:50:37 -060087 __u32 bootsect_kludge; /* Obsolete */
Graeme Russ95ffaba2010-04-24 00:05:49 +100088 __u16 heap_end_ptr;
89 __u8 ext_loader_ver;
90 __u8 ext_loader_type;
91 __u32 cmd_line_ptr;
92 __u32 initrd_addr_max;
93 __u32 kernel_alignment;
94 __u8 relocatable_kernel;
Simon Glass90f2b5a2023-03-20 08:30:06 +130095 __u8 min_alignment;
96 __u16 xloadflags;
Graeme Russ95ffaba2010-04-24 00:05:49 +100097 __u32 cmdline_size;
98 __u32 hardware_subarch;
99 __u64 hardware_subarch_data;
100 __u32 payload_offset;
101 __u32 payload_length;
102 __u64 setup_data;
Stefan Roese88d915b2016-09-30 09:15:59 +0200103 __u64 pref_address;
104 __u32 init_size;
105 __u32 handover_offset;
Simon Glass90f2b5a2023-03-20 08:30:06 +1300106 __u32 kernel_info_offset;
Graeme Russ95ffaba2010-04-24 00:05:49 +1000107} __attribute__((packed));
108
109struct sys_desc_table {
110 __u16 length;
111 __u8 table[14];
112};
113
114struct efi_info {
115 __u32 efi_loader_signature;
116 __u32 efi_systab;
117 __u32 efi_memdesc_size;
118 __u32 efi_memdesc_version;
119 __u32 efi_memmap;
120 __u32 efi_memmap_size;
121 __u32 efi_systab_hi;
122 __u32 efi_memmap_hi;
123};
124
125/* The so-called "zeropage" */
126struct boot_params {
127 struct screen_info screen_info; /* 0x000 */
128 struct apm_bios_info apm_bios_info; /* 0x040 */
129 __u8 _pad2[4]; /* 0x054 */
130 __u64 tboot_addr; /* 0x058 */
131 struct ist_info ist_info; /* 0x060 */
Andy Shevchenkod905aa82019-09-13 18:42:00 +0300132 __u64 acpi_rsdp_addr; /* 0x070 */
133 __u8 _pad3[8]; /* 0x078 */
Graeme Russ95ffaba2010-04-24 00:05:49 +1000134 __u8 hd0_info[16]; /* obsolete! */ /* 0x080 */
135 __u8 hd1_info[16]; /* obsolete! */ /* 0x090 */
136 struct sys_desc_table sys_desc_table; /* 0x0a0 */
137 __u8 _pad4[144]; /* 0x0b0 */
138 struct edid_info edid_info; /* 0x140 */
139 struct efi_info efi_info; /* 0x1c0 */
140 __u32 alt_mem_k; /* 0x1e0 */
141 __u32 scratch; /* Scratch field! */ /* 0x1e4 */
142 __u8 e820_entries; /* 0x1e8 */
143 __u8 eddbuf_entries; /* 0x1e9 */
144 __u8 edd_mbr_sig_buf_entries; /* 0x1ea */
145 __u8 _pad6[6]; /* 0x1eb */
146 struct setup_header hdr; /* setup header */ /* 0x1f1 */
147 __u8 _pad7[0x290-0x1f1-sizeof(struct setup_header)];
148 __u32 edd_mbr_sig_buffer[EDD_MBR_SIG_MAX]; /* 0x290 */
Bin Meng45519922018-04-11 22:02:11 -0700149 struct e820_entry e820_map[E820MAX]; /* 0x2d0 */
Graeme Russ95ffaba2010-04-24 00:05:49 +1000150 __u8 _pad8[48]; /* 0xcd0 */
151 struct edd_info eddbuf[EDDMAXNR]; /* 0xd00 */
152 __u8 _pad9[276]; /* 0xeec */
153} __attribute__((packed));
154
155enum {
156 X86_SUBARCH_PC = 0,
157 X86_SUBARCH_LGUEST,
158 X86_SUBARCH_XEN,
Andy Shevchenko7cbaddd2017-01-08 23:51:04 +0300159 X86_SUBARCH_INTEL_MID,
160 X86_SUBARCH_CE4100,
Graeme Russ95ffaba2010-04-24 00:05:49 +1000161 X86_NR_SUBARCHS,
162};
Graeme Russ95ffaba2010-04-24 00:05:49 +1000163#endif /* _ASM_X86_BOOTPARAM_H */