Skip to content

Commit 1a74576

Browse files
dimorinnyxypron
andcommitted
EmbeddedPkg: Introduce DT_FIXUP protocol
Proposed by [email protected]: https://github.com/U-Boot-EFI/EFI_DT_FIXUP_PROTOCOL Co-authored-by: Heinrich Schuchardt <[email protected]> Signed-off-by: Dmitrii Merkurev <[email protected]>
1 parent cb15d7b commit 1a74576

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/** @file
2+
3+
Copyright (c) 2025, Heinrich Schuchardt.
4+
5+
SPDX-License-Identifier: BSD-2-Clause-Patent
6+
7+
**/
8+
9+
/*
10+
DT Fix-up Protocol.
11+
Lets firmware patch a flattened-device-tree and reserve memory ranges.
12+
13+
Related docs:
14+
https://github.com/U-Boot-EFI/EFI_DT_FIXUP_PROTOCOL
15+
*/
16+
17+
#ifndef DT_FIXUP_PROTOCOL_H_
18+
#define DT_FIXUP_PROTOCOL_H_
19+
20+
#include <Uefi/UefiBaseType.h>
21+
22+
//
23+
// {e617d64c-fe08-46da-f4dc-bbd5870c7300}
24+
//
25+
#define DT_FIXUP_PROTOCOL_GUID \
26+
{ 0xe617d64c, 0xfe08, 0x46da, { 0xf4, 0xdc, 0xbb, 0xd5, 0x87, 0x0c, 0x73, 0x00 } }
27+
28+
#define DT_FIXUP_PROTOCOL_REVISION 0x00010000
29+
30+
typedef struct _DT_FIXUP_PROTOCOL DT_FIXUP_PROTOCOL;
31+
32+
#define DT_FIXUP_APPLY_FIXUPS 0x00000001
33+
#define DT_FIXUP_RESERVE_MEMORY 0x00000002
34+
#define DT_FIXUP_ALL (DT_FIXUP_APPLY_FIXUPS | DT_FIXUP_RESERVE_MEMORY)
35+
36+
typedef
37+
EFI_STATUS
38+
(EFIAPI *DT_FIXUP)(
39+
IN DT_FIXUP_PROTOCOL *This,
40+
IN OUT VOID *Fdt,
41+
IN OUT UINTN *BufferSize,
42+
IN UINT32 Flags
43+
);
44+
45+
struct _DT_FIXUP_PROTOCOL {
46+
UINT64 Revision;
47+
DT_FIXUP Fixup;
48+
};
49+
50+
#endif // DT_FIXUP_PROTOCOL_H_

0 commit comments

Comments
 (0)