]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoAdd IntelFsp2Pkg and IntelFsp2WrapperPkg.
Jiewen Yao [Fri, 13 May 2016 05:00:53 +0000 (13:00 +0800)]
Add IntelFsp2Pkg and IntelFsp2WrapperPkg.

Add FSP2.0 support.
This series of patch is to support FSP2.0 specification at
https://firmware.intel.com/sites/default/files/FSP_EAS_v2.0_Draft%20External.pdf

Some major updates include:
1) One FSP binary is separated to multiple components:
FSP-T, FSP-M, FSP-S, and optional FSP-O.
Each component has its own configuration data region.
2) All FSP-APIs use same UPD format - FSP_UPD_HEADER.
3) Add EnumInitPhaseEndOfFirmware notifyphase.
4) FSP1.1/FSP1.0 compatibility is NOT maintained.
5) We also add rename Fsp* to FspWrapper* in IntelFsp2WrapperPkg,
to indicate that it is for FspWrapper only.

IntelFspPkg and IntelFspWrapperPkg will be deprecated.
The new Intel platform will follow FSP2.0 and use IntelFsp2Pkg
and IntelFsp2WrapperPkg.
The old platform can still use IntelFspPkg and IntelFspWrapperPkg
for compatibility consideration.

Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Ravi P Rangarajan <ravi.p.rangarajan@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Ravi P Rangarajan <ravi.p.rangarajan@intel.com>
7 years agoMdeModulePkg UiApp: change code for easy customization.
Eric Dong [Thu, 12 May 2016 05:25:26 +0000 (13:25 +0800)]
MdeModulePkg UiApp: change code for easy customization.

Change file arrangement to let user easy customize the front page UI.
After this change:
1. UiCustomizeFrontPage function in FrontPageCustomizedUi.c use to
let user customize front page menus. UiFrontPageCallbackHandler
function use to handle the callback for the added menus.
2. FrontPageCustomizedUiSupport.c file used to add support functions
used by FrontPageCustomizedUi.c file.
3. After this change, only above two files need to be updated if front page
menus needed to be changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBootMaintenanceManagerUiLib: change code for customization.
Dong, Eric [Thu, 12 May 2016 08:32:17 +0000 (16:32 +0800)]
BootMaintenanceManagerUiLib: change code for customization.

Change file arrangement to let user easy customize the BMM UI.
After this change:
1. UiCustomizeBMMPage function in BootMaintenanceManagerCustomizedUi.c
use to let user customize BMM first page menus. UiBMMCallbackHandler
function use to handle the callback for the added menus.
2. BootMaintenanceManagerCustomizedUiSupport.c file used to add support
 functions used by BootMaintenanceManagerCustomizedUi.c file.
3. After this change, only above two files need to be updated if BMM
first page menus needed to be changed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdePkg: Add HII definitions from UEFI 2.6
Samer El-Haj-Mahmoud [Wed, 11 May 2016 20:30:55 +0000 (04:30 +0800)]
MdePkg: Add HII definitions from UEFI 2.6

Add HII definitions from UEFI 2.6 for HII Image Variability and PNG
Blocks

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
7 years agoNetworkPkg: Make HttpBootGetBootFile return EFI_BUFFER_TOO_SMALL
Gary Lin [Mon, 9 May 2016 04:32:55 +0000 (12:32 +0800)]
NetworkPkg: Make HttpBootGetBootFile return EFI_BUFFER_TOO_SMALL

Per the description of HttpBootGetBootFile, the function should return
EFI_BUFFER_TOO_SMALL if the given buffer is smaller than the remote image.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoMdeModulePkg:DxeHttpLib: Add checks in HttpGenRequestMessage API
Nagaraj Hegde [Thu, 5 May 2016 06:59:03 +0000 (14:59 +0800)]
MdeModulePkg:DxeHttpLib: Add checks in HttpGenRequestMessage API

HttpGenRequestMessage assumes that HTTP message would always
contain a request-line, headers and an optional message body.
However, subsequent to a HTTP PUT/POST request, HTTP requests
would contain just the message body. This patch supports
creation of such request messages with additional checks.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hegde, Nagaraj P <nagaraj-p.hegde@hpe.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoCorebootPayloadPkg: Add OHCI driver
Leahy, Leroy P [Thu, 12 May 2016 23:05:15 +0000 (16:05 -0700)]
CorebootPayloadPkg: Add OHCI driver

Add the USB OHCI driver from revision 24ca2f35 of QuarkSocPkg.

Change-Id: Ie7aa0bc47d4ff06adc57976a5efb0e40ce4e1673
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
7 years agoCorebootPayloadPkg: Add SD/eMMC support
Leahy, Leroy P [Tue, 10 May 2016 22:34:48 +0000 (15:34 -0700)]
CorebootPayloadPkg: Add SD/eMMC support

Add SD and eMMC DXE driver support to CorebootPayloadPkg.

Change-Id: Ibfd3a2cc32a653ce51e38d9157ea3c6da25a5474
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Set the proper Shell file GUID
Leahy, Leroy P [Tue, 10 May 2016 22:34:36 +0000 (15:34 -0700)]
CorebootPayloadPkg: Set the proper Shell file GUID

Set the proper Shell file GUID so that the BDS transfers control to the
Shell.

Change-Id: I816636a340bbe2f76ac1973b9cb685084c4f88a0
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Use correct BaseSerialPortLib16550
Leahy, Leroy P [Tue, 10 May 2016 22:34:22 +0000 (15:34 -0700)]
CorebootPayloadPkg: Use correct BaseSerialPortLib16550

Use the BaseSerialPortLib16550 which sets RTS and DTR during
initialization.  This fixes the mis-matched flow control issue when
the flow control signals are connected between the host and target
and the host has flow control enabled.

Change-Id: I3505e129b2de3c5c17fff23c62553f15cd892dca
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Assume no PCI serial devices
Leahy, Leroy P [Tue, 10 May 2016 22:34:11 +0000 (15:34 -0700)]
CorebootPayloadPkg: Assume no PCI serial devices

Set the vendor to 0xffff which indicates the end of the list.

Change-Id: If6475e04d3675f0a932571a85d1dd3f301416b6a
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
eviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg: Use DOS line endings
Leahy, Leroy P [Tue, 10 May 2016 22:33:57 +0000 (15:33 -0700)]
CorebootPayloadPkg: Use DOS line endings

Convert to using DOS line endings.

Change-Id: Ie2f148867d9b2b386d556583afb6716ec21399e9
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
7 years agoreport line number for command errors in a script.
Jaben Carsey [Tue, 10 May 2016 20:35:14 +0000 (13:35 -0700)]
report line number for command errors in a script.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
7 years agoArmPkg/PlatformBootManagerLib: implement new generic version
Ard Biesheuvel [Wed, 11 May 2016 12:46:05 +0000 (14:46 +0200)]
ArmPkg/PlatformBootManagerLib: implement new generic version

This implements the platform glue for the new generic BDS implementation.
It is based on the ArmVirtQemu version, with the QEMU references removed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmLib: don't invalidate entire I-cache on range operation
Ard Biesheuvel [Wed, 11 May 2016 08:38:47 +0000 (10:38 +0200)]
ArmPkg/ArmLib: don't invalidate entire I-cache on range operation

Instead of cleaning the data cache to the PoU by virtual address and
subsequently invalidating the entire I-cache, invalidate only the
range that we just cleaned. This way, we don't invalidate other
cachelines unnecessarily.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoOvmfPkg/PlatformBootManagerLib: Postpone the shell registration
Gary Lin [Wed, 11 May 2016 08:40:49 +0000 (16:40 +0800)]
OvmfPkg/PlatformBootManagerLib: Postpone the shell registration

We currently register the shell before creating the boot options for
the block devices and the network devices, so the boot manager boots
into the internal shell if the user doesn't specify the boot order.
However, Xen doesn't support fw_cfg, so there is no way to change the
boot order with the external command, and the firmware will always
boot into the internal shell if the user doesn't interfere the boot
process.

This patch postpones the shell registration after MdeModulePkg/BDS
creates all the boot options for the block and network devices, so
that firmware will try to boot the block/network devices first.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoEmbeddedPkg/Lan9118Dxe: Do not return uninitialised TxBuff
Michael Brown [Wed, 11 May 2016 21:50:09 +0000 (22:50 +0100)]
EmbeddedPkg/Lan9118Dxe: Do not return uninitialised TxBuff

Conform to the specification for GetStatus(), which states that "if
there are no transmit buffers to recycle and TxBuf is not NULL, *TxBuf
will be set to NULL".

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoOvmfPkg/QemuBootOrderLib: adapt Q35 SATA PMPN to UEFI spec Mantis 1353
Laszlo Ersek [Mon, 9 May 2016 11:32:27 +0000 (19:32 +0800)]
OvmfPkg/QemuBootOrderLib: adapt Q35 SATA PMPN to UEFI spec Mantis 1353

On the Q35 machine type of QEMU, there is no port multiplier connected to
the on-board SATA controller. Therefore the AtaAtapiPassThru driver update
for Mantis ticket 1353 <https://mantis.uefi.org/mantis/view.php?id=1353>
changes the middle number (the Port Multiplier Port Number) in the Sata()
device path nodes from 0x0 to 0xFFFF.

Adapt the translation from OpenFirmware in QemuBootOrderLib.

(Note: QemuBootOrderLib is deprecated at this point (see USE_OLD_BDS in
the DSC files), but until we remove it, it should be kept in sync with
QemuNewBootOrderLib.)

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoOvmfPkg/QemuNewBootOrderLib: adapt Q35 SATA PMPN to UEFI spec Mantis 1353
Laszlo Ersek [Mon, 9 May 2016 11:32:26 +0000 (19:32 +0800)]
OvmfPkg/QemuNewBootOrderLib: adapt Q35 SATA PMPN to UEFI spec Mantis 1353

On the Q35 machine type of QEMU, there is no port multiplier connected to
the on-board SATA controller. Therefore the AtaAtapiPassThru driver update
for Mantis ticket 1353 <https://mantis.uefi.org/mantis/view.php?id=1353>
changes the middle number (the Port Multiplier Port Number) in the Sata()
device path nodes from 0x0 to 0xFFFF.

Adapt the translation from OpenFirmware in QemuNewBootOrderLib.

Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg AtaAtapiPassThru: Fix incorrect parameter description comment
Hao Wu [Fri, 8 Apr 2016 08:31:32 +0000 (16:31 +0800)]
MdeModulePkg AtaAtapiPassThru: Fix incorrect parameter description comment

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg Ata: Use the new (incompatible) PortMultiplierPort semantics
Hao Wu [Fri, 8 Apr 2016 08:23:57 +0000 (16:23 +0800)]
MdeModulePkg Ata: Use the new (incompatible) PortMultiplierPort semantics

The Mantis ticket 1353 <https://mantis.uefi.org/mantis/view.php?id=1353>
and Mantis ticket 1472 <https://mantis.uefi.org/mantis/view.php?id=1472>
updated the description of the port multiplier port number parameter in
SATA Device Path Node and ATA Pass-Through Protocol.

Now, this parameter should be set to 0xFFFF instead of 0 to indicate that
an ATA device is directly attached on the controller port.

Please note that this is an incompatible change. The consumer of SATA
device path or ATA_PASS_THRU needs to re-examine its usage to follow UEFI
2.5 mantis 1353 and 1472.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdePkg Protocol/AtaPassThru.h: Update PortMultiplierPort related comments
Hao Wu [Fri, 8 Apr 2016 08:17:37 +0000 (16:17 +0800)]
MdePkg Protocol/AtaPassThru.h: Update PortMultiplierPort related comments

The UEFI2.5 Errata (Mantis ticket 1472 -
https://mantis.uefi.org/mantis/view.php?id=1472) updated
'PortMultiplierPort' parameter description for the following services in
EFI_ATA_PASS_THRU_PROTOCOL:

1. PassThru
2. BuildDevicePath
3. ResetDevice

Now, if there is no port multiplier on a ATA controller port, the
PortMultiplierPort parameter should be set to 0xFFFF instead of 0.

Please note that this is an incompatible semantic change. The consumer of
EFI_ATA_PASS_THRU_PROTOCOL needs to re-examine its usage to follow UEFI
2.5 Errata mantis 1472.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdePkg Protocol/DevicePath.h: Update SATA Device Path comments
Hao Wu [Fri, 8 Apr 2016 08:14:16 +0000 (16:14 +0800)]
MdePkg Protocol/DevicePath.h: Update SATA Device Path comments

The UEFI2.5 spec (Mantis ticket 1353 -
https://mantis.uefi.org/mantis/view.php?id=1353) updated the Port
Multiplier Port Number description of SATA device path to use 0xFFFF when
the device is directly connected to the HBA.

Please note that this is an incompatible semantic change. The consumer of
SATA device path needs to re-examine its usage to follow UEFI 2.5 mantis
1353.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoSecurityPkg OpalPasswordDxe: Error handling enhance when input password.
Eric Dong [Wed, 11 May 2016 02:36:05 +0000 (10:36 +0800)]
SecurityPkg OpalPasswordDxe: Error handling enhance when input password.

Enhance the error handling:
1. When the device is unlocked at BIOS phase and system does a warm reboot,
the device may be still in unlock status if it uses external power. For
such case, we would still popup password window to ask user input. If
user presses ESC key here, we would force the system shut down or ask
user input again to avoid security hole.
2. When user reach max retry count, force shutdown.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/UsbMouseAbsolutePointerDxe: fix VS2015 NOOPT build error
Feng Tian [Wed, 11 May 2016 02:44:42 +0000 (10:44 +0800)]
MdeModulePkg/UsbMouseAbsolutePointerDxe: fix VS2015 NOOPT build error

Cc: Shumin Qiu <shumin.qiu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Shumin Qiu <shumin.qiu@intel.com>
7 years agoNetworkPkg: Bug fix of iSCSI to support MPIO
Zhang, Lubo [Wed, 11 May 2016 01:37:39 +0000 (09:37 +0800)]
NetworkPkg: Bug fix of iSCSI to support MPIO

If two attempts added on different NIC and enable
MPIO attribute, then change the attempts order. If
both two attempts succeed to connect the target,it
should abort the later one in the order and uninstall
ExtScsiPassThruProtocol Interface, But now it
unistall it twice.

Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Cc: Wu Jiaxin <jiaxin.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Zhang Lubo <lubo.zhang@intel.com>
Reviewed-By: Ye Ting <ting.ye@intel.com>
Reviewed-By: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoArmPlatformPkg/PL031RealTimeClockLib: remove local copy of gRT pointer
Ard Biesheuvel [Wed, 13 Apr 2016 08:07:55 +0000 (10:07 +0200)]
ArmPlatformPkg/PL031RealTimeClockLib: remove local copy of gRT pointer

Since the only reason for keeping a local copy mRT of the gRT pointer
is to be able to call GetVariable/SetVariable at runtime, use the
UefiRuntimeLib helpers instead, so that we can drop mRT altogether.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPlatformPkg/PL031RealTimeClockLib: don't clobber gRT table
Ard Biesheuvel [Wed, 13 Apr 2016 08:04:24 +0000 (10:04 +0200)]
ArmPlatformPkg/PL031RealTimeClockLib: don't clobber gRT table

PL031RealTimeClockLib is a base library that could potentially (although
unlikely) be incorporated into other modules than the DXE_RUNTIME_DRIVER
module that it was intended to complement.

This means the library has no business whatsoever setting the Runtime
Service table pointers directly (since we have no way of knowing which
instance will 'win', and the pointers may end up referring to a module
that is not a DXE_RUNTIME_DRIVER). So remove the assignment altogether.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoEmbeddedPkg/Lan9118Dxe: add mask PCD to disable auto-negotiation features
Ryan Harkin [Wed, 11 May 2016 08:23:59 +0000 (09:23 +0100)]
EmbeddedPkg/Lan9118Dxe: add mask PCD to disable auto-negotiation features

Add a PCD to allow the platform to mask in/out specific features of
the LAN9118 device advertised during auto-negotiation.

For example, the Juno ARM Development Platform doesn't support full
duplex mode.  This PCD will allow the platform developer to prevent the
full duplex modes from being advertised.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ryan Harkin <ryan.harkin@linaro.org>
[ardb: change default feature mask so that full duplex is disabled]
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoBaseTools: Fix bug in GenFds to handle FV image alignment
Yonghong Zhu [Fri, 6 May 2016 09:14:26 +0000 (17:14 +0800)]
BaseTools: Fix bug in GenFds to handle FV image alignment

Cover the case that .fv file in the [Binaries] section.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoSecurity/OpalPasswordDxe: Enhance the logic in RouteConfig/ExtractConfig
Dandan Bi [Mon, 9 May 2016 11:53:00 +0000 (19:53 +0800)]
Security/OpalPasswordDxe: Enhance the logic in RouteConfig/ExtractConfig

Make the implementation of RouteConfig/ExtractConfig function
follow the UEFI spec.

Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
7 years agoBaseTools: fix a bug for uni file \x####\ format handling
Yonghong Zhu [Tue, 10 May 2016 09:46:23 +0000 (17:46 +0800)]
BaseTools: fix a bug for uni file \x####\ format handling

It should start from the last '\x' position + 1 to find next '\x'
character.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMerge branch 'master' of github.com:tianocore/edk2
Zhang, Chao B [Wed, 11 May 2016 00:59:40 +0000 (08:59 +0800)]
Merge branch 'master' of github.com:tianocore/edk2

7 years agoSecurityPkg: SecureBootConfigDxe: Add NULL pointer check
Zhang, Chao B [Tue, 10 May 2016 07:50:02 +0000 (15:50 +0800)]
SecurityPkg: SecureBootConfigDxe: Add NULL pointer check

Add SecureBoot NULL pointer check before reference it.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
7 years agoOvmfPkg/PciHostBridgeLib: Scan for root bridges when running over Xen
Ruiyu Ni [Tue, 10 May 2016 03:14:45 +0000 (11:14 +0800)]
OvmfPkg/PciHostBridgeLib: Scan for root bridges when running over Xen

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Gary Lin <glin@suse.com>
7 years agoOvmfPkg/PciHostBridgeLib: Change InitRootBridge prototype
Ruiyu Ni [Mon, 9 May 2016 06:03:57 +0000 (14:03 +0800)]
OvmfPkg/PciHostBridgeLib: Change InitRootBridge prototype

The patch re-factors the code without functionality impact.
Next patch will add code to support OVMF above Xen.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/PciHostBridgeDxe: Honor ResourceAssigned
Ruiyu Ni [Mon, 9 May 2016 05:49:27 +0000 (13:49 +0800)]
MdeModulePkg/PciHostBridgeDxe: Honor ResourceAssigned

Change PciHostBridgeDxe driver to not install the
PciHostBridgeResourceAllocation protocol and let
PciRootBridgeIo.Configuration() return the correct PCI resource
assignment information when the ResourceAssigned is TRUE.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/PciHostBridgeLib: Add ResourceAssigned field
Ruiyu Ni [Fri, 29 Apr 2016 08:43:56 +0000 (16:43 +0800)]
MdeModulePkg/PciHostBridgeLib: Add ResourceAssigned field

Some platform doesn't require PciBus driver to assign resource
to PCI devices which causes PciRootBridgeIo.Configuration() cannot
return correct resource information to caller.

When resource assignment by PciBus is not mandatory, only light
version of PCI bus enumeration is performed, which only collects
the device resource consumption and publishes the PciIo instance.
The corresponding logic is in PciEnumeratorLight() in PciBus driver.

But PciEnumeratorLight() still depends on
PciRootBridgeIo.Configuration() returns the starting bus number in
order to search down to find all PCI devices under the root bridge.

When ResourceAssigned in PCI_ROOT_BRIDGE returned by
PciHostBridgeGetRootBridges() is TRUE, PciHostBridge driver treats
the Bus/Io/Mem/MemAbove4G/PMem/PMemAbove4G as the resource that are
*actually assigned* to the root bridge, instead of the resource that
*can be assigned* to the root bridge.
So that PciRootBridgeIo.Configuration() can return the correct
information.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoOvmfPkg/PciHostBridgeLib: Set correct Base/Limit for absent resource
Ruiyu Ni [Sat, 30 Apr 2016 01:34:54 +0000 (09:34 +0800)]
OvmfPkg/PciHostBridgeLib: Set correct Base/Limit for absent resource

In order to match the previous commit, Base must be strictly larger than
Limit if some type of aperture is not available on a PCI root bridge.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/PciHostBridgeDxe: Fix a Base/Limit comparing bug
Ruiyu Ni [Fri, 29 Apr 2016 09:38:51 +0000 (17:38 +0800)]
MdeModulePkg/PciHostBridgeDxe: Fix a Base/Limit comparing bug

When the aperture base equals to aperture limit, the old code treats
the aperture as non-existent. It's not correct because it indicates
a range starting with base and the length is 1.
The new code corrects the comparing bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/PciHostBridgeDxe: Don't miss prefetchable MMIO aperture
Ruiyu Ni [Fri, 29 Apr 2016 09:41:11 +0000 (17:41 +0800)]
MdeModulePkg/PciHostBridgeDxe: Don't miss prefetchable MMIO aperture

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoArmVirtPkg: set PcdMaxVariableSize and PcdMaxAuthVariableSize
Linn Crosetto [Tue, 10 May 2016 18:16:12 +0000 (12:16 -0600)]
ArmVirtPkg: set PcdMaxVariableSize and PcdMaxAuthVariableSize

To support UEFI Secure Boot and the Linux persistent store with UEFI
variables, set PcdMaxVariableSize to 0x2000 bytes as is done in OvmfPkg.
For reference, the related Ovmf commits: 8cee3de7 2d441ca9

Also increase the maximum size for Authenticated variables in order to
handle a larger Signature List size as is done in OvmfPkg. Related Ovmf
commit: f5404a3e

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Linn Crosetto <linn@hpe.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
7 years agoCorebootPayloadPkg/PlatformBdsLib: Pass more serial parameters
Leahy, Leroy P [Mon, 9 May 2016 17:57:55 +0000 (10:57 -0700)]
CorebootPayloadPkg/PlatformBdsLib: Pass more serial parameters

Pass the serial port baudrate, register stride, input clock rate and
ID from coreboot to CorebootPayloadPkg.

Change-Id: I37111d23216e4effa2909337af7e8a6de36b61f7
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled devices
Leahy, Leroy P [Mon, 9 May 2016 17:57:35 +0000 (10:57 -0700)]
CorebootPayloadPkg/PciBusNoEnumerationDxe: Skip disabled devices

Skip non-bridge devices which are not enabled either for memory or I/O
access.

Change-Id: I1a39c69a8556b6b9cefd1a2bb191f7e0744ddfb0
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootModulePkg/PciBusNoEnumerationDxe: Remove white space
Leahy, Leroy P [Mon, 9 May 2016 17:57:21 +0000 (10:57 -0700)]
CorebootModulePkg/PciBusNoEnumerationDxe: Remove white space

Remove trailing white space from PciEnumeratorSupport.c.

Change-Id: Ia2f354151d46c09b140e2b42609d76fbbf8333f9
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootModulePkg/BaseSerialPortLib: Set DTR and RTS
Leahy, Leroy P [Mon, 9 May 2016 17:57:08 +0000 (10:57 -0700)]
CorebootModulePkg/BaseSerialPortLib: Set DTR and RTS

Ensure communication between the host and the UEFI system running
CorebootPayloadPkg.  In cases where the host has flow control enabled
and the serial connection is providing the flow control signals, the
host will not be able to send data to the UEFI system because DTR and
RTS are not present.  The host may also discard all output data from
the UEFI system because DTR is not present.  By setting DTR and RTS
in the UART initialization code this case works properly.

Change-Id: I393f57104d111472cafcae01d4e43d4ea837be3b
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootModulePkg/BaseSerialPortLib16550: Remove white-space
Leahy, Leroy P [Mon, 9 May 2016 17:56:55 +0000 (10:56 -0700)]
CorebootModulePkg/BaseSerialPortLib16550: Remove white-space

Remove trailing white space.

Change-Id: I73c3a3e1e55eec20b09443de1966573c97fa74f8
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoCorebootModulePkg: Add BaseSerialPortLib16550
Leahy, Leroy P [Mon, 9 May 2016 17:56:40 +0000 (10:56 -0700)]
CorebootModulePkg: Add BaseSerialPortLib16550

Copy MdeModulePkg/Library/BaseSerialPortLib16550 revision
89ecd4cf8078aa946083cdcbf9af81ff29f8d9f5.

Change-Id: Ie2fd0123bdd7aaba4335afdb1cb017f3690455c6
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Lee Leahy <leroy.p.leahy@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
7 years agoEmbeddedPkg/Lan9118Dxe: remove redundant stalls
Mark Rutland [Fri, 6 May 2016 17:19:09 +0000 (18:19 +0100)]
EmbeddedPkg/Lan9118Dxe: remove redundant stalls

Now that the LAN9118-specific MMIO accessors provide the required
delays, remove the redundant stalls.

Stalls in delay loops are kept, as these give time for work to happen
beyond synchronisation of the device register file.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoEmbeddedPkg/Lan9118Dxe: Use LAN9118 MMIO wrappers
Mark Rutland [Fri, 6 May 2016 17:19:08 +0000 (18:19 +0100)]
EmbeddedPkg/Lan9118Dxe: Use LAN9118 MMIO wrappers

Migrate the existing code to use the new LAN9118 MMIO wrappers, ensuring
that timing requirements are respected.

The newly redundant stalls will be removed in a subsequent patch.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoEmbeddedPkg/Lan9118Dxe: add LAN9118 MMIO wrappers
Mark Rutland [Fri, 6 May 2016 17:19:07 +0000 (18:19 +0100)]
EmbeddedPkg/Lan9118Dxe: add LAN9118 MMIO wrappers

As described in the LAN9118 datasheet, delays are necessary after some
reads and writes in order to ensure subsequent reads do not see stale
data.

This patch adds helpers to provide these delays automatically, by
performing dummy reads of the BYTE_TEST register (as recommended in the
LAN9118 datasheet). This approach allows the device register file itself
to provide the required delay, avoiding issues with early write
acknowledgement, or re-ordering of MMIO accesses aganist other
instructions (e.g. the delay loop).

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoRevert "EmbeddedPkg/Lan9118Dxe: use MemoryFence"
Mark Rutland [Fri, 6 May 2016 17:19:06 +0000 (18:19 +0100)]
Revert "EmbeddedPkg/Lan9118Dxe: use MemoryFence"

Commit a4626006bbf86113 ("EmbeddedPkg/Lan9118Dxe: use MemoryFence")
replaced some stalls with memory fences, on the presumption that these
were erroneously being used to order memory accesses. However, this was
not the case.

LAN9118 devices require a timing delay between state-changing
reads/writes and subsequent reads, as updates to the register file are
asynchronous and the effects of state-changes are not immediately
visible to subsequent reads.

This delay cannot be ensured through the use of memory barriers, which
only enforce observable ordering, and not timing. Thus, converting these
stalls to memory fences was erroneous, and may result in stale values
being read.

This reverts commit a4626006bbf86113453aeb7920895e66cdd04737.

Cc: Leif Lindholm <leif.lindholm@linaro.org>
Cc: Ryan Harkin <ryan.harkin@linaro.org>
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoArmPkg/AArch64Mmu: don't let table entries inherit XN permission bits
Ard Biesheuvel [Wed, 20 Apr 2016 08:07:20 +0000 (10:07 +0200)]
ArmPkg/AArch64Mmu: don't let table entries inherit XN permission bits

When we split a block entry into a table entry, the UXN/PXN/XN permission
attributes are inherited both by the new table entry and by the new block
entries at the next level down. Unlike the NS bit, which only affects the
next level of lookup, the XN table bits supersede the permissions of the
final translation, and setting the permissions at multiple levels is not
only redundant, it also prevents us from lifting XN restrictions on a
subregion of the original block entry by simply clearing the appropriate
bits at the lowest level.

So drop the code that sets the UXN/PXN/XN bits on the table entries.

Reported-by: "Oliyil Kunnil, Vishal" <vishalo@qti.qualcomm.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmDmaLib: assert that consistent mappings are uncached
Ard Biesheuvel [Wed, 20 Apr 2016 08:29:21 +0000 (10:29 +0200)]
ArmPkg/ArmDmaLib: assert that consistent mappings are uncached

DmaMap () only allows uncached mappings to be used for creating consistent
mappings with operation type MapOperationBusMasterCommonBuffer. However,
if the buffer passed to DmaMap () happens to be aligned to the CWG, there
is no need for a bounce buffer, and we perform the cache maintenance
directly without ever checking if the memory attributes of the buffer
adhere to the API.

So add some debug code that asserts that the operation type and the memory
attributes are consistent.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmDmaLib: do not remap arbitrary memory regions as uncached
Ard Biesheuvel [Tue, 19 Apr 2016 14:37:04 +0000 (16:37 +0200)]
ArmPkg/ArmDmaLib: do not remap arbitrary memory regions as uncached

In the DmaMap () operation, if the region to be mapped happens to be
aligned to the Cache Writeback Granule (CWG) (whose value is typically
64 or 128 bytes and 2 KB maximum), we remap the memory as uncached.

Since remapping memory occurs at page granularity, while the buffer and the
CWG may be much smaller, there is no telling what other memory we affect
by doing this, especially since the operation is not reverted in DmaUnmap().

So remove the remapping call.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmDmaLib: reject consistent DMA mappings of cached memory
Ard Biesheuvel [Tue, 19 Apr 2016 14:26:00 +0000 (16:26 +0200)]
ArmPkg/ArmDmaLib: reject consistent DMA mappings of cached memory

DmaMap () operations of type MapOperationBusMasterCommonBuffer should
return a mapping that is coherent between the CPU and the device. For
this reason, the API only allows DmaMap () to be called with this operation
type if the memory to be mapped was allocated by DmaAllocateBuffer (),
which in this implementation guarantees the coherency by using uncached
mappings on the CPU side.

This means that, if we encounter a cached mapping in DmaMap () with this
operation type, the code is either broken, or someone is violating the
API, but simply proceeding with a double buffer makes no sense at all,
and can only cause problems.

So instead, actively reject this operation type for cached memory mappings.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmDmaLib: interpret GCD attributes as a bit field
Ard Biesheuvel [Tue, 19 Apr 2016 14:19:02 +0000 (16:19 +0200)]
ArmPkg/ArmDmaLib: interpret GCD attributes as a bit field

Comparing a GCD attribute field directly against EFI_MEMORY_UC and
EFI_MEMORY_WT is incorrect, since it may have other bits set as well
which are not related to the cacheability of the region. So instead,
test explicitly against the flags EFI_MEMORY_WB and EFI_MEMORY_WT,
which must be set if the region may be mapped with cacheable attributes.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmDmaLib: consistently use 'gCacheAlignment - 1' as alignment mask
Ard Biesheuvel [Tue, 19 Apr 2016 14:16:37 +0000 (16:16 +0200)]
ArmPkg/ArmDmaLib: consistently use 'gCacheAlignment - 1' as alignment mask

We manage to use both an AND operation with 'gCacheAlignment - 1' and a
modulo operation with 'gCacheAlignment' in the same compound if statement.
Since gCacheAlignment is a global of which the compiler cannot guarantee
that it is a power of two, simply use the AND version in both cases.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/ArmDmaLib: deal with NULL return value of UncachedAllocatePages ()
Ard Biesheuvel [Tue, 19 Apr 2016 14:12:10 +0000 (16:12 +0200)]
ArmPkg/ArmDmaLib: deal with NULL return value of UncachedAllocatePages ()

The allocation function UncachedAllocatePages () may return NULL, in
which case our implementation of DmaAllocateBuffer () should return
EFI_OUT_OF_RESOURCES rather than silently ignoring the NULL value and
returning EFI_SUCCESS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoMdeModulePkg/PciSioSerialDxe: Do not flush the UART
Ruiyu Ni [Mon, 9 May 2016 03:21:25 +0000 (11:21 +0800)]
MdeModulePkg/PciSioSerialDxe: Do not flush the UART

The patch aligns to the IntelFrameworkModulePkg/Bus/Isa/IsaSerialDxe
driver not flush the UART in Reset() and SetAttributes() function.
It was found the flush causes hang on certain PCI serial devices.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Jin <eric.jin@intel.com>
7 years agoMdeModulePkg RamDiskDxe: Fix wrong HII behavior for more than 8 RAM disks
Hao Wu [Wed, 20 Apr 2016 05:23:59 +0000 (13:23 +0800)]
MdeModulePkg RamDiskDxe: Fix wrong HII behavior for more than 8 RAM disks

The RamDiskDxe driver originally uses a variable-length HII varstore to
retrieve the HII checkbox status of each registered RAM disk.

However, HII does not support the variable-length varstore feature.
Therefore, only the checkbox status for the first 8 RAM disks are tracked
for the following definition of HII varstore structure considering the
alignment:

typedef struct {
  UINT64    Size;
  UINT8     RamDiskList[0];
  } RAM_DISK_CONFIGURATION;

This commit uses the private data of each registered RAM disks to track
the HII checkbox status instead to resolve the issue.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoOvmfPkg: Modify FDF/DSC files for RamDiskDxe's adding NFIT report feature
Hao Wu [Tue, 19 Apr 2016 07:17:03 +0000 (15:17 +0800)]
OvmfPkg: Modify FDF/DSC files for RamDiskDxe's adding NFIT report feature

The RamDiskDxe driver in MdeModulePkg now will use EFI_ACPI_TABLE_PROTOCOL
and EFI_ACPI_SDT_PROTOCOL during reporting RAM disks to NVDIMM Firmware
Interface Table (NFIT).

A Pcd 'PcdInstallAcpiSdtProtocol' controls whether the
EFI_ACPI_SDT_PROTOCOL will be produced. Its default value is set to FALSE
in MdeModulePkg. To make the NFIT reporting feature working properly under
OVMF, the patch will set the Pcd to TRUE in OVMF DSC files.

Also, the RamDiskDxe driver will sometimes report a NVDIMM Root Device
using ASL code which is put in a Secondary System Description Table (SSDT)
according to the ACPI 6.1 spec.

Locating the SSDT requires modifying the [Rule.Common.DXE_DRIVER] field in
OVMF FDF files.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
7 years agoMdeModulePkg RamDiskDxe: Report ACPI NFIT for reserved memory RAM disks
Hao Wu [Tue, 29 Mar 2016 08:33:11 +0000 (16:33 +0800)]
MdeModulePkg RamDiskDxe: Report ACPI NFIT for reserved memory RAM disks

The RamDiskDxe now will report RAM disks with reserved memory type to NFIT
in the ACPI table.

This commit will also make sure that an NVDIMM root device exists in the
\SB scope before reporting any RAM disk to NFIT.

To properly report the NVDIMM root device, one will need to append the
following content in the [Rule.Common.DXE_DRIVER] field in platform FDF
files:

RAW ACPI  Optional                |.acpi
RAW ASL   Optional                |.aml

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com>
7 years agoArmPkg/DefaultExceptionHandlerLib: fix typo
Ard Biesheuvel [Mon, 9 May 2016 15:28:05 +0000 (17:28 +0200)]
ArmPkg/DefaultExceptionHandlerLib: fix typo

Replace : with ; which was changes accidentally.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoArmPkg/DefaultExceptionHandlerLib: add stack dump to exception handling code
Ard Biesheuvel [Mon, 9 May 2016 14:24:18 +0000 (16:24 +0200)]
ArmPkg/DefaultExceptionHandlerLib: add stack dump to exception handling code

This adds a partial stack dump (256 bytes at either side of the stack
pointer) to the CPU state dumping routine that is invoked when taking an
unexpected exception. Since dereferencing the stack pointer may itself
fault, ensure that we don't enter the dumping routine recursively.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoArmPkg/DefaultExceptionHandlerLib: use deadloop rather than ASSERT
Ard Biesheuvel [Mon, 9 May 2016 14:14:15 +0000 (16:14 +0200)]
ArmPkg/DefaultExceptionHandlerLib: use deadloop rather than ASSERT

The default exception handler, which is essentially the one that is invoked
for unexpected exceptions, ends with an ASSERT (FALSE), to ensure that
execution halts after dumping the CPU state. However, ASSERTs are compiled
out in RELEASE builds, and since we simply return to wherever the ELR is
pointing, we will not make any progress in case of synchronous aborts, and
the same exception will be taken again immediately, resulting in the string
'Exception at 0x....' to be printed over and over again.

So use an explicit deadloop instead.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Acked-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoMdeModulePkg/Sd: add Erase Block support on sd/emmc device
Feng Tian [Tue, 3 May 2016 06:07:38 +0000 (14:07 +0800)]
MdeModulePkg/Sd: add Erase Block support on sd/emmc device

It's done by producing EFI_ERASE_BLOCK_PROTOCOL protocol instance.

Cc: Hao Wu <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Hao Wu <hao.a.wu@intel.com>
7 years agoMdeModulePkg: FileExplorerLib: prevent freeing null pointer
Michael Zimmermann [Mon, 9 May 2016 02:01:49 +0000 (10:01 +0800)]
MdeModulePkg: FileExplorerLib: prevent freeing null pointer

when there's no volume label 'Info' can be NULL

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoSecurityPkg TcgStorageOpalLib: Check the capability before use.
Dong, Eric [Thu, 5 May 2016 00:51:28 +0000 (08:51 +0800)]
SecurityPkg TcgStorageOpalLib: Check the capability before use.

For Pyrite SSC device, it may not supports Active Key,  So
add check logic before enable it.

Cc: Feng Tian <feng.tian@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoSecurityPkg: Cleanup unused structure definition
Jiaxin Wu [Fri, 6 May 2016 06:17:51 +0000 (14:17 +0800)]
SecurityPkg: Cleanup unused structure definition

This patch is used to cleanup unused structure
definition.

Cc: Zhang Chao B <chao.b.zhang@intel.com>
Cc: Ye Ting <ting.ye@intel.com>
Cc: Fu Siyuan <siyuan.fu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoMdeModulePkg/SdMmcPciHcDxe: Check SD's supported bus mode before switch
Feng Tian [Tue, 3 May 2016 01:57:55 +0000 (09:57 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Check SD's supported bus mode before switch

Before switch to a bus mode, we need check if the SD device supports
this bus mode.

Cc: Wu, Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/SdMmcPciHcDxe: Error handling enhance on tuning procedure
Feng Tian [Tue, 3 May 2016 01:49:47 +0000 (09:49 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Error handling enhance on tuning procedure

Enhance the code to reset tuning circuit when tuning error case happens.

Cc: Wu, Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/SdMmcPciHcDxe: Using PIO rather than DMA for clock tuning
Feng Tian [Fri, 29 Apr 2016 08:02:50 +0000 (16:02 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Using PIO rather than DMA for clock tuning

The original code is using ADMA mode to do clock tuning procedure. It
may have problem on some SD/MMC host controllers as there is no way to
know when to send next tuning cmd.

Update it to PIO mode to strictly follow SD Host Controller Simplified
Specification 3.0 Figure 2-29. By this way, if the Buffer Read Ready
interrupt is set, we could know it's ok to send the next clock tuning
cmd.

Cc: Wu, Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/SdMmcPciHcDxe: Use BaseClk if the target clock is larger
Feng Tian [Fri, 29 Apr 2016 06:39:30 +0000 (14:39 +0800)]
MdeModulePkg/SdMmcPciHcDxe: Use BaseClk if the target clock is larger

The original code has a bug to calculate which clock freq should be
used when the target clock freq is larger than the BaseClock Freq
provided by the system.

Cc: Wu, Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/SdMmcPciHcDxe: break cmd exec if the card isn't identified
Feng Tian [Fri, 29 Apr 2016 06:31:36 +0000 (14:31 +0800)]
MdeModulePkg/SdMmcPciHcDxe: break cmd exec if the card isn't identified

Check if the card is identified/initialized correctly. if not, break
the following cmd execution through PassThru()/ResetDevice().

Cc: Wu, Hao A <hao.a.wu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
7 years agoArmVirtPkg: retire PlatformIntelBdsLib
Laszlo Ersek [Thu, 5 May 2016 18:25:43 +0000 (20:25 +0200)]
ArmVirtPkg: retire PlatformIntelBdsLib

This library instance is no longer referenced.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDS
Laszlo Ersek [Thu, 5 May 2016 17:12:09 +0000 (19:12 +0200)]
ArmVirtPkg/ArmVirtQemu: use MdeModulePkg/BDS

Based on OvmfPkg commit 79c098b6d25d.

Unlike in OVMF, no USE_OLD_BDS fallback is introduced; I think that
ArmVirtPkg is less widely used by non-developers than OvmfPkg.

ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from
ArmPlatformPkg.

About this patch:

- DxeServicesLib and SortLib are resolved generally (they have broad
  client module type lists).

- ReportStatusCodeLib is resolved for UEFI_APPLICATION modules.

- GenericBdsLib and PlatformBdsLib are replaced with UefiBootManagerLib
  and PlatformBootManagerLib, and resolved from under MdeModulePkg and
  ArmVirtPkg, respectively.

- QemuBootOrderLib is pointed to the QemuNewBootOrderLib instance.

- FileExplorerLib no longer depends on SECURE_BOOT_ENABLE, it is nedeed by
  BootMaintenanceManagerUiLib, which we link into UiApp.

- PcdBootManagerMenuFile carries the FILE_GUID of
  "MdeModulePkg/Application/UiApp/UiApp.inf". The default PCD value from
  "MdeModulePkg/MdeModulePkg.dec" points to
  "MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf",
  which, according to the commit that introduced it (a382952f8255), only
  'provides a very simple UI showing all the boot options recorded by
  "BootOrder" and user can select any of them to boot'.

- Include the new core BDS driver, and include the boot manager
  application, with the usual main menu entries.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Fixes: https://github.com/tianocore/edk2/issues/83
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBoot
Laszlo Ersek [Thu, 5 May 2016 16:44:25 +0000 (18:44 +0200)]
ArmVirtPkg/PlatformBootManagerLib: add EnableQuietBoot & DisableQuietBoot

UefiBootManagerLib does not provide these functions, we have to implement
them. (EnableQuietBoot() puts up the nice TianoCore logo.)

OvmfPkg commits 817fb3ac2a78 and 8e8fd3037788 have extracted these
functions already,
- from "IntelFrameworkModulePkg/Library/GenericBdsLib/BdsConsole.c"
- to "OvmfPkg/Library/PlatformBootManagerLib/QuietBoot.c".

Copy the latter file, with minimal changes.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulation
Laszlo Ersek [Thu, 5 May 2016 15:45:42 +0000 (17:45 +0200)]
ArmVirtPkg/PlatformBootManagerLib: rebase boot order manipulation

QemuBootOrderLib can only filter out and reorder boot options; it cannot
create boot options. It relies on Platform BDS to auto-generate all
possible boot options first (for example, for new virtual devices that
have been configured since the last run of the virtual machine). Then it
will decide, case-by-case, whether each of those auto-generated boot
options should be preserved (and at what position), or removed.

Thus far, the only implementation of SetBootOrderFromQemu(), used in
connection with IntelFrameworkModulePkg BDS, has expected said complete
boot option list as an input parameter:

BdsEntry()                         [IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c]
  // create empty list
  InitializeListHead (
    &BootOptionList
    )

  PlatformBdsPolicyBehavior(       [ArmVirtPkg/Library/PlatformIntelBdsLib/IntelBdsPlatform.c]
    BootOptionList
    )

    BdsLibConnectAll()
    BdsLibEnumerateAllBootOption(
      BootOptionList
      )

    // at this point, BootOptionList starts with the preexistent boot
    // options, and ends with the auto-generated options

    SetBootOrderFromQemu(          [OvmfPkg/Library/QemuBootOrderLib/QemuBootOrderLib.c]
      BootOptionList
      )

      // write out changed boot order to UEFI variables

    // The "BootOrder" variable may have changed. Refresh BootOptionList
    // from it, and return it to BdsEntry().

With MdeModulePkg BDS, a BootOptionList is not propagated from BdsEntry()
to SetBootOrderFromQemu() and back. All processing is based directly on
the underlying "BootOrder" and "Boot####" variables.

In OvmfPkg, commit d27ec22d1189 introduced a new instance of
QemuBootOrderLib, called QemuNewBootOrderLib. It is based on
UefiBootManagerLib, and rather than taking a complete BootOptionList as a
parameter, it expects that the "BootOrder" and "Boot####" variables are
complete in the above sense.

Rebase the boot order manipulation to UefiBootManagerLib and
QemuNewBootOrderLib, while keeping the requirement satisfied, like this:

BdsEntry()                               [MdeModulePkg/Universal/BdsDxe/BdsEntry.c]
  PlatformBootManagerAfterConsole()      [ArmVirtPkg/Library/PlatformBootManagerLib/PlatformBm.c]
    EfiBootManagerConnectAll()
    EfiBootManagerRefreshAllBootOption()

    // at this point all auto-generated options exist at the end of
    // "BootOrder"

    SetBootOrderFromQemu()               [OvmfPkg/Library/QemuNewBootOrderLib/QemuBootOrderLib.c]

      // read boot options from "BootOrder" and "Boot####", then
      // manipulate them

This patch parallels OvmfPkg commit 04fe914ba53e.

Once the USE_OLD_BDS fallback is removed from OvmfPkg, the parameter list
of the SetBootOrderFromQemu() prototype can be updated to VOID.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() API
Laszlo Ersek [Thu, 5 May 2016 15:38:33 +0000 (17:38 +0200)]
ArmVirtPkg/PlatformBootManagerLib: use UefiBootManagerLib ConnectAll() API

This patch parallels OvmfPkg commit fed691a6f913.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooks
Laszlo Ersek [Thu, 5 May 2016 15:31:08 +0000 (17:31 +0200)]
ArmVirtPkg/PlatformBootManagerLib: remove empty PlatformBdsLib hooks

Namely,
- PlatformBdsBootSuccess,
- PlatformBdsBootFail,
- PlatformBdsLockNonUpdatableFlash.

This patch parallels OvmfPkg commit 7f89929f7fb2.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: register boot options and hot keys
Laszlo Ersek [Thu, 5 May 2016 15:22:33 +0000 (17:22 +0200)]
ArmVirtPkg/PlatformBootManagerLib: register boot options and hot keys

Register the Enter key as the continue key (hot key to skip the boot
timeout). Map the F2 and ESC keys to the UI. Register the memory-mapped
Shell boot option.

The patch parallels OvmfPkg commit 07dd96e82032. The
PlatformRegisterFvBootOption() and PlatformRegisterOptionsAndKeys()
functions are copied almost verbatim. The only changes are: internal
linkage for these functions (i.e., STATIC), and mentioning the ESC key in
the comments.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager Menu
Laszlo Ersek [Thu, 5 May 2016 15:09:04 +0000 (17:09 +0200)]
ArmVirtPkg/PlatformBootManagerLib: don't launch the Boot Manager Menu

MdeModulePkg/BDS doesn't launch the UI (Boot Manager Menu) from the
platform side. The platform is expected to store the boot timeout only, in
PcdPlatformBootTimeOut. This is usually done in
PlatformBootManagerBeforeConsole().

(ArmVirtXen is not modified, as it uses PlatformIntelBdsLib from
ArmPlatformPkg, not ArmVirtPkg.)

The patch parallels OvmfPkg commit 8dc0f0a6aab0.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()
Laszlo Ersek [Thu, 5 May 2016 14:24:00 +0000 (16:24 +0200)]
ArmVirtPkg/PlatformBootManagerLib: init console vars in BeforeConsole()

With IntelFrameworkModulePkg BDS, the platform code is responsible for
updating console variables (e.g., with BdsLibUpdateConsoleVariable()), and
then connecting them (e.g., with BdsLibConnectAllDefaultConsoles()). This
is usually (although not necessarily) done in PlatformBdsPolicyBehavior().

With MdeModulePkg BDS, the platform is responsible for updating the
console variables in PlatformBootManagerBeforeConsole(). When that
function returns, BdsEntry() will automatically connect the consoles; the
platform is not responsible for the connection.

IntelFrameworkModulePkg               MdeModulePkg
  BdsEntry                              BdsEntry
    PlatformBdsInit                       PlatformBootManagerBeforeConsole
                                     +----> EfiBootManagerUpdateConsoleVariable
                                     |
    dispatch Driver####              |    dispatch Driver####
                                     | +> connect consoles
                                     | |
    PlatformBdsPolicyBehavior        | |  PlatformBootManagerAfterConsole
      BdsLibUpdateConsoleVariable <--+ |
      BdsLibConnectAllDefaultConsoles <+
      display splash screen                 display splash screen

Thus, move the console variable massaging from the beginning of
PlatformBootManagerAfterConsole() (originally PlatformBdsPolicyBehavior())
to the end of PlatformBootManagerBeforeConsole(), and drop the explicit
BdsLibConnectAllDefaultConsoles() call.

This patch parallels OvmfPkg commit e9e9ad644fab.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLib
Laszlo Ersek [Thu, 5 May 2016 14:08:11 +0000 (16:08 +0200)]
ArmVirtPkg/PlatformBootManagerLib: link against UefiBootManagerLib

The general BDS helper functions are now provided by MdeModulePkg's
UefiBootManagerLib, and no longer by IntelFrameworkModulePkg's
GenericBdsLib.

This patch parallels OvmfPkg commit 2b23b8d45b62.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariable
Laszlo Ersek [Thu, 5 May 2016 13:58:56 +0000 (15:58 +0200)]
ArmVirtPkg/PlatformBootManagerLib: use EfiBootManagerUpdateConsoleVariable

In this rather mechanical patch, we replace the calls to GenericBdsLib's
BdsLibUpdateConsoleVariable() with calls to UefiBootManagerLib's
EfiBootManagerUpdateConsoleVariable(), which has the same purpose.

The latter uses CONSOLE_TYPE enum constants from
"MdeModulePkg/Include/Library/UefiBootManagerLib.h", for identifying the
console type / underlying UEFI variable in the first parameter.

This patch parallels OvmfPkg commit 9dc08ec6574b.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfaces
Laszlo Ersek [Thu, 5 May 2016 13:39:59 +0000 (15:39 +0200)]
ArmVirtPkg/PlatformBootManagerLib: follow PlatformBootManagerLib interfaces

"IntelFrameworkModulePkg/Include/Library/PlatformBdsLib.h" declares the
following interfaces:

- PlatformBdsInit
- PlatformBdsPolicyBehavior
- PlatformBdsBootFail
- PlatformBdsBootSuccess
- PlatformBdsLockNonUpdatableFlash
- LockKeyboards

From these, we've been using PlatformBdsInit() and
PlatformBdsPolicyBehavior().

"MdeModulePkg/Include/Library/PlatformBootManagerLib.h" declares the three
interfaces below:

- PlatformBootManagerBeforeConsole
- PlatformBootManagerAfterConsole
- PlatformBootManagerWaitCallback

Comparing the BdsEntry() functions between
- "IntelFrameworkModulePkg/Universal/BdsDxe/BdsEntry.c" and
- "MdeModulePkg/Universal/BdsDxe/BdsEntry.c",
we can establish the following mapping:

IntelFrameworkModulePkg              MdeModulePkg
  BdsEntry()                           BdsEntry()
    PlatformBdsInit()   <--------------> PlatformBootManagerBeforeConsole()
    dispatch Driver#### <--------------> dispatch Driver####
                                         connect consoles
    PlatformBdsPolicyBehavior() <------> PlatformBootManagerAfterConsole()

The difference in connecting the consoles will be addressed in a later
patch, now we just rename the functions according to the mapping above,
and copy the call site comments from MdeModulePkg's BdsEntry().

For the third interface, PlatformBootManagerWaitCallback(), add an empty
implementation (and copy the comment from the library class header).
Platform BDS can use this callback to draw a progress bar, for example.

This patch parallels OvmfPkg commit a7566234e92c.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLib
Laszlo Ersek [Thu, 5 May 2016 13:12:09 +0000 (15:12 +0200)]
ArmVirtPkg: duplicate PlatformIntelBdsLib to PlatformBootManagerLib

Create a copy of PlatformIntelBdsLib under the name
PlatformBootManagerLib, with the following initial changes:
- replace PlatformBdsLib references with PlatformBootManagerLib in
  comments,
- replace "IntelBdsPlatform" with "PlatformBm" in file names and their
  references,
- generate a new FILE_GUID.

PlatformBootManagerLib will be linked into the BDS driver from
MdeModulePkg.

This patch parallels OvmfPkg commit 305418818959.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@Intel.com>
7 years agoShellBinPkg: Ia32/X64 Shell binary update.
Qiu Shumin [Fri, 6 May 2016 07:43:36 +0000 (15:43 +0800)]
ShellBinPkg: Ia32/X64 Shell binary update.

The binaries of ShellBinPkg are generated with ShellPkg project d454c18a315f109c52b78e8049a7231eb01f003c.
The binaries are built with no debug information by building with "RELEASE" target.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
7 years agoShellPkg: Remove debug message in release binaries.
Qiu Shumin [Thu, 5 May 2016 05:35:42 +0000 (13:35 +0800)]
ShellPkg: Remove debug message in release binaries.

Use BaseDebugLibNull instance instead of UefiDebugLibConOut to
remove the debug message in release Shell binaries.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoNetworkPkg: Ignore BootFileName if it is overloaded.
Fu Siyuan [Tue, 3 May 2016 05:29:52 +0000 (13:29 +0800)]
NetworkPkg: Ignore BootFileName if it is overloaded.

Make sure "File" field is not overloaded to carry other DHCP options before use
it in PXE driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoNetworkPkg: Ignore BootFileName if it is overloaded.
Fu Siyuan [Tue, 3 May 2016 05:29:23 +0000 (13:29 +0800)]
NetworkPkg: Ignore BootFileName if it is overloaded.

Make sure "File" field is not overloaded to carry other DHCP options before use
it in HTTP boot driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Wu Jiaxin <jiaxin.wu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
7 years agoMdeModulePkg: Ignore BootFileName if it is overloaded.
Heyi Guo [Sat, 23 Apr 2016 07:01:16 +0000 (15:01 +0800)]
MdeModulePkg: Ignore BootFileName if it is overloaded.

Make sure "BootFileName" is not overloaded before use it in PXE driver.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: chenzhihui <chenzhihui4@huawei.com>
Signed-off-by: Heyi Guo <heyi.guo@linaro.org>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
7 years agoNetworkPkg: Fix a memory leak in HTTP boot driver.
Fu Siyuan [Thu, 5 May 2016 02:15:47 +0000 (10:15 +0800)]
NetworkPkg: Fix a memory leak in HTTP boot driver.

We always need to call EfiBootManagerFreeLoadOption because the memory allocated
for NewOption (description and device path) is no longer needed.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Fu Siyuan <siyuan.fu@intel.com>
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
7 years agoMdeModulePkg/FileExplore: Make LibraryClass & Depex module type consistent
Dandan Bi [Thu, 5 May 2016 02:25:03 +0000 (10:25 +0800)]
MdeModulePkg/FileExplore: Make LibraryClass & Depex module type consistent

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg/HiiDatabaseDxe: Fix memory leak issues in HiiDatabaseDxe
Dandan Bi [Wed, 27 Apr 2016 10:00:02 +0000 (18:00 +0800)]
MdeModulePkg/HiiDatabaseDxe: Fix memory leak issues in HiiDatabaseDxe

Cc: Qiu Shumin <shumin.qiu@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Qiu Shumin <shumin.qiu@intel.com>
7 years agoMdeModulePkg/SetupBrowser: Call submit callback function when no failure
Dandan Bi [Tue, 26 Apr 2016 11:52:02 +0000 (19:52 +0800)]
MdeModulePkg/SetupBrowser: Call submit callback function when no failure

In current code will always call submit callback function,
but we should call submit callback function when has no failure
in the submit action. This patch to fix this issues.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoMdeModulePkg: Restore question base on the fail info when submit fail
Dandan Bi [Fri, 22 Apr 2016 05:51:04 +0000 (13:51 +0800)]
MdeModulePkg: Restore question base on the fail info when submit fail

When RouteConfig function fail in SubmitForForm or SubmitForFormSet
function, we should restore the question value base on the failure
information, should not restore all the question.
This patch to fix this issue.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools: Support \x####\ in UNI files to specify non-ascii characters
Yonghong Zhu [Tue, 3 May 2016 07:44:27 +0000 (15:44 +0800)]
BaseTools: Support \x####\ in UNI files to specify non-ascii characters

UNI spec updated to allow using \x####\ to specify non-ascii characters,
# is a hex digit.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoNetworkPkg/HttpBootDxe: Fix for the issue that the HTTP boot option can't be booted...
Sunny Wang [Thu, 5 May 2016 02:05:00 +0000 (10:05 +0800)]
NetworkPkg/HttpBootDxe: Fix for the issue that the HTTP boot option can't be booted more than once

This issue can be reproduced by the following steps:
1. Boot to HTTP boot option and the boot file is a ISO file like Ubuntu PE image.
2. Exit from boot option (GRUB) and then back to boot manager menu.
3. Boot to the same HTTP boot option again or a HTTP boot option pointing to the same HTTP ISO file. It will fail to boot.
Root cause:
When booting a HTTP boot option, the HTTP boot driver will save the Boot File's information in its private data as cache data for skipping the Boot file discovery from next time boot. However, the cache data doesn't include ImageType data, which would cause HTTP boot driver using the invalid ImageType (ImageTypeMax) and then fail to boot the cached boot file. In other words, for the second time boot, the HttpBootLoadFile() doesn't update ImageType (it returns a valid ImageType), which causes that the HttpBootDxeLoadFile() skips to Register a RAM Disk for downloaded HTTP ISO file and then BDS code can't find the RAM disk to boot.
Solution:
Save ImageType to private data for next time HTTP boot.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Sunny Wang <sunnywang@hpe.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>