diff --git a/MdePkg/Include/Protocol/DtFixup.h b/MdePkg/Include/Protocol/DtFixup.h new file mode 100644 index 0000000000..0f6f3849f9 --- /dev/null +++ b/MdePkg/Include/Protocol/DtFixup.h @@ -0,0 +1,42 @@ +/** @file + Device Tree Fixup Protocol. + + Modifies a device tree in memory to align it with the firmware's view of + the platform. + + Specification: + https://github.com/U-Boot-EFI/EFI_DT_FIXUP_PROTOCOL + + Copyright (c) 2025, Heinrich Schuchardt.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#pragma once + +#include + +// +// {60ed6ba9-dfef-4799-ac7b-75e0f833456c} +// +#define DT_FIXUP_PROTOCOL_GUID \ + { 0x60ed6ba9, 0xdfef, 0x4799, { 0xac, 0x7b, 0x75, 0xe0, 0xf8, 0x33, 0x45, 0x6c } } + +#define DT_FIXUP_PROTOCOL_REVISION 0x00010000 + +typedef struct _DT_FIXUP_PROTOCOL DT_FIXUP_PROTOCOL; + +typedef +EFI_STATUS +(EFIAPI *DT_FIXUP)( + IN DT_FIXUP_PROTOCOL *This, + IN OUT VOID *Fdt, + IN OUT UINTN *BufferSize + ); + +struct _DT_FIXUP_PROTOCOL { + UINT64 Revision; + DT_FIXUP Fixup; +}; + +extern EFI_GUID gDtFixupProtocolGuid; diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index a0b18916a9..92e6f98a72 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1159,6 +1159,9 @@ ## Include/Protocol/CcMeasurement.h gEfiCcMeasurementProtocolGuid = { 0x96751a3d, 0x72f4, 0x41a6, { 0xa7, 0x94, 0xed, 0x5d, 0x0e, 0x67, 0xae, 0x6b }} + ## Include/Protocol/DtFixup.h + gDtFixupProtocolGuid = { 0x60ed6ba9, 0xdfef, 0x4799, { 0xac, 0x7b, 0x75, 0xe0, 0xf8, 0x33, 0x45, 0x6c }} + # # Protocols defined in PI1.0. #