summaryrefslogtreecommitdiff
path: root/EmbeddedPkg/Include/Protocol/FdtClient.h
blob: 723be88cfc1f1dfc67b3b194dd76c6374d0c8059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
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