summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Include
Commit message (Collapse)AuthorAgeFilesLines
* MdeModulePkg/Library: Add HiiGetStringEx to UefiHiiLib for EDK2 RedfishAbner Chang2021-02-051-13/+47
| | | | | | | | | | | | | | | | | | Add HiiGetStringEx and leveraged by HiiGetString function to support getting string with the best language in optionally. This avoids the string in x-uefi language is misled to the language defined by "PlatformLang" or the "Supported Languages". This change is introduced to support x-uefi keyword language for configuring BIOS setting. Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Siyuan Fu <siyuan.fu@intel.com> Signed-off-by: Fan Wang <fan.wang@intel.com> Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Nickle Wang <nickle.wang@hpe.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* MdeModulePkg: Define the VarCheckPolicyLib and SMM interfaceBret Barkelew2020-11-171-0/+54
| | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 VariablePolicy is an updated interface to replace VarLock and VarCheckProtocol. This is an instance of a VarCheckLib that is backed by the VariablePolicyLib business logic. It also publishes the SMM calling interface for messages from the DXE protocol. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Define the VariablePolicyHelperLibBret Barkelew2020-11-171-0/+164
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 VariablePolicy is an updated interface to replace VarLock and VarCheckProtocol. Add the VariablePolicyHelperLib library, containing several functions to help with the repetitive process of creating a correctly structured and packed VariablePolicy entry. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Define the VariablePolicyLibBret Barkelew2020-11-171-0/+207
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 VariablePolicy is an updated interface to replace VarLock and VarCheckProtocol. Add the VariablePolicyLib library that implements the portable business logic for the VariablePolicy engine. Also add host-based CI test cases for the lib. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Define the VariablePolicy protocol interfaceBret Barkelew2020-11-171-0/+157
| | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=2522 VariablePolicy is an updated interface to replace VarLock and VarCheckProtocol. Add the VariablePolicy protocol interface header and add to the MdeModulePkg.dec file. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Bret Barkelew <brbarkel@microsoft.com> Signed-off-by: Bret Barkelew <brbarkel@microsoft.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Fix spelling mistake for occurredMichael D Kinney2020-08-191-2/+2
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2361 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/PeCoffImageEmulator.h: Apply BSD-2-Clause-PatentMichael D Kinney2020-08-061-8/+1
| | | | | | | | | | | | | Change license to BSD-2-Clause-Patent using an SPDX-License-Identifier statement. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
* MdeModulePkg/Core: Create Migrated FV Info Hob for calculating hash ↵Guomin Jiang2020-07-281-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | (CVE-2019-11098) REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1614 When we allocate pool to save the rebased PEIMs, the address will change randomly, therefore the hash will change and result PCR0 change as well. To avoid this, we save the raw PEIMs and use it to calculate hash. The MigratedFvInfo HOB will never produce when PcdMigrateTemporaryRamFirmwareVolumes is FALSE, because the PCD control the total feature. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Debkumar De <debkumar.de@intel.com> Cc: Harry Han <harry.han@intel.com> Cc: Catharine West <catharine.west@intel.com> Signed-off-by: Guomin Jiang <guomin.jiang@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/VariableSmmRuntimeDxe: switch to MM communicate 2Ard Biesheuvel2020-05-121-3/+3
| | | | | | | | | Switch to the new MM communicate 2 protocol which supports both traditional and standalone MM. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
* MdeModulePkg/SecurityManagementLib: Mark the File parameter as OPTIONALGuomin Jiang2020-04-221-1/+1
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2652 According to the File description, the File is optional and can be NULL. Signed-off-by: Guomin Jiang <guomin.jiang@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Remove gEfiFormBrowserExProtocolGuid Protocol GuidGuoMinJ2020-03-301-1/+0
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2145 Replace the gEfiFormBrowserExProtocolGuid with gEdkiiFormBrowserExProtocolGuid, remove the unnecessary declaration. Signed-off-by: GuoMinJ <newexplorerj@gmail.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: remove EnterS3WithImmediateWake () from ResetSystemLibArd Biesheuvel2020-01-101-11/+0
| | | | | | | | EnterS3WithImmediateWake () no longer has any callers, so remove it from ResetSystemLib. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg: Add EDK2 Platform Boot Manager ProtocolAshish Singhal2020-01-081-0/+82
| | | | | | | | | Add edk2 platform boot manager protocol which would have platform specific refreshes to the auto enumerated as well as NV boot options for the platform. Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/Include: Add DeviceSecurity.hJiewen Yao2019-11-111-0/+162
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2303 EDKII_DEVICE_SECURITY_PROTOCOL is used for device measurement and/or authentication. It is similar to EFI_SECURITY_ARCH_PROTOCOL. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Yun Lou <yun.lou@intel.com> Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg/Variable: Add RT GetVariable() cache supportMichael Kubacki2019-11-051-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2220 This change reduces SMIs for GetVariable () by maintaining a UEFI variable cache in Runtime DXE in addition to the pre- existing cache in SMRAM. When the Runtime Service GetVariable() is invoked, a Runtime DXE cache is used instead of triggering an SMI to VariableSmm. This can improve overall system performance by servicing variable read requests without rendezvousing all cores into SMM. The runtime cache can be disabled with by setting the FeaturePCD gEfiMdeModulePkgTokenSpaceGuid.PcdEnableVariableRuntimeCache to FALSE. If the PCD is set to FALSE, the runtime cache will not be used and an SMI will be triggered for Runtime Service GetVariable () and GetNextVariableName () invocations. The following are important points regarding the behavior of the variable drivers when the variable runtime cache is enabled. 1. All of the non-volatile storage contents are loaded into the cache upon driver load. This one time load operation from storage is preferred as opposed to building the cache on demand. An on- demand cache would require a fallback SMI to load data into the cache as variables are requested. 2. SetVariable () requests will continue to always trigger an SMI. This occurs regardless of whether the variable is volatile or non-volatile. 3. Both volatile and non-volatile variables are cached in a runtime buffer. As is the case in the current EDK II variable driver, they continue to be cached in separate buffers. 4. The cache in Runtime DXE and SMM are intended to be exact copies of one another. All SMM variable accesses only return data from the SMM cache. The runtime caches are only updated after the variable I/O operation is successful in SMM. The runtime caches are only updated from SMM. 5. Synchronization mechanisms are in place to ensure the runtime cache content integrity with the SMM cache. These may result in updates to runtime cache that are the same in content but different in offset and size from updates to the SMM cache. When using SMM variables with runtime cache enabled, two caches will now be present. 1. "Runtime Cache" - Maintained in VariableSmmRuntimeDxe. Used to service Runtime Services GetVariable () and GetNextVariableName () callers. 2. "SMM Cache" - Maintained in VariableSmm to service SMM GetVariable () and GetNextVariableName () callers. a. This cache is retained so SMM modules do not operate on data outside SMRAM. Because a race condition can occur if an SMI occurs during the execution of runtime code reading from the runtime cache, a runtime cache read lock is introduced that explicitly moves pending updates from SMM to the runtime cache if an SMM update occurs while the runtime cache is locked. Note that it is not expected a Runtime services call will interrupt SMM processing since all CPU cores rendezvous in SMM. It is possible to view UEFI variable read and write statistics by setting the gEfiMdeModulePkgTokenSpaceGuid.PcdVariableCollectStatistics FeaturePcd to TRUE and using the VariableInfo UEFI application in MdeModulePkg to dump variable statistics to the console. By doing so, a user can view the number of GetVariable () hits from the Runtime DXE variable driver (Runtime Cache hits) and the SMM variable driver (SMM Cache hits). SMM Cache hits for GetVariable () will occur when SMM modules invoke GetVariable (). Cc: Dandan Bi <dandan.bi@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Eric Dong <eric.dong@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael Kubacki <michael.a.kubacki@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* NetworkPkg: Move network related header files from MdeModulePkg to NetworkPkgLiming Gao2019-10-083-63/+0
| | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2196 Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* MdeModulePkg: Extend the support keyboard type of Terminal consoleZhichao Gao2019-09-241-0/+17
| | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2186 A common terminal console software Putty support various types of keyboard type, such as normal mode, Linux mode, Xterm R6, Vt400, VT100+ and SCO. Refer to the link: https://www.ssh.com/ssh/putty/putty-manuals/0.68/Chapter4.html#config-funkeys Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* NetworkPkg: Move Dpc.h from MdeModulePkg to NetworkPkgShenglei Zhang2019-08-151-98/+0
| | | | | | | | | | | Move Dpc.h from MdeModulePkg to NetworkPkg. And remove the dependency on MdeModulePkg.dec in INFs. https://bugzilla.tianocore.org/show_bug.cgi?id=1949 Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* MdeModulePkg: Add definition of the EDKII_UFS_HC_PLATFORM_PROTOCOLAlbecki, Mateusz2019-08-131-0/+124
| | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1343 EDKII_UFS_HC_PLATFORM_PROTOCOL will allow the platform to inject platform specific logic into standard UFS flows. Right now we support callbacks pre and post host controller enable and pre and post link startup. Provided callbacks allow the platform driver to inject UIC programming after HCE is set which is a standard initialization step covered by UFS specification as well as cover some additional use cases during other callbacks. For instance platform driver may switch to fast mode after link startup. We also allow the platform to override host controller capabilities and version which might be useful to manage silicon bugs or allow testing experimental features from new versions of the specification. Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Remove RecoveryLib.h and PeiRecoveryLibNullZhang, Shenglei2019-08-051-29/+0
| | | | | | | | | | | | RecoveryLib.h and PeiRecoveryLibNull have been deprecated from 2009, so remove them. https://bugzilla.tianocore.org/show_bug.cgi?id=1299 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Remove S3Lib.h and PeiS3LibNullZhang, Shenglei2019-08-051-28/+0
| | | | | | | | | | | S3Lib.h and PeiS3LibNull have been deprecated since 2009, so remove them. https://bugzilla.tianocore.org/show_bug.cgi?id=1299 Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Fix typos and add periodsShenglei Zhang2019-08-021-1/+1
| | | | | | | | | | | | 1.Update @parm to @param in function comments in Presentation.c. 2.Add missing period (.) in some function comments. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Dandan Bi <dandan.bi@intel.com>
* MdeModulePkg/SdMmcOverride: Add GetOperatingParam notify phaseAlbecki, Mateusz2019-07-011-7/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1882 The new notify phase allows platform to configure additional bus parameters in addition to parameters that can already be configured with capability override. Specifically we allow to configure bus width, clock frequency and driver strength. If platform doesn't wish to configure some of the parameters it can left it on default values and driver will assume it's standard behavior with respect to those parameters. The definition of the SD_MMC_BUS_MODE has been extended to incorporate SD card default speed and high speed. Tests on Marvell boards were also performed by Marcin Wojtas <mw@semihalf.com>: https://edk2.groups.io/g/devel/message/42999 Board 1 (out of tree): SD - OK, MMC - OK Board 2: (Armada80x0McBin): SD - OK, MMC - OK Board 3: (Armada70x0Db): SD - problems, MMC - OK Please note that the problem on Armada70x0Db SD devices are introduced by adding new types of SD bus modes, a subsequent patch within edk2-platforms repository will be proposed to address it. (More details can be referred from the above link.) Signed-off-by: Mateusz Albecki <mateusz.albecki@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Regression-tested-by: Sumit Garg <sumit.garg@linaro.org>
* MdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.Wei6 Xu2019-06-261-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://github.com/tianocore/tianocore.github.io/wiki/ UEFI-Capsule-on-Disk-Introducation CoDCheckCapsuleOnDiskFlag() is to check if CapsuleOnDisk flag in "OsIndications" Variable is enabled. It is used to indicate whether capsule on disk is provisioned in normal boot path. CoDClearCapsuleOnDiskFlag() is to to clear CapsuleOnDisk flags, including "OsIndications" and "BootNext" variable. CoDRelocateCapsule() is to relocate the capsules from EFI system partition. Depends on PcdCapsuleInRamSupport, there are two solutions to relocate the capsule on disk images: When Capsule In Ram is supported, the Capsule On Disk images are relocated into memory, and call UpdateCapsule() service to deliver the capsules. When Capsule In Ram is not supported, the Capsule On Disk images are relocated into a temp file which will be stored in root directory on a platform specific storage device. CapsuleOnDiskLoadPei PEIM will retrieve the capsules from the relocation temp file and report capsule hobs for them. CoDRemoveTempFile() is to remove the relocation temp file in the next boot after capsules are processed. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add Capsule On Disk related definition.Wei6 Xu2019-06-261-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | REF: https://github.com/tianocore/tianocore.github.io/wiki/ UEFI-Capsule-on-Disk-Introducation This patch will add Capsule On Disk related definition, including GUID, PPI and PCDs: The Capsule On Disk Name GUID indicates the capsule is to store Capsule On Disk file names. The Pei Capsule On Disk PPI provides service to retrieve capsules from Capsule On Disk temp relocation file on mass storage devices and create capsule hob for these capsules. Pei Boot In CapsuleOnDisk Mode Ppi indicates current boot mode is capsule on disk mode. PcdCapsuleOnDiskSupport is used to enable/disable Capsule On Disk. PcdCapsuleInRamSupport is used to enable/disable Capsule In Ram. PcdCoDRelocationFileName specifies the Capsule On Disk temp relocation file name. PcdCodRelocationDevPath specifies platform specific device to store Capsule On Disk temp relocation file. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com> Acked-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add definitions for NVM Express Passthru PPIChu, Maggie2019-06-241-0/+156
| | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1879 This commit will add the definitions of Nvm Express PassThru PPI. This PPI will provide services that allow NVM commands to be sent to NVM Express devices during PEI phase. More specifically, the PPI will provide services to: * Sends an NVM Express Command Packet to an NVM Express controller or namespace (by service 'PassThru'); * Get the list of the attached namespaces on a controller (by services 'GetNextNameSpace'); * Get the identification information (DevicePath) of the underlying NVM Express host controller (by service 'GetDevicePath'). Signed-off-by: Maggie Chu <maggie.chu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com>
* Revert "Capsule-on-Disk entire PatchZhang, Chao B2019-06-212-132/+1
| | | | | | | | | | | | | | | | This reverts commit 0d4aa276d1f6e0cb9d71a7fb88b30c416ba6d5a3, 6470a43160183cd48cad8901c912a48811f18b13, fd7286089542ee7a98cfea00be45ceb3561e0b20, 7837d1249807b4248079699097bc993254235d7a, 6b32af2e105f9b5454a55b581f2dc365c5eb6397, 8636f70b5a763ed1c03b292708f9c5543e531ea9, f17935321a5b818a66e999632ef371b374b98f0c due to incorrect review process. Cc: Wei6 Xu <wei6.xu@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Zhang, Chao B <chao.b.zhang@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg: Add Capsule On Disk APIs into CapsuleLib.Wei6 Xu2019-06-201-1/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule- on-Disk-Introducation CoDCheckCapsuleOnDiskFlag() is to check if CapsuleOnDisk flag in "OsIndications" Variable is enabled. It is used to indicate whether capsule on disk is provisioned in normal boot path. CoDClearCapsuleOnDiskFlag() is to to clear CapsuleOnDisk flags, including "OsIndications" and "BootNext" variable. CoDRelocateCapsule() is to relocate the capsules from EFI system partition. Depends on PcdCapsuleInRamSupport, there are two solutions to relocate the capsule on disk images: When Capsule In Ram is supported, the Capsule On Disk images are relocated into memory, and call UpdateCapsule() service to deliver the capsules. When Capsule In Ram is not supported, the Capsule On Disk images are relocated into a temp file which will be stored in root directory on a platform specific storage device. CapsuleOnDiskLoadPei PEIM will retrieve the capsules from the relocation temp file and report capsule hobs for them. CoDRemoveTempFile() is to remove the relocation temp file in the next boot after capsules are processed. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
* MdeModulePkg: Add Capsule On Disk related definition.Wei6 Xu2019-06-201-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | https://github.com/tianocore/tianocore.github.io/wiki/UEFI-Capsule- on-Disk-Introducation This patch will add Capsule On Disk related definition, including GUID, PPI and PCDs: The Capsule On Disk Name GUID indicates the capsule is to store Capsule On Disk file names. The Pei Capsule On Disk PPI provides service to retrieve capsules from Capsule On Disk temp relocation file on mass storage devices and create capsule hob for these capsules. Pei Boot In CapsuleOnDisk Mode Ppi indicates current boot mode is capsule on disk mode. PcdCapsuleOnDiskSupport is used to enable/disable Capsule On Disk. PcdCapsuleInRamSupport is used to enable/disable Capsule In Ram. PcdCoDRelocationFileName specifies the Capsule On Disk temp relocation file name. PcdCodRelocationDevPath specifies platform specific device to store Capsule On Disk temp relocation file. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Cc: Chao B Zhang <chao.b.zhang@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Chao B Zhang <chao.b.zhang@intel.com>
* MdeModulePkg: Introduce EDKII_SERIAL_PORT_LIB_VENDOR_GUIDAnthony PERARD2019-06-141-0/+19
| | | | | | | | | | | | | | | SERIAL_DXE_FILE_GUID is used in different places, create a single define that other can use. Also fix SerialDxe to actually use EDKII_SERIAL_PORT_LIB_VENDOR_GUID in the device path instead of the FILE_GUID. Suggested-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Anthony PERARD <anthony.perard@citrix.com> Message-Id: <20190606131459.1464-2-anthony.perard@citrix.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
* NetworkPkg: Move Network library header file from MdeModulePkg to NetworkPkgLiming Gao2019-05-276-4017/+0
| | | | | | | | Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
* MdeModulePkg/Library: Remove BaseUefiTianoCustomDecompressLibDandan Bi2019-05-151-22/+0
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1722 Since we have merged this one into MdePkg, remove it now. Cc: Liming Gao <liming.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao A Wu <hao.a.wu@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
* MdeModulePkg/ResetUtilityLib: Add a new API ResetSystemWithSubtypeBret Barkelew2019-04-281-4/+30
| | | | | | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1458 Add a new API ResetSystemWithSubtype's prototype declaration in header file. Also add the required data type header file. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/ResetSystemLib.h: Change comments of ResetSystemZhichao Gao2019-04-281-3/+1
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific or not. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: introduce PE/COFF image emulator protocolArd Biesheuvel2019-04-141-0/+107
| | | | | | | | | Introduce a protocol that can be invoked by the image loading services to execute foreign architecture PE/COFF images via an emulator. Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: Move BaseUefiTianoCustomDecompressLib toDandan Bi2019-04-101-0/+22
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1683 We will remove IntelFrameworkModulePkg, but BaseUefiTianoCustomDecompressLib may still need to be used. So move BaseUefiTianoCustomDecompressLib from IntelFrameworkModulePkg to MdeModulePkg. Cc: Liming Gao <liming.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-09155-1143/+155
| | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg: Add definitions for EDKII DEBUG PPIZhichao Gao2019-04-021-0/+82
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1549 Add a debug PPI for PEI phase. This PPI will provide basic services of debug. PEI debug lib instance can use these services to implement debug function to reduce the PEIMs which consume the debug lib. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg: Rename confusion function nameChen A Chen2019-02-251-1/+2
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1536 To avoid the confusion caused by function name, rename EfiBootManagerGetNextFullDevicePath to EfiBootManagerGetNextLoadOptionDevicePath. As an API function should add EFIAPI prefix for this function. Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdeModulePkg: Add the new API ResetSystem in the head fileZhichao Gao2019-02-221-1/+27
| | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Add the new API ResetSystem in the related head file so that the consumer can use it through the combination of library instance and head file. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdeModulePkg/SmmLockBoxLib: Support LockBox enlarge in UpdateLockBox()Hao Wu2019-02-221-2/+5
| | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1409 This commit will add the support to enlarge a LockBox when using the LockBoxLib API UpdateLockBox(). Please note that the new support will ONLY work for LockBox with attribute LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY set. The functional uni-test for the commit is available at: https://github.com/hwu25/edk2/tree/lockbox_unitest Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Ray Ni <ray.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdeModulePkg: Add GUID for LockBox to save storage dev to init in S3Hao Wu2019-02-221-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1409 This commit will add the GUID definitions for LockBox which is used to save a list of storage devices that need to get initialized during the S3 resume. The content of the LockBox will be a DevicePath structure that contains zero or more DevicePath instances. Each instance denotes a storage device that needs to get initialized during the S3 resume. The producers of the content of this LockBox will be drivers like OpalPassword DXE driver. This kind of drivers requires some specific storage devices to be initialized during the PEI phase of in S3 resume. (For the OpalPassword case, it requires the managing devices to be automatically unlocked during the S3 resume). The attribute of the LockBox should be set to LOCK_BOX_ATTRIBUTE_RESTORE_IN_S3_ONLY. The consumers of the content of this LockBox will be PEI storage device controller/bus drivers (e.g. NvmExpressPei) during S3 resume. This kind of drivers can use the DevicePath instances stored in the LockBox to get a list of devices that need to get initialized. In such way, an on-demand (partial) device enumeration/initialization can be performed to benefit the S3 resume performance. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@Intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Add definitions for Storage Security Command PPIHao Wu2019-02-221-0/+283
| | | | | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1409 This commit will add the definitions for Storage Security Command (SSC) PPI. This PPI will be be used to abstract mass storage devices to allow code running in the PEI phase to send security protocol commands to mass storage devices without specific knowledge of the type of device or controller that manages the device. More specifically, the PPI will provide services to: * Get the number of mass storage devices managed by a instance of the SSC PPI (by service 'GetNumberofDevices'); * Get the identification information (DevicePath) of a managing mass storage devices (by service 'GetDevicePath'); * Send security protocol commands to mass storage devices (by services 'ReceiveData' and 'SendData'). Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Add definitions for EDKII PEI ATA PassThru PPIHao Wu2019-02-221-0/+219
| | | | | | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1409 This commit will add the definitions for EDKII PEI ATA PassThru PPI. This PPI will provide services that allow ATA commands to be sent to ATA devices attached to an ATA controller in the PEI phase. More specifically, the PPI will provide services to: * Send ATA commands to an ATA device (by service 'PassThru'); * Get the list of the attached ATA device on a controller (by services 'GetNextPort' and 'GetNextDevice'); * Get the identification information (DevicePath) of the underlying ATA host controller (by service 'GetDevicePath'). Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg: Add definitions for ATA AHCI host controller PPIHao Wu2019-02-221-0/+89
| | | | | | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=1409 This commit will add the definitions for ATA AHCI host controller PPI. The purpose of the PPI in to provide: * MMIO base address * Controller identification information (DevicePath) for ATA host controllers working under AHCI mode. Cc: Jian J Wang <jian.j.wang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Eric Dong <eric.dong@intel.com>
* MdeModulePkg/CapsuleApp: Add a function used to get next DevicePathChen A Chen2019-01-311-1/+20
| | | | | | | | | | | | | | BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1482 Add a new function to support Capsule-on-Disk feature. This function is used to get next full DevicePath from a load option. Cc: Jian J Wang <jian.j.wang@intel.com> Cc: Hao Wu <hao.a.wu@intel.com> Cc: Zhang Chao B <chao.b.zhang@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Allow overriding base clock frequencyMarcin Wojtas2018-11-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some SdMmc host controllers are run by clocks with different frequency than it is reflected in Capabilities Register 1. It is allowed by SDHCI specification ver. 4.2 - if BaseClkFreq field value of the Capability Register 1 is zero, the clock frequency must be obtained via another method. Because the bitfield is only 8 bits wide, a maximum value that could be obtained from hardware is 255MHz. In case the actual frequency exceeds 255MHz, the 8-bit BaseClkFreq member of SD_MMC_HC_SLOT_CAP structure occurs to be not sufficient to be used for setting the clock speed in SdMmcHcClockSupply function. This patch adds new UINT32 array ('BaseClkFreq[]') to SD_MMC_HC_PRIVATE_DATA structure for specifying the input clock speed for each slot of the host controller. All routines that are used for clock configuration are updated accordingly. This patch also adds new IN OUT BaseClockFreq field in the Capability callback of the SdMmcOverride, protocol which allows to update BaseClkFreq value. The patch reuses original commit from edk2-platforms: 20f6f144d3a8 ("Marvell/Drivers: XenonDxe: Allow overriding base clock frequency") Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Add SwitchClockFreqPost to SdMmcOverrideTomasz Michalec2018-11-201-0/+1
| | | | | | | | | | | | | Some SD Host Controlers need to do additional operations after clock frequency switch. This patch add new callback type to NotifyPhase of the SdMmcOverride protocol. It is called after SdMmcHcClockSupply. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Add UhsSignaling to SdMmcOverride protocolTomasz Michalec2018-11-201-0/+17
| | | | | | | | | | | | | | | Some SD Host Controllers use different values in Host Control 2 Register to select UHS Mode. This patch adds a new UhsSignaling type routine to the NotifyPhase of the SdMmcOverride protocol. UHS signaling configuration is moved to a common, default routine (SdMmcHcUhsSignaling). After it is executed, the protocol producer can override the values if needed. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Hao Wu <hao.a.wu@intel.com>
* MdeModulePkg/SdMmcPciHcDxe: Add an optional parameter in NotifyPhaseMarcin Wojtas2018-11-201-1/+3
| | | | | | | | | | | | | In order to ensure bigger flexibility in the NotifyPhase routine of the SdMmcOverride protocol, enable using an optional phase-specific data. This will allow to exchange more information between the protocol producer driver and SdMmcPciHcDxe in the newly added callbacks. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marcin Wojtas <mw@semihalf.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Hao Wu <hao.a.wu@intel.com>