Commit Graph

4305 Commits

Author SHA1 Message Date
Alexander Gryanko
d55642f537 MdePkg: added mocks for DevicePathLib and OpenProtocol
Added Google Mock test support for DevicePathLib.
Added OpenProtocol and CloseProtocol for UefiBootServicesTableLib
mock library.

Signed-off-by: Alexander Gryanko <xpahos@gmail.com>
2025-08-07 01:18:26 +00:00
Gowtham M
0662754134 MdePkg/Library: Remove MM_STANDALONE LibraryClass in UefiDevicePathLib.inf
UefiDevicePathLib.inf consumes Boot Services in
MdePkg/Library/UefiDevicePathLib/DevicePathUtilitiesDxeSmm.c
- DevicePathFromHandle().
And so cannot be used by MM_STANDALONE drivers.

Instead, MM_STANDALONE drivers can use UefiDevicePathLibBase.inf
as the DevicePathLib of choice.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-08-06 17:43:56 +00:00
Gowtham M
fdd6796d08 MdePkg/Library: Remove UefiDevicePathLibStandaloneMm.inf
The file UefiDevicePathLibStandaloneMm.inf was reintroduced in [#3187] to
give downstream platforms time to transition to UefiDevicePathLibBase.inf
As nearly three years have passed since that change,
and downstream consumers have had sufficient time to migrate,
this library can now be safely removed.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-08-06 17:43:56 +00:00
Abdul Lateef Attar
10f0364b61 MdePkg/Acpi50: Add revision macro for Serial Bus UART structure
The Serial Bus UART structure was introduced in ACPI 5.0.

This patch defines a revision macro for this structure and
also adds type specific flag macros.

Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-21 13:50:05 +00:00
Sunil V L
988162092b MdePkg: Acpi66: Update FADT and MADT versions
According to the recently released ACPI 6.6 specification, the minor
version of the Fixed ACPI Description Table (FADT) should be updated to
revision 6, and the Multiple APIC Description Table (MADT) should use
revision 7. Update the macros to reflect this.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
2025-07-21 09:28:16 +00:00
Sunil V L
b0fb8da1fa MdePkg: Acpi66: Add newly defined RISC-V affinity structure
ACPI 6.6 defines new affinity structure for RISC-V Intc. Add their
definitions.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
2025-07-21 09:28:16 +00:00
Sunil V L
6b8522d007 MdePkg: Acpi66: Add RISC-V MADT and RHCT structures
ACPI 6.6 introduced new MADT structures for RISC-V and a new static
table RHCT. Add the definitions for these new structures.

Signed-off-by: Sunil V L <sunilvl@ventanamicro.com>
2025-07-21 09:28:16 +00:00
Tuan Phan
be053713c0 MdePkg: RISC-V: Add PeiServicesTablePointerLib
Based on PI 1.9, the PEI service pointer will be stored in the
scratch register.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-07-15 05:45:15 +00:00
Tuan Phan
4d80dc68c6 MdePkg: RISC-V: Remove firmware context APIs
Eliminate the APIs using the scratch register as PI 1.9 specifies
it for the PEI service table pointer.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-07-15 05:45:15 +00:00
Tuan Phan
8f62819df3 MdePkg/BaseCpuLib: Add FPU initialization support for RISC-V
Enable RISC-V support for the InitializeFloatingPointUnits function.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
2025-07-15 05:45:15 +00:00
Sarah Walker
42b30dbc03 MdePkg: Include: Add defines for AA64PFR2 system register
The AA64PFR2 system register is required to detect GICv5 support.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-07-15 02:10:39 +00:00
Oliver Smith-Denny
dbf45a870b MdePkg: Add DEBUG_SECURITY Bit in PcdDebugPrintErrorLevel
Tcg2Dxe and its libraries are currently the noisiest modules in
edk2. For a sample platform printing at INFO level, Tcg2Dxe
printed 4,000 lines out of 5,700 total lines printed.

This commit defines a DEBUG_SECURITY bit to control the debug output
of Tcg2Dxe and other security related components. Most of the output is
not useful except for deep debugging of TPM transactions, so it is
appropriate to only print when the DEBUG_SECURITY bit is present.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-07-14 07:25:12 +00:00
Akshay Behl
8c721d68ea MdePkg, EmbeddedPkg: Moved definition of Fdt Guid to MdePkg
MdePkg has a more refined implementation of Fdt as compared
to the EmbeddedPkg which was the initial implementation, hence
moving the Fdt Guid from EmbeddedPkg to MdePkg.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Akshay Behl <cap2k4@rivosinc.com>

Co-authored-by: Dhaval Sharma <dhaval@rivosinc.com>
2025-07-08 18:35:46 +00:00
GuoMinJ
c7569abdc4 MdePkg: Remove UGA support
The Universal Graphics Adapter (UGA) is a graphic abstraction.
The UGA I/O and Draw protocols are deprecated since UEFI 2.0 was
introduced. Cf. the UEFI spec v2.9:
"Appendix L - EFI 1.10 Protocol Changes and Deprecation List"
section L.2 "Deprecated Protocols"

Remove the UGA support.

Signed-off-by: GuoMinJ <newexplorerj@gmail.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-08 15:42:03 +00:00
Abdul Lateef Attar
0eae93e07c MdePkg: Correct spelling errors and typos
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-04 09:41:47 +08:00
Kun Qin
a0d78f6625 MdePkg: ArmFfaMemMgmtLib: Introduce FF-A memory protocol library
This change introduced a library interface that implements the FF-A
memory protocol v1.3 ALP1:
https://developer.arm.com/documentation/den0140/f

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 17:38:28 +00:00
Kun Qin
22142b4f4a MdePkg, MdeModulePkg: ArmFfaLib: Expose FFA_ARGS and ArmCallFfa
FFA is a framework that supports various protocols built on top. i.e.
memory protocol, which is nothing that can be done through existing
interfaces.

Instead of requiring protocol authors to check conduit PCD in every
implementation, exposing the ArmCallFfa is a unified way to allow other
protocols to leverage FFA interfaces.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-26 17:38:28 +00:00
Dionna Glaze
d7110cd638 MdePkg: Add ACPI 5.1 table definition for WAET
This is a struct needed for virtualizing Windows.

https://uefi.org/acpi entry for WAET links to
https://learn.microsoft.com/en-us/previous-versions/gg487524(v=msdn.10)

which describes the 32-bit flags field with bits 0 and 1 defined.

Signed-off-by: Dionna Glaze <dionnaglaze@google.com>
2025-06-25 20:53:49 +00:00
Michael D Kinney
953b9d0e57 MdePkg: Use Library/GoogleTestLib.h
Update unit tests to use GoogleTestLib.h instead
of gtest.h so the edk2 extensions for google tests
are always available.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-06-24 19:32:41 +00:00
Ceping Sun
510a5c2039 MdePkg/Acpi66.h: Add ACPI 6.6 header
Create Acpi66.h, which is copied from Acpi65.h, and make the following
changes:

1. Replace all occurences of "6.5/6_5" with "6.6/6_6".
2. Add "ResetVector" in Multiprocessor Wakeup Structure.
3. Add "Test" command for Multiprocessor Wakeup Mailbox.
4. Make Acpi66.h the latest ACPI definitions that Acpi.h contains.

Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Signed-off-by: Ceping Sun <cepingx.sun@intel.com>
2025-06-20 10:23:42 +08:00
Gao Qihang
dcfb898199 MdePkg: Fix EFI_SUCCESS typos
EFI_SUCESS -> EFI_SUCCESS

Signed-off-by: Gao Qihang <gaoqihang@loongson.cn>
2025-06-12 17:50:45 +00:00
Dongyan Qian
614d5ba332 MdePkg: Fix definition typos
`defintion`->`definition`

Signed-off-by: Dongyan Qian <qiandongyan@loongson.cn>
2025-06-11 17:20:20 +00:00
Kun Qin
6ec73a6c95 MdePkg: BaseLib: Add UUID-GUID conversion function
With interactions between Standalone MM partitions and normal UEFI
environment, there is constant need to convert UUID to GUID and back.

This change added 2 new interfaces to BaseLib that support such usage.

Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-06-05 05:01:57 +00:00
Leif Lindholm
6b1b031cef MdePkg/BaseFdtLib: fix declaration/definition misalignment
Commit e25331fc45
("MdePkg,UefiPayloadPkg: clean up BaseFdtLib API confusion"),
missed out aligning the wrapper for fdt_node_offset_by_property_value
between heade and implementation.
Fix this by updating the header to declare FdtNodeOffsetByPropValue
instead of FdtNodeOffsetByPropertyValue.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-05-30 08:59:54 +00:00
Leif Lindholm
72dc1d0104 MdePkg/BaseFdtLib: add a few new function wrappers
Add FdtSetPropString(), FdtDelNode() and FdtGetPath().

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-05-30 08:59:54 +00:00
levi.yun
365085f707 MdePkg/IndustryStandard: update Tpm2Acpi table to revision 5
Tpm2AcpiTable revision 5 adds new START_METHOD with Arm FF-A transfer.
add related information and update its generator.

Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-05-28 16:48:18 +00:00
Bhavani Subramanian
9c1259b4ed MdePkg: Added MockHiiDatabase protocol
Signed-off-by: Bhavani Subramanian <v-bhavanisu@microsoft.com>
2025-05-28 08:01:10 +00:00
Levi Yun
29520ddcbb MdePkg/IndustryStandard: add CRB Cap value in TpmPtp.h
add some value macro used for discerning CRB capabilties

Links: https://trustedcomputinggroup.org/resource/pc-client-platform-tpm-profile-ptp-specification/
Signed-off-by: Yeoreum Yun <yeoreum.yun@arm.com>
2025-05-28 03:17:05 +00:00
VarshitPandya
c04c2514af MdePkg: Add comment describing address parameter in PciSegmentLib
MdePkg/Include/Library/PciSegmentLib.h includes address parameter definition,
add the same comment here for explaining the INVALID_PCI_SEGMENT_ADDRESS flag.

Signed-off-by: VarshitPandya <varshit.pandya@arm.com>
2025-05-26 09:06:15 +08:00
Abhishek Mainkar
9948a30645 MdePkg/IndustryStandard: fix PASID supported bit
Fix #define EFI_ACPI_IORT_ROOT_COMPLEX_PASID_SUPPORTED from BIT1 to BIT0
based on IO Remapping Table Platform Design Document Issue E.f

Add macros for minimum and maximum PASID capabilites for PCI root
complex node.

Signed-off-by: Abhishek Mainkar <abmainkar@nvidia.com>
2025-04-30 16:33:08 +00:00
Leif Lindholm
a862c07a3a MdePkg/BaseFdtLib: add FdtGetPropertyW wrapper
Add wrapper for fdt_get_property_w.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30 10:56:03 +00:00
Leif Lindholm
cc52f88e61 MdePkg/BaseFdtLib: add FdtSubnodeOffset prototype
FdtSubnodeOffset was added to FdtLib.c, but missed out of the header.
Add the prototype to the header.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30 10:56:03 +00:00
Leif Lindholm
e25331fc45 MdePkg,UefiPayloadPkg: clean up BaseFdtLib API confusion
Commit 8040fdbb8b (MdePkg: consistently use "Property" in BaseFdtLib)
got a bit carried away and confused around how libfdt contains both
getprop and get_property functions, which operate quite differently;
the getprop variant returns a pointer to the value of the property,
whereas the get_property returns a pointer to the fdt_property
structure.

Untangle this, including fixing up affected existing in-tree users, and
adding the previously not exported FdtGetProp wrapper on fdt_getprop.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-04-30 10:56:03 +00:00
Cian Costello
aa32d2cfc2 MdePkg: Add additional PCIe extended capabilities
Changes applied to appropriate PCIExpress
header files based on the specification.

Signed-off-by: Cian Costello <ccostello@nvidia.com>
2025-04-30 04:11:42 +00:00
Jiaxin Wu
1c4c85a003 MdePkg/Library: Remove unused gEfiDevicePathProtocolGuid
Remove unused gEfiDevicePathProtocolGuid in Base UefiDevicePathLib
since it's not used.

Signed-off-by: Jiaxin Wu <jiaxin.wu@intel.com>
2025-04-22 15:42:33 +00:00
Michael D Kinney
be4ae9a97d MdePkg/Include/Ppi: Add back gEdkiiPeiMpServices2PpiGuid
Commit aef50446ce
removed gEdkiiPeiMpServices2PpiGuid from UefiCpuPkg.dec
which causes build breaks if an INF [Ppis] section
lists gEdkiiPeiMpServices2PpiGuid. There is no method
for a DEC file for conditionally declare a PPI.

In order to support the migration from use of
gEdkiiPeiMpServices2PpiGuid to the preferred use of the
gPeiMpServices2Ppi, update MpServices2.h in MdePkg
to define EDKII_PEI_MP_SERVICES2_PPI_GUID and
EDKII_PEI_MP_SERVICES2_PPI.

All references to the EDK II PEI MP Services 2 PPI can be
removed after all downstream consumers have had a chance
to perform the migration.

Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-04-22 14:43:52 +00:00
Nick Ramirez
8406e672e8 MdePkg: Updated Memory Form Factor definition per SMBIOS 3.8.0
This patch adds support for the new CAMM form factor
defined in SMBIOS specification 3.8.0

Signed-off-by: Nick Ramirez <nramirez@nvidia.com>
2025-04-22 11:53:23 +08:00
Paul Huang
62390a89c5 MdePkg: Fix typos in PerformanceLib.h
propery -> property
lof     -> log
evnent  -> event

Signed-off-by: Paul Huang <aphroteus@gmail.com>
2025-04-19 00:47:42 +00:00
INDIA\sachinganesh
29960f389f MdePkg: Add conditional backwards compatibility to MpServices2 aliases
EDKII_PEI_MP_SERVICES2_PPI has been renamed to EFI_PEI_MP_SERVICES2_PPI
and moved to MdePkg. EDKII_PEI_MP_SERVICES2_PPI structure and PPI GUID
are provided as backward compatible references.

These references have been wrapped under a conditional to aid with
its eventual removal.

To enable, define ENABLE_DEPRECATED_EDKII_MP_SERVICES2.

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-04-18 17:13:55 +00:00
INDIA\sachinganesh
27b063a1ff MdePkg: Add EFI_PEI_MP_SERVICES2_PPI
EFI_PEI_MP_SERVICES2_PPI has been added to MdePkg.

This PPI earlier existed as EDKII_PEI_MP_SERVICES2_PPI in UefiCpuPkg.

EDKII_PEI_MP_SERVICES2_PPI structure and PPI GUID are provided as
references for backwards compatibility.

Signed-off-by: Sachin Ganesh <sachinganesh@ami.com>
2025-04-18 17:13:55 +00:00
Dun Tan
161fa22bef MdePkg: Add two new APIs in HobLib
This commit is to add two new APIs in MdePkg PeiHobLib,
DxeHobLib, DxeCoreHobLib and MockHobLib:

1.The GetNextMemoryAllocationGuidHob () returns the next
instance of the Memory Allocation HOB with the matched

GUID from a starting HOB pointer.

2.The TagMemoryAllocationHobWithGuid () searchs the HOB

list for the Memory Allocation HOB with a matching base

address and set the Name GUID. Then the instance of the
tagged Memory Allocation HOB with matched base address is

returned.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-04-18 03:48:07 +00:00
Dun Tan
3872c38049 MdePkg/Include: Add two new APIs in HobLib.h
This commit is to add two new APIs in HobLib.h:
GetNextMemoryAllocationGuidHob ()
TagMemoryAllocationHobWithGuid ()

The UEFI_PI_SPEC defines the EFI_GUID Name in the
EFI_HOB_MEMORY_ALLOCATION_HEADER as:
A GUID that defines the memory allocation region’s type
and purpose, as well as other fields within the memory
allocation HOB.

Currently there is no API in HobLib to handle this Name
GUID in EFI_HOB_MEMORY_ALLOCATION_HEADER, and the code
logic is common. So the following 2 APIs are added to:

1.The GetNextMemoryAllocationGuidHob () returns the next
instance of the Memory Allocation HOB with the matched
GUID from a starting HOB pointer.

2.The TagMemoryAllocationHobWithGuid () searchs the HOB
list for the Memory Allocation HOB with a matching base
address and set the Name GUID. Then the instance of the
tagged Memory Allocation HOB with matched base address is
returned.

Signed-off-by: Dun Tan <dun.tan@intel.com>
2025-04-18 03:48:07 +00:00
Sarah Walker
28b952a56b MdePkg: Add as-is baud rate setting to SPCR
The SPCR specification at
https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/serial-port-console-redirection-table
states that baud rate 0 is interpreted as "as-is". This indicates that the
OS should rely on the current UART configuration until the full featured
driver is initialized.

Signed-off-by: Sarah Walker <Sarah.Walker2@arm.com>
2025-04-17 14:13:07 +01:00
Kun Qin
937ffef8ed ArmPkg: ArmFfaLib.h: Move to MdePkg
As a set of definitions from an industry specification-defined interface,
ArmFfaLib.h is more appropriately placed in MdePkg.

This update relocates both the header definition of ArmFfaLib to MdePkg,
thereby supporting the monitor call primitives for all other packages
that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
541c46a705 ArmPkg: ArmSvcLib: Move ArmSvcLib to MdePkg
As an implementation of an industry specification-defined interface,
ArmSvcLib is more appropriately placed in MdePkg.

This update relocates both the header definition and the implementation
of ArmSvcLib to MdePkg, thereby supporting the supervisor call primitives
for all other packages that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
211bb9b839 ArmPkg: ArmSmcLibNull: Move ArmSmcLibNull to MdePkg
ArmSmcLibNull is a null implementation of an industry specification-
defined interface, which is defined in MdePkg.

This update relocates the null implementation of ArmSmcLib to MdePkg,
thereby supporting the monitor call primitives for ARM platforms that
does not have SMC capabilities.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
86099b948b ArmPkg: ArmSmcLib: Move ArmSmcLib to MdePkg
As an implementation of an industry specification-defined interface,
ArmSmcLib is more appropriately placed in MdePkg.

This update relocates both the header definition and the implementation
of ArmSmcLib to MdePkg, thereby supporting the monitor call primitives
for all other packages that depend on this interface.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
014689399f ArmPkg: FF-A headers: Move to MdePkg
ArmFfaBootInfo.h, ArmFfaPartInfo.h and ArmFfaSvc.h comprise a set of
definitions established by industry standard specifications:
https://developer.arm.com/documentation/den0077/latest

This update relocates the header definitions from ArmPkg to MdePkg to
maintain consistency within the EDK2 layout.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
9bcb2e41f7 ArmPkg: ArmStdSmc.h: Move to MdePkg
ArmStdSmc.h comprises a set of definitions established by an industry
standard specification:
https://developer.arm.com/documentation/den0028/latest/

This update relocates the header definition from ArmPkg to MdePkg to
maintain consistency within the EDK2 repo layout.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2025-04-10 17:52:48 +00:00
Kun Qin
3da340ccdd MdePkg: MmCommunication: Introduce EFI_PEI_MM_COMMUNICATION3_PPI to MdePkg
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3398
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3430

This change introduces a new definition for MM communicate PPI v3.

This PPI will be installed under a new GUID in contrast to exisiting
EFI_PEI_MM_COMMUNICATION_PPI.

Data communicated to MM through EFI_PEI_MM_COMMUNICATION3_PPI should
always start with EFI_MM_COMMUNICATE_HEADER_V3 with its HeaderGuid,
Signature and Version fields properly populated.

Signed-off-by: Kun Qin <kuqin12@gmail.com>
2025-04-07 07:42:13 +00:00