summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg
Commit message (Collapse)AuthorAgeFilesLines
* ArmVirtPkg: HighMemDxe: add memory space for the high memory nodesShannon Zhao2015-12-044-0/+163
| | | | | | | | | | | | | | | Here we add the memory space for the high memory nodes except the lowest one in FDT. So these spaces will show up in the UEFI memory map. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> [lersek@redhat.com: rewrap at 79 chars, use NULL, print Status] 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@19124 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: ArmVirtPlatformLib: find the lowest memory nodeShannon Zhao2015-12-041-13/+17
| | | | | | | | | | | | While QEMU NUMA support on ARM will introduce more than one /memory node in the device tree, it needs to find the lowest one and set PcdSystemMemorySize with the actual size of this memory node. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19123 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: use explicit KERNEL_BLOB_TYPE castArd Biesheuvel2015-12-031-1/+3
| | | | | | | | | | | | | The ARM RVCT compiler does not allow implicit casts between enumerated types and integer types. In this particular case, the STUB_FILE::Position member is overloaded as a KERNEL_BLOB_TYPE identifier, so it does not hurt to make that cast explicit. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19108 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: add secure boot support to 32-bit ARM targetsArd Biesheuvel2015-11-301-0/+3
| | | | | | | | | | | | | Building the 32-bit ARM targets with secure boot enabled requires a library resolution for the ArmSoftfloatLib dependency of OpenSslLib. So provide one. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@19032 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/PrePi: remove global variable allocation from lowlevel initArd Biesheuvel2015-11-274-42/+2
| | | | | | | | | | | | | Now that we dropped all ArmPlatformGlobalVariableLib dependencies, there is no longer a need to allocate and clear out the global variable region in the PrePi init code. So remove it. 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: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18991 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: drop ArmPlatformGlobalVariableLib dependencyArd Biesheuvel2015-11-274-10/+1
| | | | | | | | | | | | | | Now that all PeiServicesTablePointerLib and PrePiHobListPointerLib library dependencies in both ArmVirtQemu and ArmVirtXen are satisfied by implementations that do not depend on ArmPlatformGlobalVariableLib, we can remove all mention of it from the various .dsc files. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18986 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu: move to ArmPkg version of PeiServicesTablePointerLibArd Biesheuvel2015-11-271-3/+3
| | | | | | | | | | | | | | | | | | As pointed out by Eugene, the ArmPlatformPkg implementation of PeiServicesTablePointerLib violates the PI sec, since it uses ArmPlatformGlobalVariableLib to store the PEI services table pointer rather than the thread ID cpu registers as the spec requires. So instead, move to the ArmPkg version of this library, which does adhere to the PI spec. Reported-by: Eugene Cohen <eugene@hp.com> 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18985 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: Use SerialDxe in MdeModulePkg instead of EmbeddedPkgStar Zeng2015-11-267-6/+180
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Beyond just changing the directly related lines in the FDF and DSC files, we have to adapt the EarlyFdtPL011SerialPortLib and FdtPL011SerialPortLib instances as well, in the same patch. This is because the EmbeddedPkg driver expects the SerialPortSetAttributes(), SerialPortSetControl() and SerialPortGetControl() functions from SerialPortExtLib, while the MdeModulePkg driver expects them from SerialPortLib itself. We cannot implement these functions in ArmVirtPkg's SerialPortLib instances *before* flipping the driver, because it would cause double function definitions in the EmbeddedPkg driver. We also can't implement the functions *after* flipping the driver, because it would cause unresolved function references in the MdeModulePkg driver. Therefore we have to implement the functions simultaneously with the driver replacement. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18973 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtPlatformLib: reduce ID map size to GCD region sizeArd Biesheuvel2015-11-242-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | The ID mapping routines on virtual platforms simply map the entire hardware supported physical address space as device memory, and then punch some holes for regions that need to be mapped cacheable. On virtual platforms hosted on CPUs that support a large physical address range, this may result in a lot of overhead, i.e., 4 KB of page tables for each 512 GB of address space, which quickly adds up (i.e., 2 MB for the architectural maximum of 48 bits). Since there may be a platform specific limit to the size of the (I)PA space that is not reflected by CPU id registers, restrict the range of the ID mapping to gEmbeddedTokenSpaceGuid.PcdPrePiCpuMemorySize bits. This makes sense by itself, since we cannot manipulate mappings above that limit anwyay (because they are not covered by GCD), and it allows the PCD be set to a lower value by platforms whose (I)PA space is smaller than the hardware supported maximum. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Wei Huang <wei@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18929 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu: limit the (I)PA space to 40 bitsArd Biesheuvel2015-11-241-0/+4
| | | | | | | | | | | | | KVM uses a fixed size of 40 bits for its intermediate physical address space, so there is no need to support anything beyond that even if the host hardware does. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Wei Huang <wei@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18928 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtPlatformLib: map executable NOR region as normal memoryArd Biesheuvel2015-11-181-2/+8
| | | | | | | | | | | | | | | | | | | The ARM architecture version 7 and later mandates that device mappings have the XN (non-executable) bit set, to prevent speculative instruction fetches from read-sensitive regions. This implies that we should not map regions as device if we want to execute from them, so the NOR region that contains our FD image should be mapped as normal memory instead. The MMU code deals correctly with overlapping ARM_MEMORY_REGION_DESCRIPTOR entries, and later entries in the array take precedence over earlier ones. So simply add an entry to the end of the array that overrides the mapping attributes of the FD image, wherever it resides. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18889 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/PrePi: do not invalidate the entire data cache at startupArd Biesheuvel2015-11-091-2/+0
| | | | | | | | | | | | | | Drop the call to ArmInvalidateDataCache () from the PrePi startup sequence. This kind of data cache maintenance should not be performed when running under virtualization. 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: Mark Rutland <mark.rutland@arm.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18757 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: include BaseStackCheckLib also for AARCH64Mark Rutland2015-10-161-15/+9
| | | | | | | | | | | | | | | | | | | Some AArch64 toolchains also invoke the software stack checker functions on certain code - so include BaseStackCheckLib for AARCH64 as well as for ARM. Since this was the only difference between [LibraryClasses.ARM] and [LibraryClasses.AARCH64], merge the two into the existing [LibraryClasses.common]. At the same time, fix the grammar for the related comments. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Mark Rutland <mark.rutland@arm.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18617 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu: enable non-exec DXE stack for AARCH64Ard Biesheuvel2015-10-081-0/+3
| | | | | | | | | | Enable the non-exec DXE stack feature when building for AARCH64. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18589 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: use 4 KB section alignment for ARM DXE_RUNTIME_DRIVER modulesArd Biesheuvel2015-10-011-1/+2
| | | | | | | | | | | | | In order to support the Properties Table memory protection feature on 32-bit ARM, build DXE_RUNTIME_DRIVER type binaries with 4 KB section alignment by setting the common-page-size linker command line option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> Tested-by: Michael Zimmermann <sigmaepsilon92@gmail.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18566 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: build the TFTP command into the UEFI shellLaszlo Ersek2015-09-251-0/+1
| | | | | | | | | | | | | | | | | | | | The TFTP command is easy to use, it has very nice documentation (accessible with "HELP TFTP" in the shell), and it's a very versatile tool for downloading files from the host to the guest, via virtual network, while the guest is in the UEFI shell. Even better, enabling this command in the shell increases the uncompressed FVMAIN size only by 8192 bytes, in my AARCH64 build of VirtArmQemu.dsc, and the final size increase (after LZMA compression) that is visible in the FVMAIN_COMPACT volume is merely 1976 bytes. 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> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18555 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: QemuFwCfgLib: read bytes from fw-cfg with DMA when availableLaszlo Ersek2015-09-242-7/+121
| | | | | | | | | | | The protocol is documented in "docs/specs/fw_cfg.txt" in the QEMU tree. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18545 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: VirtFdtDxe: detect fw-cfg DMA interface from the DTBLaszlo Ersek2015-09-245-0/+19
| | | | | | | | | | | | | | | | A DMA-like transfer interface has recently been implemented in QEMU for fw-cfg. For ARM and AARCH64 virtual machines, the binding prescribes a new 8-byte wide register at offset 0x10 in the register block. Make VirtFdtDxe expose this register if it is present. Please see "docs/specs/fw_cfg.txt" in the QEMU tree for more information. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18544 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: reduce preallocation of boot services data pagesArd Biesheuvel2015-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | Commit SVN r18503 ("MdeModulePkg DxeCore: Take the range in resource HOB for PHIT as higher priority") changed the GCD init logic to take the sum of the region sizes in gMemoryTypeInformation[] into account when estimating the minimal amount of memory needed to boot the system. Unfortunately, as an unintended side effect, this change results in boot failures of ArmVirtQemu when running with QEMU's default memory size of 128 MB. The reason is that the sum of the gMemoryTypeInformation region sizes plus the size of the inital PEI region exceeds 128 MB. Since we do not actually need to preallocate 20,000 pages' worth of BootServicesData memory, reduce this figure to the more reasonable 12,000. Reported-by: Mark Rutland <mark.rutland@arm.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18533 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: PlatformIntelBdsLib: signal ReadyToBoot on direct kernel bootLaszlo Ersek2015-09-182-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | According to the UEFI spec, EFI_EVENT_GROUP_READY_TO_BOOT "is notified by the system when the Boot Manager is about to load and execute a boot option". ArmVirtPkg doesn't do this currently when launching a kernel from the QEMU command line. OvmfPkg does (see git commit 28a34033ee). At least two edk2-wide callbacks are worth mentioning: - OnReadyToBoot() in "MdeModulePkg/Universal/Variable/RuntimeDxe/VariableDxe.c" performs variable reclaim and (optionally) installs variable usage statistics as a vendor config table; - OnReadyToBoot() in "SecurityPkg/Library/DxeImageVerificationLib/DxeImageVerificationLib.c" installs the image execution info table if it doesn't exist yet, in SecureBoot-enabled builds. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18513 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: set max physical address width to 40 bitsArd Biesheuvel2015-09-091-0/+3
| | | | | | | | | | | | When executing on a LPAE capable 32-bit ARM platform, we support up to 40 bits of physical address space so set PcdPrePiCpuMemorySize accordingly. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18428 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtMemoryInitPeiLib: handle memory above 4 GB on 32-bit ARMArd Biesheuvel2015-09-091-6/+25
| | | | | | | | | | | | | On 32-bit ARM, split system memory into a region below (and up to) 4 GB and a region above 4 GB. This is necessary to get the DXE core to consider the former as the resource descriptor that describes the primary memory region that also covers the PHIT region. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18427 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: revert unintended change to ArmVirt.dsc.incArd Biesheuvel2015-08-261-5/+0
| | | | | | | | | | | The recent changes to ArmVExpress-FVP-AArch64 in SVN r18309 contained a hunk to ArmVirt.dsc.inc which was included in error. So remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18321 6f19259b-4bc3-4df7-8a09-765794883524
* ArmPlatformPkg/FVP: unify support for Foundation and Base modelsArd Biesheuvel2015-08-251-0/+5
| | | | | | | | | | | | | Now that the PL180 and PL111 drivers know how to behave when executed on the Foundation model (which does not emulate the hardware), we can remove the ARM_FOUNDATION_FVP ifdefs and produce a single build that runs on both the Foundation model and the Base model. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18309 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: Link separated VarCheckUefiLib NULL class library instanceStar Zeng2015-08-251-1/+4
| | | | | | | | | | Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18290 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: Add VarCheckLib library mappingStar Zeng2015-08-251-0/+1
| | | | | | | | | | | | Since Variable driver has been updated to consume the separated VarCheckLib. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18283 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: use global section alignment in custom linker scriptArd Biesheuvel2015-08-111-2/+2
| | | | | | | | | | | | | | The ArmVirtPrePiUniCoreRelocatable module comes with its own GNU linker script to create a PIE executable that can relocate itself at runtime. In order to be able to build this module using CLANG, we need to adhere to the section alignment passed via to the linker using -z commmon-page-size, so add this to the linker script. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18203 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: avoid relocated immediates in AARCH64 asmArd Biesheuvel2015-08-111-2/+2
| | | | | | | | | | | | | The relocated immediate notation supported by GNU as (e.g., #:lo12:foo) is not supported by clang. Since we are loading a constant value, they were not entirely appropriate here anyway, so simply replace them with assembler arithmetic expressions. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Acked-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18202 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: set default for PcdSmbiosDocRevLaszlo Ersek2015-08-061-0/+1
| | | | | | | | | | | | | | | | | | When MdeModulePkg/Universal/SmbiosDxe is instructed to compose & install an SMBIOS 3.0 entry point, it keys the Docrev (specification document revision) field of that structure off of PcdSmbiosDocRev. An upcoming OvmfPkg patch will have OvmfPkg/Library/SmbiosVersionLib set this PCD dynamically. Because we use that driver in the ArmVirtQemu.dsc platform, we must provide a default for the dynamic PCD. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Wei Huang <wei@redhat.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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18181 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu.dsc: set default for PcdQemuSmbiosValidatedLaszlo Ersek2015-08-061-0/+1
| | | | | | | | | | | | | | | The upcoming OvmfPkg patches will implicitly affect the ArmVirtQemu.dsc build, necessitating a default value for the new dynamic PcdQemuSmbiosValidated. Add it. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Wei Huang <wei@redhat.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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18179 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: revert "ArmVirtPkg: add QemuFwCfgToPcdDxe"Laszlo Ersek2015-08-064-78/+0
| | | | | | | | | | | | | | | | | | | | | | | This reverts git commit d2733aa9 (SVN r18042), because it is empty now. The original problem: Many universal DXE drivers in edk2 can be controlled by setting dynamic PCDs. Such a PCD must be set before the consumer DXE driver is dispatched. should be hereafter solved similarly to how OvmfPkg/Library/SmbiosVersionLib is plugged into MdeModulePkg/Universal/SmbiosDxe now (originally suggested by Jordan Justen <jordan.l.justen@intel.com>). Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Wei Huang <wei@redhat.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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18177 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: set SMBIOS version in DetectSmbiosVersionLib instead of ↵Laszlo Ersek2015-08-063-45/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QemuFwCfgToPcdDxe This patch de-duplicates the logic added in commit ArmVirtPkg: QemuFwCfgToPcdDxe: set SMBIOS entry point version dynamically (git c98da334, SVN r18043) by hooking DetectSmbiosVersionLib into SmbiosDxe. Although said commit was supposed to work with SMBIOS 3.0 payloads from QEMU, in practice that never worked, because the size / signature checks in SmbiosVersionInitialization() would always fail, due to the SMBIOS 3.0 entry point being structurally different. Therefore this patch doesn't regress ArmVirtPkg. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Wei Huang <wei@redhat.com> Suggested-by: 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18176 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtXen: add missing BdsLib instanceArd Biesheuvel2015-08-041-0/+2
| | | | | | | | | | | | Now that the ARM BDS has been removed, there is a remaining BdsLib dependency in ArmVirtXen that has now become unresolved. So re-add the BdsLib resolution that we removed from ArmVirt.dsc.inc to ArmVirtXen.dsc Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18156 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu: add LinuxLoader UEFI app to ARM buildArd Biesheuvel2015-08-043-3/+20
| | | | | | | | | | | | | | | | | The ARM build still needs an intermediate loader to boot Linux, since ARM/Linux has no builtin UEFI boot stub (yet). So add the LinuxLoader UEFI application to the FV, and enable the FvSimpleFileSystemDxe driver so that we can invoke the Linux loader from the shell, e.g., Shell> linuxloader fs2:zImage -c console=ttyAMA0 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18155 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtXen: remove unused PcdFirmwareVendor PCDArd Biesheuvel2015-08-041-1/+0
| | | | | | | | | | | The PcdFirmwareVendor PCD was never used on this platform, since it has never supported the ARM BDS. So remove it. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18154 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu: drop ARM BDS and make Intel BDS the defaultArd Biesheuvel2015-08-043-40/+3
| | | | | | | | | | | | | | | | ARM BDS support in ArmVirtQemu has been broken since SVN r17969 ("ArmPkg/BdsLib: Remove Linux loader from BdsLib") dated July 14th. Instead of fixing this, let's get rid of the ARM BDS and LinuxLoader altogether: they violate both the UEFI spec and the arm64 Linux boot protocol, and lack the level of integration with the QEMU command line that the Intel BDS has when running under ArmVirtPkg or OvmfPkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18153 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: move to unified GCC linker scriptArd Biesheuvel2015-08-031-1/+1
| | | | | | | | | | | | | Move to the parametrised generic GCC linker script and set 64 KB alignment, instead of using the AARCH64 specific incremental linker script for 64 KB alignment which is about to be removed. 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: Jordan Justen <jordan.l.justen@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18140 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: use 'auto' alignment and FIXED placement for XIP modulesArd Biesheuvel2015-07-312-12/+12
| | | | | | | | | | | | | | | | | Now that GenFw correctly propagates the minimum alignment of the ELF input sections to the PE/COFF binary, we can simply select 'auto' alignment in the FDF Rule section instead of tweaking it by hand. Also add the FIXED FFS attribute to the module types that may execute in place. This enables a newly added optimization in GenFfs that strips redundant padding, preventing excessive waste of FV space if the section alignment is considerable (i.e., 2 KB or 4 KB) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18122 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: implement DT-based ArmGicArchLibArd Biesheuvel2015-07-283-1/+116
| | | | | | | | | | | | | | | | | | | | | Since it is arguably incorrect to infer the GIC revision from CPU ID and GIC feature registers on platforms that describe the GIC in the device tree, this implements the library class ArmGicArchLib tailored for such platforms. The supported GIC revision is retrieved from the dynamic PCD that is set based on the GIC DT node. This means this library can only execute post DXE core, but this is not a problem for any of the virt platforms. 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> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18102 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: record GIC revision in dynamic PCDArd Biesheuvel2015-07-285-0/+10
| | | | | | | | | | | | | | In order to allow a ArmGicArchLib to be implemented that returns the supported GIC revision based on the device tree, add handling to VirtFdtDxe to record the GIC revision at DT parsing time. 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> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18101 6f19259b-4bc3-4df7-8a09-765794883524
* ArmPkg: split off ArmGicArchLib from ArmGicLibArd Biesheuvel2015-07-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | The current implementation of ArmGicGetSupportedArchRevision () that is used by all ARM platforms is entirely stateless (in order to support being executed from flash) so it needs to interrogate the hardware for the supported GIC revision upon each invocation. However, this statelessness is only needed for SEC type modules; in all other cases, we could easily determine the GIC revision once, and store the result in a global variable. In preparation of having separate early and normal versions, this patch introduces the ArmGicArchLib library class and default implementation, and moves the existing ArmGicGetSupportedArchRevision () into it. 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: Leif Lindholm <leif.lindholm@linaro.org> Tested-by: Leif Lindholm <leif.lindholm@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18098 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu: support SMBIOSLaszlo Ersek2015-07-262-0/+12
| | | | | | | | | | | | | | | The "MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf" driver is generic, it provides EFI_SMBIOS_PROTOCOL. The "OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf" driver downloads the SMBIOS payload from QEMU via fw_cfg. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18044 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: QemuFwCfgToPcdDxe: set SMBIOS entry point version dynamicallyLaszlo Ersek2015-07-263-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (This patch parallels OvmfPkg commit 37baf06b (SVN r17676).) PcdSmbiosVersion controls the version number of the SMBIOS entry point table (and other, related things) that the universal "MdeModulePkg/Universal/SmbiosDxe" driver, providing EFI_SMBIOS_PROTOCOL, installs. The "virt" machine type of QEMU generates SMBIOS payload for the firmware to install. The payload includes the entry point table ("anchor" table). OvmfPkg/SmbiosPlatformDxe cannot install the anchor table (because that is the jurisdiction of the generic "MdeModulePkg/Universal/SmbiosDxe" driver); however, we can parse the entry point version from QEMU's anchor table, and instruct "MdeModulePkg/Universal/SmbiosDxe" to adhere to that version. As default for PcdSmbiosVersion we should keep the current 0x0300 value (ie. SMBIOS 3.0) from "MdeModulePkg/MdeModulePkg.dec"; that spec version was specifically created for ARM / AARCH64 needs. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18043 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: add QemuFwCfgToPcdDxeLaszlo Ersek2015-07-264-0/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many universal DXE drivers in edk2 can be controlled by setting dynamic PCDs. Such a PCD must be set before the consumer DXE driver is dispatched. (In general we assume that the DXE driver will consume the PCD in its entry point, or in the constructor of a library instance it links against. In special cases this requirement can be relaxed a bit, if we know that the DXE driver accesses the PCD only in a protocol member function that it exports.) On the QEMU platform, the PCD values to be set for the universal drivers are frequently derived from fw_cfg files that QEMU exports. In OvmfPkg we tend to handle this in the following way: - For IA32 and X64, OvmfPkg provides a QemuFwCfgLib instance that is usable in PEI. - In PlatformPei, fw_cfg files can be loaded and transformed to PCD values. - Any DXE driver is bound to be dispatched after the PEI phase is done. (In specific cases other ordering solutions might be possible, via Depex or protocol notify, etc.) In ArmVirtPkg/ArmVirtQemu, things differ a bit: - We don't have an ArmVirtPkg-specific ("Platform") PEIM. This is actually a good thing for now, so let's not introduce one just for this purpose. - Even if we had such a PEIM, it could not easily access fw_cfg: the MMIO addresses of the fw_cfg device are available only in the DTB that QEMU exports. (Accordingly, our QemuFwCfgLib instance is restricted to DXE_DRIVER modules: VirtFdtDxe parses the DTB, stores the fw_cfg addresses in PCDs, and then QemuFwCfgLib's constructor fetches those PCDs.) There are some examples in ArmVirtPkg where early code is forced to parse the DTB manually, but those examples are all painful, and our goal here (controlling universal DXE drivers) doesn't justify more of that pain. Therefore, introduce a separate, minimal DXE driver that is dispatched strictly after VirtFdtDxe (so that it can use QemuFwCfgLib), and strictly before other DXE drivers (so that it can set dynamic PCDs for them). Because VirtFdtDxe is already ordered with the APRIORI DXE file, it is simplest to do the same for the new driver. Actual fw_cfg files and PCDs shall be accessed in future patches. 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> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18042 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: Make terminal type consistentHeyi Guo2015-07-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | Change default terminal type to be consistent with default ConIn/ConOut device path, which is now determined by TTY_TERMINAL flag, TTYTERM or VT100. I can't say this is a bug, as we can pass the whole console device path to ConnectController, and TerminalDxe driver will pick up the terminal in the remaining device path. However, in rare circumstances, the console devices may be disconnected with the driver, and they will be ignored by ConPlatformDxe until we pass the device path explicitly just as BDS. Changing default terminal type to be the same with console device path could help serial terminal be reconnected with normal connect controller operation. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Heyi Guo <heyi.guo@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18025 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirtQemu.dsc: Remove Linux specific boot pathOlivier Martin2015-07-141-1/+0
| | | | | | | | | | | | | | | | | | PcdDefaultBootType has been removed when the embedded Linux Loader has been removed from BdsLib. The boot arguments (defined by PcdDefaultBootArgument) are now always targetting EFI applications. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ronald Cron <Ronald.Cron@arm.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17972 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg: Remove Ip4ConfigDxe module from ArmVirtPkgJiaxin Wu2015-07-102-2/+0
| | | | | | | | | | | | | | Ip4ConfigDxe driver is deprecated in UEFI 2.5, so we will not support original Ip4Config Protocol, which is replace by Ip4Config2 Protocol integrated in Ip4Dxe driver(git commit 1f6729ff (SVN r17853)). Therefore we can remove Ip4ConfigDxe driver from this build. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Olivier Martin <Olivier.martin@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17912 6f19259b-4bc3-4df7-8a09-765794883524
* add TTY_TERMINAL build option for ARM BDSRoy Franz2015-07-092-5/+10
| | | | | | | | | | | | | Enable selecting the TtyTerminal type for the ARM BDS build of QEMU using the TTY_TERMINAL define. Convert INTEL_BDS define to check for value (!if) rather than just definition (!ifdef) to allow setting of either value on command line. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz <roy.franz@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17899 6f19259b-4bc3-4df7-8a09-765794883524
* Add PCD for selecting terminal type at build timeLaszlo Ersek2015-07-094-4/+25
| | | | | | | | | | | | | | | | Add a fixed pointer PCD to allow build-time selection of VT100 or TTY terminal type. The default remains VT100 emulation. Add support for building the ARM QEMU platforms with the TTY terminal with the "-D TTY_TERMINAL" build option. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> [Roy Franz: minor edits: add TtyTerminal GUID, rename LINUX_TERMINAL to TTY_TERMINAL] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Roy Franz <roy.franz@linaro.org> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17898 6f19259b-4bc3-4df7-8a09-765794883524
* ArmVirtPkg/ArmVirt.dsc.inc: Fixed BuildOptionsOlivier Martin2015-07-071-1/+1
| | | | | | | | | | | | | | The linker script is specific to GCC toolchain. So, this script will not work with other linkers (eg: ARM Toolchain Linker, Microsoft Linker, etc). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin <Olivier.Martin@arm.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17865 6f19259b-4bc3-4df7-8a09-765794883524