]> git.proxmox.com Git - mirror_edk2.git/blob - ArmVirtPkg/Include/Protocol/FdtClient.h
ArmVirtPkg: introduce FdtClientProtocol
[mirror_edk2.git] / ArmVirtPkg / Include / Protocol / FdtClient.h
1 /** @file
2
3 DISCLAIMER: the FDT_CLIENT_PROTOCOL introduced here is a work in progress,
4 and should not be used outside of the EDK II tree.
5
6 Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
7
8 This program and the accompanying materials
9 are licensed and made available under the terms and conditions of the BSD License
10 which accompanies this distribution. The full text of the license may be found at
11 http://opensource.org/licenses/bsd-license.php
12
13 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
14 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15
16 **/
17
18 #ifndef __FDT_CLIENT_H__
19 #define __FDT_CLIENT_H__
20
21 #define FDT_CLIENT_PROTOCOL_GUID { \
22 0xE11FACA0, 0x4710, 0x4C8E, {0xA7, 0xA2, 0x01, 0xBA, 0xA2, 0x59, 0x1B, 0x4C} \
23 }
24
25 //
26 // Protocol interface structure
27 //
28 typedef struct _FDT_CLIENT_PROTOCOL FDT_CLIENT_PROTOCOL;
29
30 typedef
31 EFI_STATUS
32 (EFIAPI *FDT_CLIENT_GET_NODE_PROPERTY) (
33 IN FDT_CLIENT_PROTOCOL *This,
34 IN INT32 Node,
35 IN CONST CHAR8 *PropertyName,
36 OUT CONST VOID **Prop,
37 OUT UINT32 *PropSize OPTIONAL
38 );
39
40 typedef
41 EFI_STATUS
42 (EFIAPI *FDT_CLIENT_SET_NODE_PROPERTY) (
43 IN FDT_CLIENT_PROTOCOL *This,
44 IN INT32 Node,
45 IN CONST CHAR8 *PropertyName,
46 IN CONST VOID *Prop,
47 IN UINT32 PropSize
48 );
49
50 typedef
51 EFI_STATUS
52 (EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE) (
53 IN FDT_CLIENT_PROTOCOL *This,
54 IN CONST CHAR8 *CompatibleString,
55 OUT INT32 *Node
56 );
57
58 typedef
59 EFI_STATUS
60 (EFIAPI *FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE) (
61 IN FDT_CLIENT_PROTOCOL *This,
62 IN CONST CHAR8 *CompatibleString,
63 IN INT32 PrevNode,
64 OUT INT32 *Node
65 );
66
67 typedef
68 EFI_STATUS
69 (EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY) (
70 IN FDT_CLIENT_PROTOCOL *This,
71 IN CONST CHAR8 *CompatibleString,
72 IN CONST CHAR8 *PropertyName,
73 OUT CONST VOID **Prop,
74 OUT UINT32 *PropSize OPTIONAL
75 );
76
77 typedef
78 EFI_STATUS
79 (EFIAPI *FDT_CLIENT_FIND_COMPATIBLE_NODE_REG) (
80 IN FDT_CLIENT_PROTOCOL *This,
81 IN CONST CHAR8 *CompatibleString,
82 OUT CONST VOID **Reg,
83 OUT UINT32 *RegElemSize,
84 OUT UINT32 *RegSize
85 );
86
87 typedef
88 EFI_STATUS
89 (EFIAPI *FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE) (
90 IN FDT_CLIENT_PROTOCOL *This,
91 OUT INT32 *Node
92 );
93
94 struct _FDT_CLIENT_PROTOCOL {
95 FDT_CLIENT_GET_NODE_PROPERTY GetNodeProperty;
96 FDT_CLIENT_SET_NODE_PROPERTY SetNodeProperty;
97
98 FDT_CLIENT_FIND_COMPATIBLE_NODE FindCompatibleNode;
99 FDT_CLIENT_FIND_NEXT_COMPATIBLE_NODE FindNextCompatibleNode;
100 FDT_CLIENT_FIND_COMPATIBLE_NODE_PROPERTY FindCompatibleNodeProperty;
101 FDT_CLIENT_FIND_COMPATIBLE_NODE_REG FindCompatibleNodeReg;
102
103 FDT_CLIENT_GET_OR_INSERT_CHOSEN_NODE GetOrInsertChosenNode;
104 };
105
106 extern EFI_GUID gFdtClientProtocolGuid;
107
108 #endif