]> git.proxmox.com Git - mirror_edk2.git/log
mirror_edk2.git
7 years agoBaseTools tools_def.txt: Include AutoGen.h in GCC ASLPP_FLAGS
Liming Gao [Mon, 14 Nov 2016 06:37:26 +0000 (14:37 +0800)]
BaseTools tools_def.txt: Include AutoGen.h in GCC ASLPP_FLAGS

https://bugzilla.tianocore.org/show_bug.cgi?id=227
Refer to VS ASLPP_FLAGS, force include AutoGen.h so that ASL code
can use FixedPcdGetXX to get FixedPcd value.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoBaseTools tools_def.txt: Remove -P option in GCC ASLPP_FLAGS
Liming Gao [Mon, 14 Nov 2016 06:37:25 +0000 (14:37 +0800)]
BaseTools tools_def.txt: Remove -P option in GCC ASLPP_FLAGS

https://bugzilla.tianocore.org/show_bug.cgi?id=227

After -P option is removed, the generated preprocessed ASL file will have
line markers. The extra information can be removed by Trim script. ASL code
can refer to the definition in C source file. This has been supported in
VS and XCODE tool chains.

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoArmPkg/Library/ArmDmaLib: Deallocate Map buffer in case of error
Daniil Egranov [Tue, 15 Nov 2016 13:24:40 +0000 (13:24 +0000)]
ArmPkg/Library/ArmDmaLib: Deallocate Map buffer in case of error

The patch is fixing memory leak in case of errors.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Daniil Egranov <daniil.egranov@arm.com>
Tested-by; Ryan Harkin <ryan.harkin@linaro.org>

Style fixes: use goto for error handling, whitespace fixes

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
7 years agoSecurityPkg: Fix typos in comments
Zhang, Chao B [Tue, 15 Nov 2016 08:20:08 +0000 (16:20 +0800)]
SecurityPkg: Fix typos in comments

This patch fixes the following typos:

- intialized -> initialized
- TURE -> TRUE
- successull -> successfully
- hanlder -> handler
- funciton -> function
- Seperator -> Separator
- Sumbit -> Submit

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoSecurityPkg: Fix typos in comments
Zhang, Chao B [Tue, 15 Nov 2016 07:39:26 +0000 (15:39 +0800)]
SecurityPkg: Fix typos in comments

This patch fixes the following typos:
- intialized -> initialized
- TURE -> TRUE
- successull -> successfully
- hanlder -> handler
- funciton -> function
- Seperator -> Separator
- Sumbit -> Submit
Also convert EFI_D_ERROR to DEBUG_ERROR for some debug messages.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
7 years agoMdeModulePkg/CapsuleApp: remove unused definition.
Jiewen Yao [Fri, 11 Nov 2016 08:57:48 +0000 (16:57 +0800)]
MdeModulePkg/CapsuleApp: remove unused definition.

remove EFI_CAPSULE_FROM_FILE_DIR
remove EFI_OS_INDICATIONS_FILE_CAPSULE_DELIVERY_SUPPORTED.
no one uses them.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
7 years agoShellPkg: Fix typos in comments and variables
Gary Lin [Wed, 19 Oct 2016 07:01:35 +0000 (15:01 +0800)]
ShellPkg: Fix typos in comments and variables

- funciton -> function
- paramter -> parameter
- supresses -> suppresses
- Seperator -> Separator
- permenant -> permanent

Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoOptionRomPkg: Fix typos in comments
Gary Lin [Wed, 19 Oct 2016 07:01:30 +0000 (15:01 +0800)]
OptionRomPkg: Fix typos in comments

- stoping -> stopping
- Sumbit -> Submit
- pionter -> pointer

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoNt32Pkg: Fix typos in comments and variables
Gary Lin [Wed, 19 Oct 2016 07:01:29 +0000 (15:01 +0800)]
Nt32Pkg: Fix typos in comments and variables

- discontiguous -> discontinuous
- reloaced -> relocated
- supresses -> suppresses
- debuging -> debugging
- suported -> supported
- availble -> available
- environmemt -> environment
- Seperator -> Separator
- remmeber -> remember
- interperted -> interpreted
- the a new -> the new
- initailized -> initialized
- attribue -> attribute
- boundry -> boundary
- nto -> not
- permenent -> permanent
- immediatly -> immediately
- excuted -> executed

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoDuetPkg: Fix typos in comments
Gary Lin [Wed, 19 Oct 2016 07:01:11 +0000 (15:01 +0800)]
DuetPkg: Fix typos in comments

- TURE -> TRUE
- successull -> successfully
- Libary -> Library
- Incude -> Include
- futhure -> future
- Predfined -> Predefined
- minimue -> minimum
- predeined -> predefined
- excute -> execute
- dirver -> driver
- hanlde -> handle
- boundry -> boundary

Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
7 years agoBaseTools: FILE DATA to support relative path under Multiple workspace
Yonghong Zhu [Mon, 14 Nov 2016 09:41:11 +0000 (17:41 +0800)]
BaseTools: FILE DATA to support relative path under Multiple workspace

Fix the bug that FILE DATA to support relative path under Multiple
workspace.

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 agoBaseTools: Fix the bug to support generate FFS by Align=Auto
Yonghong Zhu [Wed, 9 Nov 2016 10:18:01 +0000 (18:18 +0800)]
BaseTools: Fix the bug to support generate FFS by Align=Auto

FDF spec support to use 'Auto' as <FfsAlignmentValues>, but current Tool
report error about -a=Auto is invalid option when we set Align=Auto for
RAW File.

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 agoUefiCpuPkg/PiSmmCpuDxeSmm: Decrease mNumberToFinish in AP safe code
Jeff Fan [Fri, 11 Nov 2016 05:25:51 +0000 (13:25 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Decrease mNumberToFinish in AP safe code

We will put APs into hlt-loop in safe code. But we decrease mNumberToFinish
before APs enter into the safe code. Paolo pointed out this gap.

This patch is to move mNumberToFinish decreasing to the safe code. It could
make sure BSP could wait for all APs are running in safe code.

https://bugzilla.tianocore.org/show_bug.cgi?id=216

Reported-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Place AP to 32bit protected mode on S3 path
Jeff Fan [Fri, 11 Nov 2016 05:11:22 +0000 (13:11 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Place AP to 32bit protected mode on S3 path

On S3 path, we may transfer to long mode (if DXE is long mode) to restore CPU
contexts with CR3 = SmmS3Cr3 (in SMM). AP will execute hlt-loop after CPU
contexts restoration. Once one NMI or SMI happens, APs may exit from hlt state
and execute the instruction after HLT instruction. If APs are running on long
mode, page table is required to fetch the instruction. However, CR3 pointer to
page table in SMM. APs will crash.

This fix is to disable long mode on APs and transfer to 32bit protected mode to
execute hlt-loop. Then CR3 and page table will no longer be required.

https://bugzilla.tianocore.org/show_bug.cgi?id=216

Reported-by: Laszlo Ersek <lersek@redhat.com>
Analyzed-by: Paolo Bonzini <pbonzini@redhat.com>
Analyzed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoUefiCpuPkg/PiSmmCpuDxeSmm: Put AP into safe hlt-loop code on S3 path
Jeff Fan [Thu, 10 Nov 2016 05:40:12 +0000 (13:40 +0800)]
UefiCpuPkg/PiSmmCpuDxeSmm: Put AP into safe hlt-loop code on S3 path

On S3 path, we will wake up APs to restore CPU context in PiSmmCpuDxeSmm
driver. However, we place AP in hlt-loop under 1MB space borrowed after CPU
restoring CPU contexts.
In case, one NMI or SMI happens, APs may exit from hlt state and execute the
instruction after HLT instruction. But the code under 1MB is no longer safe at
that time.

This fix is to allocate one ACPI NVS range to place the AP hlt-loop code. When
CPU finished restoration CPU contexts, AP will execute in this ACPI NVS range.

https://bugzilla.tianocore.org/show_bug.cgi?id=216

v2:
  1. Make stack alignment per Laszlo's comment.
  2. Trim whitespace at end of end.
  3. Update year mark in file header.

Reported-by: Laszlo Ersek <lersek@redhat.com>
Analyzed-by: Paolo Bonzini <pbonzini@redhat.com>
Analyzed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
7 years agoMdeModulePkg/BMMUI: add comments for function parameter
Dandan Bi [Tue, 1 Nov 2016 02:25:19 +0000 (10:25 +0800)]
MdeModulePkg/BMMUI: add comments for function parameter

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 agoIntelSiliconPkg: Add PCD for Graphics VBT FFS GUID
Giri P Mudusuru [Tue, 8 Nov 2016 21:43:38 +0000 (13:43 -0800)]
IntelSiliconPkg: Add PCD for Graphics VBT FFS GUID

Added PCD PcdIntelGraphicsVbtFileGuid to store raw format
Graphics Video BIOS Table (VBT) in FFS.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoBaseTools/Scripts: Add BinToPcd utility
Michael Kinney [Tue, 8 Nov 2016 22:25:30 +0000 (14:25 -0800)]
BaseTools/Scripts: Add BinToPcd utility

https://bugzilla.tianocore.org/show_bug.cgi?id=228

Add a utility that converts a binary file into a VOID* PCD value
or a full DSC file VOID* PCD statement with support for all the
DSC supported PCD sections.

usage: BinToPcd [-h] [--version] -i INPUTFILE [-o OUTPUTFILE] [-p PCDNAME]
                [-t {VPD,HII}] [-m MAXSIZE] [-f OFFSET] [-n VARIABLENAME]
                [-g VARIABLEGUID] [-v] [-q] [--debug [0-9]]

Convert a binary file to a VOID* PCD value or DSC file VOID* PCD statement.
Copyright (c) 2016, Intel Corporation. All rights reserved.

optional arguments:
  -h, --help        show this help message and exit
  --version         show program's version number and exit
  -i INPUTFILE, --input INPUTFILE
                    Input binary filename
  -o OUTPUTFILE, --output OUTPUTFILE
                    Output filename for PCD value or PCD statement
  -p PCDNAME, --pcd PCDNAME
                    Name of the PCD in the form
                    <PcdTokenSpaceGuidCName>.<PcdCName>
  -t {VPD,HII}, --type {VPD,HII}
                    PCD statement type (HII or VPD). Default is standard.
  -m MAXSIZE, --max-size MAXSIZE
                    Maximum size of the PCD. Ignored with --type HII.
  -f OFFSET, --offset OFFSET
                    VPD offset if --type is VPD. UEFI Variable offset if
                    --type is HII.
  -n VARIABLENAME, --variable-name VARIABLENAME
                    UEFI variable name. Only used with --type HII.
  -g VARIABLEGUID, --variable-guid VARIABLEGUID
                    UEFI variable GUID C name. Only used with --type HII.
  -v, --verbose     Increase output messages
  -q, --quiet       Reduce output messages
  --debug [0-9]     Set debug level

This utility can be used in PCD value mode to convert a binary
file into a string that can then be copied into the PCD value field
of a VOID* PCD.  The following is an example of PCD value mode on
an 8 byte test.bin file.

  BinToPcd.py -i test.bin

  {0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

The DSC file VOID* PCD statement mode can be used to generate a
complete PCD statement for the PCD section types that a DSC file
supports:

  [PcdsFixedAtBuild]
  [PcdsPatchableInModule]
  [PcdsDynamicDefault]
  [PcdsDynamicExDefault]
  [PcdsDynamicVpd]
  [PcdsDynamicExVpd]
  [PcdsDynamicHii]
  [PcdsDynamicExHii]

The PCD statement mode is useful when combined with a !include
statement in a DSC file.  BinToPcd.py can be used to convert a
binary file to a PCD statement in an output file, and that output
file can be included into a DSC file in the matching PCD section
to set the value of the PCD to the value from the binary file
without having to copy the value into the DSC file.  Updates can be
made to the included file without editing the DSC file.  Some
example use cases are the setting the public key PCDs such as:

  gEfiSecurityPkgTokenSpaceGuid.PcdRsa2048Sha256PublicKeyBuffer
  gEfiSecurityPkgTokenSpaceGuid.PcdPkcs7CertBuffer

The following example converts a public key binary file to a
[PcdsFixedAtBuild] compatible PCD statement:

  BinToPcd.py -i PublicKey.bin -o PublicKey.pcd
    --pcd gEfiSecurityPkgTokenSpaceGuid.PcdPkcs7CertBufferkenSpaceGuid

The PublicKey.pcd output file contains a single line:

  gEfiSecurityPkgTokenSpaceGuid.PcdPkcs7CertBuffer|{0x48, ...}

A DSC file can be updated to include the PublicKey.pcd file:

  [PcdsFixedAtBuild]
  !include PublicKey.pcd

Value examples
===============
  BinToPcd.py -i test.bin
    {0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

Normal examples:
=================
  BinToPcd.py -i test.bin -p Guid.Token
    Guid.Token|{0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

  BinToPcd.py -i test.bin -p Guid.Token -m 20
    Guid.Token|{0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}|VOID*|20

VPD examples:
=============
  BinToPcd.py -i test.bin -p Guid.Token -t VPD
    Guid.Name|*|8|{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

  BinToPcd.py -i test.bin -p Guid.Token -t VPD -f 20
    Guid.Name|20|8|{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

  BinToPcd.py -i test.bin -p Guid.Token -t VPD -m 10
    Guid.Name|*|10|{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

  BinToPcd.py -i test.bin -p Guid.Token -t VPD -f 20 -m 10
    Guid.Name|20|10|{0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x0d, 0x0a}

HII examples:
=============
  BinToPcd.py -i test.bin -p Guid.Token -t HII -g VarGuid -n VarName
    Guid.Name|L"VarName"|VarGuid|0|{0x48, 0x65, 0x6c, 0x6c}

  BinToPcd.py -i test.bin -p Guid.Token -t HII -g VarGuid -n VarName -f 8
    Guid.Name|L"VarName"|VarGuid|8|{0x48, 0x65, 0x6c, 0x6c}

Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Michael Kinney <michael.d.kinney@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
7 years agoEmbeddedPkg: MmcDxe: add SPEC_VERS field in CSD structure
Haojian Zhuang [Sun, 13 Nov 2016 06:47:53 +0000 (14:47 +0800)]
EmbeddedPkg: MmcDxe: add SPEC_VERS field in CSD structure

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoEmbeddedPkg: MmcDxe: declare ECSD structure
Haojian Zhuang [Sun, 13 Nov 2016 06:47:52 +0000 (14:47 +0800)]
EmbeddedPkg: MmcDxe: declare ECSD structure

Declare fields in ECSD structure. And drop the original 128 words
arrary.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoEmbeddedPkg: MmcDxe: move ECSD into CardInfo structure
Haojian Zhuang [Sun, 13 Nov 2016 06:47:51 +0000 (14:47 +0800)]
EmbeddedPkg: MmcDxe: move ECSD into CardInfo structure

Since ECSD also describes the information of card, move it into
structure CardInfo.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoEmbeddedPkg: MmcDxe: wait OCR busy bit free
Haojian Zhuang [Sun, 13 Nov 2016 06:47:50 +0000 (14:47 +0800)]
EmbeddedPkg: MmcDxe: wait OCR busy bit free

According to eMMC spec, OCR.PowerUp bit is also busy bit. If the busy
bit is '0', CMD1 should be sent and OCR should be fetched again. And add
a timeout counter on the repeated steps.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Haojian Zhuang <haojian.zhuang@linaro.org>
Tested-by: Ryan Harkin <ryan.harkin@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
7 years agoDuetPkg: Add POSTBUILD in DSC files to run post-build automatically
Hao Wu [Fri, 11 Nov 2016 08:21:35 +0000 (16:21 +0800)]
DuetPkg: Add POSTBUILD in DSC files to run post-build automatically

https://bugzilla.tianocore.org/show_bug.cgi?id=220

Currently, the post-build scripts PostBuild.bat/PostBuild.sh in DuetPkg
need to be run manually. Especially for Windows batch script, it also
requires users to set the build options (like tool chain, target and arch)
in file Conf/target.txt. If users using command line options via '-t' or
'-a', the post-build script won't work properly.

The package DSC files now support the feature to execute post-build script
automatically by adding a 'POSTBUILD' definition. This feature also passes
the build options into the post-build script as parameters. This commit
uses this feature to make the post-build works for DuetPkg more
user-friendly. Also, ReadMe.txt is updated to reflect the new steps for
UEFI Emulation (DUET) development.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoDuetPkg: Use 'echo off' in BATCH script files
Hao Wu [Fri, 11 Nov 2016 08:15:52 +0000 (16:15 +0800)]
DuetPkg: Use 'echo off' in BATCH script files

Instead of putting a '@' at the beginning of every command in BATCH script
files, use 'echo off' at the beginning of each file.

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoDuetPkg: Resolve white-space issues for post-build scripts & ReadMe
Hao Wu [Fri, 11 Nov 2016 08:08:35 +0000 (16:08 +0800)]
DuetPkg: Resolve white-space issues for post-build scripts & ReadMe

Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoMdeModulePkg/UsbMass: Revert changes of removing retry logic
Feng Tian [Mon, 7 Nov 2016 07:46:16 +0000 (15:46 +0800)]
MdeModulePkg/UsbMass: Revert changes of removing retry logic

This patch is used to revert changes done in commit 17f3e942
bc527fbd75068d2d5752b6af54917487 - "MdeModulePkg/UsbMass: Not
retry if usb bot transfer execution fail"

It's because Usb Floppy will report DEVICE_ERROR for the first
several cmds when it need spin up. so retry logic makes sense.

Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
7 years agoIntelFsp2Pkg: Support to return error status from FSP API done
Thomaiyar, Richard Marian [Tue, 8 Nov 2016 09:45:25 +0000 (17:45 +0800)]
IntelFsp2Pkg: Support to return error status from FSP API done

Added FspMemoryInitDone2, FspTempRamExitDone2, FspSiliconInitDone2
to return error status to Boot Loader for FSP API calls.
To maintain backward compatibility existing functions
(FspMemoryInitDone, FspTempRamExitDone, FspSiliconInitDone)
declaration left untouched.

Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
7 years agoMdePkg: Fix spec mismatch in string representation of EMMC dev node
Feng Tian [Thu, 10 Nov 2016 05:16:14 +0000 (13:16 +0800)]
MdePkg: Fix spec mismatch in string representation of EMMC dev node

Cc: Eric Jin <eric.jin@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <feng.tian@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoUefiCpuPkg/DxeMpLib: Place APs to suitable state on Legacy OS boot
Jeff Fan [Fri, 11 Nov 2016 11:51:36 +0000 (19:51 +0800)]
UefiCpuPkg/DxeMpLib: Place APs to suitable state on Legacy OS boot

Currently, DxeMpLib only places APs into specified c-state in Exit Boot Service
callback function for UEFI OS boot. We need to put APs into specified c-state
for legacy OS boot also.

https://bugzilla.tianocore.org/show_bug.cgi?id=210

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/DxeMpLib: Rename MpInitExitBootServicesCallback()
Jeff Fan [Fri, 11 Nov 2016 11:48:09 +0000 (19:48 +0800)]
UefiCpuPkg/DxeMpLib: Rename MpInitExitBootServicesCallback()

Rename MpInitExitBootServicesCallback() to MpInitChangeApLoopCallback() because
it will not only be invoked on Exit Boot Service Event, but also will be invoked
on Legacy Ready To Boot Event.

https://bugzilla.tianocore.org/show_bug.cgi?id=210

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg/DxeMpLib: Allocate below 4GB mem for AsmRelocateApLoopFunc
Jeff Fan [Fri, 11 Nov 2016 08:56:44 +0000 (16:56 +0800)]
UefiCpuPkg/DxeMpLib: Allocate below 4GB mem for AsmRelocateApLoopFunc

Current implementation just allocates reserve memory for AsmRelocateApLoopFunc.
It not be safe because APs will be placed into 32bit protected mode on long mode
DXE. This reserve memory must be located below 4GB memory.

This fix is to allocate < 4GB memory for AsmRelocateApLoopFunc.

Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
[lersek@redhat.com: strip whitespace at EOL]
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
7 years agoSignedCapsulePkg/CapsulePkg.dsc: Add capsule related component.
Jiewen Yao [Mon, 7 Nov 2016 12:40:03 +0000 (20:40 +0800)]
SignedCapsulePkg/CapsulePkg.dsc: Add capsule related component.

Add capsule related component to check build.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Tested-by: Michael D Kinney <michael.d.kinney@intel.com>
7 years agoCryptoPkg/BaseCryptLib: Make comments consistent with the function
Dandan Bi [Fri, 11 Nov 2016 05:46:04 +0000 (13:46 +0800)]
CryptoPkg/BaseCryptLib: Make comments consistent with the function

Correct the unaligned parameter names in comments (BaseCryptLib.h and
HMAC-SHA256 wrapper implementation)

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Qin Long <qin.long@intel.com>
7 years agoMdeModulePkg/BootLogoLib: Remove invalid if judgments
Song, BinX [Thu, 10 Nov 2016 08:19:59 +0000 (16:19 +0800)]
MdeModulePkg/BootLogoLib: Remove invalid if judgments

FreePool (Blt) function will be called in while loop, cannot be removed.

Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bell Song <binx.song@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoShellPkg/ShellCommandLib: Add missing EFIAPI for public library APIs
Ruiyu Ni [Thu, 10 Nov 2016 06:58:20 +0000 (14:58 +0800)]
ShellPkg/ShellCommandLib: Add missing EFIAPI for public library APIs

DumpHex() and CatSDumpHex() are public library APIs but don't have
EFIAPI modifier. Add the missing EFIAPI.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
7 years agoBaseTools/GenSec: Return correct status when input file size is 0
Hao Wu [Thu, 10 Nov 2016 01:43:07 +0000 (09:43 +0800)]
BaseTools/GenSec: Return correct status when input file size is 0

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoBaseTools/GenFfs: Fix return too early when input file is of size 0
Hao Wu [Wed, 9 Nov 2016 15:00:01 +0000 (23:00 +0800)]
BaseTools/GenFfs: Fix return too early when input file is of size 0

Commit 2cb874352423fcfd180199e6de8298567dff8e7f eliminates possible NULL
pointer dereference in GenFfs tool source codes. However, it doesn't
correctly handle the case when the input file is of size 0. This will lead
to possible build issues.

This commits refine the logic to handle the above case.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoShellPkg: Fix the coding style issue
Bi, Dandan [Thu, 10 Nov 2016 07:40:14 +0000 (15:40 +0800)]
ShellPkg: Fix the coding style issue

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
7 years agoNt32Pkg/PlatformBds: Dispatch deferred images after EndOfDxe
Ruiyu Ni [Tue, 8 Nov 2016 12:21:23 +0000 (20:21 +0800)]
Nt32Pkg/PlatformBds: Dispatch deferred images after EndOfDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoQuarkPlatformPkg/PlatformBds: Dispatch deferred images after EndOfDxe
Ruiyu Ni [Tue, 8 Nov 2016 12:19:58 +0000 (20:19 +0800)]
QuarkPlatformPkg/PlatformBds: Dispatch deferred images after EndOfDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoCorebootPayload/PlatformBds: Dispatch deferred images after EndOfDxe
Ruiyu Ni [Tue, 8 Nov 2016 12:18:30 +0000 (20:18 +0800)]
CorebootPayload/PlatformBds: Dispatch deferred images after EndOfDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoOvmfPkg/PlatformBds: Dispatch deferred images after EndOfDxe
Ruiyu Ni [Tue, 8 Nov 2016 12:16:39 +0000 (20:16 +0800)]
OvmfPkg/PlatformBds: Dispatch deferred images after EndOfDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoArmVirPkg/PlatformBds: Dispatch deferred images after EndOfDxe
Ruiyu Ni [Tue, 8 Nov 2016 12:13:18 +0000 (20:13 +0800)]
ArmVirPkg/PlatformBds: Dispatch deferred images after EndOfDxe

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoMdeModulePkg/SecurityStubDxe: Report failure if image is load earlier
Ruiyu Ni [Tue, 1 Nov 2016 08:42:21 +0000 (16:42 +0800)]
MdeModulePkg/SecurityStubDxe: Report failure if image is load earlier

The 3rd party image should be loaded after EndOfDxe event signal and
DxeSmmReadyToLock protocol installation. But non-SMM platform doesn't
published DxeSmmReadyToLock protocol.
So the SecurityStubDxe can only depend on EndOfDxe event.

This patch enhances the SecurityStubDxe to listen on
DxeSmmReadyToLock protocol installation and if any 3rd party image
is loaded before DxeSmmReadyToLock, it reports failure.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoMdeModulePkg/BdsDxe: Check deferred images before booting to OS
Ruiyu Ni [Tue, 1 Nov 2016 05:55:49 +0000 (13:55 +0800)]
MdeModulePkg/BdsDxe: Check deferred images before booting to OS

The patch adds check of deferred images before booting to OS.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoMdeModulePkg/UefiBootManager: Add EfiBootManagerDispatchDeferredImages
Ruiyu Ni [Mon, 31 Oct 2016 08:34:41 +0000 (16:34 +0800)]
MdeModulePkg/UefiBootManager: Add EfiBootManagerDispatchDeferredImages

The API dispatches the deferred images that are returned from all
DeferredImageLoad instances.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoMdeModulePkg/SecurityStubDxe: Defer 3rd party image before EndOfDxe
Ruiyu Ni [Mon, 31 Oct 2016 08:31:44 +0000 (16:31 +0800)]
MdeModulePkg/SecurityStubDxe: Defer 3rd party image before EndOfDxe

The images not from FV are treated as 3rd party images. They will
be deferred to dispatch when they are dispatched before EndOfDxe
event.
It's a new feature in the BS.LoadImage() path which can disallow
executing 3rd party images before EndOfDxe and re-execute them
after EndOfDxe (through EfiBootManagerDispatchDeferredImages
introduced in next commit).

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
Reviewed-by: Sunny Wang <sunnywang@hpe.com>
7 years agoIntelFrameworkModulePkg/LegacyBios: Fix legacy serial redirection bug
Ruiyu Ni [Tue, 8 Nov 2016 02:25:46 +0000 (10:25 +0800)]
IntelFrameworkModulePkg/LegacyBios: Fix legacy serial redirection bug

Upon booting to a legacy OS, LegacyBios driver is responsible to
initialize the BDA region with the correct COM port base address.
But the current logic to get the COM port base address from IsaIo
instance is not correct.
The patch fixes this bug.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
7 years agoMdeModulePkg/PciSioSerial: Fix a bug that wrongly produces 2 UARTs
Ruiyu Ni [Tue, 8 Nov 2016 02:35:22 +0000 (10:35 +0800)]
MdeModulePkg/PciSioSerial: Fix a bug that wrongly produces 2 UARTs

When PciSioSerial is firstly started with a non-NULL remaining
device path, the UART instance is created using the parameters
specified in the remaining device path. Later when the driver
is started again on the same UART controller with NULL remaining
device path, the correct logic is to directly return SUCCESS
instead of current buggy implementation which wrongly produces
another UART using the default parameters.

The bug causes two UARTs are created when the UART is configured
in 57600 baud rate.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
7 years agoCorebootPayloadPkg: Fix GCC build issue on macro definition
Maurice Ma [Tue, 8 Nov 2016 23:54:24 +0000 (15:54 -0800)]
CorebootPayloadPkg: Fix GCC build issue on macro definition

The previous change to disable deprecated APIs in CorebootPayloadPkg
used "/D" instead of "-D".  It caused Linux GCC build error. Correct
it to use "-D" instead.

Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Rusty Coleman <rcoleman@sigovs.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Prince Agyeman <prince.agyeman@intel.com>
Reviewed-by: Rusty Coleman <rcoleman@sigovs.com>
7 years agoMdePkg UefiDevicePathLib: Validate before touch input buffer.
Eric Dong [Thu, 27 Oct 2016 06:17:54 +0000 (14:17 +0800)]
MdePkg UefiDevicePathLib: Validate before touch input buffer.

Current code not validate the input buffer before touch.
it may touch the buffer outside the validate scope. This
patch validate the input size big enough to touch the
first node.

Cc: Ruiyu NI <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
7 years agoMdePkg UefiDevicePathLib: Rollback former change.
Eric Dong [Thu, 27 Oct 2016 06:16:53 +0000 (14:16 +0800)]
MdePkg UefiDevicePathLib: Rollback former change.

Former patch still has some bugs, so rollback it and
enhance the original code.

Cc: Ruiyu NI <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
7 years agoMdePkg DevicePathLib: Validate before touch input buffer.
Eric Dong [Thu, 27 Oct 2016 03:08:37 +0000 (11:08 +0800)]
MdePkg DevicePathLib: Validate before touch input buffer.

Current code not validate the input buffer before touch.
it may touch the buffer outside the validate scope. This
patch validate the input size big enough to touch the
first node.

Cc: Ruiyu NI <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
7 years agoMdePkg DevicePathLib: Rollback former change.
Eric Dong [Thu, 27 Oct 2016 03:05:51 +0000 (11:05 +0800)]
MdePkg DevicePathLib: Rollback former change.

Former patch still has some bugs, so rollback it and
enhance the original code.

Cc: Ruiyu NI <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
7 years agoBaseTools/PeCoffLib: Check 'RelocDir' before finding relocation block
Hao Wu [Wed, 9 Nov 2016 04:06:29 +0000 (12:06 +0800)]
BaseTools/PeCoffLib: Check 'RelocDir' before finding relocation block

To match the code logics in MdePkg/Library/BasePeCoffLib, add checks for
'RelocDir' before finding the relocation block.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Hao Wu <hao.a.wu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
7 years agoUefiCpuPkg/MpInitLib: Do not wakeup AP if only one processor supported
Jeff Fan [Fri, 4 Nov 2016 07:45:13 +0000 (15:45 +0800)]
UefiCpuPkg/MpInitLib: Do not wakeup AP if only one processor supported

If MaxLogicalProcessorNumber is only 1, we needn't to wake up APs at all
and needn't to register callback functions.

It could improve boot performance on single supported system.

https://bugzilla.tianocore.org/show_bug.cgi?id=204

Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Acked-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/DxeIplPeim: UINTN used wrongly for EFI_PHYSICAL_ADDRESS
Jeff Fan [Fri, 4 Nov 2016 02:01:21 +0000 (10:01 +0800)]
MdeModulePkg/DxeIplPeim: UINTN used wrongly for EFI_PHYSICAL_ADDRESS

PeiServicesAllocatePages () will output sizeof (EFI_PHYSICAL_ADDRESS) value.
IdtTableForX64 is sizeof (UINTN) local variable. It will overwrite other local
variable.

This issue is found when we dump BaseOfStack value.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoUefiCpuPkg: Display new stack base and size
Jeff Fan [Thu, 3 Nov 2016 07:48:11 +0000 (15:48 +0800)]
UefiCpuPkg: Display new stack base and size

Dump new stack base and size information could help developer to narrow down
stack crash issue.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg: Display new stack base and size
Jeff Fan [Thu, 3 Nov 2016 07:47:06 +0000 (15:47 +0800)]
MdeModulePkg: Display new stack base and size

Dump new stack base and size information could help developer to narrow down
stack crash issue.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Michael Kinney <michael.d.kinney@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Feng Tian <feng.tian@intel.com>
7 years agoMdeModulePkg/Ufs: ensure the DBC field of UTP PRDT is dword-aligned
Feng Tian [Tue, 18 Oct 2016 05:17:56 +0000 (13:17 +0800)]
MdeModulePkg/Ufs: ensure the DBC field of UTP PRDT is dword-aligned

According to UFS Host Controller Spec(JESD223), the bits 1:0 of this
DataByteCount field shall be 11b to indicate Dword granularity.

But the size of UFS Request Sense Data Response defined in UFS Spec
(JESD220C) is 18 which is not Dword aligned, we would have to round
down to the multiple of 4 to fill the DBC field to avoid bring issue
on some UFS HCs.

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 agoVlv2TbltDevicePkg/Build: Add capsule/recovery in help info.
Jiewen Yao [Wed, 21 Sep 2016 08:44:24 +0000 (16:44 +0800)]
Vlv2TbltDevicePkg/Build: Add capsule/recovery in help info.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/bat: add capsule generation in bat.
Jiewen Yao [Wed, 21 Sep 2016 03:53:47 +0000 (11:53 +0800)]
Vlv2TbltDevicePkg/bat: add capsule generation in bat.

If OPENSSL_PATH is set, the build process generates capsule.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/dsc/fdf: add capsule generation DSC/FDF.
Jiewen Yao [Wed, 21 Sep 2016 03:52:18 +0000 (11:52 +0800)]
Vlv2TbltDevicePkg/dsc/fdf: add capsule generation DSC/FDF.

Add DSC/FDF to generate capsule image.
It is separated from normal DSC/FDF, because the FDF file need use
the result of final build.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/dsc/fdf: Add capsule/recovery support.
Jiewen Yao [Wed, 21 Sep 2016 03:51:21 +0000 (11:51 +0800)]
Vlv2TbltDevicePkg/dsc/fdf: Add capsule/recovery support.

Add capsule and recovery support module in platform dsc and fdf.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PlatformBootManager: Add capsule/recovery handling.
Jiewen Yao [Wed, 21 Sep 2016 03:50:09 +0000 (11:50 +0800)]
Vlv2TbltDevicePkg/PlatformBootManager: Add capsule/recovery handling.

1) Add capsule and recovery boot path handling in platform BDS.
2) Add check if the platform is using default test key for capsule.
Produce PcdTestKeyUsed to indicate if there is any
test key used in current BIOS, such as recovery key,
or capsule update key.
Then the generic UI may consume this PCD to show warning information.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/FlashDeviceLib: Add DXE flash device lib.
Jiewen Yao [Wed, 21 Sep 2016 03:48:11 +0000 (11:48 +0800)]
Vlv2TbltDevicePkg/FlashDeviceLib: Add DXE flash device lib.

Previous FlashDeviceLib only supports DxeRuntime and Smm.
It cannot be linked with SystemBiosUpdateDxe driver.

So we separate DxeRuntime related code into a standalone file,
and create FlashDeviceLibDxe.inf.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/SystemFirmwareUpdateConfig: Add capsule config file.
Jiewen Yao [Wed, 21 Sep 2016 03:45:05 +0000 (11:45 +0800)]
Vlv2TbltDevicePkg/SystemFirmwareUpdateConfig: Add capsule config file.

Add SystemFirmwareUpdateConfig as capsule configuration file.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/SystemFirmwareDescriptor: Add Capsule Descriptor.
Jiewen Yao [Wed, 21 Sep 2016 03:44:16 +0000 (11:44 +0800)]
Vlv2TbltDevicePkg/SystemFirmwareDescriptor: Add Capsule Descriptor.

Add SystemFirmwareDescriptor for capsule update.
The PEIM extracts SystemFirmwareDescriptor info from FFS and reports
it via PCD.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoVlv2TbltDevicePkg/PlatformFlashAccessLib: Add instance for update.
Jiewen Yao [Wed, 21 Sep 2016 03:43:01 +0000 (11:43 +0800)]
Vlv2TbltDevicePkg/PlatformFlashAccessLib: Add instance for update.

Add PlatformFlashAccessLib for capsule update.

Cc: David Wei <david.wei@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: David Wei <david.wei@intel.com>
7 years agoQuarkPlatformPkg/Readme: add capsule/recovery related content.
Jiewen Yao [Wed, 21 Sep 2016 08:42:53 +0000 (16:42 +0800)]
QuarkPlatformPkg/Readme: add capsule/recovery related content.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/dsc/fdf: Add capsule/recovery support.
Jiewen Yao [Wed, 21 Sep 2016 03:39:24 +0000 (11:39 +0800)]
QuarkPlatformPkg/dsc/fdf: Add capsule/recovery support.

Add capsule and recovery support module in platform dsc and fdf.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/PlatformBootManager: Add capsule/recovery handling.
Jiewen Yao [Wed, 21 Sep 2016 03:37:27 +0000 (11:37 +0800)]
QuarkPlatformPkg/PlatformBootManager: Add capsule/recovery handling.

1) Add capsule and recovery boot path handling in platform BDS.
2) Add check if the platform is using default test key for capsule.
Produce PcdTestKeyUsed to indicate if there is any
test key used in current BIOS, such as recovery key,
or capsule update key.
Then the generic UI may consume this PCD to show warning information.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/PlatformInit: Remove recovery PPI installation.
Jiewen Yao [Wed, 21 Sep 2016 03:36:02 +0000 (11:36 +0800)]
QuarkPlatformPkg/PlatformInit: Remove recovery PPI installation.

The QuarkPlatform will use MdeModulePkg/RecoveryModuleLoadPei for recovery.
There is no need to produce recovery PPI in platform module.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/SystemFirmwareUpdateConfig: Add capsule config file.
Jiewen Yao [Wed, 21 Sep 2016 03:34:04 +0000 (11:34 +0800)]
QuarkPlatformPkg/SystemFirmwareUpdateConfig: Add capsule config file.

Add SystemFirmwareUpdateConfig as capsule configuration file.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/SystemFirmwareDescriptor: Add Descriptor for capsule.
Jiewen Yao [Wed, 21 Sep 2016 03:32:52 +0000 (11:32 +0800)]
QuarkPlatformPkg/SystemFirmwareDescriptor: Add Descriptor for capsule.

Add SystemFirmwareDescriptor for capsule update.
The PEIM extracts SystemFirmwareDescriptor info from FFS and reports
it via PCD.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoQuarkPlatformPkg/PlatformFlashAccessLib: Add instance for update.
Jiewen Yao [Wed, 21 Sep 2016 03:31:11 +0000 (11:31 +0800)]
QuarkPlatformPkg/PlatformFlashAccessLib: Add instance for update.

Add PlatformFlashAccessLib for capsule update.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Kelly Steele <kelly.steele@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/MicrocodeUpdate: Add Microcode FMP build sample
Jiewen Yao [Fri, 28 Oct 2016 05:09:29 +0000 (13:09 +0800)]
UefiCpuPkg/MicrocodeUpdate: Add Microcode FMP build sample

This folder provides the sample build for Microcode FMP.
The DSC/FDF is to convert the Microcode binary/text to Microcode FMP.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/MicrocodeUpdate: Add MicrocodeUpdate component.
Jiewen Yao [Wed, 21 Sep 2016 03:15:03 +0000 (11:15 +0800)]
UefiCpuPkg/MicrocodeUpdate: Add MicrocodeUpdate component.

MicrocodeUpdate supports update Microcode region via UEFI FMP capsule.

MicrocodeUpdate SetImage() will perform the Microcode version,
ProcessorSignature/ProcessorFlag, and try to load microcode.
If and only if the Microcode is loaded successfully, and new Microcode
will be updated to system flash region.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/MicrocodeFlashAccessLib: Add NULL MicrocodeFlashAccessLib.
Jiewen Yao [Wed, 21 Sep 2016 03:16:02 +0000 (11:16 +0800)]
UefiCpuPkg/MicrocodeFlashAccessLib: Add NULL MicrocodeFlashAccessLib.

Add NULL instance to pass build.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/UefiCpuPkg.dec: Add Microcode capsule related definition.
Jiewen Yao [Wed, 21 Sep 2016 03:11:44 +0000 (11:11 +0800)]
UefiCpuPkg/UefiCpuPkg.dec: Add Microcode capsule related definition.

1) Add Microcode capsule related GUID.
   gMicrocodeFmpImageTypeIdGuid
2) Add Microcode capsule related library.
   MicrocodeFlashAccessLib

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/Include: Add MicrocodeFlashAccessLib header.
Jiewen Yao [Wed, 21 Sep 2016 03:09:42 +0000 (11:09 +0800)]
UefiCpuPkg/Include: Add MicrocodeFlashAccessLib header.

This library is used to abstract microcode flash region access.
This library is consumed by a microcode capsule update module.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/Include: Add Microcode FMP definition.
Jiewen Yao [Wed, 21 Sep 2016 03:00:49 +0000 (11:00 +0800)]
UefiCpuPkg/Include: Add Microcode FMP definition.

It defined ImageTypeId for Microcode.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/RecoveryModuleLoadPei: Add RecoveryModuleLoadPei.
Jiewen Yao [Wed, 21 Sep 2016 02:40:50 +0000 (10:40 +0800)]
SignedCapsulePkg/RecoveryModuleLoadPei: Add RecoveryModuleLoadPei.

RecoveryModuleLoadPei supports recovery system firmware via FMP capsule.

RecoveryModuleLoadPei produces EFI_PEI_RECOVERY_MODULE_PPI. It is invoked
by DxeIpl in recovery boot mode.

LoadRecoveryCapsule() will scan all possible
gEfiPeiDeviceRecoveryModulePpiGuid and get EDKII system FMP capsule there.

LoadRecoveryCapsule() will perform the FMP authentication and version
check. If and only if the FMP authentication passes, and EDKII system FMP
capsule version is equal to the current system firmware Version, the
recovery will be performed. Or this capsule image is discard.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/SystemFirmwareUpdate: Add SystemFirmwareUpdate.
Jiewen Yao [Wed, 21 Sep 2016 02:30:12 +0000 (10:30 +0800)]
SignedCapsulePkg/SystemFirmwareUpdate: Add SystemFirmwareUpdate.

SystemFirmwareUpdate supports update system firmware via UEFI FMP capsule.

SystemFirmwareReportDxe.inf can be included in system BIOS. It is a
lightweight FMP protocol implementation and it only reports FMP
information, so that ESRT table can report the system firmware
information. SetImage() will dispatch the driver FV in the EDKII system
FMP image (SystemFirmwareUpdateDxe),
then pass thru the SetImage() request to latter.

SystemFirmwareUpdateDxe.inf can be included in EDKII system capsule image.
It is a full feature FMP protocol implementation and supports SetImage().
It can be used to update the system firmware.
SystemFirmwareUpdateDxe.inf can also be included in system firmware.
If so SystemFirmwareReportDxe.inf is not needed.

SystemFirmwareUpdateDxe SetImage() will perform the FMP authentication and
version check. If and only if the FMP authentication passes, and new
EDKII system capsule version is no less than current system firmware
LowestSupportedVersion, the system firmware will be updated.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/PlatformFlashAccessLib: Add NULL instance.
Jiewen Yao [Wed, 21 Sep 2016 02:03:33 +0000 (10:03 +0800)]
SignedCapsulePkg/PlatformFlashAccessLib: Add NULL instance.

Add NULL instance to pass build.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/EdkiiSystemCapsuleLib: Add EdkiiSystemCapsuleLib.
Jiewen Yao [Wed, 21 Sep 2016 02:02:21 +0000 (10:02 +0800)]
SignedCapsulePkg/EdkiiSystemCapsuleLib: Add EdkiiSystemCapsuleLib.

This library is used to abstract the action for EDKII system FMP capsule,
such as extracting a component from capsule, or authenticate the capsule.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/IniParsingLib: Add InitParsingLib instance.
Jiewen Yao [Wed, 21 Sep 2016 01:45:23 +0000 (09:45 +0800)]
SignedCapsulePkg/IniParsingLib: Add InitParsingLib instance.

This library is used to parse the INI configuration file.
The INI configuration file is used in EDKII capsule image to describe
the capsule information.

Detail format is documented in header file.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/CapsulePkg.dec: Add capsule related definition.
Jiewen Yao [Wed, 12 Oct 2016 06:41:12 +0000 (14:41 +0800)]
SignedCapsulePkg/CapsulePkg.dec: Add capsule related definition.

1) Add capsule related GUID.
   EdkiiSystemFmpCapsule
2) Add capsule related library.
   EdkiiSystemCapsuleLib
   IniParsingLib
   PlatformFlashAccessLib
3) Add EDKII system capsule related DynamicEx PCD
   PcdEdkiiSystemFirmwareImageDescriptor
   PcdEdkiiSystemFirmwareFileGuid
   NOTE: We use DynamicEx here because the update driver may be in
   the capsule FMP, instead of system firmware.
   The update driver MUST use the PCD info produced system firmware.
4) Add Test key file PCD
   These PCDs indicate the GUID of FFS which contains test key file.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/Include: Add PlatformFlashAccessLib header.
Jiewen Yao [Wed, 21 Sep 2016 01:37:01 +0000 (09:37 +0800)]
SignedCapsulePkg/Include: Add PlatformFlashAccessLib header.

This library is used to abstract platform flash access.
This library is consumed by a capsule update module.
It may cover SystemFirmware region and/or non-SystemFirmware region.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/Include: Add IniParsingLib header.
Jiewen Yao [Wed, 21 Sep 2016 01:30:31 +0000 (09:30 +0800)]
SignedCapsulePkg/Include: Add IniParsingLib header.

This library is used to parse the INI configuration file.
The INI configuration file is used in EDKII capsule image to describe
the capsule information.

Detail format is documented in header file.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/Include: Add EdkiiSystemCapsuleLib definition.
Jiewen Yao [Wed, 21 Sep 2016 01:25:37 +0000 (09:25 +0800)]
SignedCapsulePkg/Include: Add EdkiiSystemCapsuleLib definition.

This library is used to abstract the action for EDKII system FMP capsule,
such as extracting a component from capsule, or authenticate the capsule.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg/Include: Add EDKII system FMP capsule header.
Jiewen Yao [Wed, 21 Sep 2016 01:21:52 +0000 (09:21 +0800)]
SignedCapsulePkg/Include: Add EDKII system FMP capsule header.

Add EDKII system FMP capsule header file.
This describes the EDKII system FMP capsule format.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSignedCapsulePkg: Add license file.
Jiewen Yao [Wed, 12 Oct 2016 07:31:03 +0000 (15:31 +0800)]
SignedCapsulePkg: Add license file.

Add license file for SignedCapsulePkg.
This package contains sample drivers to do system firmware update
and recovery.
It also includes a capsule library to support system FMP and device FMP.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoUefiCpuPkg/UefiCpuPkg.dsc: Add MicrocodeCapsule related component.
Jiewen Yao [Wed, 21 Sep 2016 03:19:19 +0000 (11:19 +0800)]
UefiCpuPkg/UefiCpuPkg.dsc: Add MicrocodeCapsule related component.

Add Microcode capsule related component to check build.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSecurityPkg/SecurityPkg.dsc: Add FmpAuthenticationLib*.
Jiewen Yao [Wed, 21 Sep 2016 02:53:50 +0000 (10:53 +0800)]
SecurityPkg/SecurityPkg.dsc: Add FmpAuthenticationLib*.

Add FmpAuthenticationLib* to check build.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSecurityPkg/FmpAuthenticationLibRsa2048Sha256: Add RSA2048 instance.
Jiewen Yao [Wed, 21 Sep 2016 02:48:40 +0000 (10:48 +0800)]
SecurityPkg/FmpAuthenticationLibRsa2048Sha256: Add RSA2048 instance.

It provides Rsa2048Sha256 based FMP authentication.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSecurityPkg/FmpAuthenticationLibPkcs7: Add PKCS7 instance for FMP.
Jiewen Yao [Wed, 21 Sep 2016 02:47:43 +0000 (10:47 +0800)]
SecurityPkg/FmpAuthenticationLibPkcs7: Add PKCS7 instance for FMP.

It provides PKCS7 based FMP authentication.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoSecurityPkg/SecurityPkg.dec: Add PcdPkcs7CertBuffer PCD.
Jiewen Yao [Wed, 21 Sep 2016 02:51:55 +0000 (10:51 +0800)]
SecurityPkg/SecurityPkg.dec: Add PcdPkcs7CertBuffer PCD.

This PCD is similar to PcdRsa2048Sha256PublicKeyBuffer.
It provides trusted cert for PKCS7 verification.
It can be used for Recovery and Capsule Update images.

We added warning message for both PcdPkcs7CertBuffer and
PcdRsa2048Sha256PublicKeyBuffer. The default value is only for
test purpose.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoIntelFrameworkModulePkg/DxeCapsuleLib: Add ProcessCapsules().
Jiewen Yao [Wed, 21 Sep 2016 01:59:17 +0000 (09:59 +0800)]
IntelFrameworkModulePkg/DxeCapsuleLib: Add ProcessCapsules().

Add NULL ProcessCapsules() interface for DxeCapsuleLib.
IntelFrameworkModulePkg is under maintenance phase.
We stop adding new feature there.
Just add NULL function to make it pass build.

Cc: Jeff Fan <jeff.fan@intel.com>
Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Jeff Fan <jeff.fan@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>
7 years agoMdeModulePkg/MdeModulePkg.dsc: Add FMP related component.
Jiewen Yao [Wed, 21 Sep 2016 02:44:16 +0000 (10:44 +0800)]
MdeModulePkg/MdeModulePkg.dsc: Add FMP related component.

Add FMP related component to check build.

Cc: Feng Tian <feng.tian@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
Tested-by: Michael Kinney <michael.d.kinney@intel.com>