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.
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
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.
16 ################################################################################
18 # Defines Section - statements that will be processed to create a Makefile.
20 ################################################################################
22 PLATFORM_NAME = ArmVirtQemu
23 PLATFORM_GUID = 37d7e986-f7e9-45c2-8067-e371421a626c
24 PLATFORM_VERSION = 0.1
25 DSC_SPECIFICATION = 0x00010005
26 OUTPUT_DIRECTORY = Build/ArmVirtQemu-$(ARCH)
27 SUPPORTED_ARCHITECTURES = AARCH64|ARM
28 BUILD_TARGETS = DEBUG|RELEASE
29 SKUID_IDENTIFIER = DEFAULT
30 FLASH_DEFINITION = ArmVirtPkg/ArmVirtQemu.fdf
33 # Defines for default states. These can be changed on the command line.
36 DEFINE SECURE_BOOT_ENABLE = FALSE
38 !include ArmVirtPkg/ArmVirt.dsc.inc
40 [LibraryClasses.AARCH64]
41 ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64Lib.inf
42 ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexAEMv8Lib/ArmCortexAEMv8Lib.inf
45 ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7Lib.inf
46 ArmCpuLib|ArmPkg/Drivers/ArmCpuLib/ArmCortexA15Lib/ArmCortexA15Lib.inf
48 [LibraryClasses.common]
50 VirtioLib|OvmfPkg/Library/VirtioLib/VirtioLib.inf
51 VirtioMmioDeviceLib|OvmfPkg/Library/VirtioMmioDeviceLib/VirtioMmioDeviceLib.inf
52 QemuFwCfgLib|ArmVirtPkg/Library/QemuFwCfgLib/QemuFwCfgLib.inf
54 ArmPlatformLib|ArmVirtPkg/Library/ArmVirtPlatformLib/ArmVirtPlatformLib.inf
55 ArmPlatformSysConfigLib|ArmPlatformPkg/Library/ArmPlatformSysConfigLibNull/ArmPlatformSysConfigLibNull.inf
57 TimerLib|ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.inf
58 NorFlashPlatformLib|ArmVirtPkg/Library/NorFlashQemuLib/NorFlashQemuLib.inf
60 CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf
61 GenericBdsLib|IntelFrameworkModulePkg/Library/GenericBdsLib/GenericBdsLib.inf
62 PlatformBdsLib|ArmVirtPkg/Library/PlatformIntelBdsLib/PlatformIntelBdsLib.inf
63 CustomizedDisplayLib|MdeModulePkg/Library/CustomizedDisplayLib/CustomizedDisplayLib.inf
64 QemuBootOrderLib|OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.inf
65 !if $(SECURE_BOOT_ENABLE) == TRUE
66 FileExplorerLib|MdeModulePkg/Library/FileExplorerLib/FileExplorerLib.inf
69 [LibraryClasses.common.UEFI_DRIVER]
70 UefiScsiLib|MdePkg/Library/UefiScsiLib/UefiScsiLib.inf
72 [LibraryClasses.AARCH64.SEC]
73 ArmLib|ArmPkg/Library/ArmLib/AArch64/AArch64LibSec.inf
75 [LibraryClasses.ARM.SEC]
76 ArmLib|ArmPkg/Library/ArmLib/ArmV7/ArmV7LibSec.inf
79 RVCT:*_*_ARM_PLATFORM_FLAGS == --cpu Cortex-A15 -I$(WORKSPACE)/ArmVirtPkg/Include
80 GCC:*_*_ARM_PLATFORM_FLAGS == -mcpu=cortex-a15 -I$(WORKSPACE)/ArmVirtPkg/Include
81 *_*_AARCH64_PLATFORM_FLAGS == -I$(WORKSPACE)/ArmVirtPkg/Include
84 ################################################################################
86 # Pcd Section - list of all EDK II PCD Entries defined by this Platform
88 ################################################################################
90 [PcdsFeatureFlag.common]
91 gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderPciTranslation|TRUE
92 gUefiOvmfPkgTokenSpaceGuid.PcdQemuBootOrderMmioTranslation|TRUE
94 ## If TRUE, Graphics Output Protocol will be installed on virtual handle created by ConsplitterDxe.
95 # It could be set FALSE to save size.
96 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE
97 gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE
99 # Activate KVM workaround for now.
100 gArmVirtTokenSpaceGuid.PcdKludgeMapPciMmioAsCached|TRUE
102 [PcdsFixedAtBuild.common]
103 gArmPlatformTokenSpaceGuid.PcdCoreCount|1
104 !if $(ARCH) == AARCH64
105 gArmTokenSpaceGuid.PcdVFPEnabled|1
108 gArmPlatformTokenSpaceGuid.PcdCPUCoresStackBase|0x4007c000
109 gArmPlatformTokenSpaceGuid.PcdCPUCorePrimaryStackSize|0x4000
111 # Size of the region used by UEFI in permanent memory (Reserved 64MB)
112 gArmPlatformTokenSpaceGuid.PcdSystemMemoryUefiRegionSize|0x04000000
117 gArmTokenSpaceGuid.PcdArmUncachedMemoryMask|0x0000000040000000
119 ## Trustzone enable (to make the transition from EL3 to EL2 in ArmPlatformPkg/Sec)
120 gArmTokenSpaceGuid.PcdTrustzoneSupport|FALSE
126 ## PL011 - Serial Terminal
127 gEfiMdePkgTokenSpaceGuid.PcdUartDefaultBaudRate|38400
129 ## Default Terminal Type
130 ## 0-PCANSI, 1-VT100, 2-VT00+, 3-UTF8, 4-TTYTERM
131 !if $(TTY_TERMINAL) == TRUE
132 gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|4
134 gEfiMdePkgTokenSpaceGuid.PcdDefaultTerminalType|1
136 gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|3
139 # ARM Virtual Architectural Timer -- fetch frequency from QEMU (TCG) or KVM
141 gArmTokenSpaceGuid.PcdArmArchTimerFreqInHz|0
144 # NV Storage PCDs. Use base of 0x04000000 for NOR1
146 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|0x04000000
147 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize|0x00040000
148 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|0x04040000
149 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize|0x00040000
150 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|0x04080000
151 gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize|0x00040000
153 # System Memory Base -- fixed at 0x4000_0000
154 gArmTokenSpaceGuid.PcdSystemMemoryBase|0x40000000
156 # initial location of the device tree blob passed by QEMU -- base of DRAM
157 gArmVirtTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress|0x40000000
159 gEfiMdeModulePkgTokenSpaceGuid.PcdResetOnMemoryTypeInformationChange|FALSE
160 gEfiIntelFrameworkModulePkgTokenSpaceGuid.PcdShellFile|{ 0x83, 0xA5, 0x04, 0x7C, 0x3E, 0x9E, 0x1C, 0x4F, 0xAD, 0x65, 0xE0, 0x52, 0x68, 0xD0, 0xB4, 0xD1 }
163 # The maximum physical I/O addressability of the processor, set with
166 gEmbeddedTokenSpaceGuid.PcdPrePiCpuIoSize|16
168 [PcdsFixedAtBuild.AARCH64]
169 gEfiMdeModulePkgTokenSpaceGuid.PcdSetNxForStack|TRUE
171 # KVM limits it IPA space to 40 bits (1 TB), so there is no need to
172 # support anything bigger, even if the host hardware does
173 gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize|40
175 # Clearing BIT0 in this PCD prevents installing a 32-bit SMBIOS entry point,
176 # if the entry point version is >= 3.0. AARCH64 OSes cannot assume the
177 # presence of the 32-bit entry point anyway (because many AARCH64 systems
178 # don't have 32-bit addressable physical RAM), and the additional allocations
179 # below 4 GB needlessly fragment the memory map. So expose the 64-bit entry
180 # point only, for entry point versions >= 3.0.
181 gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosEntryPointProvideMethod|0x2
183 # ACPI predates the AARCH64 architecture by 5 versions, so
184 # we only target OSes that support ACPI v5.0 or later
185 gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiExposedTableVersions|0x20
187 [PcdsDynamicDefault.common]
188 ## If TRUE, OvmfPkg/AcpiPlatformDxe will not wait for PCI
189 # enumeration to complete before installing ACPI tables.
190 gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|TRUE
192 # System Memory Size -- 1 MB initially, actual size will be fetched from DT
193 gArmTokenSpaceGuid.PcdSystemMemorySize|0x00100000
195 gArmTokenSpaceGuid.PcdArmArchTimerSecIntrNum|0x0
196 gArmTokenSpaceGuid.PcdArmArchTimerIntrNum|0x0
197 gArmTokenSpaceGuid.PcdArmArchTimerVirtIntrNum|0x0
198 gArmTokenSpaceGuid.PcdArmArchTimerHypIntrNum|0x0
201 # ARM General Interrupt Controller
203 gArmTokenSpaceGuid.PcdGicDistributorBase|0x0
204 gArmTokenSpaceGuid.PcdGicRedistributorsBase|0x0
205 gArmTokenSpaceGuid.PcdGicInterruptInterfaceBase|0x0
206 gArmVirtTokenSpaceGuid.PcdArmGicRevision|0x0
208 ## PL031 RealTimeClock
209 gArmPlatformTokenSpaceGuid.PcdPL031RtcBase|0x0
211 gArmPlatformTokenSpaceGuid.PcdPciBusMin|0x0
212 gArmPlatformTokenSpaceGuid.PcdPciBusMax|0x0
213 gArmPlatformTokenSpaceGuid.PcdPciIoBase|0x0
214 gArmPlatformTokenSpaceGuid.PcdPciIoSize|0x0
215 gArmPlatformTokenSpaceGuid.PcdPciIoTranslation|0x0
216 gArmPlatformTokenSpaceGuid.PcdPciMmio32Base|0x0
217 gArmPlatformTokenSpaceGuid.PcdPciMmio32Size|0x0
218 gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0x0
220 gArmVirtTokenSpaceGuid.PcdArmPsciMethod|0
222 gArmVirtTokenSpaceGuid.PcdFwCfgSelectorAddress|0x0
223 gArmVirtTokenSpaceGuid.PcdFwCfgDataAddress|0x0
224 gArmVirtTokenSpaceGuid.PcdFwCfgDmaAddress|0x0
227 # Set video resolution for boot options and for text setup.
228 # PlatformDxe can set the former at runtime.
230 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|800
231 gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|600
232 gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoHorizontalResolution|640
233 gEfiMdeModulePkgTokenSpaceGuid.PcdSetupVideoVerticalResolution|480
236 # SMBIOS entry point version
238 gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0300
239 gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosDocRev|0x0
240 gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated|FALSE
242 ################################################################################
244 # Components Section - list of all EDK II Modules needed by this Platform
246 ################################################################################
251 ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
252 MdeModulePkg/Core/Pei/PeiMain.inf
253 MdeModulePkg/Universal/PCD/Pei/Pcd.inf
254 ArmPlatformPkg/PlatformPei/PlatformPeim.inf
255 ArmPlatformPkg/MemoryInitPei/MemoryInitPeim.inf
256 ArmPkg/Drivers/CpuPei/CpuPei.inf
258 MdeModulePkg/Universal/Variable/Pei/VariablePei.inf
260 MdeModulePkg/Core/DxeIplPeim/DxeIpl.inf {
262 NULL|MdeModulePkg/Library/LzmaCustomDecompressLib/LzmaCustomDecompressLib.inf
268 MdeModulePkg/Core/Dxe/DxeMain.inf {
270 NULL|MdeModulePkg/Library/DxeCrc32GuidedSectionExtractLib/DxeCrc32GuidedSectionExtractLib.inf
272 MdeModulePkg/Universal/PCD/Dxe/Pcd.inf
275 # Architectural Protocols
277 ArmPkg/Drivers/CpuDxe/CpuDxe.inf
278 MdeModulePkg/Core/RuntimeDxe/RuntimeDxe.inf
279 MdeModulePkg/Universal/Variable/RuntimeDxe/VariableRuntimeDxe.inf {
281 NULL|MdeModulePkg/Library/VarCheckUefiLib/VarCheckUefiLib.inf
283 !if $(SECURE_BOOT_ENABLE) == TRUE
284 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf {
286 NULL|SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.inf
288 SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigDxe.inf
290 MdeModulePkg/Universal/SecurityStubDxe/SecurityStubDxe.inf
292 MdeModulePkg/Universal/CapsuleRuntimeDxe/CapsuleRuntimeDxe.inf
293 MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteDxe.inf
294 MdeModulePkg/Universal/MonotonicCounterRuntimeDxe/MonotonicCounterRuntimeDxe.inf
295 EmbeddedPkg/ResetRuntimeDxe/ResetRuntimeDxe.inf
296 EmbeddedPkg/RealTimeClockRuntimeDxe/RealTimeClockRuntimeDxe.inf
297 EmbeddedPkg/MetronomeDxe/MetronomeDxe.inf
299 MdeModulePkg/Universal/Console/ConPlatformDxe/ConPlatformDxe.inf
300 MdeModulePkg/Universal/Console/ConSplitterDxe/ConSplitterDxe.inf
301 MdeModulePkg/Universal/Console/GraphicsConsoleDxe/GraphicsConsoleDxe.inf
302 MdeModulePkg/Universal/Console/TerminalDxe/TerminalDxe.inf
303 MdeModulePkg/Universal/SerialDxe/SerialDxe.inf
305 MdeModulePkg/Universal/HiiDatabaseDxe/HiiDatabaseDxe.inf
307 ArmPkg/Drivers/ArmGic/ArmGicDxe.inf
308 ArmPkg/Drivers/TimerDxe/TimerDxe.inf
309 !if $(SECURE_BOOT_ENABLE) == TRUE
310 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashAuthenticatedDxe.inf
312 ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashDxe.inf
314 MdeModulePkg/Universal/WatchdogTimerDxe/WatchdogTimer.inf
319 ArmVirtPkg/VirtFdtDxe/VirtFdtDxe.inf
320 ArmVirtPkg/HighMemDxe/HighMemDxe.inf
321 OvmfPkg/VirtioBlkDxe/VirtioBlk.inf
322 OvmfPkg/VirtioScsiDxe/VirtioScsi.inf
323 OvmfPkg/VirtioNetDxe/VirtioNet.inf
324 OvmfPkg/VirtioRngDxe/VirtioRng.inf
327 # FAT filesystem + GPT/MBR partitioning
329 MdeModulePkg/Universal/Disk/DiskIoDxe/DiskIoDxe.inf
330 MdeModulePkg/Universal/Disk/PartitionDxe/PartitionDxe.inf
331 MdeModulePkg/Universal/Disk/UnicodeCollation/EnglishDxe/EnglishDxe.inf
336 MdeModulePkg/Universal/DevicePathDxe/DevicePathDxe.inf
337 MdeModulePkg/Universal/DisplayEngineDxe/DisplayEngineDxe.inf
338 MdeModulePkg/Universal/SetupBrowserDxe/SetupBrowserDxe.inf
339 IntelFrameworkModulePkg/Universal/BdsDxe/BdsDxe.inf
342 # SCSI Bus and Disk Driver
344 MdeModulePkg/Bus/Scsi/ScsiBusDxe/ScsiBusDxe.inf
345 MdeModulePkg/Bus/Scsi/ScsiDiskDxe/ScsiDiskDxe.inf
350 MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf {
352 NULL|OvmfPkg/Library/SmbiosVersionLib/DetectSmbiosVersionLib.inf
354 OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf
359 ArmVirtPkg/PciHostBridgeDxe/PciHostBridgeDxe.inf
360 MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf
361 OvmfPkg/VirtioPciDeviceDxe/VirtioPciDeviceDxe.inf
366 OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf {
368 BltLib|OptionRomPkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf
370 OvmfPkg/PlatformDxe/Platform.inf
375 MdeModulePkg/Bus/Pci/UhciDxe/UhciDxe.inf
376 MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
377 MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
378 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
379 MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
385 MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf
386 OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf
390 # The ARM/Linux kernel has no built in EFI boot stub (yet), so we still need
391 # an intermediate OS loader. Add the LinuxLoader UEFI application so we can
392 # invoke it from the shell.
394 MdeModulePkg/Universal/FvSimpleFileSystemDxe/FvSimpleFileSystemDxe.inf
395 ArmPkg/Application/LinuxLoader/LinuxLoader.inf {
397 BdsLib|ArmPkg/Library/BdsLib/BdsLib.inf