]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg: introduce FdtClientProtocol
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Fri, 8 Apr 2016 09:44:48 +0000 (11:44 +0200)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Mon, 11 Apr 2016 16:12:21 +0000 (18:12 +0200)
This introduces the FdtClientProtocol, which will be used to expose the
device tree provided by the host to other DXE drivers.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
ArmVirtPkg/ArmVirtPkg.dec
ArmVirtPkg/Include/Protocol/FdtClient.h [new file with mode: 0644]

index b6ff63677837fe02e41c599e90efba0a8e4e58f7..fa908253b3205378cfa38e76ea6c2d48d23ff768 100644 (file)
@@ -34,6 +34,9 @@
   gArmVirtTokenSpaceGuid = { 0x0B6F5CA7, 0x4F53, 0x445A, { 0xB7, 0x6E, 0x2E, 0x36, 0x5B, 0x80, 0x63, 0x66 } }\r
   gEarlyPL011BaseAddressGuid       = { 0xB199DEA9, 0xFD5C, 0x4A84, { 0x80, 0x82, 0x2F, 0x41, 0x70, 0x78, 0x03, 0x05 } }\r
 \r
+[Protocols]\r
+  gFdtClientProtocolGuid = { 0xE11FACA0, 0x4710, 0x4C8E, { 0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C } }\r
+\r
 [PcdsFixedAtBuild, PcdsPatchableInModule]\r
   #\r
   # This is the physical address where the device tree is expected to be stored\r
diff --git a/ArmVirtPkg/Include/Protocol/FdtClient.h b/ArmVirtPkg/Include/Protocol/FdtClient.h
new file mode 100644 (file)
index 0000000..79a8f3c
--- /dev/null
@@ -0,0 +1,108 @@
+/** @file\r
+\r
+  DISCLAIMER: the FDT_CLIENT_PROTOCOL introduced here is a work in progress,\r
+  and should not be used outside of the EDK II tree.\r
+\r
+  Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>\r
+\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __FDT_CLIENT_H__\r
+#define __FDT_CLIENT_H__\r
+\r
+#define FDT_CLIENT_PROTOCOL_GUID { \\r
+  0xE11FACA0, 0x4710, 0x4C8E, {0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C} \\r
+  }\r
+\r
+//\r
+// Protocol interface structure\r
+//\r
+typedef struct _FDT_CLIENT_PROTOCOL FDT_CLIENT_PROTOCOL;\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_GET_NODE_PROPERTY) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  IN  INT32                   Node,\r
+  IN  CONST CHAR8             *PropertyName,\r
+  OUT CONST VOID              **Prop,\r
+  OUT UINT32                  *PropSize OPTIONAL\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_SET_NODE_PROPERTY) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  IN  INT32                   Node,\r
+  IN  CONST CHAR8             *PropertyName,\r
+  IN  CONST VOID              *Prop,\r
+  IN  UINT32                  PropSize\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  IN  CONST CHAR8             *CompatibleString,\r
+  OUT INT32                   *Node\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  IN  CONST CHAR8             *CompatibleString,\r
+  IN  INT32                   PrevNode,\r
+  OUT INT32                   *Node\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  IN  CONST CHAR8             *CompatibleString,\r
+  IN  CONST CHAR8             *PropertyName,\r
+  OUT CONST VOID              **Prop,\r
+  OUT UINT32                  *PropSize OPTIONAL\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_REG) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  IN  CONST CHAR8             *CompatibleString,\r
+  OUT CONST VOID              **Reg,\r
+  OUT UINT32                  *RegElemSize,\r
+  OUT UINT32                  *RegSize\r
+  );\r
+\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE) (\r
+  IN  FDT_CLIENT_PROTOCOL     *This,\r
+  OUT INT32                   *Node\r
+  );\r
+\r
+struct _FDT_CLIENT_PROTOCOL {\r
+  FDT_CLIENT_GET_NODE_PROPERTY             GetNodeProperty;\r
+  FDT_CLIENT_SET_NODE_PROPERTY             SetNodeProperty;\r
+\r
+  FDT_CLIENT_FIND_COMPATIBLE_NODE          FindCompatibleNode;\r
+  FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE     FindNextCompatibleNode;\r
+  FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty;\r
+  FDT_CLIENT_FIND_COMPATIBLE_NODE_REG      FindCompatibleNodeReg;\r
+\r
+  FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE     GetOrInsertChosenNode;\r
+};\r
+\r
+extern EFI_GUID gFdtClientProtocolGuid;\r
+\r
+#endif\r