summaryrefslogtreecommitdiff
path: root/ArmPlatformPkg/ArmVirtualizationPkg/Library
AgeCommit message (Collapse)Author
2015-04-14ArmVirtualizationPkg: invalidate PEI memory region by VAArd Biesheuvel
This updates ArmVirtualizationMemoryInitPeiLib so that the PEI memory region, i.e., the region that is used both before and after the MMU and caches are enabled, is invalidated by virtual address before enabling the MMU. This prevents issues where data we modified with the caches and MMU off may be shadowed by clean cachelines in system caches or in lower level caches on other CPUs, resulting in the this data to become invisible once we turn the MMU and caches on. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17177 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-01ArmPlatformPkg/ArmXenRelocatablePlatformLib: Replaced tabulation by spacesOlivier Martin
EDK2 coding style requires to use 2 spaces instead of tabulation in source code files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17094 6f19259b-4bc3-4df7-8a09-765794883524
2015-04-01ArmPlatformPkg/ArmVirtualizationPkg: Removed trailing spacesOlivier Martin
Trailing spaces causes warnings when generating patches. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17092 6f19259b-4bc3-4df7-8a09-765794883524
2015-03-02ArmVirtualizationPkg: PlatformIntelBdsLib: lack of QEMU kernel is no errorLaszlo Ersek
When the user doesn't pass a kernel with QEMU's "-kernel" switch, the firmware sees a zero-sized kernel blob via the QemuFwCfgItemKernelSize key; there's no way to distinguish "no kernel" from "zero sized kernel". In both cases TryRunningQemuKernel() proceeds as far as gBS->LoadImage(), which then rejects the zero sized synthetic file with EFI_UNSUPPORTED. This is known and works fully as expected; however we should rather catch the much more frequent "no kernel" case earlier, in order to avoid the EFI_D_ERROR message TryRunningQemuKernel: LoadImage(): Unsupported which is arguably meaningless noise for the "no kernel" case. 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: Leif Lindholm <leif.lindholm@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16985 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: implement dummy RealTimeClockLib for XenArd Biesheuvel
This implements a dummy RealTimeClockLib for Xen, as there is no guest interface to access the time kept by Xen that can be shared between UEFI and the OS. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16977 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: Xen/PV relocatable platformlib instanceArd Biesheuvel
Add a ArmPlatformLib instance that can deal with the self relocation and truly dynamic discovery of system RAM base and size. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16964 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: allow patchable PCD for FV and DT base addressesArd Biesheuvel
Allow the use of patchable PCDs for gArmTokenSpaceGuid.PcdFvBaseAddress and gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress by moving them from the [FixedPcd] to the [Pcd] section in the INF file of PlatformPeiLib. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16963 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: implement custom MemoryInitPeiLibArd Biesheuvel
This implements a MemoryInitPeiLib instance that differs from the stock ArmPlatformPkg version only in the fact that it does not remove the memory used by the flash device (FD). The reason is that, when using PrePi, the DXE core is started immediately and never returns so there is no reason to preserve any of the memory that the flash device occupied originally, and it is preferable to release is so that the OS loader can reuse it. This is especially important for the relocatable PrePi configuration, which is aimed at being launched from a boot loader that itself adheres to the Linux arm64 boot protocol. Contributed-under: TianoCore Contribution Agreement 1.0 Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martn@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16962 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: add padding to FDT allocationArd Biesheuvel
Our primary user QEMU/mach-virt presents us with a FDT blob padded to 64 KB with plenty of room to set additional properties. However, in the general case, we should only add properties after making sure there is enough room available. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16960 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: use a HOB to store device tree blobArd Biesheuvel
Instead of using a dynamic PCD, store the device tree address in a HOB so that we can also run under a configuration that does not support dynamic PCDs. This also adds MemoryAllocationLib to the [LibraryClasses] section of ArmVirtualizationPlatformLib/ArmVirtualizationPlatformLib.inf, as this dependency was formerly satisfied transitively through one of the library dependencies that were dropped. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16959 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: move early UART discovery to PlatformPeimArd Biesheuvel
This is partially motivated by the desire to use PrePi in a virt environment, and in that configuration, ArmPlatformInitializeSystemMemory() is never called. But actually, this is a more suitable place anyway. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <olivier.martin@arm.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16958 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-28ArmVirtualizationPkg: allow patchable PCD for device tree base addressArd Biesheuvel
To allow a runtime self relocating PrePi instance to discover the base address of the device tree at runtime, allow the use of a patchable PCD for gArmVirtualizationTokenSpaceGuid.PcdDeviceTreeInitialBaseAddress. We will not be using the build time patch tool in this case, but using a patchable PCD will make the build system aware that its value is not a compile time constant. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Olivier Martin <olivier.martin@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16957 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-25ArmVirtualizationPkg/QemuFwCfgLib: Fixed build errorOlivier Martin
ARM toolchain raises the build error: Error #188-D: enumerated type mixed with another type Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16927 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-25ArmVirtualizationPkg: PlatformIntelBdsLib: display TianoCore logoLaszlo Ersek
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: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16925 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-25ArmVirtualizationPkg: PlatformIntelBdsLib: detect consoles dynamicallyLaszlo Ersek
Detect the video displays dynamically, and add them to the console and error output variables. Add a short-form, "wild card" USB_CLASS_DEVICE_PATH to the console input variable, which causes the USB keyboard to be handled automatically. Add the fixed location serial console to all of the console input, console output, and error output variables. This patch enables QEMU users to drop "addr=..." PCI address specifications from the -device options (or to use whatever addresses they like). For example, the following works: -device VGA \ \ -device ich9-usb-ehci1,multifunction=on,id=ehci \ -device ich9-usb-uhci1,multifunction=on,masterbus=ehci.0,firstport=0 \ -device ich9-usb-uhci2,multifunction=on,masterbus=ehci.0,firstport=2 \ -device ich9-usb-uhci3,multifunction=on,masterbus=ehci.0,firstport=4 \ -device usb-kbd,bus=ehci.0 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16924 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-25ArmVirtualizationPkg: PlatformIntelBdsLib: remove ties to ARM BDSLaszlo Ersek
In this patch we remove all dependencies on ARM BDS libraries. We also remove empty and/or unneeded functions, includes, etc. PlatformIntelBdsLib "goes back to basics" temporarily -- there are no consoles configured, and it's practically not possible to interact with the user interface. Bisection remains available in the sense that "ArmVirtualizationQemu.dsc" continues to build and should boot preexistent boot options, but user interaction does regress temporarily. The reason for this is that it's preferable to keep this patch and the next one separate for readability's sake -- they amount to a rewrite from scratch. 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: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16923 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-25ArmVirtualizationPkg: PlatformIntelBdsLib: beautify sourceLaszlo Ersek
This patch introduces no functional changes. It sorts #include directives, sorts INF file sections, and reformats license blocks. 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: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16922 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-23ArmVirtualizationPkg: PlatformIntelBdsLib: fix multiconsole setupLaszlo Ersek
In the following call chain: PlatformBdsPolicyBehavior() PlatformBdsConnectConsole() InitializeConsolePipe() x 3 BdsConnectDevicePath() [ArmPkg/Library/BdsLib/BdsFilePath.c] the three InitializeConsolePipe() function calls pass through - (&gST->ConsoleOutHandle, &gST->ConOut), - (&gST->ConsoleInHandle, &gST->ConIn), - (&gST->StandardErrorHandle, &gST->StdErr) to BdsConnectDevicePath(), in ArmPkg's BdsLib. At least when more than one console device paths are specified in the ConIn / ConOut / ErrOut variables, the above resuls in: - unchanged protocol interfaces (ConOut, ConIn, StdErr) in the system table (because ConSplitterDxe installs its non-NULL interfaces first), - but, changed handles in the system table. This effectively separates the handle fields in the system table from the protocol interfaces in the same that should always be associated with the handles. The end result is that clients using the handles break (splitting / multiplexing doesn't work for them), while clients directly using the protocol interfaces work. Therefore, do not attempt to connect consoles separately. ConSplitterDxe is dispatched before PlatformBdsPolicyBehavior() is called (the latter happens in the BDS phase), and ConSplitterDxe installs virtual handles and protocol interfaces for input / output / error. BdsLibConnectAll() covers all devices, including consoles; as those consoles are connected, ConPlatformDxe and ConSplitterDxe pick them up nicely as "slaves". We just need to make sure that the variables are set first, for the variables -> ConPlatformDxe -> ConSplitterDxe dependency chain. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16912 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-23ArmVirtualizationPkg: PlatformIntelBdsLib: kernel boot should provide ACPILaszlo Ersek
If there is a PCI host, then PCI enumeration (which happens inside BdsLibConnectAll()) blocks ACPI table installation (correctly). Make sure we install ACPI tables before trying to direct-boot a QEMU kernel. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16911 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-23ArmVirtualizationPkg: clone BasePciExpressLib, cache PCIe config baseLaszlo Ersek
The BarExisted() function in "MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c" raises the TPL to TPL_HIGH_LEVEL before accessing PCI config space. The PciExpressLib instance under "MdePkg/Library/BasePciExpressLib" -- serving the PCI config space access -- calls PcdGet64(PcdPciExpressBaseAddress) in turn, for each such call. The PcdGet64() function, when issued at TPL_HIGH_LEVEL, triggers an ASSERT(). PcdGet64() is based on a protocol in this UEFI phase, and protocol handler services are not allowed above TPL_NOTIFY (see Table 23 "TPL Restrictions" in the UEFI spec). Clone the library, and in a new constructor, cache the PCD in a global variable. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16909 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-14ArmVirtualizationPkg: PlatformIntelBdsLib: get front page timeout from QEMULaszlo Ersek
Put QemuBootOrderLib's GetFrontPageTimeoutFromQemu() to use, so that ArmVirtualizationPkg's Platform BDS policy can consume QEMU's command line option -boot menu=on,splash-time=N RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1172756 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16612 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-02ArmVirtualizationPkg: Intel BDS: load EFI-stubbed Linux kernel from fw_cfgLaszlo Ersek
A number of tools depend on passing the kernel image, the initial ramdisk, and the kernel command line to the guest on the QEMU command line (options -kernel, -initrd, -append, respectively). At the moment, these QEMU options work, but the guest kernel loaded this way is launched by a minimal binary firmware that is dynamically composed by QEMU. As a consequence, such a kernel has no UEFI environment. This patch enables -kernel, -initrd, -append to work on top of the ArmVirtualizationQemu firmware build. The approach it takes is different from how the same functionality is implemented in OvmfPkg. OvmfPkg contains a full-fledged Linux boot loader (see "OvmfPkg/Library/PlatformBdsLib/QemuKernel.c" and "OvmfPkg/Library/LoadLinuxLib/"). OVMF's LoadLinuxLib sets up the required kernel environment in a sophisticated way (including x86-specific artifacts like the GDT), calls ExitBootServices() itself (for legacy kernels without EFI handover protocol), and jumps to the kernel (using x86 assembly). In ArmVirtualizationPkg's PlatformIntelBdsLib, we require the kernel being loaded to have an EFI stub -- that is, to be a genuine UEFI application. (The EFI stub is not an additional burden for guest kernels -- the EFI stub is a hard requirement anyway because it needs to process the DTB heavily: - it removes memory nodes, - it removes memreserve entries, - it adds UEFI properties to the "chosen" node, - it calculates and installs virt-to-phys mappings with SetVirtualAddressMap() in a way that enables kexec [planned]. Kudos to Ard Biesheuvel for summarizing the above.) An EFI-stubbed Linux guest kernel can be loaded with plain gBS->LoadImage(). The EFI stub will look up its own EFI_LOADED_IMAGE_DEVICE_PATH_PROTOCOL instance (ie. the device path where it has been loaded from), and it will locate the initial ramdisk named by the "initrd" command line parameter as a *sibling file* on the same device. The initrd file is then loaded using the EFI_SIMPLE_FILE_SYSTEM_PROTOCOL. This approach enables the EFI stub to load the initial ramdisk from normal EFI System Partitions, from remote PXE/TFTP directories -- and it enables us to provide the initrd from memory as well. In this patch: - We download the kernel image, the initrd image, and the kernel command line, using QEMU's fw_cfg interface. - We create a read-only EFI_SIMPLE_FILE_SYSTEM_PROTOCOL instance that has just a root directory, with the three downloaded files in it. - The handle that carries the simple file system has a single-node VenHw(...) device path (not counting the terminator node). - We load the EFI-stubbed kernel (which is a UEFI application) with gBS->LoadImage(), passing "VenHw(...)/kernel" as device path. This causes gBS->LoadImage() to call back into our filesystem. - Appended to the downloaded command line, we pass "initrd=initrd" to the EFI stub. - Once the EFI stub is running, it loads the initial ramdisk from the "sibling" device path "VenHw(...)/initrd", also calling back into our filesystem. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16578 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-02ArmVirtualizationPkg: PlatformIntelBdsLib: adhere to QEMU's boot orderLaszlo Ersek
We have all the required pieces in place. Let's call SetBootOrderFromQemu() in PlatformBdsPolicyBehavior(). We disable OFW-to-UEFI device path fragment translation for virtio-pci, and enable it only virtio-mmio at this time. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16576 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-02ArmVirtualizationPkg: PlatformIntelBdsLib: add basic policyLaszlo Ersek
In PlatformBdsPolicyBehavior() we should follow the same pattern as in OvmfPkg's: after the consoles are connected, - connect all drivers and devices, - enumerate all boot options, - enter the Intel BDS FrontPage if the user presses a key different from Enter. We set the countdown to 3 seconds, similarly to the timeout that we specify for ARM BDS. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16569 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-02ArmVirtualizationPkg: clone PlatformIntelBdsLib from ArmPlatformPkgLaszlo Ersek
In the next patch(es) we'll customize the PlatformBdsLib instance used by ArmVirtualizationQemu.dsc. Let's clone it first verbatim from ArmPlatformPkg/Library/PlatformIntelBdsLib, changing only its FILE_GUID. (Also, coding style errors like "missing space before open parenthesis" and "missing space after comma or semicolon" have been cleaned up.) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16568 6f19259b-4bc3-4df7-8a09-765794883524
2015-01-02ArmVirtualizationPkg: introduce QemuFwCfgLib instance for DXE driversLaszlo Ersek
After reviewing OvmfPkg's use of its own QemuFwCfgLib instances, it is clear that its only pre-DXE fw_cfg dependency concerns S3 support (the QemuFwCfgS3Enabled() call in "PlatformPei/Platform.c"). For ARM guests, S3 is in the distant future, but we can see several shorter term applications for fw_cfg that all reside in DXE: - controlling boot order (to be implemented in PlatformBdsLib for Intel BDS), - supporting -kernel / -initrd / -append boot on QEMU (to be implemented in PlatformBdsLib for Intel BDS, similarly), - loading and linking ACPI tables, - installing SMBIOS tables. Therefore it makes sense to add a simple MMIO-based fw_cfg client library to ArmVirtualizationPkg that for the moment is only available to DXE_DRIVER modules. Because MMIO accesses are costly on KVM/ARM, InternalQemuFwCfgReadBytes() accesses the fw_cfg data register in full words. This speeds up transfers almost linearly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16567 6f19259b-4bc3-4df7-8a09-765794883524
2014-12-12ArmPlatformPkg/ArmVirtualizationPkg: Removed compiler family to the AArch64 ↵Olivier Martin
assembly files LLVM/ARMCC6 supports GNU assembly language. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16509 6f19259b-4bc3-4df7-8a09-765794883524
2014-11-11ArmPlatformPkg: Increase more ARM address Pcd entries to 64-bit.Leif Lindholm
Some AArch64 platforms have RAM and flash devices >4GB. Update some additional Pcd entries to 64-bit, and change the corresponding PcdGet32 calls to PcdGet64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Leif Lindholm <leif.lindholm@linaro.org> Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16325 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-15ArmVirtualizationPkg: FdtPL011SerialPortLib: support UEFI_APPLICATIONLaszlo Ersek
The library already supports UEFI_DRIVER, we just need to relax the restriction list. This allows ArmVirtualizationPkg platforms to build applications, like the UEFI shell. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16219 6f19259b-4bc3-4df7-8a09-765794883524
2014-10-10ArmPkg/ArmPsciResetSystemLib: Made the library only using SMCOlivier Martin
Only ArmVirtualizationPkg based platforms are expected to use the dynamic method to choose between SMC and HVC to invoke PSCI. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16204 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18ArmPlatformPkg/ArmVirtualizationPkg: Add ArmVirtualizationQemu platformMichael Casadevall
This adds support for executing UEFI in a QEMU/mach-virt emulated environment. The following assumptions are made about the target: - DRAM base at 0x4000_0000, containing the device tree blob - DRAM size at least 1 MB - device tree uses 64-bit physical base addresses and sizes - ARM architected timer - Cortex-A15 CPU (if built for 32-bit) The following information is retrieved from the device tree: - PL011 UART base address - GIC base addresses - virtual timer interrupt - PL031 RTC base address - DRAM size, must be at least 128 MB - virtio MMIO transports - PSCI 0.2 availability (for reset and poweroff) The device tree image is relocated and installed as a configuration table so an EFI stub enabled kernel can be booted directly without the need for a bootloader. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Casadevall <michael.casadevall@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16141 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18ArmVirtualizationPkg: add device tree based PL011 SerialPortLibLaszlo Ersek
This adds 2 implementations of SerialPortLib for device tree based platforms using a PL011 UART: - an 'early' one which is completely stateless and uses only fixed PCDs - a normal one which takes its base address from a HOB containing the base address discovered in the PEI phase Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-with-remarks-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16140 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18ArmPlatformPkg/ArmVirtualizationPkg: add ArmVirtualizationPlatformLib libraryMichael Casadevall
This is an implementation of ArmPlatformLib that discovers the size of system DRAM from a device tree blob located at the address passed in gArmTokenSpaceGuid.PcdDeviceTreeBaseAddress, which should equal the value in gArmTokenSpaceGuid.PcdSystemMemoryBase. As the device tree blob is passed in system DRAM, this library can only be used if sufficient DRAM is available (>= 128 MB) and if not using shadowed NOR. The reason for this is that it makes it easier to guarantee that such a device tree blob at base of DRAM will not be clobbered before we get a chance to preserve it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Casadevall <michael.casadevall@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-By: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16138 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18ArmPlatformPkg/ArmVirtualizationPkg: Add PlatformPeiLib libraryArd Biesheuvel
This is a fork of the ARM PlatformPeiLib for virtual machines. The main purpose of having this specific implementation is that it allows us to preserve the device tree blob if it was passed to us in system DRAM. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16136 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18ArmPlatformPkg/ArmVirtualizationPkg: Add private HobLib implementation for ↵Ard Biesheuvel
DXE phase To allow a dynamically discovered UART base address, we parse the device tree early and store the base address in a HOB. To prevent circular constructor dependencies from interfering with bringing up the serial port using this dynamic base address, use our own private HobLib with no dependencies on DebugLib either directly or indirectly through UefiLib. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16134 6f19259b-4bc3-4df7-8a09-765794883524
2014-09-18ArmVirtualizationPkg: add driver for QEMU's NOR flashArd Biesheuvel
This adds an implementation of NorFlashPlatformLib that exposes the two 64 MB NOR flash banks that are provided by QEMU's mach-virt emulation both in 32-bit and 64-bit mode. Contributed-under: TianoCore Contribution Agreement 1.0 Reviewed-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Olivier Martin <olivier.martin@arm.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16133 6f19259b-4bc3-4df7-8a09-765794883524