Commit Graph
23574 Commits
Author SHA1 Message Date
Yonghong Zhu 04250372d9 BaseTools: Remove the duplicate Pcd items
The case is the Pcd item both used in 1 module inf and 1 lib inf, and
in the DSC component section, it override the Pcd value.
In the module, the pcd value is the override value, but in the lib inf
the pcd value is the value that in the DSC PCD section's value, then it
cause the Pcd value is different in the module and lib. but actually we
only need use the Pcd value in the module to decide whether it use the
same value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
(cherry picked from commit d900d7c985)
2018-07-18 12:50:29 +08:00
Kinney, Michael D 5c95470e51 BaseTools/BinToPcd: Follow PEP-8 indent of 4 spaces
https://www.python.org/dev/peps/pep-0008/

Cc: Yanyan Sun <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Yonghong Zhu <[email protected]>
(cherry picked from commit 0c805f4f8f)
2018-07-18 12:28:46 +08:00
Kinney, Michael D 103d8512b3 BaseTools/BinToPcd: Update for Python 3 compatibility
Update to be compatible with both Python 2.x and Python 3.x.
Also return error code 1 when an error is detected to support
use of this tool in scripts.

Cc: Yanyan Sun <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Yonghong Zhu <[email protected]>
(cherry picked from commit d0f946f30d)
2018-07-18 12:28:46 +08:00
Kinney, Michael D 99408693e5 BaseTools/BinToPcd: --offset must be 8-byte aligned
https://bugzilla.tianocore.org/show_bug.cgi?id=974
https://bugzilla.tianocore.org/show_bug.cgi?id=965

Update help to state that --offset must be 8-byte aligned.
Verify that --offset is 8-byte aligned and print an error
message if it is not 8-byte aligned.

Cc: Yanyan Sun <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Yonghong Zhu <[email protected]>
(cherry picked from commit 8e96580999)
2018-07-18 12:28:45 +08:00
Kinney, Michael D 9cc36e316b BaseTools/BinToPcd: Clarify error message for --type HII
https://bugzilla.tianocore.org/show_bug.cgi?id=963

Update error message for --type HII.  If either --variable-guid
or --variable-name is missing, then print an error message that
states that both --variable-guid and --variable-name are required.

Cc: Yanyan Sun <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Yonghong Zhu <[email protected]>
(cherry picked from commit b2e043b689)
2018-07-18 12:28:44 +08:00
Kinney, Michael D e3a2a231b5 BaseTools/BinToPcd: Fix typo in error messages
https://bugzilla.tianocore.org/show_bug.cgi?id=962

Change "PcdToBin" to "BinToPcd"

Cc: Yanyan Sun <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Yonghong Zhu <[email protected]>
(cherry picked from commit 1d79b72ee6)
2018-07-18 12:28:31 +08:00
Kinney, Michael D 6434e499e9 BaseTools/BinToPcd: Add support for multiple binary input files
https://bugzilla.tianocore.org/show_bug.cgi?id=890

There are use cases where a VOID * PCD needs to be generated from multiple
binary input files.  This can be in the form of an array of fixed size
elements or a set of variable sized elements.

Update BinToPcd to support multiple one or more -i INPUTFILE arguments.
By default, the contents of each binary input file are concatenated in
the order provided.  This supports generating a PCD that is an array of
fixed size elements

Add -x, --xdr flags to BinToPcd  to encodes the PCD using the
Variable-Length Opaque Data of RFC 4506 External Data Representation
Standard (XDR).

    https://tools.ietf.org/html/rfc4506
    https://tools.ietf.org/html/rfc4506#section-4.10

The data format from RFC 4506 meets the requirements for a PCD that is a
set of variable sized elements in the Variable-Length Opaque Data format.
The overhead of this format is a 32-bit length and 0 to 3 bytes of padding
to align the next element at a 32-bit boundary.

Cc: Sean Brogan <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Yonghong Zhu <[email protected]>
(cherry picked from commit aedd1559cc)
2018-07-18 12:28:13 +08:00
Star Zeng 9cb0eabbaf MdeModulePkg UsbBusPei: Fix wrong buffer length used to read hub desc
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=973

Bug 973 just mentions UsbBusDxe, but UsbBusPei has similar issue.

HUB descriptor has variable length.
But the code uses stack (HubDescriptor in PeiDoHubConfig) with fixed
length sizeof(EFI_USB_HUB_DESCRIPTOR) to hold HUB descriptor data.
It uses hard code length value (12) for SuperSpeed path.
And it uses HubDesc->Length for none SuperSpeed path, then there will
be stack overflow when HubDesc->Length is greater than
sizeof(EFI_USB_HUB_DESCRIPTOR).

The patch updates the code to use a big enough buffer to hold the
descriptor data.

Cc: Jiewen Yao <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Cc: Bret Barkelew <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 72750e3bf9)
2018-07-18 11:46:34 +08:00
Star Zeng 196dc149bc MdeModulePkg UsbBusDxe: Fix wrong buffer length used to read hub desc
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=973

HUB descriptor has variable length.
But the code uses stack (HubDesc in UsbHubInit) with fixed length
sizeof(EFI_USB_HUB_DESCRIPTOR) to hold HUB descriptor data.
It uses hard code length value (32 that is greater than
sizeof(EFI_USB_HUB_DESCRIPTOR)) for SuperSpeed path, then there will
be stack overflow when IOMMU is enabled because the Unmap operation
will copy the data from device buffer to host buffer.
And it uses HubDesc->Length for none SuperSpeed path, then there will
be stack overflow when HubDesc->Length is greater than
sizeof(EFI_USB_HUB_DESCRIPTOR).

The patch updates the code to use a big enough buffer to hold the
descriptor data.
The definition EFI_USB_SUPER_SPEED_HUB_DESCRIPTOR is wrong (HubDelay
field should be UINT16 type) and no code is using it, the patch
removes it.

Cc: Jiewen Yao <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Cc: Bret Barkelew <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit acebdf14c9)
2018-07-18 11:46:33 +08:00
Yonghong Zhu 3f6c3d4b55 BaseTools: Fix the bug to remove the extra guid info
self.Guids update with package Guids will generate multiply defined
GUID symbols in AutoGen file, it was introduced by 6877a0a9.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Yonghong Zhu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
2018-07-18 09:55:55 +08:00
Star Zeng 6a8e80a4e7 MdeModulePkg CapsuleApp: Fix typo EFI_CAPSULE_RPORT_GUID
Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 0c6f94dae5)
2018-07-13 10:34:24 +08:00
Star Zeng f6828eabec MdeModulePkg CapsuleApp: Refine -D option help information
Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 045bb32364)
2018-07-13 10:34:23 +08:00
Star Zeng d2e2520011 MdeModulePkg CapsuleApp: Check Arg count for -D option
Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Yonghong Zhu <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 1c6dd45b9b)
2018-07-13 10:34:22 +08:00
Star Zeng c73f36472d SignedCapsulePkg SystemFirmwareUpdate: Fix typo EFI_SECURITY_VIOLATIO
Fix typo EFI_SECURITY_VIOLATIO to EFI_SECURITY_VIOLATION.

Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit c8dca871df)
2018-07-13 09:58:03 +08:00
Star Zeng 6a780e35b1 IntelSiliconPkg MicrocodeUpdate: Fix typo EFI_SECURITY_VIOLATIO
Fix typo EFI_SECURITY_VIOLATIO to EFI_SECURITY_VIOLATION.

Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 1779cf40c0)
2018-07-13 09:58:02 +08:00
Star Zeng 3103511f16 MdePkg FirmwareManagement.h: Fix typo EFI_SECURITY_VIOLATIO
Fix typo EFI_SECURITY_VIOLATIO to EFI_SECURITY_VIOLATION.

Cc: Jiewen Yao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 58fe27722d)
2018-07-13 09:58:01 +08:00
Ard Biesheuvel 3d7ec26873 MdeModulePkg/DxeCapsuleLibFmp: pass progress callback only if it works
If the first call to UpdateImageProgress() fails, there is no point
in passing a pointer to it to Fmp->SetImage(), since it is highly
unlikely to succeed on any subsequent calls.

This permits the FMP implementation to fall back to an alternate means
of providing feedback to the user, e.g., via the console.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit 1342bd4486)
2018-07-13 09:48:15 +08:00
Star Zeng 6e4c19ae34 SignedCapsulePkg SystemFirmwareUpdateDxe: Fix failure caused by d69d922
d69d9227d0 caused system firmware update
failure. It is because FindMatchingFmpHandles() is expected to return
handles matched, but the function returns all handles found.

This patch is to fix the issue.
This patch also assigns mSystemFmpPrivate->Handle for "case 1:" path
in case the Handle is needed by other place in future.

Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
(cherry picked from commit 665bfd41ac)
2018-07-13 09:47:36 +08:00
Kinney, Michael D eba8906472 SignedCapsulePkg/SystemFirmwareReportDxe: Pass thru on same handle
https://bugzilla.tianocore.org/show_bug.cgi?id=928

Use HandleProtocol() to pass thru a SetImage() call to the
System FMP Protocol that must be on the same handle as the
FMP Protocol.

Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 153f5c7a93)
2018-07-13 09:47:34 +08:00
Kinney, Michael D 879b86ccc6 SignedCapsulePkg/SystemFirmwareUpdateDxe: Single FMP
https://bugzilla.tianocore.org/show_bug.cgi?id=928

Uninstall all System FMP Protocols for the current FW device.

If an FMP Protocol for the current FW device is already present,
then install the new System FMP protocol onto the same handle as
the FMP Protocol.  Otherwise, install the FMP protocol onto a
new handle.

This supports use cases where multiple capsules for the
same system firmware device are processed on the same
boot of the platform.  It guarantees there is at most one
FMP protocol for each system firmware device.

Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit d69d9227d0)
2018-07-13 09:47:32 +08:00
Star Zeng eec70f57f4 MdeModulePkg CapsuleApp: Fix NestedCapsuleHeader->Flags assigned wrong
(FwType == ESRT_FW_TYPE_DEVICEFIRMWARE) ? system : device
should be
(FwType == ESRT_FW_TYPE_SYSTEMFIRMWARE) ? system : device

Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Ming Shao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 99fd30431d)
2018-07-11 15:32:35 +08:00
Star Zeng 925edf6e42 SignedCapsulePkg RecoveryModuleLoadPei: Fix typo 'Press' to 'Process'
Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Ming Shao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 70bd2a85e9)
2018-07-11 15:32:34 +08:00
Star Zeng cfc2c2415b MdeModulePkg DxeCapsuleLibFmp: Fix typo 'Press' to 'Process'
Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Ming Shao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit a891bd7337)
2018-07-11 15:32:33 +08:00
Michael D Kinney a8df5eabb0 OvmfPkg: Add SafeIntLib and BmpSupportLib to DSC files
https://bugzilla.tianocore.org/show_bug.cgi?id=800

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

The BootGraphicsResourceTableDxe module uses the BmpSupportLib
and SafeIntLib to convert a GOP BLT buffer to a BMP graphics image.
Add library mappings for these new library classes.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Jordan Justen <[email protected]>
Cc: Laszlo Ersek <[email protected]>
Cc: Ard Biesheuvel <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 7fc21c29e8)
2018-07-11 14:30:23 +08:00
Yonghong Zhu 11a7424591 BaseTools: Fix the bug that incorrect size info in the Lib autogen
The case is a PCD used in one library only, and in DSC component
section the PCD value is override in one of module inf. Then it cause
the bug the PCD size in the Lib autogen use the PCD value in the DSC
PCD section, but not use the override value.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
(cherry picked from commit 9edba51f93)
2018-07-10 16:37:51 +08:00
Star Zeng a84e7870ae MdeModulePkg DxeCapsuleLibFmp: Fix wrong Index is used
DEBUG((
  DEBUG_ERROR,
  "ItemOffsetList[%d](0x%lx) < ItemOffsetList[%d](0x%x)\n",
  Index,
  ItemOffsetList[Index],
  Index,                       // Should be Index - 1
  ItemOffsetList[Index - 1]
  ));

Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 0f3cd8a92b)
2018-07-09 13:38:58 +08:00
Star Zeng de45e66b34 IntelFrameworkPkg FrameworkUefiLib: Fix in EfiLocateProtocolBuffer()
Free HandleBuffer for error path in EfiLocateProtocolBuffer().

Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
(cherry picked from commit 76022b02e8)
2018-07-09 13:34:24 +08:00
Star Zeng eb314ac46a MdePkg UefiLib: Fix in EfiLocateProtocolBuffer()
Free HandleBuffer for error path in EfiLocateProtocolBuffer().

Cc: Michael D Kinney <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
(cherry picked from commit fe507283af)
2018-07-09 13:34:23 +08:00
Kinney, Michael D 6a424a8a46 IntelFrameworkPkg/FrameworkUefiLib: Sync with MdePkg/UefiLib
Add functions that have been added to MdePkg/UefiLib.

* GetVariable2()
* GetEfiGlobalVariable2

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 7aaa7e67c4)
2018-07-09 13:34:23 +08:00
Kinney, Michael D edeffc4e32 IntelFrameworkPkg/FrameworkUefiLib: Add EfiLocateProtocolBuffer()
https://bugzilla.tianocore.org/show_bug.cgi?id=838

Add new API to the UefiLib that locates and returns
an array of protocols instances that match a given
protocol.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 3499b150d1)
2018-07-09 13:34:22 +08:00
Michael D Kinney 88380b6ab5 MdePkg/UefiLib: Add EfiLocateProtocolBuffer()
https://bugzilla.tianocore.org/show_bug.cgi?id=838

Add new API to the UefiLib that locates and returns
an array of protocols instances that match a given
protocol.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Liming Gao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 40070a186a)
2018-07-09 13:27:55 +08:00
Ruiyu Ni 56bda6da0b MdeModulePkg/BmpSupportLib: Check PixelHeight/PixelWidth against 0
The patch adds check logic to make sure that for a input BMP file,
the width or height is not 0; for a input GOP blt buffer, the width
or height is not 0. Otherwise, UNSUPPORTED status is returned.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Cc: Michael D Kinney <[email protected]>
(cherry picked from commit 51fe5b5140)
2018-07-09 13:14:31 +08:00
Ruiyu Ni 0c3ac72a88 MdeModulePkg/BmpSupportLib: Correct debug message
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ruiyu Ni <[email protected]>
Cc: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit 2a9e1b97c9)
2018-07-09 13:14:30 +08:00
Dandan Bi d75055f0f8 SignedCapsulePkg/SystemFirmwareUpdateDxe: Fix ECC issues
Make function comments align with functions.

Cc: Star Zeng <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Jiewen Yao <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit 2e1083038d)
2018-07-09 13:05:08 +08:00
Kinney, Michael D e54a849c28 SignedCapsulePkg/SystemFirmwareUpdateDxe: Use progress API
https://bugzilla.tianocore.org/show_bug.cgi?id=801

Use PlatformFlashWriteWithProgress() instead of PlatformFLashWrite()
so the user can be informed of the progress as a capsule is used
to update a firmware image in a firmware device.

Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Tested-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit eb59431346)
2018-07-09 13:05:07 +08:00
Michael D Kinney a3062a0153 SignedCapsulePkg/PlatformFlashAccessLib: Add progress API
https://bugzilla.tianocore.org/show_bug.cgi?id=801

Add a new API to the PlatformFlashAccessLib that passes
in an optional Progress() function along with a start and
end percentage to call the Progress() function with.
If the Progress() function is not NULL, then it is the
Progress() function that was passed into the Firmware
Management Protocol SetImage() services and is used
to update the user on the progress as a firmware device
is updated with a firmware image.

Implementations of the PlatformFlashAccessLib are
recommended to call the Progress() function as work
is performed to update to contents of a firmware
storage device.

Cc: Jiewen Yao <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 550de36633)
2018-07-09 13:05:06 +08:00
Kinney, Michael D 6ef1723114 MdeModulePkg/DxeCapsuleLibFmp: Add progress bar support
https://bugzilla.tianocore.org/show_bug.cgi?id=801

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

* Change Update_Image_Progress() to UpdateImageProcess()
* Call DisplayUpdateProgressLib from UpdateImageProgress().
* Split out a boot service and runtime version of
  UpdateImageProgress() so the DisplayUpdateProgressLib is
  not used at runtime.
* If gEdkiiFirmwareManagementProgressProtocolGuid is present,
  then use its progress bar color and watchdog timer value.
* If gEdkiiFirmwareManagementProgressProtocolGuid is not present,
  then use default progress bar color and 5 min watchdog timer.
* Remove Print() calls during capsule processing.  Instead,
  the DisplayUpdateProgressLib is used to inform the user
  of progress during a capsule update.

Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Sean Brogan <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Tested-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit 5747610657)
2018-07-09 13:05:06 +08:00
Dandan Bi d8ea9f1d74 MdeModulePkg/DisplayUpdateProgressLib: Fix ECC issues
Make the comment align with Edk2 coding style.

Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit ec50f7535b)
2018-07-09 13:05:04 +08:00
Michael D Kinney ea1572dc81 MdeModulePkg: Add DisplayUpdateProgressLib instances
https://bugzilla.tianocore.org/show_bug.cgi?id=801

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

Add DisplayUpdateProgressLib instances for text consoles
and graphical consoles.

Cc: Sean Brogan <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 72b0a9bed9)
2018-07-09 12:57:40 +08:00
Michael D Kinney c3c7f199d9 MdeModulePkg: Add DisplayUpdateProgressLib class
https://bugzilla.tianocore.org/show_bug.cgi?id=801

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

Add the DisplayUpdateProgressLib class that is used
to inform the user of progress during updates of
firmware images in firmware devices.  A platform
specific instance of this library can be used to
customize how the user is informed of progress.

Add the EDK II Firmware Management Progress Protocol.
This is an optional protocol that must be installed
onto the same handle as a Firmware Management Protocol.
This new protocol provides the color of a progress
bar that allows different firmware devices to use
different colors during a firmware update.  It also
provides a watchdog timer value in seconds that is
armed each time the Progress() service passed
into Firmware Management Protocol SetImage()
is called.

Cc: Sean Brogan <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Signed-off-by: Michael D Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
(cherry picked from commit 825d138f83)
2018-07-09 12:57:39 +08:00
Star Zeng 278bf86247 MdeModulePkg EsrtFmpDxe: Use EfiBootServicesData for ESRT table
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=933

We see UEFI spec is saying to use EfiBootServicesData for ESRT table.

UEFI 2.7 chapter 23.3:
The ESRT shall be stored in memory of type EfiBootServicesData.

And we see EsrtDxe is using AllocatePool for ESRT table, but
EsrtFmpDxe is using AllocateRuntimeZeroPool for ESRT table.

This patch updates code to use EfiBootServicesData for ESRT table
in EsrtFmpDxe.

Change-Id: I72a73e0cc0a37e429cc262d68eb284fb268cb5ef
Cc: Jiewen Yao <[email protected]>
Cc: Michael D Kinney <[email protected]>
Cc: Sean Brogan <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Star Zeng <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Michael D Kinney <[email protected]>
(cherry picked from commit 3545488dd6)
2018-07-09 10:52:27 +08:00
Dandan Bi 05d48dace8 MdeModulePkg: Fix coding style issues in file/function comments
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit ae38c9765a)
2018-07-09 10:51:34 +08:00
Hao Wu 63bcec2f01 MdeModulePkg/BmpSupportLib: Refine type cast for pointer subtraction
Since the pointer subtraction here is not performed by pointers to
elements of the same array object. This might lead to potential issues,
such behavior is undefined according to C11 standard.

Refine the pointer subtraction expressions by casting each pointer to
UINTN first and then perform the subtraction.

Cc: Michael D Kinney <[email protected]>
Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Hao Wu <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
(cherry picked from commit 99576ee3fd)
2018-07-09 10:43:54 +08:00
Michael D Kinney 15598bda80 MdeModulePkg/EsrtFmpDxe: Add EsrtFmpDxe module
https://bugzilla.tianocore.org/show_bug.cgi?id=802

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport

The EsrtFmpDxe module is a lightweight version of the EsrtDxe
module that produces ESRT entries based only on FMP Protocol
instances.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 4184aabda2)
2018-07-09 10:43:34 +08:00
Michael D Kinney 8e03d30f96 MdeModulePkg/BootGraphicsResourceDxe: Add Boot Logo 2 Protocol
https://bugzilla.tianocore.org/show_bug.cgi?id=799

Based on content from the following branch/commit:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d

Update BootGraphicsResourceDxe to produce both the Boot Logo
Protocol and the Boot Logo 2 Protocol.

The Boot Logo 2 Protocol service GetBootLogo() is amended
to return the pointer to the GOP BLT buffer previously
registered with the SetBootLogo() service.

Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Sean Brogan <[email protected]>
(cherry picked from commit 7777360637)
2018-07-06 19:27:46 +08:00
Kinney, Michael D 712567006d MdeModulePkg: Add Boot Logo 2 Protocol
https://bugzilla.tianocore.org/show_bug.cgi?id=799

Based on content from the following branch/commit:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d

Add new Boot Logo 2 Protocol that adds a GetBootLogo()
service that can be used to retrieve the GOP BLT buffer,
location, and size of the boot logo that was previously
registered with the SetBootLogo() service.

The Boot Logo 2 Protocol service GetBootLogo() is amended
to return the pointer to the GOP BLT buffer previously
registered with the SetBootLogo() service.

Cc: Sean Brogan <[email protected]>
Cc: Bret Barkelew <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Sean Brogan <[email protected]>
(cherry picked from commit b7c7ec8c17)
2018-07-06 19:27:45 +08:00
Michael D Kinney ea5eab38ee MdeModulePkg/DxeCapsuleLibFmp: Use BmpSupportLib
https://bugzilla.tianocore.org/show_bug.cgi?id=800

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Use BmpSupportLib to convert a BMP graphics image to a
GOP BLT buffer.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 1ec2e7d0e8)
2018-07-06 19:27:44 +08:00
Michael D Kinney f7eff55288 MdeModulePkg/BootGraphicsResourceTableDxe: Use BmpSupportLib
https://bugzilla.tianocore.org/show_bug.cgi?id=800

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Use BmpSupportLib to convert a GOP BLT Buffer to the BMP graphics
image that is published in an ACPI BGRT table.

* Remove use of IndustryStandard/Bmp.h include file
* Remove mBmpImageHeaderTemplate.  This is handled by BmpSupportLib
* Clean up code style with function prototypes at top
  and all module global variables together
* Update SetBootLogo() to use SafeIntLib to check input parameters
  for overflows.
* Remove internal function BgrtAcpiTableChecksum().  Use
  CalculateCheckSum8() directly from BgrtReadyToBootEventNotify()
* Remove InstallBootGraphicsResourceTable().  Move all the code into
  BgrtReadyToBootEventNotify() that is signaled at ready to boot.
* Remove all logic that converts a GOP BLT buffer to a BMP graphics image
  and use BmpSupportLib function TranslateGopBltToBmp() instead.
* Use AllocatePool() instead of AllocatePages() to allocate copy of
  BMP image that is provided by BGRT.  This is required to be compatible
  with BmpSupportLib function TranslateGopBltToBmp() that uses
  AllocatePool().
* Zero OemId in BGRT header before filling in value from PCD.
* Get size of PcdAcpiDefaultOemId and only copy the the size of the PCD
  if it is smaller than the size of the OemId field in the BGRT header.
* Use WriteUnaligned24() instead of CopyMem() for the OemTableId field
  of the BGRT header.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 53be772103)
2018-07-06 19:27:43 +08:00
Kinney, Michael D 9a54b42353 MdeModulePkg: Add BmpSupportLib class and instance
https://bugzilla.tianocore.org/show_bug.cgi?id=800

Based on content from the following branch/commits:
https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport
https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d
https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61
https://github.com/Microsoft/MS_UEFI/commit/2b9f111f2e74a4c2ef4c4e32379e111f016dbd9b

Add BmpSupportLib class and instances that provides services to
convert a BMP graphics image to a GOP BLT buffer and to convert
a GOP BLT buffer to a BMP graphics image.

Cc: Sean Brogan <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Eric Dong <[email protected]>
Cc: Ruiyu Ni <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Michael D Kinney <[email protected]>
Reviewed-by: Star Zeng <[email protected]>
Reviewed-by: Bret Barkelew <[email protected]>
(cherry picked from commit 4123d6da70)
2018-07-06 19:27:42 +08:00
Dandan Bi 7448d1a220 MdePkg/BaseSafeIntLib: Fix VS2015 IA32 NOOPT build failure
v2: Add [LibraryClasses] section in INF file and refine coding style.

There are VS2015 NOOPT IA32 build failure like below in BaseSafeIntLib.
XXX.lib(XXX.obj): error LNK2001: unresolved external symbol __allmul
XXX.lib(XXX.obj): error LNK2001: unresolved external symbol __allshl
XXX.lib(XXX.obj): error LNK2001: unresolved external symbol __aullshr

This patch replaces direct shift/multiplication of 64-bit integer
with related function call to fix these failure.

Cc: Laszlo Ersek <[email protected]>
Cc: Liming Gao <[email protected]>
Cc: Michael Kinney <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Dandan Bi <[email protected]>
Reviewed-by: Liming Gao <[email protected]>
Reviewed-by: Laszlo Ersek <[email protected]>
(cherry picked from commit dc9b2a5740)
2018-07-06 17:26:17 +08:00