Commit Graph

14108 Commits

Author SHA1 Message Date
Olivier Martin 4257aa4d4b ArmPlatformPkg/ArmVExpressPkg: Added Isp1761 USB OTG driver
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@15315 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 04:33:37 +00:00
Olivier Martin dbfd80d873 EmbeddedPkg/Isp1761UsbDxe: Driver for the NXP ISP1761's USB peripheral controller
This driver doesn't support OTG - it simply sets the NXP ISP1761 in pure
peripheral mode.

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@15314 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 04:32:48 +00:00
Olivier Martin d972f80b08 EmbeddedPkg/UsbDevice.h: Introduced USB Device Protocol
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@15313 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 04:31:04 +00:00
Olivier Martin f6755908de EmbeddedPkg/AndroidFastboot: Introduce Android FastBoot Application
This application enables Android FastBoot on UEFI.

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@15312 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 04:15:44 +00:00
Olivier Martin ddd1436622 EmbeddedPkg/AndroidFastbootPlatform.h: Introduced Fastboot Platform Protocol
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@15311 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 04:14:02 +00:00
Olivier Martin d8fd88626b EmbeddedPkg/AndroidFastbootTransport.h: Introduced Android Fastboot Transport protocol
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@15310 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 04:12:35 +00:00
Laszlo Ersek da78c88f45 OvmfPkg: raise DXEFV size to 8 MB
This fixes build errors like:

  GenFds.py...
    the required fv image size 0x71b118 exceeds the set fv image size
    0x700000

which is reported at least for:
(a) -b DEBUG -D SECURE_BOOT_ENABLE -t GCC44,
(b) -b DEBUG -D SECURE_BOOT_ENABLE -t GCC48 -D CSM_ENABLE

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15309 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-05 00:54:00 +00:00
Jordan Justen 34511266c2 OvmfPkg: Add DebugAgentLib for Library class mapping for DXE_DRIVER
This is needed for BootScriptExecutorDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15308 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:04:20 +00:00
Laszlo Ersek 939004009d OvmfPkg: S3 Resume: pull in BootScriptExecutorDxe
This driver (from
"MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.inf")
is first loaded normally during DXE. When the
EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is installed by any DXE driver (purely
as a form of notification), the driver reloads itself to reserved memory.

During S3 Resume / PEI, the driver image is executed from there. In order
to access the boot script saved during S3 Suspend, LockBox access is
needed.

The boot script is transferred internal to PiDxeS3BootScriptLib:

Both S3SaveStateDxe and BootScriptExecutorDxe are statically linked
against PiDxeS3BootScriptLib. Whichever is loaded first (during normal
boot, in the DXE phase), allocates the root storage for the script. The
address is then passed between the PiDxeS3BootScriptLib instances living
in the two separate drivers thru the dynamic
PcdS3BootScriptTablePrivateDataPtr PCD.

Dependencies:

  BootScriptExecutorDxe
    gEfiLockBoxProtocolGuid [OvmfPkg/AcpiS3SaveDxe]
    S3BootScriptLib [PiDxeS3BootScriptLib]
      SmbusLib [BaseSmbusLibNull]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]
    LockBoxLib [OvmfPkg/Library/LockBoxLib]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15307 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:04:13 +00:00
Laszlo Ersek d4ba06dfdc OvmfPkg: S3 Resume: fake LockBox protocol for BootScriptExecutorDxe
BootScriptExecutorDxe, to be pulled in in the next patch, was written with
the SMM implementation of LockBox in mind. That implementation is split in
the following three parts:

- client side (DXE/PEI) library,
- SMM driver producing gEfiLockBoxProtocolGuid,
- driver side (SMM) library.

BootScriptExecutorDxe includes the client side LockBoxLib. So that the
library can communicate with the SMM LockBox driver, BootScriptExecutorDxe
has a Depex on gEfiLockBoxProtocolGuid, normally installed by the SMM
LockBox driver. This is actually not a hard dependency, it just ensures
correct load order between BootScriptExecutorDxe and
MdeModulePkg/Universal/LockBox/SmmLockBox.

The (client side) LockBox library instance in OVMF doesn't depend on a
separate driver that produces gEfiLockBoxProtocolGuid. Nothing  produces
that GUID right now in OVMF. This prevents BootScriptExecutorDxe from
loading.

Install gEfiLockBoxProtocolGuid in our only S3-specific, custom DXE
driver, in order to enable loading of BootScriptExecutorDxe.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15306 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:04:04 +00:00
Laszlo Ersek 5a217a0649 OvmfPkg: S3 Suspend: save boot script after ACPI context
The trigger to actually save the boot script is the installation of
EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL, to be performed by any DXE driver.
Installation of the protocol also locks down SMM (as its name indicates)
and (in theory) prevents further LockBox access.

We cannot install this protocol before BdsLibBootViaBootOption() is called
(eg. in OVMF's PlatformBdsPolicyBehavior()), because
BdsLibBootViaBootOption() calls EFI_ACPI_S3_SAVE_PROTOCOL.S3Save(), which
needs LockBox access.

We also can't install the protocol after BdsLibBootViaBootOption()
returns, simply because control is never returned to us.

Therefore modify our EFI_ACPI_S3_SAVE_PROTOCOL implementation so that the
boot script is prepared and installed internally to S3Save().

(The boot script must contain at least one opcode, otherwise
S3BootScriptLib runs into an assertion failure. We add a harmless (no-op)
"information" opcode.)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15305 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:03:56 +00:00
Laszlo Ersek b017b1b27a OvmfPkg: S3 Suspend: enable creation/saving of an S3 Boot Script
"MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf" produces
the EFI_S3_SAVE_STATE_PROTOCOL which allows creation and saving of an S3
Boot Script, to be replayed in PEI during S3 Resume. The script contains
opcodes and opcode arguments to configure CPU, PCI and IO resources.

S3SaveStateDxe relies on the S3BootScriptLib library. The Null
implementation is not useful for actually saving the boot script, we need
the PiDxeS3BootScriptLib instance.

The PiDxeS3BootScriptLib library instance depends on LockBoxLib,
implemented for OVMF in one of the previous patches.

PiDxeS3BootScriptLib also depends on SmbusLib. For now we opt for the Null
instance of the latter. It means that SMBus commands in the boot script
will have no effect when interpreted during S3 Resume. This should be fine
for OvmfPkg and QEMU.

  EFI_S3_SAVE_STATE_PROTOCOL [S3SaveStateDxe]
    S3BootScriptLib [PiDxeS3BootScriptLib]
      SmbusLib [BaseSmbusLibNull]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]

When the EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL is installed by any DXE driver
(purely as a form of notification), the S3SaveStateDxe driver saves the
boot script to EfiACPIMemoryNVS, and links it into the LockBox.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15304 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:03:50 +00:00
Laszlo Ersek 389cbceb7f OvmfPkg: S3 Suspend: save ACPI context
"OvmfPkg/AcpiS3SaveDxe/AcpiS3SaveDxe.inf" (originally:
"IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf")
produces the EFI_ACPI_S3_SAVE_PROTOCOL.

When found, this protocol is automatically invoked by
BdsLibBootViaBootOption(), in file
"IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c", right before
booting a boot option, to save ACPI S3 context.

At that point during BDS, our AcpiPlatformDxe driver will have installed
the FACS table (which AcpiS3SaveDxe has a use-time dependency upon).

With regard to dependencies: AcpiS3SaveDxe implements
EFI_ACPI_S3_SAVE_PROTOCOL by relying on LockBoxLib.

  BdsLibBootViaBootOption()
    EFI_ACPI_S3_SAVE_PROTOCOL [AcpiS3SaveDxe]
      LockBoxLib [OvmfPkg/Library/LockBoxLib]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: Remove EmuNvramLib]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15303 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:03:38 +00:00
Laszlo Ersek 600c74bcd2 OvmfPkg: S3 Suspend: import specialized copy of AcpiS3SaveDxe
"IntelFrameworkModulePkg/Universal/Acpi/AcpiS3SaveDxe/AcpiS3SaveDxe.inf"
currently specifies a DepEx on gEfiMpServiceProtocolGuid (MP Services).

The justification is the following code sequence:

  InstallAcpiS3Save()
    if PcdFrameworkCompatibilitySupport is set:
      InstallAcpiS3SaveThunk()
        if EFI_MP_SERVICES_PROTOCOL is available:
          GetVariable(ACPI_GLOBAL_VARIABLE)

In English, the AcpiS3SaveDxe driver insists on the presence of MP
Services *unconditionally* because,

- if PcdFrameworkCompatibilitySupport is set (the default is false),
- and MP Services are available (which is constant true under the above
  condition),

then the AcpiS3SaveDxe driver would like to get the ACPI_GLOBAL_VARIABLE
variable from the MP Services driver, rather than setting it itself.

The DepEx prevents AcpiS3SaveDxe from loading under OvmfPkg, since we
provide no MP Services implementation. This is particularly broken since
the default PcdFrameworkCompatibilitySupport value is FALSE, making the
entire code that would look at EFI_MP_SERVICES_PROTOCOL dead.

Copy AcpiS3SaveDxe to OvmfPkg, substitute PcdFrameworkCompatibilitySupport
with constant FALSE, and remove all code that becomes dead, including the
DepEx.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15302 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:03:31 +00:00
Laszlo Ersek 6a7cba79b7 OvmfPkg: implement LockBoxLib
The S3 suspend/resume infrastructure depends on the LockBox library class.
The edk2 tree currently contains Null and SMM instances. The Null instance
is useless, and the SMM instance would require SMM emulation by including
the SMM core and adding several new drivers, which is deemed too complex.

Hence add a simple LockBoxLib instance for OVMF.

jordan.l.justen@intel.com:
 * use PCDs instead of EmuNvramLib
   - clear memory in PlatformPei on non S3 boots
 * allocate NVS memory and store a pointer to that memory
   - reduces memory use at fixed locations

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15301 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:03:23 +00:00
Laszlo Ersek 5fb6fc0f05 OvmfPkg: S3 Resume: pull in PEIM orchestrating S3 Resume
"UefiCpuPkg/Universal/Acpi/S3Resume2Pei/S3Resume2Pei.inf" produces the
EFI_PEI_S3_RESUME2 PEIM-to-PEIM Interface.

When the platform-specific initialization code (in PEI) sets the Boot Mode
to BOOT_ON_S3_RESUME, the DXE IPL (which is the last step in PEI) skips
the DXE phase entirely, and executes the S3 Resume PEIM through the
EFI_PEI_S3_RESUME2 interface instead. (See DxeLoadCore() in
"MdeModulePkg/Core/DxeIplPeim/DxeLoad.c".)

S3Resume2Pei depends on LockBoxLib.

  EFI_PEI_S3_RESUME2 [S3Resume2Pei]
    LockBoxLib [OvmfPkg/Library/LockBoxLib]

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15300 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:03:06 +00:00
Jordan Justen 74e5c15842 OvmfPkg/PlatformPei: Allocate PEI FV as ACPI NVS if S3 is supported
On S3 resume, we skip decompression of the PEI FV, and expect
to jump directly into it. For this to work, we need the OS to
leave the memory range untouched.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15299 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:02:59 +00:00
Laszlo Ersek 78a38b73c3 OvmfPkg: PlatformPei: reserve early page tables on X64
On X64, the reset vector code in
"OvmfPkg/ResetVector/Ia32/PageTables64.asm" identity maps the first 4GB of
RAM for PEI, consuming six frames starting at 8MB.

This range is declared by the PcdOvmfSecPageTablesBase/Size PCDs.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
[jordan.l.justen@intel.com: Move to MemDetect.c; use PCDs]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15298 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:02:52 +00:00
Laszlo Ersek e249f906f1 OvmfPkg: PlatformPei: reserve SEC/PEI temp RAM for S3 resume
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
[jordan.l.justen@intel.com: move to MemDetect.c; use PCDs]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15297 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:02:45 +00:00
Jordan Justen a781f7099b OvmfPkg/Sec: Don't decompress the FV on S3 resume
Since we marked the FV at PcdOvmfPeiMemFvBase as ACPI NVS memory,
we can use it on S3 resume.

The FV at PcdOvmfDxeMemFvBase may have been overwritten by the OS,
but we do not use it's contents on S3 resume.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15296 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:02:37 +00:00
Jordan Justen bd386eaf86 OvmfPkg/PlatformPei: Skip various items for S3 resume
We will not be running DXE on S3 resume, so we don't
need to do these initialization items:
 * Reserve EMU Variable memory range
 * Declare Firmware volumes
 * Add memory HOBs

v5:
 * Move MiscInitialization back to running on S3 resume

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15295 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:02:30 +00:00
Jordan Justen 8e54500fd4 OvmfPkg: Add section of memory to use for PEI on S3 resume
This 32k section of RAM will be declared to the PEI Core on
S3 resume to allow memory allocations during S3 resume PEI.

If the boot mode is BOOT_ON_S3_RESUME, then we publish
the pre-reserved PcdS3AcpiReservedMemory range to PEI.

If the boot mode is not BOOT_ON_S3_RESUME, then we reserve
this range as ACPI NVS so the OS will not use it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15294 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:02:16 +00:00
Jordan Justen 7cdba6346b OvmfPkg/PlatformPei: Detect S3 support for QEMU / KVM
QEMU indicates whether S3 is supported or not in the
fw-cfg interface.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15293 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:01:58 +00:00
Laszlo Ersek 14eb7a5be2 OvmfPkg QemuFwCfgLib: determine if S3 support is explicitly enabled
Such a packaged query function will come in handy in the following
patches.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: check for enabled rather than disabled]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15292 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:01:49 +00:00
Jordan Justen 979420df98 OvmfPkg/PlatformPei: Add mBootMode driver variable
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15291 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:01:40 +00:00
Laszlo Ersek 8f5ca05b0d OvmfPkg: PlatformPei: detect S3 Resume in CMOS and set boot mode accordingly
Data is transferred between S3 Suspend and S3 Resume as follows:

S3 Suspend (DXE):

(1) BdsLibBootViaBootOption()
      EFI_ACPI_S3_SAVE_PROTOCOL [AcpiS3SaveDxe]
      - saves ACPI S3 Context to LockBox  ---------------------+
        (including FACS address -- FACS ACPI table             |
        contains OS waking vector)                             |
                                                               |
      - prepares boot script:                                  |
        EFI_S3_SAVE_STATE_PROTOCOL.Write() [S3SaveStateDxe]    |
          S3BootScriptLib [PiDxeS3BootScriptLib]               |
          - opcodes & arguments are saved in NVS.  --+         |
                                                     |         |
      - issues a notification by installing          |         |
        EFI_DXE_SMM_READY_TO_LOCK_PROTOCOL           |         |
                                                     |         |
(2) EFI_S3_SAVE_STATE_PROTOCOL [S3SaveStateDxe]      |         |
      S3BootScriptLib [PiDxeS3BootScriptLib]         |         |
      - closes script with special opcode  <---------+         |
      - script is available in non-volatile memory             |
        via PcdS3BootScriptTablePrivateDataPtr  --+            |
                                                  |            |
    BootScriptExecutorDxe                         |            |
      S3BootScriptLib [PiDxeS3BootScriptLib]      |            |
      - Knows about boot script location by  <----+            |
        synchronizing with the other library                   |
        instance via                                           |
        PcdS3BootScriptTablePrivateDataPtr.                    |
      - Copies relocated image of itself to                    |
        reserved memory. --------------------------------+     |
      - Saved image contains pointer to boot script.  ---|--+  |
                                                         |  |  |
Runtime:                                                 |  |  |
                                                         |  |  |
(3) OS is booted, writes OS waking vector to FACS,       |  |  |
    suspends machine                                     |  |  |
                                                         |  |  |
S3 Resume (PEI):                                         |  |  |
                                                         |  |  |
(4) PlatformPei sets S3 Boot Mode based on CMOS          |  |  |
                                                         |  |  |
(5) DXE core is skipped and EFI_PEI_S3_RESUME2 is        |  |  |
    called as last step of PEI                           |  |  |
                                                         |  |  |
(6) S3Resume2Pei retrieves from LockBox:                 |  |  |
    - ACPI S3 Context (path to FACS)  <------------------|--|--+
                                      |                  |  |
                                      +------------------|--|--+
    - Boot Script Executor Image  <----------------------+  |  |
                                                            |  |
(7) BootScriptExecutorDxe                                   |  |
      S3BootScriptLib [PiDxeS3BootScriptLib]                |  |
      - executes boot script  <-----------------------------+  |
                                                               |
(8) OS waking vector available from ACPI S3 Context / FACS  <--+
    is called

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
[jordan.l.justen@intel.com: move code into BootModeInitialization]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15290 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-04 08:01:32 +00:00
Laszlo Ersek bb97e78852 OvmfPkg: QemuVideoDxe: add further BOCHS modes
This brings the list of BOCHS video modes to par with the QEMU QXL
implementation.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15289 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:41:15 +00:00
Laszlo Ersek ec88061ec8 OvmfPkg: QemuVideoDxe: filter BOCHS modes vs. available frame buffer size
In the next patch we'll add many new BOCHS modes, some of which require
large frame buffers.

The size of the QXL VGA compatibility framebuffer can be changed with the

  -global qxl-vga.vgamem_mb=$NUM_MB

QEMU option.

If $NUM_MB would exceed 32, then the following two QEMU options are
necessary instead:

  -global qxl-vga.vgamem_mb=$NUM_MB         \
  -global qxl-vga.ram_size_mb=$((NUM_MB*2))

because the compatibility framebuffer can't cover more than half of PCI
BAR #0. The latter defaults to 64MB in size, and is controlled by
"ram_size_mb".

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15288 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:41:08 +00:00
Laszlo Ersek cd15261014 OvmfPkg: QemuVideoDxe: clarify QEMU_VIDEO_MODE_DATA.ModeNumber
The field name "ModeNumber" in QEMU_VIDEO_MODE_DATA is misleading -- it is
not immediately obvious whether this field carries a client-visible mode
number, in the GOP sense, or an internal, card type specific mode index.
After checking all references, rename the field to "InternalModeIndex".

Also, when filling in the card type independent QEMU_VIDEO_MODE_DATA array
from the card type specific mode array, distinguish the GOP mode number
from the internal mode index in the debug message.

This patch effects no functional changes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15287 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:40:59 +00:00
Laszlo Ersek 96b5f39777 OvmfPkg: QemuVideoDxe: eliminate useless Private->HardwareNeedsStarting
Currently, QemuVideoGraphicsOutputQueryMode() reports EFI_NOT_STARTED when
this boolean field is set.

However, QemuVideoGraphicsOutputQueryMode() is only available to callers
after the GOP interface has been installed. That in turn implies that the
following partial call tree has succeeded without errors:

  QemuVideoControllerDriverStart()
    QemuVideoGraphicsOutputConstructor()
      QemuVideoGraphicsOutputSetMode(... 0 ...)
        HardwareNeedsStarting = FALSE
    InstallMultipleProtocolInterfaces(... GOP ...)

That is, when QemuVideoGraphicsOutputQueryMode() is reached,
HardwareNeedsStarting is always FALSE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15286 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:40:52 +00:00
Laszlo Ersek 847e4c3477 OvmfPkg: QemuVideoDxe: plug remaining leaks in Stop()
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15285 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:40:44 +00:00
Laszlo Ersek 99a6dce3c2 OvmfPkg: QemuVideoDxe: disentangle UEFI driver model use in Stop()
A bus driver needs to pay attention whether its Stop() function is being
called on the "main" controller handle (NumberOfChildren == 0) or on the
child handles (NumberOfChildren > 0).

In QemuVideoDxe, all our resources are associated with the one child
handle (and the Private data structure) *except* the top-level PciIo
protocol reference. Be conscious of which mode Stop() is being called for.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15284 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:40:35 +00:00
Laszlo Ersek 42d0cad751 OvmfPkg: QemuVideoDxe: simplify UEFI driver model use in Supported() / Start()
A bus driver is allowed to ignore the actual value of RemainingDevicePath
in Supported() and Start(), and to produce all child handles at once.

This in effect means the following invariants for QemuVideoDxe:
- (RemainingDevicePath == NULL), and
- (Private->GopDevicePath != NULL)

Simplify Supported() and Start() by substituting constant TRUE and FALSE
(as appropriate) in expressions that check RemainingDevicePath and/or
Private->GopDevicePath.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15283 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:40:28 +00:00
Laszlo Ersek d89186bc86 OvmfPkg: QemuVideoDxe: tidy up error checking/handling in & under Start()
In QemuVideoControllerDriverStart():
- remove redundant zero-initialization of:
  - Private->Handle (2 locations)
  - Private->GopDevicePath (when at devpath end)

- remove fields used for error handling only:
  - PciAttributesSaved

- tigthen scope of temporaries:
  - MmioDesc
  - AcpiDeviceNode

- supplement missing error checks:
  - AppendDevicePathNode() can fail with out-of-memory (2 locations)
  - when installing GopDevicePath
  - retval of QemuVideoGraphicsOutputConstructor() (can justifiedly fail
    with out-of-resources)

- plug leaks on error:
  - free GopDevicePath (AppendDevicePathNode() allocates dynamically)
  - uninstall GopDevicePath
  - free Private->ModeData
  - call QemuVideoGraphicsOutputDestructor()
  - uninstall GOP

In QemuVideoGraphicsOutputConstructor(), called by Start():
- supplement missing error checks:
  - QemuVideoGraphicsOutputSetMode() retval (it can fail with
    out-of-resources)

- plug leaks on error:
  - free Mode->Info
  - free Mode

In QemuVideoCirrusModeSetup() and QemuVideoBochsModeSetup(), both called
by Start():
- supplement missing error checks:
  - AllocatePool() can fail in both

In QemuVideoGraphicsOutputDestructor(), called by Start() on the error
path:
- plug leaks:
  - free Private->LineBuffer, which is allocated in
    Start() -> Constructor() -> SetMode()

In QemuVideoGraphicsOutputSetMode(), called by Start() indirectly:
- remove redundant zero-assignment to:
  - Private->LineBuffer

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-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@15282 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-03 08:40:19 +00:00
jyao1 57a1b9c425 Add comment for S3BootScriptSaveMemPoll API, since it does not match PI specification.
Signed-off by: Jiewen Yao <Jiewen.yao@intel.com>
Reviewed by: Star Zeng <Star.Zeng@intel.com>

Contributed-under: TianoCore Contribution Agreement 1.0

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15280 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 12:25:31 +00:00
Olivier Martin a4ab7df48f ArmPlatformPkg/ArmVExpressDxe: Platform specific driver for ARM VExpress based platform
This driver should be used when adding code specific to a platform based on
ARM VExpress based board.

ArmFvpDxe driver has been renamed into ArmVExpressDxe driver to support the hardware
based platforms and the model based platforms.

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@15279 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 11:05:44 +00:00
Olivier Martin 35a3e76261 EmbeddedPkg: Added support for AArch64
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@15278 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 11:01:44 +00:00
Olivier Martin 27995cd5d6 ArmPkg: Tidy assembler code
- Fixed typo
- Removed unreachable 'dead' loop

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@15277 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 11:01:00 +00:00
Olivier Martin f6c5a29bb9 ArmPkg/ArmLib: Rationalise ArmReadMidr and cognate functions.
The function ArmReadMidr has been recently added, but that functionality was
already present under other names such as Cp15IdCode and ArmMainIdCode.  This
change removes redundant code and moves the function to the Common library.

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@15276 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 11:00:07 +00:00
Olivier Martin 992a1f830d ArmPkg/ArmLib: Fix compilation error with -O3 switch
A warning is reported because ArmArchTimerReadReg may theoretically result
in an unititialised value.

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@15275 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 10:59:25 +00:00
Olivier Martin f0247796cb ArmPkg/ArmLib: ArmReadVBar implementation missing in AArch64
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@15274 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 10:58:46 +00:00
Olivier Martin eaa84fd553 ArmPkg: Replace single dead loop.
Several assembler macros use a loop at the label "dead" to trap an error.
This is difficult to debug as there is no indication of how one arrived at the loop.
This change replaces dead with distinct loops locally in the macro,
which means the cause of the hang is detectable to the debugger.

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@15273 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 10:57:55 +00:00
Olivier Martin 0ff0e414d1 ArmPkg/ArmLib: Move common definitions from ArmV7Lib.h & AArch64Lib.h to ArmLib.h
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@15272 6f19259b-4bc3-4df7-8a09-765794883524
2014-03-01 10:57:09 +00:00
Shumin Qiu f716d7b8c5 Convert the value from 'int' to 'CHAR16' to match the type of variable in ShellProtocol.c.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15271 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-28 00:36:03 +00:00
Brendan Jackman b9b77ab1ba ShellPkg/ShellProtocol.c: Fix case sensitivity in GetAlias and SetAlias
ShellCommandIsOnAliasList is case insensitive, but GetAlias and SetAlias use the
UEFI variable services, which are case sensitive.

Force alias names to lowercase to get around this.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Brendan Jackman <Brendan.Jackman@arm.com>
Reviewed-By: Olivier Martin <olivier.martin@arm.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15270 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-26 09:46:40 +00:00
Eric Dong b572d3f0db When exit from GetFullStringFromHiiFormPackages function, should update the PointerProgress parameter if necessary.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15263 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-26 08:13:10 +00:00
Jaben Carsey e8c737ae79 ShellPkg: Add missing header files
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <Jaben.Carsey@intel.com>
Reviewed-by: Daryl McDaniel daryl.mcdaniel@intel.com


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15262 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-25 23:03:17 +00:00
Olivier Martin e840822b2d ShellBinPkg: ARM binaries update based on 15257.
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@15261 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-25 10:37:49 +00:00
Shumin Qiu 3a8406adb3 Add code to check whether the pointer 'CorrectedPath' and 'FullPath' are NULL before used.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shumin Qiu <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <Jaben.carsey@intel.com>


git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15260 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-25 08:30:32 +00:00
Ari Zigler e27ecde731 Fix the bug for the structure definition of _EFI_ADAPTER_INFORMATION_PROTOCOL in AdapterInformation.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ari Zigler <ariz@mellanox.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>



git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15259 6f19259b-4bc3-4df7-8a09-765794883524
2014-02-25 05:20:31 +00:00