]> git.proxmox.com Git - mirror_edk2.git/blob - ArmVirtPkg/ArmVirtQemuKernel.fdf
ArmVirtPkg/ArmVirtQemu: factor out shared FV.FvMain definition
[mirror_edk2.git] / ArmVirtPkg / ArmVirtQemuKernel.fdf
1 #
2 # Copyright (c) 2011-2015, ARM Limited. All rights reserved.
3 # Copyright (c) 2014, Linaro Limited. All rights reserved.
4 # Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
5 #
6 # This program and the accompanying materials
7 # are licensed and made available under the terms and conditions of the BSD License
8 # which accompanies this distribution. The full text of the license may be found at
9 # http://opensource.org/licenses/bsd-license.php
10 #
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 #
14
15 ################################################################################
16 #
17 # FD Section
18 # The [FD] Section is made up of the definition statements and a
19 # description of what goes into the Flash Device Image. Each FD section
20 # defines one flash "device" image. A flash device image may be one of
21 # the following: Removable media bootable image (like a boot floppy
22 # image,) an Option ROM image (that would be "flashed" into an add-in
23 # card,) a System "Flash" image (that would be burned into a system's
24 # flash) or an Update ("Capsule") image that will be used to update and
25 # existing system flash.
26 #
27 ################################################################################
28
29 [FD.QEMU_EFI]
30 BaseAddress = 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress # QEMU assigns 0 - 0x8000000 for a BootROM
31 Size = 0x00200000|gArmTokenSpaceGuid.PcdFdSize # The size in bytes of the FLASH Device
32 ErasePolarity = 1
33
34 # This one is tricky, it must be: BlockSize * NumBlocks = Size
35 BlockSize = 0x00001000
36 NumBlocks = 0x200
37
38 ################################################################################
39 #
40 # Following are lists of FD Region layout which correspond to the locations of different
41 # images within the flash device.
42 #
43 # Regions must be defined in ascending order and may not overlap.
44 #
45 # A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
46 # the pipe "|" character, followed by the size of the region, also in hex with the leading
47 # "0x" characters. Like:
48 # Offset|Size
49 # PcdOffsetCName|PcdSizeCName
50 # RegionType <FV, DATA, or FILE>
51 #
52 ################################################################################
53
54 #
55 # Implement the Linux kernel header layout so that the Xen loader will identify
56 # it as something bootable, and execute it with a FDT pointer in x0 or r2.
57 # This area will be reused to store a copy of the FDT so round it up to 8 KB.
58 #
59 0x00000000|0x00002000
60 DATA = {
61 !if $(ARCH) == AARCH64
62 0x01, 0x00, 0x00, 0x10, # code0: adr x1, .
63 0xff, 0x07, 0x00, 0x14, # code1: b 0x2000
64 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, # text_offset: 512 KB
65 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, # image_size: 2 MB
66 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # flags
67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res2
68 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res3
69 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, # res4
70 0x41, 0x52, 0x4d, 0x64, # magic: "ARM\x64"
71 0x00, 0x00, 0x00, 0x00 # res5
72 !else
73 0x08, 0x10, 0x4f, 0xe2, # adr r1, .
74 0x02, 0x00, 0xa0, 0xe1, # mov r0, r2 (DTB)
75 0x00, 0x00, 0xa0, 0xe1, # nop
76 0x00, 0x00, 0xa0, 0xe1, # nop
77 0x00, 0x00, 0xa0, 0xe1, # nop
78 0x00, 0x00, 0xa0, 0xe1, # nop
79 0x00, 0x00, 0xa0, 0xe1, # nop
80 0x00, 0x00, 0xa0, 0xe1, # nop
81
82 0xf6, 0x07, 0x00, 0xea, # b 0x2000
83 0x18, 0x28, 0x6f, 0x01, # magic
84 0x00, 0x00, 0x00, 0x00, # start
85 0x00, 0x00, 0x20, 0x00, # image size: 2 MB
86 0x01, 0x02, 0x03, 0x04 # endiannness flag
87 !endif
88 }
89
90 0x00002000|0x001fe000
91 gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
92 FV = FVMAIN_COMPACT
93
94 !include VarStore.fdf.inc
95
96 ################################################################################
97 #
98 # FV Section
99 #
100 # [FV] section is used to define what components or modules are placed within a flash
101 # device file. This section also defines order the components and modules are positioned
102 # within the image. The [FV] section consists of define statements, set statements and
103 # module statements.
104 #
105 ################################################################################
106
107 !include ArmVirtQemuFvMain.fdf.inc
108
109 [FV.FVMAIN_COMPACT]
110 FvAlignment = 16
111 ERASE_POLARITY = 1
112 MEMORY_MAPPED = TRUE
113 STICKY_WRITE = TRUE
114 LOCK_CAP = TRUE
115 LOCK_STATUS = TRUE
116 WRITE_DISABLED_CAP = TRUE
117 WRITE_ENABLED_CAP = TRUE
118 WRITE_STATUS = TRUE
119 WRITE_LOCK_CAP = TRUE
120 WRITE_LOCK_STATUS = TRUE
121 READ_DISABLED_CAP = TRUE
122 READ_ENABLED_CAP = TRUE
123 READ_STATUS = TRUE
124 READ_LOCK_CAP = TRUE
125 READ_LOCK_STATUS = TRUE
126
127 INF ArmVirtPkg/PrePi/ArmVirtPrePiUniCoreRelocatable.inf
128
129 FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
130 SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
131 SECTION FV_IMAGE = FVMAIN
132 }
133 }
134
135
136 ################################################################################
137 #
138 # Rules are use with the [FV] section's module INF type to define
139 # how an FFS file is created for a given INF file. The following Rule are the default
140 # rules for the different module type. User can add the customized rules to define the
141 # content of the FFS file.
142 #
143 ################################################################################
144
145
146 ############################################################################
147 # Example of a DXE_DRIVER FFS file with a Checksum encapsulation section #
148 ############################################################################
149 #
150 #[Rule.Common.DXE_DRIVER]
151 # FILE DRIVER = $(NAMED_GUID) {
152 # DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
153 # COMPRESS PI_STD {
154 # GUIDED {
155 # PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
156 # UI STRING="$(MODULE_NAME)" Optional
157 # VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
158 # }
159 # }
160 # }
161 #
162 ############################################################################
163
164 [Rule.Common.SEC]
165 FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED FIXED {
166 TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
167 }
168
169 [Rule.Common.PEI_CORE]
170 FILE PEI_CORE = $(NAMED_GUID) FIXED {
171 TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
172 UI STRING ="$(MODULE_NAME)" Optional
173 }
174
175 [Rule.Common.PEIM]
176 FILE PEIM = $(NAMED_GUID) FIXED {
177 PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
178 TE TE Align = Auto $(INF_OUTPUT)/$(MODULE_NAME).efi
179 UI STRING="$(MODULE_NAME)" Optional
180 }
181
182 [Rule.Common.PEIM.TIANOCOMPRESSED]
183 FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 {
184 PEI_DEPEX PEI_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
185 GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
186 PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
187 UI STRING="$(MODULE_NAME)" Optional
188 }
189 }
190
191 [Rule.Common.DXE_CORE]
192 FILE DXE_CORE = $(NAMED_GUID) {
193 PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
194 UI STRING="$(MODULE_NAME)" Optional
195 }
196
197 [Rule.Common.UEFI_DRIVER]
198 FILE DRIVER = $(NAMED_GUID) {
199 DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
200 PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
201 UI STRING="$(MODULE_NAME)" Optional
202 }
203
204 [Rule.Common.DXE_DRIVER]
205 FILE DRIVER = $(NAMED_GUID) {
206 DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
207 PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
208 UI STRING="$(MODULE_NAME)" Optional
209 }
210
211 [Rule.Common.DXE_RUNTIME_DRIVER]
212 FILE DRIVER = $(NAMED_GUID) {
213 DXE_DEPEX DXE_DEPEX Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
214 PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
215 UI STRING="$(MODULE_NAME)" Optional
216 }
217
218 [Rule.Common.UEFI_APPLICATION]
219 FILE APPLICATION = $(NAMED_GUID) {
220 UI STRING ="$(MODULE_NAME)" Optional
221 PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi
222 }
223
224 [Rule.Common.UEFI_DRIVER.BINARY]
225 FILE DRIVER = $(NAMED_GUID) {
226 DXE_DEPEX DXE_DEPEX Optional |.depex
227 PE32 PE32 |.efi
228 UI STRING="$(MODULE_NAME)" Optional
229 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
230 }
231
232 [Rule.Common.UEFI_APPLICATION.BINARY]
233 FILE APPLICATION = $(NAMED_GUID) {
234 PE32 PE32 |.efi
235 UI STRING="$(MODULE_NAME)" Optional
236 VERSION STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
237 }
238
239 [Rule.Common.USER_DEFINED.ACPITABLE]
240 FILE FREEFORM = $(NAMED_GUID) {
241 RAW ACPI |.acpi
242 RAW ASL |.aml
243 UI STRING="$(MODULE_NAME)" Optional
244 }