]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
9 years agoAdd code to identify D0 stepping ValleyView SoC.
Shifei Lu [Tue, 10 Mar 2015 03:16:48 +0000 (03:16 +0000)]
Add code to identify D0 stepping ValleyView SoC.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shifei Lu <shifeix.a.lu@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17034 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoUpdate build script to include new SEC.
David Wei [Tue, 10 Mar 2015 03:11:24 +0000 (03:11 +0000)]
Update build script to include new SEC.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17033 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoShellPkg: Help and Error Messages Update
Tapan Shah [Mon, 9 Mar 2015 22:18:59 +0000 (22:18 +0000)]
ShellPkg: Help and Error Messages Update

Updates to various profile commands help and error message output with better wordings.
Fix few inconsistency issues found in error messages across various profile commands.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Tapan Shah <tapandshah@hp.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17032 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoSecurityPkg Variable: Keep the behavior of Variable Dxe and SMM drivers consistent
Star Zeng [Mon, 9 Mar 2015 13:05:55 +0000 (13:05 +0000)]
SecurityPkg Variable: Keep the behavior of Variable Dxe and SMM drivers consistent

to return EFI_NOT_FOUND when a specified variable doesn't exist and
Data parameter is NULL but DataSize parameter is valid in GetVariable() invocation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17031 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg Variable: Keep the behavior of Variable Dxe and SMM drivers consistent
Star Zeng [Mon, 9 Mar 2015 13:03:42 +0000 (13:03 +0000)]
MdeModulePkg Variable: Keep the behavior of Variable Dxe and SMM drivers consistent

to return EFI_NOT_FOUND when a specified variable doesn't exist and
Data parameter is NULL but DataSize parameter is valid in GetVariable() invocation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17030 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoUefiCpuPkg/MpSerivce: add volatile qualifiers
Chen Fan [Mon, 9 Mar 2015 06:45:26 +0000 (06:45 +0000)]
UefiCpuPkg/MpSerivce: add volatile qualifiers

For avoid the compiler optimizing the code, we let Parameter and Procedure in CpuData volatile.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17024 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoUefiCpuPkg/MpService: Put APs to sleep when not busy.
Chen Fan [Mon, 9 Mar 2015 06:43:11 +0000 (06:43 +0000)]
UefiCpuPkg/MpService: Put APs to sleep when not busy.

Add a new sleeping state for APs, when no procedure execution, put AP to sleep. when need to execute
procedure, only need to wake up this AP by sent SIPI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17023 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoUefiCpuPkg/MpService: put AP to busy state when execution
Chen Fan [Mon, 9 Mar 2015 06:38:16 +0000 (06:38 +0000)]
UefiCpuPkg/MpService: put AP to busy state when execution

CpuState should follow the process?

    Idle -> Ready -> Busy -> Finished
     ^                         |
     |                         |
     + - - - - - - - - - - - - +

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17022 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoUefiCpuPkg/MpService: fix trivial typo in cpu state
Chen Fan [Mon, 9 Mar 2015 06:37:32 +0000 (06:37 +0000)]
UefiCpuPkg/MpService: fix trivial typo in cpu state

CpuStateBuzy => CpuStateBusy

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chen Fan <chen.fan.fnst@cn.fujitsu.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17021 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoSet network boot option to the default last priority.
Mang Guo [Fri, 6 Mar 2015 05:56:43 +0000 (05:56 +0000)]
Set network boot option to the default last priority.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Mang Guo <mang.guo@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17018 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: use 64 KB granularity for runtime allocations on AArch64
Ard Biesheuvel [Fri, 6 Mar 2015 02:58:01 +0000 (02:58 +0000)]
MdeModulePkg: use 64 KB granularity for runtime allocations on AArch64

On AArch64, the OS can choose to run with a page size of 64 KB,
making it cumbersome to deal with UEFI reserved memory regions
whose boundaries are not 64 KB aligned.

So increase the allocation granularity for runtime regions to
64 KB.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17016 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: serve allocations from higher-up bins if current bin is empty
Ard Biesheuvel [Fri, 6 Mar 2015 02:57:11 +0000 (02:57 +0000)]
MdeModulePkg: serve allocations from higher-up bins if current bin is empty

This patch changes the allocation logic for the pool allocator to only
allocate additional pages if the requested allocation cannot be fulfilled
from the current bin or any of the larger ones. If there are larger blocks
available, they will be used to serve the allocation, and the remainder will
be carved up into smaller blocks using the existing carving up logic.
Note that all pool sizes are a multiple of the smallest pool size, so it is
guaranteed that the remainder will be carved up without spilling. Due to the
exponential nature of the pool sizes, the amount of work is logarithmic in
the size of the available block.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17015 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: carve pool pages into the largest chunks possible
Ard Biesheuvel [Fri, 6 Mar 2015 02:56:20 +0000 (02:56 +0000)]
MdeModulePkg: carve pool pages into the largest chunks possible

In preparation of the next patch, that serves allocations from higher-up
bins if the current bin is depleted, this patch updates the carving up
strategy to populate the largest bins first. To ensure that there will
always be an allocation of the appropriate size made, the current allocation
request is served first from the newly allocated memory region.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17014 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: use index to traverse free pool pages
Ard Biesheuvel [Fri, 6 Mar 2015 02:55:35 +0000 (02:55 +0000)]
MdeModulePkg: use index to traverse free pool pages

In preparation of making the pool code capable of serving allocations
from higher-up bins, update the free path to traverse a candidate page
by following the index of POOL_FREE header instead of duplicating the
carving logic that was used at page allocation time. This allows chunks
to be split into smaller ones, where one can be returned to serve the
allocation, and the other stored in a smaller bin for later use.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17013 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: improve scalability of memory pools
Ard Biesheuvel [Fri, 6 Mar 2015 02:54:50 +0000 (02:54 +0000)]
MdeModulePkg: improve scalability of memory pools

The existing linear mapping between allocation size and pool index
does not scale when moving to a 64 KB granularity or beyond. With
a granularity of 64 KB, 2048 (!) bins will be created for each
memory type, each differing 32 bytes in size with the next one.

Instead, introduce an exponential scheme where each bin size is
the sum of the two previous ones.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17012 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: use correct granularity when allocating pool pages
Ard Biesheuvel [Fri, 6 Mar 2015 02:54:05 +0000 (02:54 +0000)]
MdeModulePkg: use correct granularity when allocating pool pages

After fixing the sanity check on the alignment of the runtime regions
in SVN revision #16630 ("MdeModulePkg/DxeMain: Fix wrong sanity check
in CoreTerminateMemoryMap()"), it is no longer possible to define a
runtime allocation alignment that is different from the boot time
allocation alignment.

For instance, #defining the following in MdeModulePkg/Core/Dxe/Mem/Imem.h
will hit the ASSERT () in MdeModulePkg/Core/Dxe/Mem/Page.c:1798

  #define EFI_ACPI_RUNTIME_PAGE_ALLOCATION_ALIGNMENT  (SIZE_64KB)
  #define DEFAULT_PAGE_ALLOCATION                     (EFI_PAGE_SIZE)

(which is needed for 64-bit ARM to adhere to the Server Base Boot
Requirements [SBBR], which stipulates that all runtime memory regions
should be naturally aligned multiples of 64 KB)

This patch fixes this use case by ensuring that the backing for the memory
pools is allocated in appropriate chunks for the memory type.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Liming Gao <liming.gao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17011 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdePkg: Convert non DOS format files to DOS format
Hot Tian [Thu, 5 Mar 2015 07:21:34 +0000 (07:21 +0000)]
MdePkg: Convert non DOS format files to DOS format

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hot Tian <hot.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17010 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoShellPkg: smbiosview shows wrong information for Type 27.
Elvin Li [Wed, 4 Mar 2015 07:50:47 +0000 (07:50 +0000)]
ShellPkg: smbiosview shows wrong information for Type 27.

Fixed smbiosview to use correct value to parse Type 27.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17007 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoAdd performance optimization for Tcg/TrEE.
Yao, Jiewen [Wed, 4 Mar 2015 01:15:08 +0000 (01:15 +0000)]
Add performance optimization for Tcg/TrEE.

Add error check for Tcg/TrEE Pei/Dxe driver to avoid unnecessary hardware check for performance optimization.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Zeng, Star" <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17004 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoAdd UINT16/32/64 array and DSC include support.
Ma, Maurice [Wed, 4 Mar 2015 01:03:20 +0000 (01:03 +0000)]
Add UINT16/32/64 array and DSC include support.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Ma, Maurice" <maurice.ma@intel.com>
Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17003 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmfPkg: replace strict XenHypercallLib construction with explicit query
Laszlo Ersek [Tue, 3 Mar 2015 08:13:40 +0000 (08:13 +0000)]
OvmfPkg: replace strict XenHypercallLib construction with explicit query

XenHypercallLib has two clients at the moment: XenBusDxe and
XenConsoleSerialPortLib. Currently, when XenBusDxe starts on a non-Xen X86
platform (ie. as part of OVMF not running on Xen), the X86XenHypercallLib
instance built into it fails to initialize, which triggers an ASSERT() in
auto-generated code.

Instead, let's call XenHypercallIsAvailable() in the driver's entry point,
and exit cleanly when the driver is started on a non-Xen platform.

Modify the constructor of XenConsoleSerialPortLib similarly; we shouldn't
proceed if Xen is not available. In practice this check should never fail,
because XenConsoleSerialPortLib is only used on ARM, and
ArmXenHypercallLib is always available; but nonetheless we should be
pedantic.

Reported-by: Gabriel L. Somlo <gsomlo@gmail.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: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17001 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmfPkg: XenHypercallLib: introduce XenHypercallIsAvailable()
Laszlo Ersek [Tue, 3 Mar 2015 08:13:30 +0000 (08:13 +0000)]
OvmfPkg: XenHypercallLib: introduce XenHypercallIsAvailable()

Similarly to QemuFwCfgLib, we prefer mellow library construction code and
an explicit "are you available" query function in the XenHypercallLib
class. In this step we introduce that query function, but move no client
code to it yet.

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: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17000 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmfPkg: XenHypercallLib: add empty constructor for ARM & AARCH64
Laszlo Ersek [Tue, 3 Mar 2015 08:13:19 +0000 (08:13 +0000)]
OvmfPkg: XenHypercallLib: add empty constructor for ARM & AARCH64

In the next patch we'll add a simple query function to the XenHypercallLib
library class that is supposed to be called by initialization code in
modules. Among those, in constructors of dependent libraries too.

Library construction ordering is ensured only between libraries with
constructors, plus we shouldn't allow a dependent library with a
constructor to call into any XenHypercallLib instances (the simple query
function) before XenHypercallLib is constructed itself. For this reason,
introduce an (empty) constructor for ARM & AARCH64 too.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16999 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmfPkg, ArmVirtualizationPkg: clean up XenHypercallLib names
Laszlo Ersek [Tue, 3 Mar 2015 08:13:09 +0000 (08:13 +0000)]
OvmfPkg, ArmVirtualizationPkg: clean up XenHypercallLib names

Perform the following renames in order to stick with edk2 tradition more
closely:

  XenHypercallLibArm, XenHypercallLibIntel  ->  XenHypercallLib
  XenHypercallIntel                         ->  X86XenHypercall

In addition, we unify the INF files.

This patch modifies ArmVirtualizationPkg and OvmfPkg at once, in order to
keep both bisectable (client code shouldn't break).

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: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16998 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoShellPkg: Fixed EBC build error.
Elvin Li [Tue, 3 Mar 2015 02:38:26 +0000 (02:38 +0000)]
ShellPkg: Fixed EBC build error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16987 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: expose debug message bitmask on build command line
Laszlo Ersek [Mon, 2 Mar 2015 16:19:41 +0000 (16:19 +0000)]
ArmVirtualizationPkg: expose debug message bitmask on build command line

This enables -D DEBUG_PRINT_ERROR_LEVEL=0x8040004F style command line
options.

Since we're massaging the debug message bitmask anyway, let's update the
description of the individual bits too in the comments, so that they match
"MdePkg/Include/Library/DebugLib.h".

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@16986 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: lack of QEMU kernel is no error
Laszlo Ersek [Mon, 2 Mar 2015 16:19:36 +0000 (16:19 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: lack of QEMU kernel is no error

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

9 years agoArmPlatformPkg: PEIM startup is not an error
Laszlo Ersek [Mon, 2 Mar 2015 16:19:32 +0000 (16:19 +0000)]
ArmPlatformPkg: PEIM startup is not an error

"MemoryInitPeim.c" and "PlatformPeim.c" log startup messages on the
EFI_D_ERROR level. This clutters a strictly EFI_D_ERROR level log
needlessly; change the log bitmask of these messages to EFI_D_LOAD |
EFI_D_INFO.

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@16984 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPkg: DebugPeCoffExtraActionLib: debugger commands are not errors
Laszlo Ersek [Mon, 2 Mar 2015 16:19:26 +0000 (16:19 +0000)]
ArmPkg: DebugPeCoffExtraActionLib: debugger commands are not errors

PeCoffLoaderRelocateImageExtraAction() prints helpful debugger commands
for source level debugging. These messages should not be printed on the
EFI_D_ERROR level; they don't report errors. Change the debug level
(bitmask, actually) to EFI_D_LOAD | EFI_D_INFO, because the messages are
printed in relation to image loading, and they are informative.

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@16983 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: add platform description for Xen guests
Ard Biesheuvel [Sat, 28 Feb 2015 20:34:36 +0000 (20:34 +0000)]
ArmVirtualizationPkg: add platform description for Xen guests

This adds the .dsc and .fdf descriptions to build a UEFI image that
is bootable by a Xen guest on 64-bit ARM (AArch64)

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@16981 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/VirtFdtDxe: wire up XenBusDxe to "xen,xen" DT node
Ard Biesheuvel [Sat, 28 Feb 2015 20:34:26 +0000 (20:34 +0000)]
ArmVirtualizationPkg/VirtFdtDxe: wire up XenBusDxe to "xen,xen" DT node

This patchs adds support to VirtFdtDxe for the Xen DT node which
contains the base address of the Grant Table. This data is communicated
to XenBusDxe using a XENIO_PROTOCOL instance.

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@16980 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: add XenIoMmioLib
Ard Biesheuvel [Sat, 28 Feb 2015 20:34:16 +0000 (20:34 +0000)]
ArmVirtualizationPkg: add XenIoMmioLib

This adds a XenIoMmioLib declaration and implementation that can
be invoked to install the XENIO_PROTOCOL and a corresponding
grant table address on a EFI handle.

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: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16979 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvfm/Xen: add a Vendor Hardware device path GUID for the XenBus root
Ard Biesheuvel [Sat, 28 Feb 2015 20:34:06 +0000 (20:34 +0000)]
Ovfm/Xen: add a Vendor Hardware device path GUID for the XenBus root

On non-PCI Xen guests (such as ARM), the XenBus root is not a PCI
device but an abstract 'platform' device. Add a dedicated Vendor
Hardware device path GUID to identify this node.

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: Laszlo Ersek <lersek@redhat.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16978 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: implement dummy RealTimeClockLib for Xen
Ard Biesheuvel [Sat, 28 Feb 2015 20:33:55 +0000 (20:33 +0000)]
ArmVirtualizationPkg: implement dummy RealTimeClockLib for Xen

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

9 years agoOvmf/Xen: add Xen PV console SerialPortLib driver
Ard Biesheuvel [Sat, 28 Feb 2015 20:33:45 +0000 (20:33 +0000)]
Ovmf/Xen: add Xen PV console SerialPortLib driver

This implements a SerialPortLib instance that wires up to the
PV console ring used by domU guests. Also imports the required
upstream Xen io/console.h header.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-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@16976 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: port XenBusDxe to other architectures
Ard Biesheuvel [Sat, 28 Feb 2015 20:33:34 +0000 (20:33 +0000)]
Ovmf/Xen: port XenBusDxe to other architectures

This patch updates XenBusDxe to use the 16-bit compare and exchange
function that was introduced for this purpose to the
BaseSynchronizationLib. It also provides a new generic implementation
of TestAndClearBit () using the same 16-bit compare and exchange, making
this module fully architecture agnostic.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16975 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: implement XenHypercallLib for ARM
Ard Biesheuvel [Sat, 28 Feb 2015 20:33:22 +0000 (20:33 +0000)]
Ovmf/Xen: implement XenHypercallLib for ARM

This patch adds an implementation of XenHypercallLib for both
AArch64 and AArch32 execution modes on ARM systems.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.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@16974 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: move XenBusDxe to abstract XENIO_PROTOCOL
Ard Biesheuvel [Sat, 28 Feb 2015 20:33:11 +0000 (20:33 +0000)]
Ovmf/Xen: move XenBusDxe to abstract XENIO_PROTOCOL

While Xen on Intel uses a virtual PCI device to communicate the
base address of the grant table, the ARM implementation uses a DT
node, which is fundamentally incompatible with the way XenBusDxe is
implemented, i.e., as a UEFI Driver Model implementation for a PCI
device.

Contributed-under: TianoCore Contribution Agreement 1.0
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16973 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: add separate driver for Xen PCI device
Ard Biesheuvel [Sat, 28 Feb 2015 20:33:00 +0000 (20:33 +0000)]
Ovmf/Xen: add separate driver for Xen PCI device

Prepare for making XenBusDxe suitable for use with non-PCI devices
(such as the DT node exposed by Xen on ARM) by introducing a separate
DXE driver that binds to the Xen virtual PCI device and exposes the
abstract XENIO_PROTOCOL for XenBusDxe to bind against.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16972 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: introduce XENIO_PROTOCOL
Ard Biesheuvel [Sat, 28 Feb 2015 20:32:50 +0000 (20:32 +0000)]
Ovmf/Xen: introduce XENIO_PROTOCOL

This introduces the abstract XENIO_PROTOCOL that will be used to
communicate the Xen grant table address to drivers supporting this
protocol. Primary purpose is allowing us to change the XenBusDxe
implementation so that it can support non-PCI Xen implementations
such as Xen on ARM.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16971 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: move XenBusDxe hypercall code to separate library
Ard Biesheuvel [Sat, 28 Feb 2015 20:32:39 +0000 (20:32 +0000)]
Ovmf/Xen: move XenBusDxe hypercall code to separate library

This moves all of the Xen hypercall code that was private to XenBusDxe
to a new library class XenHypercallLib. This will allow us to reimplement
it for ARM, and to export the Xen hypercall functionality to other parts
of the code, such as a Xen console SerialPortLib driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16970 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: refactor XenBusDxe hypercall implementation
Ard Biesheuvel [Sat, 28 Feb 2015 20:32:27 +0000 (20:32 +0000)]
Ovmf/Xen: refactor XenBusDxe hypercall implementation

This refactors the Xen hypercall implementation that is part of the
XenBusDxe driver, in preparation of splitting it off entirely into
a XenHypercallLib library. This involves:
- removing the dependency on XENBUS_DEVICE* pointers in the XenHypercall()
  prototypes
- moving the discovered hyperpage address to a global variable
- moving XenGetSharedInfoPage() to its only user XenBusDxe.c (the shared info
  page is not strictly part of the Xen hypercall interface, and is not used
  by other expected users of XenHypercallLib such as the Xen console version
  of SerialPortLib
- reimplement XenHypercall2() in C and move the indexing of the hyperpage
  there; the existing asm implementations are renamed to __XenHypercall2() and
  invoked from the new C implementation.

Contributed-under: TianoCore Contribution Agreement 1.0
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16969 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: fix pointer to int cast in XenBusDxe
Ard Biesheuvel [Sat, 28 Feb 2015 20:32:16 +0000 (20:32 +0000)]
Ovmf/Xen: fix pointer to int cast in XenBusDxe

On ARM, xen_pfn_t is 64 bits but the size of a pointer is only
32 bits, so casting between them needs to go via (UINTN). Also
move the xen_pfn_t cast outside the shift so that we can avoid
shifting 64-bit quantities on 32-bit architectures, which may
require runtime library support.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16968 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoOvmf/Xen: move Xen interface version to <xen.h>
Ard Biesheuvel [Sat, 28 Feb 2015 20:32:06 +0000 (20:32 +0000)]
Ovmf/Xen: move Xen interface version to <xen.h>

Tiancore has its private copy of the Xen headers, and all drivers
that depend on it should use the same Xen interface version, so
let's move the #define to xen.h itself.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony PERARD <anthony.perard@citrix.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@16967 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdePkg/BaseSynchronizationLib: Add InterlockedCompareExchange16
Ard Biesheuvel [Sat, 28 Feb 2015 20:31:54 +0000 (20:31 +0000)]
MdePkg/BaseSynchronizationLib: Add InterlockedCompareExchange16

This implements the function InterlockedCompareExchange16 () for all
architectures, using architecture and toolchain specific intrinsics
or primitive assembler instructions.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
Acked-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.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@16966 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdePkg/BaseSynchronizationLib: Added proper support for ARM architecture
Olivier Martin [Sat, 28 Feb 2015 20:31:40 +0000 (20:31 +0000)]
MdePkg/BaseSynchronizationLib: Added proper support for ARM architecture

This implements the following synchronization primitives for AArch64 (GCC)
and ARM (GCC & RVCT):

InternalSyncCompareExchange32
InternalSyncCompareExchange64
InternalSyncIncrement
InternalSyncDecrement

Note: these functions are implemented using the exclusive monitor,
which implies that they can only be used after the caches (and hence
the MMU) have been enabled.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@16965 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: Xen/PV relocatable platformlib instance
Ard Biesheuvel [Sat, 28 Feb 2015 20:31:28 +0000 (20:31 +0000)]
ArmVirtualizationPkg: Xen/PV relocatable platformlib instance

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

9 years agoArmVirtualizationPkg: allow patchable PCD for FV and DT base addresses
Ard Biesheuvel [Sat, 28 Feb 2015 20:31:18 +0000 (20:31 +0000)]
ArmVirtualizationPkg: allow patchable PCD for FV and DT base addresses

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

9 years agoArmVirtualizationPkg: implement custom MemoryInitPeiLib
Ard Biesheuvel [Sat, 28 Feb 2015 20:31:08 +0000 (20:31 +0000)]
ArmVirtualizationPkg: implement custom MemoryInitPeiLib

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

9 years agoArmVirtualizationPkg: add a relocatable version of PrePi
Ard Biesheuvel [Sat, 28 Feb 2015 20:26:20 +0000 (20:26 +0000)]
ArmVirtualizationPkg: add a relocatable version of PrePi

This patch introduces a relocatable PrePi, which can execute
from arbitrary offsets in RAM. This is intendend to be run
from a boot loader which passes a description of the actual
platform in a device tree, for instance.

This module is based on the PrePi implementations residing under
ArmPlatformPkg.

Contributed-under: TianoCore Contribution Agreement 1.0
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@16961 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: add padding to FDT allocation
Ard Biesheuvel [Sat, 28 Feb 2015 20:26:10 +0000 (20:26 +0000)]
ArmVirtualizationPkg: add padding to FDT allocation

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

9 years agoArmVirtualizationPkg: use a HOB to store device tree blob
Ard Biesheuvel [Sat, 28 Feb 2015 20:26:00 +0000 (20:26 +0000)]
ArmVirtualizationPkg: use a HOB to store device tree blob

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

9 years agoArmVirtualizationPkg: move early UART discovery to PlatformPeim
Ard Biesheuvel [Sat, 28 Feb 2015 20:25:48 +0000 (20:25 +0000)]
ArmVirtualizationPkg: move early UART discovery to PlatformPeim

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

9 years agoArmVirtualizationPkg: allow patchable PCD for device tree base address
Ard Biesheuvel [Sat, 28 Feb 2015 20:25:38 +0000 (20:25 +0000)]
ArmVirtualizationPkg: allow patchable PCD for device tree base address

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

9 years agoArmVirtualizationPkg: add GICv3 detection to VirtFdtDxe
Ard Biesheuvel [Sat, 28 Feb 2015 20:25:26 +0000 (20:25 +0000)]
ArmVirtualizationPkg: add GICv3 detection to VirtFdtDxe

This adds support for detecting the presence of a GICv3 interrupt
controller from the device tree, and recording its distributor and
redistributor base addresses in their respective PCDs.

Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
Acked-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@16956 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg: allow patchable PCD for FD base address
Ard Biesheuvel [Sat, 28 Feb 2015 20:25:17 +0000 (20:25 +0000)]
ArmPlatformPkg: allow patchable PCD for FD base address

This moves the reference to gArmTokenSpaceGuid.PcdFdBaseAddress
from the [FixedPcd] to the [Pcd] section in the INF file of
PrePiArmPlatformGlobalVariableLib so that its users may choose
to use a patchable PCD instead.

Contributed-under: TianoCore Contribution Agreement 1.0
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@16955 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPkg: allow patchable PCDs for memory, FD and FV addresses
Ard Biesheuvel [Sat, 28 Feb 2015 20:25:07 +0000 (20:25 +0000)]
ArmPkg: allow patchable PCDs for memory, FD and FV addresses

In order to allow a runtime self relocating PrePi instance, change the
allowable PCD types for the following PCDs:

  gArmTokenSpaceGuid.PcdSystemMemoryBase
  gArmTokenSpaceGuid.PcdSystemMemorySize
  gArmTokenSpaceGuid.PcdFdBaseAddress
  gArmTokenSpaceGuid.PcdFvBaseAddress

to include PcdsPatchableInModule. This makes the build system correctly
distinguish fixed PCDs from PCDs whose value may be different from the
assigned value at compile time.

Note that this only affects platforms that explicitly mark these PCDs as
PatchableInModule in the DSC. All existing platforms that use FixedPcd
will not be affected by this change.

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@16954 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPkg: allow HYP timer interrupt to be omitted
Ard Biesheuvel [Sat, 28 Feb 2015 20:24:57 +0000 (20:24 +0000)]
ArmPkg: allow HYP timer interrupt to be omitted

The DT binding for the ARM generic timer describes the secure,
non-secure, virtual and hypervisor timer interrupts, respectively.
However, under virtualization, only the virtual timer is usable, and
the device tree may omit the hypervisor timer interrupt. (Other timer
interrupts cannot be omitted simply due to the fact that the virtual
timer is listed third)

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@16953 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoPcAtChipsetPkg: Update BaseAcpiTimerLib
Liming Gao [Sat, 28 Feb 2015 05:34:38 +0000 (05:34 +0000)]
PcAtChipsetPkg: Update BaseAcpiTimerLib

Introduce new PcdAcpiIoPortBaseAddressMask to mask BITS ACPI IO Port Base Address.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16952 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoNT32Pkg: Bind NT32 process to a single core to avoid NT32 crash issue in some multi...
Qiu Shumin [Sat, 28 Feb 2015 02:36:06 +0000 (02:36 +0000)]
NT32Pkg: Bind NT32 process to a single core to avoid NT32 crash issue in some multi-core processors.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Ni Ruiyu <ni.ruiyu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16951 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoShellBinPkg: Arm/AArch64 Shell binary update.
Olivier Martin [Fri, 27 Feb 2015 17:54:29 +0000 (17:54 +0000)]
ShellBinPkg: Arm/AArch64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg project 16948.

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@16950 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoFatBinPkg: Update ARM and AArch64 binaries
Olivier Martin [Fri, 27 Feb 2015 17:27:42 +0000 (17:27 +0000)]
FatBinPkg: Update ARM and AArch64 binaries

Based on MdePkg and BaseTools (r16948), FatPkg (r93)

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@16949 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoShellPkg: Update Intel copyright to 2015.
Elvin Li [Fri, 27 Feb 2015 03:32:59 +0000 (03:32 +0000)]
ShellPkg: Update Intel copyright to 2015.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16944 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoShellPkg: Parse new SMBIOS 3.0 fields.
Elvin Li [Fri, 27 Feb 2015 02:10:57 +0000 (02:10 +0000)]
ShellPkg: Parse new SMBIOS 3.0 fields.

Parse new SMBIOS 3.0 fields in Type 4: Core Count 2, Core Enabled 2, Thread Count 2.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16943 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmJunoPkg: Create two default boot entries on first boot on Juno R1
Olivier Martin [Thu, 26 Feb 2015 11:04:52 +0000 (11:04 +0000)]
ArmPlatformPkg/ArmJunoPkg: Create two default boot entries on first boot on Juno R1

Juno R1 can run in two configurations:
- A57x2
- A57x2-A53x4

The Device Tree tell Linux which configuration has been selected.

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@16942 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmJunoPkg: Update with Juno R1 device tree names
Olivier Martin [Thu, 26 Feb 2015 11:03:41 +0000 (11:03 +0000)]
ArmPlatformPkg/ArmJunoPkg: Update with Juno R1 device tree names

Juno R1 support two configurations:
- A57x2
- A57x2-A53x4

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@16941 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/Bds: Remove any use of the "Fdt" UEFI variable
Ronald Cron [Thu, 26 Feb 2015 11:02:39 +0000 (11:02 +0000)]
ArmPlatformPkg/Bds: Remove any use of the "Fdt" UEFI variable

Remove the option to update the "Fdt" UEFI variable in the ARM BDS as
the "setfdt" EFI Shell command provides this service from now.

Remove the use of this variable in the legacy kernel boot loader and
use the FDT installed in the configuration table instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16940 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmJunoDxe: Set the platform dependent FDT device path
Ronald Cron [Thu, 26 Feb 2015 10:57:27 +0000 (10:57 +0000)]
ArmPlatformPkg/ArmJunoDxe: Set the platform dependent FDT device path

The MIDR register of the CPU on which the UEFI firmware is running on
is used to infer if the platform is a Juno r0 or a Juno r1. The right
device path to the platform FDT is then stored in the
"gEmbeddedTokenSpaceGuid.PcdFdtDevicePaths" dynamic PCD.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16939 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmJunoPkg : Use FdtPlatformDxe driver to install the FDT
Ronald Cron [Thu, 26 Feb 2015 10:56:20 +0000 (10:56 +0000)]
ArmPlatformPkg/ArmJunoPkg : Use FdtPlatformDxe driver to install the FDT

Remove the installation of the FDT for Juno into the UEFI Configuration
Table from the Juno specific DXE driver. Use the FdtPlatformDxe driver to
do it instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16938 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmVExpressDxe: Load FDT into the EFI Configuration Table
Ronald Cron [Thu, 26 Feb 2015 10:54:39 +0000 (10:54 +0000)]
ArmPlatformPkg/ArmVExpressDxe: Load FDT into the EFI Configuration Table

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16937 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoClean up GCC build.
Bruce Cran [Thu, 26 Feb 2015 06:49:31 +0000 (06:49 +0000)]
Clean up GCC build.

Make the Unix Vlv2TbltDevicePkg scripts executable, add shebangs and skip the requirement to press a key when displaying usage text from Build_IFWI.sh.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bruce Cran <bruce.cran@gmail.com>
Reviewed-by: David Wei <david.wei@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16936 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoEmbeddedPkg/FdtPlatformDxe: Add 'setfdt' EFI Shell command
Ronald Cron [Wed, 25 Feb 2015 19:34:07 +0000 (19:34 +0000)]
EmbeddedPkg/FdtPlatformDxe: Add 'setfdt' EFI Shell command

The 'setfdt' EFI Shell command allows to define a new FDT
as the prefered one for development purposes. It allows to
trigger the run of the FDT installation process as well.

Please refer to the README.txt file for more comprehensive
description.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16934 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoEmbeddedPkg : Add FdtPlatformDxe driver
Ronald Cron [Wed, 25 Feb 2015 19:20:57 +0000 (19:20 +0000)]
EmbeddedPkg : Add FdtPlatformDxe driver

The FdtPlatformDxe driver installs the FDT of the platform it
is running on into the UEFI Configuration table at the end of
the DXE phase.

Please refer to the README.txt file for a global overview of
the driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ronald Cron <Ronald.Cron@arm.com>
Reviewed-by: Olivier Martin <olivier.martin@arm.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16933 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmVExpressPkg: Added support to differentiate ARMv8 FVP variants
Olivier Martin [Wed, 25 Feb 2015 19:15:39 +0000 (19:15 +0000)]
ArmPlatformPkg/ArmVExpressPkg: Added support to differentiate ARMv8 FVP variants

There are three FVP variants for the Base and Foundation models:
- model with GICv2 legacy memory map (same location as the Versatile Express model)
- model with GICv2 and Base model memory map
- model with GICv3 and Base model memory map

The new code detects the variants to load the appropriate device tree.

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@16932 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmVExpressDxe: Identify the current platform
Olivier Martin [Wed, 25 Feb 2015 19:14:26 +0000 (19:14 +0000)]
ArmPlatformPkg/ArmVExpressDxe: Identify the current platform

Add a function to ArmVExpressDxe to identify the current platform we
are running on. This includes ARM32 and AArch64 models and hardware.

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@16931 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPkg/BdsLib: Added support to change the given DevicePath of a Boot Entry
Olivier Martin [Wed, 25 Feb 2015 19:04:59 +0000 (19:04 +0000)]
ArmPkg/BdsLib: Added support to change the given DevicePath of a Boot Entry

Some boot entries might not have a EFI Device Path FilePath
attached to it (eg: EFI device Path for removable device path).
This patch allows a support loader to edit the EFI Device Path
and for instance add \EFI\BOOT\BOOT(ARM|AA64).EFI

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@16930 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmVExpress-FVP-AArch64.dsc: Switch to Linux kernel with EFI stub...
Olivier Martin [Wed, 25 Feb 2015 18:50:37 +0000 (18:50 +0000)]
ArmPlatformPkg/ArmVExpress-FVP-AArch64.dsc: Switch to Linux kernel with EFI stub by default

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@16929 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmPlatformPkg/ArmJuno: Use EFI Stub and updated the command line
Olivier Martin [Wed, 25 Feb 2015 18:49:51 +0000 (18:49 +0000)]
ArmPlatformPkg/ArmJuno: Use EFI Stub and updated the command line

- 'earlycon' is the new name for 'earlyprintk'
- Support Linux EFI stub by default
- The command line is expected to be in unicode when
  booting an EFI application.

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@16928 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/QemuFwCfgLib: Fixed build error
Olivier Martin [Wed, 25 Feb 2015 18:47:12 +0000 (18:47 +0000)]
ArmVirtualizationPkg/QemuFwCfgLib: Fixed build error

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

9 years agoArmPkg/ArmGic: Fix GICv3 in GICv2 legacy mode
Olivier Martin [Wed, 25 Feb 2015 18:42:36 +0000 (18:42 +0000)]
ArmPkg/ArmGic: Fix GICv3 in GICv2 legacy mode

- GIC distributor needs to be programmed to target interrupts
on the boot CPU using the Interrupt Processor Targets Registers
- Enabling the GIC Distributor is different following the value
of GICD_CTLR.ARE_NS.

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@16926 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: display TianoCore logo
Laszlo Ersek [Wed, 25 Feb 2015 17:54:15 +0000 (17:54 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: display TianoCore logo

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

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: detect consoles dynamically
Laszlo Ersek [Wed, 25 Feb 2015 17:54:05 +0000 (17:54 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: detect consoles dynamically

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

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: remove ties to ARM BDS
Laszlo Ersek [Wed, 25 Feb 2015 17:53:55 +0000 (17:53 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: remove ties to ARM BDS

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

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: beautify source
Laszlo Ersek [Wed, 25 Feb 2015 17:53:44 +0000 (17:53 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: beautify source

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

9 years agoFix typo.
Yao, Jiewen [Wed, 25 Feb 2015 03:11:05 +0000 (03:11 +0000)]
Fix typo.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Yao, Jiewen" <jiewen.yao@intel.com>
Reviewed-by: "Fan, Jeff" <jeff.fan@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16919 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg/FvSimpleFileSystemDxe: Fixed ARM compiler error
Olivier Martin [Wed, 25 Feb 2015 02:24:04 +0000 (02:24 +0000)]
MdeModulePkg/FvSimpleFileSystemDxe: Fixed ARM compiler error

Some compilers requires an empty line at the end of the file.
ARM compiler version 5 is one of these compilers:
error  #1-D: last line of file ends without a newline

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16918 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdePkg: Fixed wrong definition in smbios.h.
Elvin Li [Wed, 25 Feb 2015 01:02:41 +0000 (01:02 +0000)]
MdePkg: Fixed wrong definition in smbios.h.

SlotTypeAgp8X should be used per SMBIOS spec.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Elvin Li <elvin.li@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16917 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdeModulePkg: list ARM and AARCH64 as valid architectures for some modules
Laszlo Ersek [Mon, 23 Feb 2015 16:05:50 +0000 (16:05 +0000)]
MdeModulePkg: list ARM and AARCH64 as valid architectures for some modules

"ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualizationQemu.dsc" references
these drivers:
- Pci/PciBusDxe
- Pci/EhciDxe
- Pci/UhciDxe
- Usb/UsbBusDxe
- Usb/UsbKbDxe

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@16916 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoMdePkg: BasePciLibPciExpress: list ARM and AARCH64 as valid architectures
Laszlo Ersek [Mon, 23 Feb 2015 16:04:35 +0000 (16:04 +0000)]
MdePkg: BasePciLibPciExpress: list ARM and AARCH64 as valid architectures

"ArmPlatformPkg/ArmVirtualizationPkg/ArmVirtualization.dsc.inc" references
this PciLib instance.

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@16915 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/ArmVirtualizationQemu: add USB keyboard input
Laszlo Ersek [Mon, 23 Feb 2015 16:04:30 +0000 (16:04 +0000)]
ArmVirtualizationPkg/ArmVirtualizationQemu: add USB keyboard input

Similarly to the previous patch, we can now multiplex input from the USB
keyboard.

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@16914 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/ArmVirtualizationQemu: add VGA console output
Laszlo Ersek [Mon, 23 Feb 2015 16:04:25 +0000 (16:04 +0000)]
ArmVirtualizationPkg/ArmVirtualizationQemu: add VGA console output

Alex Graf's QEMU patchset enables "-device VGA" for the virt machtype as
well. We can now include OvmfPkg/QemuVideoDxe in the firmware, and set
PcdDefaultConOutPaths such that the console output is multiplexed to the
video window as well. (Our platform BDS lib doesn't (yet) locate the VGA
device automatically.)

OvmfPkg/PlatformDxe is included too; it allows users to select a video
resolution. (Note that PcdSetupVideoHorizontalResolution and
PcdSetupVideoVerticalResolution are independent; see git commit 848834cb
(SVN r16311) for explanation.)

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@16913 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: fix multiconsole setup
Laszlo Ersek [Mon, 23 Feb 2015 16:04:21 +0000 (16:04 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: fix multiconsole setup

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

9 years agoArmVirtualizationPkg: PlatformIntelBdsLib: kernel boot should provide ACPI
Laszlo Ersek [Mon, 23 Feb 2015 16:04:16 +0000 (16:04 +0000)]
ArmVirtualizationPkg: PlatformIntelBdsLib: kernel boot should provide ACPI

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

9 years agoArmVirtualizationPkg/ArmVirtualizationQemu: enable PCI support
Laszlo Ersek [Mon, 23 Feb 2015 16:04:11 +0000 (16:04 +0000)]
ArmVirtualizationPkg/ArmVirtualizationQemu: enable PCI support

Beyond including the foundational drivers in the DSC and FDF files, we
enable virtio-over-PCI, and turn on QemuBootOrderLib's OFW-to-UEFI device
path translation for PCI devices.

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@16910 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg: clone BasePciExpressLib, cache PCIe config base
Laszlo Ersek [Mon, 23 Feb 2015 16:04:07 +0000 (16:04 +0000)]
ArmVirtualizationPkg: clone BasePciExpressLib, cache PCIe config base

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

9 years agoArmVirtualizationPkg/PciHostBridgeDxe: handle 0 in GetProposedResources()
Laszlo Ersek [Mon, 23 Feb 2015 16:04:00 +0000 (16:04 +0000)]
ArmVirtualizationPkg/PciHostBridgeDxe: handle 0 in GetProposedResources()

When there are no devices connected to the root bridge, no resources are
needed. GetProposedResources() currently considers this an invalid
condition (the PI spec doesn't regulate it).

Emitting an empty set of EFI_ACPI_ADDRESS_SPACE_DESCRIPTORs, followed by
the required EFI_ACPI_END_TAG_DESCRIPTOR, allows
PciHostBridgeResourceAllocator() [MdeModulePkg/Bus/Pci/PciBusDxe/PciLib.c]
to advance.

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@16908 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/PciHostBridgeDxe: skip 0 AddrLen in SubmitResources()
Laszlo Ersek [Mon, 23 Feb 2015 16:03:56 +0000 (16:03 +0000)]
ArmVirtualizationPkg/PciHostBridgeDxe: skip 0 AddrLen in SubmitResources()

According to Volume 5 of the PI spec, 10.8.2 PCI Host Bridge Resource
Allocation Protocol, SubmitResources(),

  It is considered an error if no resource requests are submitted for a
  PCI root bridge. If a PCI root bridge does not require any resources, a
  zero-length resource request must explicitly be submitted.

Under MdeModulePkg/Bus/Pci/PciBusDxe/, we have:

  PciHostBridgeResourceAllocator()                   [PciLib.c]
    ConstructAcpiResourceRequestor(..., &AcpiConfig) [PciEnumerator.c]
    PciResAlloc->SubmitResources(..., &AcpiConfig)
    ASSERT_EFI_ERROR ()

If ConstructAcpiResourceRequestor() finds no resources to request (for
example because no PCI devices are on the root bridge), it places a
zero-length EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR followed by an
EFI_ACPI_END_TAG_DESCRIPTOR in "AcpiConfig"; satisfying the PI spec.

However, PciHostBridgeDxe's SubmitResources() function does not expect
such input; the following part of the code rejects it:

        switch (Ptr->ResType) {

        case 0:

          //
          // Check invalid Address Sapce Granularity
          //
          if (Ptr->AddrSpaceGranularity != 32) {
            return EFI_INVALID_PARAMETER;
          }

Skip EFI_ACPI_ADDRESS_SPACE_DESCRIPTORs with zero AddrLen early. Also,
allow PciHostBridgeResourceAllocator() to proceed to the AllocateResources
phase by setting "ResourceSubmited" to TRUE.

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@16907 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/PciHostBridgeDxe: get MMIO BARs from our own aperture
Laszlo Ersek [Mon, 23 Feb 2015 16:03:51 +0000 (16:03 +0000)]
ArmVirtualizationPkg/PciHostBridgeDxe: get MMIO BARs from our own aperture

This is our MMIO space map:

> GCD:AddMemorySpace(Base=0000000010000000,Length=000000002EFF0000)
>   GcdMemoryType   = MMIO
>   Capabilities    = 0000000000000001
>   Status = Success
> GCDMemType Range                             Capabilities     Attributes
> ========== ================================= ================ ================
> NonExist   0000000000000000-0000000003FFFFFF 0000000000000000 0000000000000000
> MMIO       0000000004000000-0000000007FFFFFF C000000000000001 8000000000000001

NorFlashDxe adds this, but does not allocate it.

> NonExist   0000000008000000-000000000900FFFF 0000000000000000 0000000000000000
> MMIO       0000000009010000-0000000009010FFF C000000000000001 8000000000000001

Added by RealTimeClockRuntimeDxe, but also not allocated.

> NonExist   0000000009011000-000000000FFFFFFF 0000000000000000 0000000000000000
> MMIO       0000000010000000-000000003EFEFFFF C000000000000001 0000000000000000

Added by ourselves.

> NonExist   000000003EFF0000-000000003FFFFFFF 0000000000000000 0000000000000000
> SystemMem  0000000040000000-00000000BFFFFFFF 800000000000000F 0000000000000008*
> NonExist   00000000C0000000-0000FFFFFFFFFFFF 0000000000000000 0000000000000000

In the EfiPciHostBridgeAllocateResources phase, we allocate memory BARs
bottom up, from whichever MMIO range comes first and has room left.
Unfortunately, this places memory BARs into MMIO ranges that belong to
other devices. (Arguably, their respective drivers should not just add,
but immediately allocate those ranges as well.)

(

  This problem is not seen in OVMF / PcAtChipsetPkg, because there we
  allocate bottom-up from the range

    [max(2GB, top-of-low-RAM), 0xFC000000).

  (See the MMIO resource descriptor HOB created in MemMapInitialization()
  [OvmfPkg/PlatformPei/Platform.c].)

  That MMIO range fits in the static [2GB, 4GB) aperture given in
  "mResAperture" in PcAtChipsetPkg/PciHostBridgeDxe; plus other MMIO
  ranges (IO-APIC, HPET, LAPIC, flash chip) are higher than 0xFC000000.
  Hence the bottom-up BAR allocation in OvmfPkg always finds the right
  MMIO range first.

)

In ArmVirtualizationPkg/PciHostBridgeDxe we can solve the problem by
working our way downwards from the top of our own aperture.

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@16906 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/PciHostBridgeDxe: allocate IO BARs top-down
Laszlo Ersek [Mon, 23 Feb 2015 16:03:46 +0000 (16:03 +0000)]
ArmVirtualizationPkg/PciHostBridgeDxe: allocate IO BARs top-down

Currently we allocate IO BARs bottom-up in the
EfiPciHostBridgeAllocateResources phase of the enumeration.

> GCD:AddIoSpace(Base=0000000000000000,Length=0000000000010000)
>   GcdIoType    = I/O
>   Status = Success
> GCDIoType  Range
> ========== =================================
> I/O        0000000000000000-000000000000FFFF

Because the IO aperture is based at zero, the first allocation happens to
get the zero address. However, a zero address for a PCI BAR is considered
unmapped; see eg.:

- <http://www.pcisig.com/reflector/msg00459.html>,

- the (new_addr == 0) part in QEMU, pci_bar_address() [hw/pci/pci.c]:

    new_addr = pci_get_long(d->config + bar) & ~(size - 1);
    last_addr = new_addr + size - 1;
    /* Check if 32 bit BAR wraps around explicitly.
     * TODO: make priorities correct and remove this work around.
     */
    if (last_addr <= new_addr || new_addr == 0 || last_addr >= UINT32_MAX)
    {
        return PCI_BAR_UNMAPPED;
    }

We can avoid this problem by allocating top-down in the IO aperture.

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@16905 6f19259b-4bc3-4df7-8a09-765794883524

9 years agoArmVirtualizationPkg/PciHostBridgeDxe: MMIO aperture must not be uncached
Laszlo Ersek [Mon, 23 Feb 2015 16:03:42 +0000 (16:03 +0000)]
ArmVirtualizationPkg/PciHostBridgeDxe: MMIO aperture must not be uncached

Quite non-intuitively, we must allow guest-side writes to emulated PCI
MMIO regions to go through the CPU cache, otherwise QEMU, whose accesses
always go through the cache, may see stale data in the region.

This change makes no difference for QEMU/TCG, but it is important for
QEMU/KVM, at the moment.

Because gDS->SetMemorySpaceAttributes() is ultimately implemented by
EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() -- see
"MdeModulePkg/Core/Dxe/Gcd/Gcd.c" and "ArmPkg/Drivers/CpuDxe/" -- we add
the CPU architectural protocol to the module's DepEx.

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@16904 6f19259b-4bc3-4df7-8a09-765794883524