summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg
Commit message (Collapse)AuthorAgeFilesLines
* ArmVirtPkg: set PcdMaxVariableSize and PcdMaxAuthVariableSizeLinn Crosetto2016-05-102-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>
* ArmVirtPkg: retire PlatformIntelBdsLibLaszlo Ersek2016-05-064-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>
* ArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDSLaszlo Ersek2016-05-065-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>
* ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBootLaszlo Ersek2016-05-063-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>
* ArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulationLaszlo Ersek2016-05-061-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>
* ArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() APILaszlo Ersek2016-05-061-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>
* ArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooksLaszlo Ersek2016-05-061-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>
* ArmVirtPkg/PlatformBootManagerLib: register boot options and hot keysLaszlo Ersek2016-05-062-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>
* ArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager MenuLaszlo Ersek2016-05-065-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>
* ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()Laszlo Ersek2016-05-061-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>
* ArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLibLaszlo Ersek2016-05-062-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>
* ArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariableLaszlo Ersek2016-05-061-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>
* ArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfacesLaszlo Ersek2016-05-062-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>
* ArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLibLaszlo Ersek2016-05-064-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>
* ArmVirtPkg/VirtFdtDxe: remove Xenio handling and rename to VirtioFdtDxeArd Biesheuvel2016-04-137-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>
* ArmVirtPkg/ArmVirtXen: move from VirtFdtDxe to new XenioFdtDxe driverArd Biesheuvel2016-04-134-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>
* ArmVirtPkg/VirtFdtDxe: move FDT config table installation to FdtClientDxeArd Biesheuvel2016-04-134-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>
* ArmVirtPkg/VirtFdtDxe: remove unused PL011 DT node typeArd Biesheuvel2016-04-131-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>
* ArmVirtPkg: get rid of A PRIORI DXE declarations for VirtFdtDxeArd Biesheuvel2016-04-133-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>
* ArmVirtPkg/VirtFdtDxe: drop RTC handlingArd Biesheuvel2016-04-132-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>
* ArmVirtPkg: move QEMU based platforms to ArmVirtPL031FdtClientLibArd Biesheuvel2016-04-132-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>
* ArmVirtPkg: implement ArmVirtPL031FdtClientLibArd Biesheuvel2016-04-132-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>
* ArmVirtPkg/RelocatableVirtHelper: use correct FindMemNode argument orderArd Biesheuvel2016-04-134-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>
* ArmVirtPkg/VirtFdtDxe: drop PCI host bridge handlingArd Biesheuvel2016-04-125-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>
* ArmVirtPkg/PciHostBridgeDxe: move to FDT client protocolArd Biesheuvel2016-04-123-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>
* ArmVirtPkg/BaseCachingPciExpressLib: depend on PciPcdProducerLibArd Biesheuvel2016-04-123-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>
* ArmVirtPkg: implement FdtPciPcdProducerLibArd Biesheuvel2016-04-122-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>
* ArmVirtPkg/VirtFdtDxe: remove handling of fw_cfg DT nodeArd Biesheuvel2016-04-126-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>
* ArmVirtPkg/QemuFwCfgLib: move to FDT client protocolArd Biesheuvel2016-04-122-10/+77
| | | | | | | | | | | | | | | | Make this library depend on the FDT client protocol to access the host supplied device tree directly rather than depending on VirtFdtDxe to set them using dynamic PCDs. Since this library is used by several drivers (BdsDxe, SmbiosPlatformDxe, SmbiosDxe and QemuFwCfgAcpiPlatformDxe), we will end up parsing the device tree and the fwcfg node at least four times. However, no dynamic PCDs are involved anymore, and will even be removed completely in a subsequent patch. So the conversion is not optimal, but guaranteed to be safe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/VirtFdtDxe: remove timer DT node handlingArd Biesheuvel2016-04-112-42/+1
| | | | | | | | | The timer code no longer relies on VirtFdtDxe to set the PCDs, so remove the handling of the timer node and the references to those PCDs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: move TimerDxe to FDT client libraryArd Biesheuvel2016-04-113-3/+12
| | | | | | | | | | | | Move to the new dedicated ArmVirtTimerFdtClientLib to populate the various timer related PCDs at driver load time rather than relying on VirtFdtDxe to do it. Since ArmPkg/TimerDxe is the only consumer of these PCDs, which is the DXE driver ArmVirtTimerFdtClientLib is intended to complement, this conversion is guaranteed to be safe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: implement ArmVirtTimerFdtClientLibArd Biesheuvel2016-04-112-0/+136
| | | | | | | | | | | | This implements a library ArmVirtTimerFdtClientLib which is intended to be incorporated into TimerDxe via NULL library class resolution. This allows us to make TimerDxe depend on the FDT client protocol, and discover the timer interrupts from the device tree directly rather than relying on VirtFdtDxe to set the dynamic PCDs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/VirtFdtDxe: drop detection of PSCI methodArd Biesheuvel2016-04-116-33/+1
| | | | | | | | | | The detection of the PSCI method has been moved to the EfiResetSystemLib implementation, so drop the handling from VirtFdtDxe. Since no users remain of gArmVirtTokenSpaceGuid.PcdArmPsciMethod, remove that 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>
* ArmVirtPkg/ArmVirtPsciResetSystemLib: move to FDT client protocolArd Biesheuvel2016-04-112-7/+36
| | | | | | | | | | | | | | Instead of relying on VirtFdtDxe to detect the PSCI method, move our EfiResetSystemLib to the FDT client protocol to interrogate the device tree directly. Since this library is only consumed by EmbeddedPkg/ResetRuntimeDxe, and considering that the PCD is no longer set, and even removed completely in a subsequent patch, this conversion is guaranteed to be safe. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/VirtFdtDxe: remove GIC discoveryArd Biesheuvel2016-04-116-63/+0
| | | | | | | | | | | Now that we moved the GIC discovery to our ArmGicArchLib implementation, we can remove it from VirtFdtDxe, since it is no longer used. Remove the PcdArmGicRevision declaration and definitions as well: VirtFdtDxe no longer sets it, and no other drivers consume its value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/ArmGicArchLib: move to FdtClient protocolArd Biesheuvel2016-04-112-8/+85
| | | | | | | | | | | | | | | | | | | | | | | Instead of relying on VirtFdtDxe to populate the GIC related PCDs, move this handling to our implementation of ArmGicArchLib, and retrieve the required DT info using the new FDT client protocol. This removes one of the reasons we need to load VirtFdtDxe first using an 'A PRIORI' declaration in the platform FDF. As Laszlo kindly confirms: So, ultimately, the only user of this library instance is "ArmPkg/Drivers/ArmGic/ArmGicDxe.inf". ... Indeed, checking the build report file for ArmVirtQemu (AARCH64), I find ArmVirtGicArchLib (and ArmGicLib too) only under "ArmPkg/Drivers/ArmGic/ArmGicDxe.inf". which means that the constructor is only invoked once, and so the dynamic PCDs are set in time for ArmGicDxe to consume them, and never afterwards. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: add FdtClientDxe to the ArmVirtPkg platformsArd Biesheuvel2016-04-116-0/+6
| | | | | | | | | | Add FdtClientDxe to the various platforms under ArmVirtPkg, so that the drivers we will update to depend on the FDT client protocol in subsequent patches will remain in working order. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/FdtClientDxe: implement new driverArd Biesheuvel2016-04-112-0/+304
| | | | | | | | | This implements a new DXE driver FdtClientDxe to produce the FDT client protocol based on a device tree image supplied by the virt host. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: introduce FdtClientProtocolArd Biesheuvel2016-04-112-0/+111
| | | | | | | | | This introduces the FdtClientProtocol, which will be used to expose the device tree provided by the host to other DXE drivers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: Convert to build FatPkg from sourceJordan Justen2016-04-076-7/+10
| | | | | | | | | | | | | | Now that FatPkg is open source (and therefore can be included in the EDK II tree) we build and use it directly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmVirtPkg: drop dependency on PeiPcdLib for PEI Pcd.infArd Biesheuvel2016-04-072-4/+4
| | | | | | | | | | | | The PcdPeim dynamic PCD driver is dispatched explicitly via an 'A PRIORI' declaration in the platform DSC. Without that declaration, the PEI module can never be dispatched since it transitively (via PeiPcdLib) depends on a PPI it produces itself. So use the NULL PcdLib explicitly only for 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>
* ArmVirtPkg: drop dependency on DxePcdLib for DXE Pcd.infArd Biesheuvel2016-04-073-3/+12
| | | | | | | | | | | | The PcdDxe dynamic PCD driver is dispatched explicitly via an 'A PRIORI' declaration in the platform DSC. Without that declaration, the DXE driver can never be dispatched since it transitively (via DxePcdLib) depends on protocols it produces itself. So use the NULL PcdLib explicitly only for 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>
* ArmVirtPkg: drop bogus ArmPlatformSecExtraActionLib resolutionArd Biesheuvel2016-04-071-1/+0
| | | | | | | | | | | Nothing we use on any of the ArmVirtPkg platforms depends on the ArmPlatformSecExtraActionLib library class, so drop the resolution from ArmVirt.dsc.inc Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Suggested-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: remove linux loader from ARM buildsArd Biesheuvel2016-04-074-34/+0
| | | | | | | | | | The built in Linux loader was a temporary solution to boot ARM Linux without EFI support in the OS. Now that EFI support is merged in the upstream v4.5 release, we no longer need it. So drop it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: include Virtio10Dxe from OvmfPkgLaszlo Ersek2016-04-064-0/+4
| | | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@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> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* ArmVirtPkg: disable PcdHiiOsRuntimeSupportLaszlo Ersek2016-04-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Edk2 commit 8a45f80edad4 ("MdeModulePkg: Make HII configuration settings available to OS runtime") implements the optional UEFI feature described in "31.2.11.1 OS Runtime Utilization" in UEFI v2.6. While this feature might show benefits down the road even in QEMU virtual machines, at the moment it only presents drawbacks: - it increases the EfiRuntimeServicesData footprint, - it triggers HII compatibility problems between edk2 and external drivers unconditionally, even if the end-user is not interested in HII and/or in configuring said drivers (see <https://www.redhat.com/archives/vfio-users/2016-March/msg00153.html> and <http://thread.gmane.org/gmane.comp.bios.edk2.devel/9894> for an example). While the feature was being introduced, popular demand for a controlling Feature PCD rose (see <http://thread.gmane.org/gmane.comp.bios.edk2.devel/7626>), which is why we can set it now to FALSE. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* ArmVirtPkg/ArmVirtQemu: gate FDT config table install with build optionArd Biesheuvel2016-03-311-0/+5
| | | | | | | | | | | | | | | | | | This introduces the .DSC define 'PURE_ACPI_BOOT_ENABLE', defaulting to FALSE, which controls the value of the feature PCD 'PcdPureAcpiBoot'. This allows an ArmVirtQemu image to be built that restricts the OS to booting in ACPI mode. This feature is only added to ArmVirtQemu, and not to ArmVirtQemuKernel, the reason being that the latter is mostly intended for development work, where the burden of adding 'acpi=force' if you need it is much more tolerable than when trying to boot an installer on a production KVM guest instance. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg/VirtFdtDxe: make installation of FDT as config table optionalArd Biesheuvel2016-03-313-31/+48
| | | | | | | | | | | | The arm64 kernel is hardwired to prefer DT over ACPI, unless 'acpi=force' is passed on the kernel command line. The only other way to force the kernel to use ACPI is not to pass an FDT to it in the first place. So introduce a PCD that inhibits the installation of the QEMU supplied FDT as a configuration table. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
* ArmVirtPkg: PlatformIntelBdsLib: signal gRootBridgesConnectedEventGroupGuidLaszlo Ersek2016-03-232-0/+7
| | | | | | | | | | | | | | | The explanation is in the patch titled OvmfPkg: introduce gRootBridgesConnectedEventGroupGuid At this point, this signal doesn't do anything yet. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Jordan Justen <jordan.l.justen@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>
* ArmVirtPkg/PlatformIntelBdsLib: rebase to EfiEventGroupSignalLaszlo Ersek2016-03-233-34/+2
| | | | | | | | | Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Quickly-acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>