summaryrefslogtreecommitdiff
path: root/ArmVirtPkg
AgeCommit message (Collapse)AuthorFilesLines
2016-08-03ArmVirtPkg ARM: make relocatable PrePi users build with CLANG35Ard Biesheuvel2-0/+17
The clang developers have made a backward incompatible change to the command line arguments, and have replaced '-mllvm -arm-use-movt=0' with '-mno-movt'. This does not matter for most ARM platforms, and therefore it has been removed from the default CLANG35/ARM CC flags in patch 1c63516075b3 ("BaseTools CLANG35: drop problematic use-movt and save-temps options"), but as it turns out, the relocatable PrePi implementation used by ArmVirtQemuKernel and ArmVirtXen will fail to build if it contains MOVT/MOVW pairs, due to the fact that these are not runtime relocatable under ELF. Since they are runtime relocatable under PE/COFF, and GenFw does the right thing when encountering them, selectively controlling their use is more appropriate than disabling them altogether. Therefore, this patch adds the -mno-movt argument only for the platforms that use the relocatable PrePi, and only for the module types that may be pulled into its build. In addition, switch to the SEC type version of ArmLib, so that the relocatable PrePi only depends on BASE and SEC type libraries. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
2016-08-02ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: deal with relaxed XIP alignmentArd Biesheuvel1-2/+3
Commit b89919ee8f8c ("BaseTools AARCH64: override XIP module linker alignment to 32 bytes") updated the various AARCH64 toolchain definitions to allow SEC, PEI_CORE and PEIM modules to be built with minimal alignment requirements even when using the AArch64 small code model which normally requires 4 KB section alignment. This involves conversion of ADRP instructions into ADR instructions, which can only be done reliably if the ELF and the PE/COFF sections appear at the same offset modulo 4 KB. The ArmVirtPrePiUniCoreRelocatable linker script did not yet take this into account, so update it by starting the .text section at the next appropriately aligned offset PECOFF_HEADER_SIZE bytes into the image. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
2016-08-02BaseTools GCC: use 'gcc' as the linker command for GCC44 and laterArd Biesheuvel1-1/+1
To accommodate upcoming GCCx toolchain versions that require 'gcc' to be used as the linker in order to support LTO, switch GCC44 and later (including CLANG35) to a new DLINK build rule that invokes 'gcc' as the linker instead of 'ld'. Since gcc expects its command line arguments in a different format, and expects arguments that it needs to pass to the linker to be prefixed with '-Wl,', this involves changes to most of the DLINK_FLAGS definitions in tools_def.template, as well as some changes to module .INF files that set their own linker options. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-08-02ArmVirtPkg/ArmVirtPrePiUniCoreRelocatable: ignore .hash and .note sectionsArd Biesheuvel1-0/+3
Newer versions of ld automatically emit .gnu.hash and .note.gnu.build-id sections, which are not listed in the linker script, and will end up breaking the build with an allocation conflict, e.g., /usr/bin/aarch64-linux-gnu-ld: section .note.gnu.build-id loaded at [0000000000000000,0000000000000023] overlaps section .text loaded at [0000000000000000,0000000000017dbf] Since we don't require or care about these sections, update the linker script so that they are discarded. Note that this involves emitting the .note.gnu.build-id section into a non-allocatable segment to prevent the linker from noticing that it is being discarded (and subsequently complaining about it) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com>
2016-07-13ArmVirtPkg/PlatformBootManagerLib: remove stale FvFile boot optionsLaszlo Ersek2-0/+133
(This patch ports OvmfPkg commit 2eb358986052 to ArmVirtPkg. That functionality was not added to QemuBootOrderLib, because it was (and is) independent from QEMU and fw_cfg.) Remove any boot options that point to binaries built into the firmware and have become stale due to any of the following: - FvMain's base address or size changed (historical -- see commit e191a3114f4c), - FvMain's FvNameGuid changed, - the FILE_GUID of the pointed-to binary changed, - the referenced binary is no longer built into the firmware. For example, multiple such "EFI Internal Shell" boot options can coexist. They technically differ from each other, but may not describe any built-in shell binary exactly. Such options can accumulate in a varstore over time, and while they remain generally bootable (thanks to the efforts of BmGetFileBufferByFvFilePath()), they look bad. Filter out any stale options. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Fixes: https://github.com/tianocore/edk2/issues/107 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-07-12ArmVirtPkg: add name GUIDs to FvMain instancesArd Biesheuvel2-0/+2
Assign name GUIDs to the FVs that may appear in DevicePath references to things like the UiApp and the UEFI Shell. This prevents these device paths from changing inadvertently when the FV ends up in a different memory location due to external occurrences such as, e.g., a change in the amount of system memory. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-07-12ArmVirtPkg: factor out Rules FDF sectionArd Biesheuvel4-330/+126
All three current ArmVirtPkg have identical [Rules] sections in their FDF definitions, and ideally, they should remain that way. So factor out the definitions into a separate include file, and replace the existing definitions with !include directives. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-07-12ArmVirtPkg/ArmVirtQemu: factor out shared FV.FvMain definitionArd Biesheuvel3-306/+180
The FDF definition of [FV.FvMain] is identical between ArmVirtQemu and ArmVirtQemuKernel, and needs to remain that way. So factor it out into a separate include file, and replace both definitions with an !include directive. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-07-12ArmVirtPkg: align ArmVirtQemuKernel with ArmVirtQemuArd Biesheuvel2-0/+4
The platform ArmVirtQemuKernel is intended as an alternative for ArmVirtQemu that only deviates in the way it is invoked by QEMU, either from flash address 0x0 (the default ARM reset vector) or via the Linux kernel boot protocol. So add VirtioRngDxe and HighMemDxe here as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-07-12ArmVirtPkg: ArmVirtQemuKernel: make ACPI support AARCH64 onlyArd Biesheuvel2-9/+12
The reasoning of patch 8e2efec6b206: No ARM support for ACPI is planned under any OS we intend to run under ArmVirtQemu-ARM, so remove the drivers from the ARM build. applies equally to ArmVirtQemuKernel, so apply the same change there. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-07-12ArmVirtPkg/HighMemDxe: allow patchable PCD for PcdSystemMemoryBaseArd Biesheuvel2-2/+2
Redefine the reference to PcdSystemMemoryBase in HighMemDxe.inf as a plain [Pcd] rather than [FixedPcd] (and fix up the code as appropriate). This allows us to align ArmVirtQemuKernel with ArmVirtQemu, given that the former uses a patchable PCD not a fixed PCD. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-07-08ArmVirtPkg/PlatformBootManagerLib: Postpone the shell registrationLaszlo Ersek1-6/+8
This patch ports Gary's OvmfPkg commit 14b2ebc30c8b to ArmVirtPkg. Turns out Gary's argument in 14b2ebc30c8b is not only valid for Xen. The same situation arises with QEMU if: - the user specifies no boot order via fw_cfg at all (so QemuBootOrderLib won't touch the boot order), and - the varstore file has just been created from the varstore template. In this case the user is dropped to the UEFI shell (because the shell is registered earlier than all the auto-generated options), which is likely not what the user wants. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Lin <glin@suse.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-07-07ArmPkg ArmVirtPkg MdeModulePkg: switch to separate ArmMmuLibArd Biesheuvel5-0/+8
Switch all users of ArmLib that depend on the MMU routines to the new, separate ArmMmuLib. This needs to occur in one go, since the MMU routines are removed from ArmLib build at the same time, to prevent conflicting symbols. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2016-06-28ArmVirtPkg: Re-add the Driver Health ManagerBruce Cran4-0/+4
The Driver Health HII menu is not an integral part of the MdeModulePkg BDS driver / UI app. Because we abandoned the IntelFrameworkModulePkg BDS in the QEMU builds, now we have to get the same functionality explicitly from DriverHealthManagerDxe. Suggested-by: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bruce Cran <bruce@cran.org.uk> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: update commit message, drop Xen changes] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
2016-06-28ArmVirtPkg/ArmVirtXen: Add ACPI support for Virt Xen ARMShannon Zhao4-0/+310
Add ACPI support for Virt Xen ARM and only for aarch64. It gets the ACPI tables through Xen ARM multiboot protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-06-23ArmVirtPkg: add FDF definition for empty varstoreArd Biesheuvel5-20/+84
Similar to how OVMF implements this, add a FD definition for the varstore firmware volume and the FTW areas. The template was taken from the file OvmfPkg/VarStore.fdf.inc, and subsequently modified to accommodate the differences in NOR flash layout. This affects the FvLength, Checksum and BlockMap[0] fields in the FV header, the Size field of the varstore header, and the Crc and WriteQueueSize fields of the FTW header. The event log region is not used by ArmVirtQemu, so it has been omitted. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-06-22ArmVirtPkg/ArmVirtQemu: switch secure boot build to NorFlashDxeArd Biesheuvel4-16/+0
There is no longer a reason to use a different implementation of NorFlashDxe for secure boot builds now that the varstore FV header can carry either gEfiVariableGuid or gEfiAuthenticatedVariableGuid, and the dependent code has been updated to deal with that. So move the secure boot capable builds to the common NorFlashDxe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-06-15ArmVirtPkg/FdtPL011SerialPortLib: Set the PL011 UART clock rateEvan Lloyd4-3/+17
The interface to PL011UartInitializePort has changed in ArmPlatformPkg/Drivers/PL011Uart with the title: "ArmPlatformPkg: Add support to configure PL011 UART clock" This patch updates the calls to PL011UartInitializePort(), in line with that change, adding a parameter value using the PCD previously used directly by the driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Sami Mujawar <sami.mujawar@arm.com> Signed-off-by: Evan Lloyd <evan.lloyd@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-06-06ArmVirtPkg/PlatformBootManagerLib: introduce the progress barLaszlo Ersek1-0/+17
ArmVirtPkg's Platform BDS has never had a progress bar. We can easily add one, by copying the PlatformBootManagerWaitCallback() function verbatim from Nt32Pkg/Library/PlatformBootManagerLib/PlatformBootManager.c It can be tested by passing the following option to QEMU (5 seconds): -boot menu=on,splash-time=5000 Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-06-06ArmVirtPkg/PlatformBootManagerLib: rebase boot logo display to BootLogoLibLaszlo Ersek6-719/+21
In the course of porting ArmVirtPkg to the MdeModulePkg BDS, commit 1f73aef50c5e ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBoot open-coded the EnableQuietBoot() function (and its dependencies / friends) from IntelFrameworkModulePkg BDS. This code duplication can be avoided; the functionality is available from the following three libraries in MdeModulePkg: - BootLogoLib: provides the BootLogoEnableLogo() function. It does not provide the internal ConvertBmpToGopBlt() function -- that one is delegated to ImageDecoderLib (function DecodeImage()). - ImageDecoderLib: a general library that registers decoder plugins for specific image formats, and provides the generic DecodeImage() on top. - BmpImageDecoderLib: one of said decoder plugins, for handling BMP images (which is the format of our logo). In this patch, we revert 1f73aef50c5e, and atomically incorporate the above libraries. This is inspired by Nt32Pkg commit 859e75c4fc42: Nt32Pkg: Use BootLogoLib for logo and progress bar drawing. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Leif Lindholm <leif.lindholm@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
2016-05-25OvmfPkg, ArmVirtPkg: rename QemuNewBootOrderLib to QemuBootOrderLibLaszlo Ersek2-2/+2
This completes the transition to the new BDS. The FILE_GUID in "QemuBootOrderLib.inf" is intentionally not changed. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-25OvmfPkg, ArmVirtPkg: clean up SetBootOrderFromQemu() parameter listLaszlo Ersek1-1/+1
With OvmfPkg's original QemuBootOrderLib (and USE_OLD_BDS) gone, we no longer need the BootOptionList parameter in the SetBootOrderFromQemu() prototype. Update the library class header file (including the function's documentation), and adapt the library instance and the call sites. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Gary Ching-Pang Lin <glin@suse.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2016-05-10ArmVirtPkg: set PcdMaxVariableSize and PcdMaxAuthVariableSizeLinn Crosetto2-0/+4
To support UEFI Secure Boot and the Linux persistent store with UEFI variables, set PcdMaxVariableSize to 0x2000 bytes as is done in OvmfPkg. For reference, the related Ovmf commits: 8cee3de7 2d441ca9 Also increase the maximum size for Authenticated variables in order to handle a larger Signature List size as is done in OvmfPkg. Related Ovmf commit: f5404a3e Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Linn Crosetto <linn@hpe.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-05-06ArmVirtPkg: retire PlatformIntelBdsLibLaszlo Ersek4-1743/+0
This library instance is no longer referenced. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDSLaszlo Ersek5-18/+29
Based on OvmfPkg commit 79c098b6d25d. Unlike in OVMF, no USE_OLD_BDS fallback is introduced; I think that ArmVirtPkg is less widely used by non-developers than OvmfPkg. ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from ArmPlatformPkg. About this patch: - DxeServicesLib and SortLib are resolved generally (they have broad client module type lists). - ReportStatusCodeLib is resolved for UEFI_APPLICATION modules. - GenericBdsLib and PlatformBdsLib are replaced with UefiBootManagerLib and PlatformBootManagerLib, and resolved from under MdeModulePkg and ArmVirtPkg, respectively. - QemuBootOrderLib is pointed to the QemuNewBootOrderLib instance. - FileExplorerLib no longer depends on SECURE_BOOT_ENABLE, it is nedeed by BootMaintenanceManagerUiLib, which we link into UiApp. - PcdBootManagerMenuFile carries the FILE_GUID of "MdeModulePkg/Application/UiApp/UiApp.inf". The default PCD value from "MdeModulePkg/MdeModulePkg.dec" points to "MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf", which, according to the commit that introduced it (a382952f8255), only 'provides a very simple UI showing all the boot options recorded by "BootOrder" and user can select any of them to boot'. - Include the new core BDS driver, and include the boot manager application, with the usual main menu entries. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Fixes: https://github.com/tianocore/edk2/issues/83 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBootLaszlo Ersek3-0/+716
UefiBootManagerLib does not provide these functions, we have to implement them. (EnableQuietBoot() puts up the nice TianoCore logo.) OvmfPkg commits 817fb3ac2a78 and 8e8fd3037788 have extracted these functions already, - from "IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c" - to "OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c". Copy the latter file, with minimal changes. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulationLaszlo Ersek1-5/+4
QemuBootOrderLib can only filter out and reorder boot options; it cannot create boot options. It relies on Platform BDS to auto-generate all possible boot options first (for example, for new virtual devices that have been configured since the last run of the virtual machine). Then it will decide, case-by-case, whether each of those auto-generated boot options should be preserved (and at what position), or removed. Thus far, the only implementation of SetBootOrderFromQemu(), used in connection with IntelFrameworkModulePkg BDS, has expected said complete boot option list as an input parameter: BdsEntry() [IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c] // create empty list InitializeListHead ( &BootOptionList ) PlatformBdsPolicyBehavior( [ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c] BootOptionList ) BdsLibConnectAll() BdsLibEnumerateAllBootOption( BootOptionList ) // at this point, BootOptionList starts with the preexistent boot // options, and ends with the auto-generated options SetBootOrderFromQemu( [OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c] BootOptionList ) // write out changed boot order to UEFI variables // The "BootOrder" variable may have changed. Refresh BootOptionList // from it, and return it to BdsEntry(). With MdeModulePkg BDS, a BootOptionList is not propagated from BdsEntry() to SetBootOrderFromQemu() and back. All processing is based directly on the underlying "BootOrder" and "Boot####" variables. In OvmfPkg, commit d27ec22d1189 introduced a new instance of QemuBootOrderLib, called QemuNewBootOrderLib. It is based on UefiBootManagerLib, and rather than taking a complete BootOptionList as a parameter, it expects that the "BootOrder" and "Boot####" variables are complete in the above sense. Rebase the boot order manipulation to UefiBootManagerLib and QemuNewBootOrderLib, while keeping the requirement satisfied, like this: BdsEntry() [MdeModulePkg/Universal/BdsDxe/BdsEntry.c] PlatformBootManagerAfterConsole() [ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c] EfiBootManagerConnectAll() EfiBootManagerRefreshAllBootOption() // at this point all auto-generated options exist at the end of // "BootOrder" SetBootOrderFromQemu() [OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c] // read boot options from "BootOrder" and "Boot####", then // manipulate them This patch parallels OvmfPkg commit 04fe914ba53e. Once the USE_OLD_BDS fallback is removed from OvmfPkg, the parameter list of the SetBootOrderFromQemu() prototype can be updated to VOID. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() APILaszlo Ersek1-1/+1
This patch parallels OvmfPkg commit fed691a6f913. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooksLaszlo Ersek1-50/+0
Namely, - PlatformBdsBootSuccess, - PlatformBdsBootFail, - PlatformBdsLockNonUpdatableFlash. This patch parallels OvmfPkg commit 7f89929f7fb2. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: register boot options and hot keysLaszlo Ersek2-1/+116
Register the Enter key as the continue key (hot key to skip the boot timeout). Map the F2 and ESC keys to the UI. Register the memory-mapped Shell boot option. The patch parallels OvmfPkg commit 07dd96e82032. The PlatformRegisterFvBootOption() and PlatformRegisterOptionsAndKeys() functions are copied almost verbatim. The only changes are: internal linkage for these functions (i.e., STATIC), and mentioning the ESC key in the comments. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager MenuLaszlo Ersek5-10/+10
MdeModulePkg/BDS doesn't launch the UI (Boot Manager Menu) from the platform side. The platform is expected to store the boot timeout only, in PcdPlatformBootTimeOut. This is usually done in PlatformBootManagerBeforeConsole(). (ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from ArmPlatformPkg, not ArmVirtPkg.) The patch parallels OvmfPkg commit 8dc0f0a6aab0. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()Laszlo Ersek1-41/+36
With IntelFrameworkModulePkg BDS, the platform code is responsible for updating console variables (e.g., with BdsLibUpdateConsoleVariable()), and then connecting them (e.g., with BdsLibConnectAllDefaultConsoles()). This is usually (although not necessarily) done in PlatformBdsPolicyBehavior(). With MdeModulePkg BDS, the platform is responsible for updating the console variables in PlatformBootManagerBeforeConsole(). When that function returns, BdsEntry() will automatically connect the consoles; the platform is not responsible for the connection. IntelFrameworkModulePkg MdeModulePkg BdsEntry BdsEntry PlatformBdsInit PlatformBootManagerBeforeConsole +----> EfiBootManagerUpdateConsoleVariable | dispatch Driver#### | dispatch Driver#### | +> connect consoles | | PlatformBdsPolicyBehavior | | PlatformBootManagerAfterConsole BdsLibUpdateConsoleVariable <--+ | BdsLibConnectAllDefaultConsoles <+ display splash screen display splash screen Thus, move the console variable massaging from the beginning of PlatformBootManagerAfterConsole() (originally PlatformBdsPolicyBehavior()) to the end of PlatformBootManagerBeforeConsole(), and drop the explicit BdsLibConnectAllDefaultConsoles() call. This patch parallels OvmfPkg commit e9e9ad644fab. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLibLaszlo Ersek2-1/+2
The general BDS helper functions are now provided by MdeModulePkg's UefiBootManagerLib, and no longer by IntelFrameworkModulePkg's GenericBdsLib. This patch parallels OvmfPkg commit 2b23b8d45b62. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariableLaszlo Ersek1-6/+6
In this rather mechanical patch, we replace the calls to GenericBdsLib's BdsLibUpdateConsoleVariable() with calls to UefiBootManagerLib's EfiBootManagerUpdateConsoleVariable(), which has the same purpose. The latter uses CONSOLE_TYPE enum constants from "MdeModulePkg/Include/Library/UefiBootManagerLib.h", for identifying the console type / underlying UEFI variable in the first parameter. This patch parallels OvmfPkg commit 9dc08ec6574b. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfacesLaszlo Ersek2-21/+37
"IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h" declares the following interfaces: - PlatformBdsInit - PlatformBdsPolicyBehavior - PlatformBdsBootFail - PlatformBdsBootSuccess - PlatformBdsLockNonUpdatableFlash - LockKeyboards From these, we've been using PlatformBdsInit() and PlatformBdsPolicyBehavior(). "MdeModulePkg/Include/Library/PlatformBootManagerLib.h" declares the three interfaces below: - PlatformBootManagerBeforeConsole - PlatformBootManagerAfterConsole - PlatformBootManagerWaitCallback Comparing the BdsEntry() functions between - "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" and - "MdeModulePkg/Universal/BdsDxe/BdsEntry.c", we can establish the following mapping: IntelFrameworkModulePkg MdeModulePkg BdsEntry() BdsEntry() PlatformBdsInit() <--------------> PlatformBootManagerBeforeConsole() dispatch Driver#### <--------------> dispatch Driver#### connect consoles PlatformBdsPolicyBehavior() <------> PlatformBootManagerAfterConsole() The difference in connecting the consoles will be addressed in a later patch, now we just rename the functions according to the mapping above, and copy the call site comments from MdeModulePkg's BdsEntry(). For the third interface, PlatformBootManagerWaitCallback(), add an empty implementation (and copy the comment from the library class header). Platform BDS can use this callback to draw a progress bar, for example. This patch parallels OvmfPkg commit a7566234e92c. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-05-06ArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLibLaszlo Ersek4-0/+1744
Create a copy of PlatformIntelBdsLib under the name PlatformBootManagerLib, with the following initial changes: - replace PlatformBdsLib references with PlatformBootManagerLib in comments, - replace "IntelBdsPlatform" with "PlatformBm" in file names and their references, - generate a new FILE_GUID. PlatformBootManagerLib will be linked into the BDS driver from MdeModulePkg. This patch parallels OvmfPkg commit 305418818959. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
2016-04-13ArmVirtPkg/VirtFdtDxe: remove Xenio handling and rename to VirtioFdtDxeArd Biesheuvel7-241/+143
Now that we have moved the handling of the xen,xen DT node to XenioFdtDxe, remove its handling from VirtFdtDxe. Since the only functionality that remains is handling the virtio,mmio DT node, rename VirtFdtDxe to VirtioFdtDxe to reflect that. Also update the platforms that use this driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg/ArmVirtXen: move from VirtFdtDxe to new XenioFdtDxe driverArd Biesheuvel4-2/+114
Now that the only functionality that remains in VirtFdtDxe is enumerating the respective virtual I/O buses, it no longer makes sense to have a driver that is shared between Xen domU and QEMU. So move the Xen I/O DT node handling to a new driver, and update ArmVirtXen to switch to it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg/VirtFdtDxe: move FDT config table installation to FdtClientDxeArd Biesheuvel4-14/+15
Now that FdtClientDxe is the core driver that takes ownership of the host supplied FDT, it makes sense to put it in charge of installing the FDT configuration table as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg/VirtFdtDxe: remove unused PL011 DT node typeArd Biesheuvel1-2/+0
This type is not used in the code, so drop the definitions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg: get rid of A PRIORI DXE declarations for VirtFdtDxeArd Biesheuvel3-12/+0
We no longer care when VirtFdtDxe executes, since - the driver sets no dynamic PCDs any longer, and - the only remaining functionality centers on VirtioMmioInstallDevice() and XenIoMmioInstall() function calls and FDT configuration table installation. So drop the A PRIORI declaration. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg/VirtFdtDxe: drop RTC handlingArd Biesheuvel2-31/+1
The RTC driver no longer relies on VirtFdtDxe to set the pl031 RTC base address in a dynamic PCD, so drop the handling altogether. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg: move QEMU based platforms to ArmVirtPL031FdtClientLibArd Biesheuvel2-2/+8
This moves QEMU based platforms to ArmVirtPL031FdtClientLib, so that we no longer have to rely on VirtFdtDxe to execute first and set the PL031 base address in a dynamic PCD. The only driver which [transitively] depends on this PcdPL031RtcBase PCD is EmbeddedPkg/RealTimeClockRuntimeDxe, so this conversion cannot affect any other users and is thus safe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg: implement ArmVirtPL031FdtClientLibArd Biesheuvel2-0/+131
This implements a library ArmVirtPL031FdtClientLib which is intended to be incorporated into RealTimeClockRuntimeDxe via NULL library class resolution. This allows us to make RealTimeClockRuntimeDxe depend on the FDT client protocol, and discover the PL031 base address from the device tree directly rather than relying on VirtFdtDxe to set the dynamic PCDs. The NULL library class resolution approach to strictly order production and consumption of dynamic PCDs is not generally safe in cases such as this one, where the producer and the consumer of the PCD are both libraries. However, since the PCD is produced in this library's constructor, and the consumer library's constructor 'LibRtcInitialize' is not a 'true' constructor (it is invoked explicitly by RealTimeClockRuntimeDxe), this case is guaranteed to be safe after all. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-13ArmVirtPkg/RelocatableVirtHelper: use correct FindMemNode argument orderArd Biesheuvel4-8/+8
Commit 03b6bed17ea6 ArmVirtPkg/XenRelocatablePlatformLib: rewrite DTB memory node retrieval in C") introduced a FindMemNode () C function that takes pointers to system memory base and size as arguments, but the calling code passes them in the wrong order. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com>
2016-04-12ArmVirtPkg/VirtFdtDxe: drop PCI host bridge handlingArd Biesheuvel5-244/+16
Now that the PCI host bridge driver parses the DT node that describes the PCI host bridge directly via the FDT client protocol, we can drop the handling from VirtFdtDxe completely. This means some PCI related PCDs are no longer set, such as PcdPciBusMin, PcdPciBusMax, PcdPciIoBase, PcdPciIoSize, PcdPciIoTranslation, PcdPciMmio32Base and PcdPciMmio32Size. Since these PCDs are specific to ARM (and declared in ArmPlatformPkg), and not used anywhere else by the ArmVirtPkg platforms, we can simply stop populating them, and drop all references to them. It also means that we can no longer rely on PcdPciDisableBusEnumeration to be set before it is consumed by PciBusDxe and QemuFwCfgAcpiPlatformDxe, so make those depend on FdtPciPcdProducerLib explicitly via NULL library class resolution. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-12ArmVirtPkg/PciHostBridgeDxe: move to FDT client protocolArd Biesheuvel3-24/+252
Instead of relying on VirtFdtDxe to populate various dynamic PCDs with information retrieved from the host-provided device tree, perform the PCI ECAM related DT node parsing directly in PciHostBridgeDxe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-12ArmVirtPkg/BaseCachingPciExpressLib: depend on PciPcdProducerLibArd Biesheuvel3-2/+12
Make BaseCachingPciExpressLib depend on PciPcdProducerLib, so that we have a chance to populate PcdPciExpressBaseAddress based on the contents of the device tree. Also update the platforms under ArmVirtPkg that support PCI to use the special MAX_UINT64 value as the build time default for PcdPciExpressBaseAddress. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-12ArmVirtPkg: implement FdtPciPcdProducerLibArd Biesheuvel2-0/+109
This implements a library FdtPciPcdProducerLib which is intended to be incorporated into modules that consume the PCI related dynamic PCDs PcdPciExpressBaseAddress and PcdPciDisableBusEnumeration, either via NULL library class resolution or via a direct dependency (for other libraries or modules in ArmVirtPkg). This allows us to make them depend on the FDT client protocol, and populate these PCDs based on the presence and the contents of a 'pci-host-ecam-generic' DT node. This also overloads the meaning of PcdPciExpressBaseAddress, which we will set to MAX_UINT64 to signify that the actual values of these two PCDs have not been assigned yet. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2016-04-12ArmVirtPkg/VirtFdtDxe: remove handling of fw_cfg DT nodeArd Biesheuvel6-69/+0
Remove the handling of the fw_cfg DT node from VirtFdtDxe now that the fw_cfg client library has been moved to the FDT client protocol, and no longer relies on VirtFdtDxe to pass this information via dynamic PCDs. Since the PCDs in question are now no longer used, remove them from the various DEC and DSC files as well. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>