1#
2#  Copyright (c) 2011 - 2015, ARM Limited. All rights reserved.
3#
4#  This program and the accompanying materials
5#  are licensed and made available under the terms and conditions of the BSD License
6#  which accompanies this distribution.  The full text of the license may be found at
7#  http://opensource.org/licenses/bsd-license.php
8#
9#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11#
12
13################################################################################
14#
15# FD Section
16# The [FD] Section is made up of the definition statements and a
17# description of what goes into  the Flash Device Image.  Each FD section
18# defines one flash "device" image.  A flash device image may be one of
19# the following: Removable media bootable image (like a boot floppy
20# image,) an Option ROM image (that would be "flashed" into an add-in
21# card,) a System "Flash"  image (that would be burned into a system's
22# flash) or an Update ("Capsule") image that will be used to update and
23# existing system flash.
24#
25################################################################################
26
27[FD.FVP_AARCH64_EFI_SEC]
28BaseAddress   = 0x00000000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in SecureROM.
29Size          = 0x04000000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the device (64MiB).
30ErasePolarity = 1
31
32# This one is tricky, it must be: BlockSize * NumBlocks = Size
33BlockSize     = 0x00001000
34NumBlocks     = 0x4000
35
36################################################################################
37#
38# Following are lists of FD Region layout which correspond to the locations of different
39# images within the flash device.
40#
41# Regions must be defined in ascending order and may not overlap.
42#
43# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
44# the pipe "|" character, followed by the size of the region, also in hex with the leading
45# "0x" characters. Like:
46# Offset|Size
47# PcdOffsetCName|PcdSizeCName
48# RegionType <FV, DATA, or FILE>
49#
50################################################################################
51
520x00000000|0x00080000
53gArmTokenSpaceGuid.PcdSecureFvBaseAddress|gArmTokenSpaceGuid.PcdSecureFvSize
54FV = FVMAIN_SEC
55
56[FD.FVP_AARCH64_EFI]
57!ifdef ARM_FVP_RUN_NORFLASH
58BaseAddress   = 0x08000000|gArmTokenSpaceGuid.PcdFdBaseAddress  # The base address of the Firmware in Flash0.
59!else
60BaseAddress   = 0x88000000|gArmTokenSpaceGuid.PcdFdBaseAddress  # UEFI in DRAM + 128MB.
61!endif
62Size          = 0x04000000|gArmTokenSpaceGuid.PcdFdSize         # The size in bytes of the device (64MiB).
63ErasePolarity = 1
64
65# This one is tricky, it must be: BlockSize * NumBlocks = Size
66BlockSize     = 0x00001000
67NumBlocks     = 0x4000
68
690x00000000|0x00280000
70gArmTokenSpaceGuid.PcdFvBaseAddress|gArmTokenSpaceGuid.PcdFvSize
71FV = FVMAIN_COMPACT
72
73################################################################################
74#
75# FV Section
76#
77# [FV] section is used to define what components or modules are placed within a flash
78# device file.  This section also defines order the components and modules are positioned
79# within the image.  The [FV] section consists of define statements, set statements and
80# module statements.
81#
82################################################################################
83
84[FV.FVMAIN_SEC]
85FvBaseAddress      = 0x0  # Secure ROM
86FvForceRebase      = TRUE
87FvAlignment        = 16
88ERASE_POLARITY     = 1
89MEMORY_MAPPED      = TRUE
90STICKY_WRITE       = TRUE
91LOCK_CAP           = TRUE
92LOCK_STATUS        = TRUE
93WRITE_DISABLED_CAP = TRUE
94WRITE_ENABLED_CAP  = TRUE
95WRITE_STATUS       = TRUE
96WRITE_LOCK_CAP     = TRUE
97WRITE_LOCK_STATUS  = TRUE
98READ_DISABLED_CAP  = TRUE
99READ_ENABLED_CAP   = TRUE
100READ_STATUS        = TRUE
101READ_LOCK_CAP      = TRUE
102READ_LOCK_STATUS   = TRUE
103
104  INF ArmPlatformPkg/Sec/Sec.inf
105
106
107[FV.FvMain]
108BlockSize          = 0x40
109NumBlocks          = 0         # This FV gets compressed so make it just big enough
110FvAlignment        = 16        # FV alignment and FV attributes setting.
111ERASE_POLARITY     = 1
112MEMORY_MAPPED      = TRUE
113STICKY_WRITE       = TRUE
114LOCK_CAP           = TRUE
115LOCK_STATUS        = TRUE
116WRITE_DISABLED_CAP = TRUE
117WRITE_ENABLED_CAP  = TRUE
118WRITE_STATUS       = TRUE
119WRITE_LOCK_CAP     = TRUE
120WRITE_LOCK_STATUS  = TRUE
121READ_DISABLED_CAP  = TRUE
122READ_ENABLED_CAP   = TRUE
123READ_STATUS        = TRUE
124READ_LOCK_CAP      = TRUE
125READ_LOCK_STATUS   = TRUE
126FvNameGuid         = 87940482-fc81-41c3-87e6-399cf85ac8a0
127
128  APRIORI DXE {
129    INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
130  }
131
132  INF MdeModulePkg/Core/Dxe/DxeMain.inf
133  INF MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
134
135  #
136  # PI DXE Drivers producing Architectural Protocols (EFI Services)
137  #
138  INF ArmPkg/Drivers/CpuDxe/CpuDxe.inf
139  INF MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
140  INF MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
141  INF MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
142!if $(SECURE_BOOT_ENABLE) == TRUE
143  INF SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
144!endif
145  INF MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf
146  INF MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
147  INF MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
148  INF EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
149  INF EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
150  INF EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
151
152  INF MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
153
154  # ACPI Support
155  #
156  INF MdeModulePkg/Universal/Acpi/AcpiPlatformDxe/AcpiPlatformDxe.inf
157  INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
158  INF RuleOverride=ACPITABLE OpenPlatformPkg/Platforms/ARM/VExpress/AcpiTables/rtsm_ve-aemv8a/AcpiTables.inf
159
160  #
161  # Multiple Console IO support
162  #
163  INF MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
164  INF MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
165  INF MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
166  INF MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
167  INF MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
168
169  INF ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
170  INF ArmPkg/Drivers/TimerDxe/TimerDxe.inf
171!if $(SECURE_BOOT_ENABLE) == TRUE
172  INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashAuthenticatedDxe.inf
173!else
174  INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
175!endif
176!ifndef ARM_FOUNDATION_FVP
177  INF ArmPlatformPkg/Drivers/LcdGraphicsOutputDxe/PL111LcdGraphicsOutputDxe.inf
178!endif
179  INF ArmPlatformPkg/Drivers/SP805WatchdogDxe/SP805WatchdogDxe.inf
180
181  #
182  # Semi-hosting filesystem
183  #
184  INF ArmPkg/Filesystem/SemihostFs/SemihostFs.inf
185
186  #
187  # FAT filesystem + GPT/MBR partitioning
188  #
189  INF MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
190  INF MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
191  INF FatBinPkg/EnhancedFatDxe/Fat.inf
192  INF MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
193
194!ifndef ARM_FOUNDATION_FVP
195  #
196  # Multimedia Card Interface
197  #
198  INF EmbeddedPkg/Universal/MmcDxe/MmcDxe.inf
199  INF ArmPlatformPkg/Drivers/PL180MciDxe/PL180MciDxe.inf
200!endif
201
202  #
203  # SMBIOS Support
204  #
205  INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf
206
207  #
208  # Platform Driver
209  #
210  INF ArmPlatformPkg/ArmVExpressPkg/ArmVExpressDxe/ArmFvpDxe.inf
211  INF OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
212
213!ifdef EDK2_ENABLE_SMSC_91X
214!include OpenPlatformPkg/Platforms/ARM/VExpress/ArmVExpress-networking.fdf.inc
215  INF OpenPlatformPkg/Drivers/Net/Lan91xDxe/Lan91xDxe.inf
216!endif
217
218  #
219  # UEFI application (Shell Embedded Boot Loader)
220  #
221  INF ShellBinPkg/UefiShell/UefiShell.inf
222
223  #
224  # Bds
225  #
226  INF MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
227!if $(USE_ARM_BDS) == TRUE
228  INF ArmPlatformPkg/Bds/Bds.inf
229!else
230  INF MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
231  INF MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
232  INF IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
233
234  #
235  # TianoCore logo (splash screen)
236  #
237  FILE FREEFORM = PCD(gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdLogoFile) {
238   SECTION RAW = MdeModulePkg/Logo/Logo.bmp
239  }
240!endif
241
242  # Legacy Linux Loader
243  INF ArmPkg/Application/LinuxLoader/LinuxLoader.inf
244
245  # FV Filesystem
246  INF MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
247
248  #
249  # FDT installation
250  #
251  # The UEFI driver is at the end of the list of the driver to be dispatched
252  # after the device drivers (eg: Ethernet) to ensure we have support for them.
253  INF EmbeddedPkg/Drivers/FdtPlatformDxe/FdtPlatformDxe.inf
254
255!ifdef $(DTB_DIR)
256  #
257  # Embed flattened device tree (FDT) images for all known
258  # variants of this platform
259  #
260  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2) {
261    $(DTB_DIR)/fvp-base-gicv2-psci.dtb
262  }
263  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV2Legacy) {
264    $(DTB_DIR)/fvp-base-gicv2legacy-psci.dtb
265  }
266  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpBaseAEMv8x4GicV3) {
267    $(DTB_DIR)/fvp-base-gicv3-psci.dtb
268  }
269  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2) {
270    $(DTB_DIR)/fvp-foundation-gicv2-psci.dtb
271  }
272  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV2Legacy) {
273    $(DTB_DIR)/fvp-foundation-gicv2legacy-psci.dtb
274  }
275  FILE RAW = PCD (gArmVExpressTokenSpaceGuid.PcdFdtFvpFoundationGicV3) {
276    $(DTB_DIR)/fvp-foundation-gicv3-psci.dtb
277  }
278!endif
279
280[FV.FVMAIN_COMPACT]
281FvAlignment        = 16
282ERASE_POLARITY     = 1
283MEMORY_MAPPED      = TRUE
284STICKY_WRITE       = TRUE
285LOCK_CAP           = TRUE
286LOCK_STATUS        = TRUE
287WRITE_DISABLED_CAP = TRUE
288WRITE_ENABLED_CAP  = TRUE
289WRITE_STATUS       = TRUE
290WRITE_LOCK_CAP     = TRUE
291WRITE_LOCK_STATUS  = TRUE
292READ_DISABLED_CAP  = TRUE
293READ_ENABLED_CAP   = TRUE
294READ_STATUS        = TRUE
295READ_LOCK_CAP      = TRUE
296READ_LOCK_STATUS   = TRUE
297
298!if $(EDK2_SKIP_PEICORE) == 1
299  INF ArmPlatformPkg/PrePi/PeiMPCore.inf
300!else
301  INF ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
302  INF MdeModulePkg/Core/Pei/PeiMain.inf
303  INF ArmPlatformPkg/PlatformPei/PlatformPeim.inf
304  INF ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf
305  INF ArmPkg/Drivers/CpuPei/CpuPei.inf
306  INF MdeModulePkg/Universal/PCD/Pei/Pcd.inf
307  INF IntelFrameworkModulePkg/Universal/StatusCode/Pei/StatusCodePei.inf
308  INF MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
309  INF MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf
310!endif
311
312  FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
313    SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
314      SECTION FV_IMAGE = FVMAIN
315    }
316  }
317
318
319################################################################################
320#
321# Rules are use with the [FV] section's module INF type to define
322# how an FFS file is created for a given INF file. The following Rule are the default
323# rules for the different module type. User can add the customized rules to define the
324# content of the FFS file.
325#
326################################################################################
327
328
329############################################################################
330# Example of a DXE_DRIVER FFS file with a Checksum encapsulation section   #
331############################################################################
332#
333#[Rule.Common.DXE_DRIVER]
334#  FILE DRIVER = $(NAMED_GUID) {
335#    DXE_DEPEX    DXE_DEPEX               Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
336#    COMPRESS PI_STD {
337#      GUIDED {
338#        PE32     PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi
339#        UI       STRING="$(MODULE_NAME)" Optional
340#        VERSION  STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
341#      }
342#    }
343#  }
344#
345############################################################################
346
347[Rule.Common.SEC]
348  FILE SEC = $(NAMED_GUID) RELOCS_STRIPPED {
349    TE  TE Align = 4K                  $(INF_OUTPUT)/$(MODULE_NAME).efi
350  }
351
352[Rule.Common.PEI_CORE]
353  FILE PEI_CORE = $(NAMED_GUID) {
354    TE     TE Align = 8                 $(INF_OUTPUT)/$(MODULE_NAME).efi
355    UI     STRING ="$(MODULE_NAME)" Optional
356  }
357
358[Rule.Common.PEIM]
359  FILE PEIM = $(NAMED_GUID) {
360     PEI_DEPEX PEI_DEPEX Optional       $(INF_OUTPUT)/$(MODULE_NAME).depex
361     TE       TE Align = 8              $(INF_OUTPUT)/$(MODULE_NAME).efi
362     UI       STRING="$(MODULE_NAME)" Optional
363  }
364
365[Rule.Common.PEIM.TIANOCOMPRESSED]
366  FILE PEIM = $(NAMED_GUID) DEBUG_MYTOOLS_IA32 {
367    PEI_DEPEX PEI_DEPEX Optional        $(INF_OUTPUT)/$(MODULE_NAME).depex
368    GUIDED A31280AD-481E-41B6-95E8-127F4C984779 PROCESSING_REQUIRED = TRUE {
369      PE32      PE32                    $(INF_OUTPUT)/$(MODULE_NAME).efi
370      UI        STRING="$(MODULE_NAME)" Optional
371    }
372  }
373
374[Rule.Common.DXE_CORE]
375  FILE DXE_CORE = $(NAMED_GUID) {
376    PE32     PE32                       $(INF_OUTPUT)/$(MODULE_NAME).efi
377    UI       STRING="$(MODULE_NAME)" Optional
378  }
379
380[Rule.Common.UEFI_DRIVER]
381  FILE DRIVER = $(NAMED_GUID) {
382    DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
383    PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
384    UI           STRING="$(MODULE_NAME)" Optional
385  }
386
387[Rule.Common.DXE_DRIVER]
388  FILE DRIVER = $(NAMED_GUID) {
389    DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
390    PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
391    UI           STRING="$(MODULE_NAME)" Optional
392  }
393
394[Rule.Common.DXE_RUNTIME_DRIVER]
395  FILE DRIVER = $(NAMED_GUID) {
396    DXE_DEPEX    DXE_DEPEX              Optional $(INF_OUTPUT)/$(MODULE_NAME).depex
397    PE32         PE32                   $(INF_OUTPUT)/$(MODULE_NAME).efi
398    UI           STRING="$(MODULE_NAME)" Optional
399  }
400
401[Rule.Common.UEFI_APPLICATION]
402  FILE APPLICATION = $(NAMED_GUID) {
403    UI     STRING ="$(MODULE_NAME)"     Optional
404    PE32   PE32                         $(INF_OUTPUT)/$(MODULE_NAME).efi
405  }
406
407[Rule.Common.UEFI_DRIVER.BINARY]
408  FILE DRIVER = $(NAMED_GUID) {
409    DXE_DEPEX DXE_DEPEX Optional      |.depex
410    PE32      PE32                    |.efi
411    UI        STRING="$(MODULE_NAME)" Optional
412    VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
413  }
414
415[Rule.Common.UEFI_APPLICATION.BINARY]
416  FILE APPLICATION = $(NAMED_GUID) {
417    PE32      PE32                    |.efi
418    UI        STRING="$(MODULE_NAME)" Optional
419    VERSION   STRING="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER)
420  }
421
422[Rule.Common.USER_DEFINED.ACPITABLE]
423  FILE FREEFORM = $(NAMED_GUID) {
424    RAW ASL                |.aml
425  }
426