diff options
author | Abner Chang <abner.chang@hpe.com> | 2021-10-11 21:24:08 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2021-10-14 06:25:52 +0000 |
commit | e40fefafa90fb3a9aca77adc697c97cf6a4dd673 (patch) | |
tree | 8b5f6cef00fdb17b06fa7101037671477cd186a5 /EmbeddedPkg/Include | |
parent | a7fcab7aa3de338c02e61fd891610b1ec926e6c8 (diff) | |
download | edk2-e40fefafa90fb3a9aca77adc697c97cf6a4dd673.tar.gz edk2-e40fefafa90fb3a9aca77adc697c97cf6a4dd673.tar.bz2 edk2-e40fefafa90fb3a9aca77adc697c97cf6a4dd673.zip |
ArmVirtPkg/FdtClintDxe: Move FdtClientDxe to EmbeddedPkg
This is one of the series patches to restructure the location of modules under
ArmVirtPkg for RiscVVirtPkg. RiscVVirtPkg leverage FDT Client protocol to
parse FDT nodes.
Signed-off-by: Abner Chang <abner.chang@hpe.com>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>
Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Sunil V L <sunilvl@ventanamicro.com>
Reviewed-by: Daniel Schaefer <daniel.schaefer@hpe.com>
Reviewed-by: Sunil V L <sunilvl@ventanamicro.com>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'EmbeddedPkg/Include')
-rw-r--r-- | EmbeddedPkg/Include/Protocol/FdtClient.h | 129 |
1 files changed, 129 insertions, 0 deletions
diff --git a/EmbeddedPkg/Include/Protocol/FdtClient.h b/EmbeddedPkg/Include/Protocol/FdtClient.h new file mode 100644 index 0000000000..08eb49639b --- /dev/null +++ b/EmbeddedPkg/Include/Protocol/FdtClient.h @@ -0,0 +1,129 @@ +/** @file
+
+ DISCLAIMER: the FDT_CLIENT_PROTOCOL introduced here is a work in progress,
+ and should not be used outside of the EDK II tree.
+
+ Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef __FDT_CLIENT_H__
+#define __FDT_CLIENT_H__
+
+#define FDT_CLIENT_PROTOCOL_GUID { \
+ 0xE11FACA0, 0x4710, 0x4C8E, {0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C} \
+ }
+
+//
+// Protocol interface structure
+//
+typedef struct _FDT_CLIENT_PROTOCOL FDT_CLIENT_PROTOCOL;
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_GET_NODE_PROPERTY) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN INT32 Node,
+ IN CONST CHAR8 *PropertyName,
+ OUT CONST VOID **Prop,
+ OUT UINT32 *PropSize OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_SET_NODE_PROPERTY) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN INT32 Node,
+ IN CONST CHAR8 *PropertyName,
+ IN CONST VOID *Prop,
+ IN UINT32 PropSize
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN CONST CHAR8 *CompatibleString,
+ OUT INT32 *Node
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN CONST CHAR8 *CompatibleString,
+ IN INT32 PrevNode,
+ OUT INT32 *Node
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN CONST CHAR8 *CompatibleString,
+ IN CONST CHAR8 *PropertyName,
+ OUT CONST VOID **Prop,
+ OUT UINT32 *PropSize OPTIONAL
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_REG) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN CONST CHAR8 *CompatibleString,
+ OUT CONST VOID **Reg,
+ OUT UINTN *AddressCells,
+ OUT UINTN *SizeCells,
+ OUT UINT32 *RegSize
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ IN INT32 PrevNode,
+ OUT INT32 *Node,
+ OUT CONST VOID **Reg,
+ OUT UINTN *AddressCells,
+ OUT UINTN *SizeCells,
+ OUT UINT32 *RegSize
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_FIND_MEMORY_NODE_REG) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ OUT INT32 *Node,
+ OUT CONST VOID **Reg,
+ OUT UINTN *AddressCells,
+ OUT UINTN *SizeCells,
+ OUT UINT32 *RegSize
+ );
+
+typedef
+EFI_STATUS
+(EFIAPI *FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE) (
+ IN FDT_CLIENT_PROTOCOL *This,
+ OUT INT32 *Node
+ );
+
+struct _FDT_CLIENT_PROTOCOL {
+ FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty;
+ FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty;
+
+ FDT_CLIENT_FIND_COMPATIBLE_NODE FindCompatibleNode;
+ FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE FindNextCompatibleNode;
+ FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty;
+ FDT_CLIENT_FIND_COMPATIBLE_NODE_REG FindCompatibleNodeReg;
+
+ FDT_CLIENT_FIND_MEMORY_NODE_REG FindMemoryNodeReg;
+ FDT_CLIENT_FIND_NEXT_MEMORY_NODE_REG FindNextMemoryNodeReg;
+
+ FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode;
+};
+
+extern EFI_GUID gFdtClientProtocolGuid;
+
+#endif
|