TianoCore EDK2 master
Loading...
Searching...
No Matches
PciRootBridge.h
Go to the documentation of this file.
1
10#ifndef _PCI_ROOT_BRIDGE_H_
11#define _PCI_ROOT_BRIDGE_H_
12
13#include <PiDxe.h>
16
17//
18// Driver Consumed Protocol Prototypes
19//
20#include <Protocol/CpuIo2.h>
21#include <Protocol/DevicePath.h>
23#include <Library/DebugLib.h>
28#include <Library/BaseLib.h>
30#include <Library/UefiLib.h>
31#include <Library/TimerLib.h>
32#include "PciHostResource.h"
33
34typedef enum {
35 IoOperation,
36 MemOperation,
37 PciOperation
38} OPERATION_TYPE;
39
40#define MAP_INFO_SIGNATURE SIGNATURE_32 ('_', 'm', 'a', 'p')
41typedef struct {
42 UINT32 Signature;
43 LIST_ENTRY Link;
45 UINTN NumberOfBytes;
46 UINTN NumberOfPages;
47 EFI_PHYSICAL_ADDRESS HostAddress;
48 EFI_PHYSICAL_ADDRESS MappedHostAddress;
49} MAP_INFO;
50#define MAP_INFO_FROM_LINK(a) CR (a, MAP_INFO, Link, MAP_INFO_SIGNATURE)
51
52#define PCI_ROOT_BRIDGE_SIGNATURE SIGNATURE_32 ('_', 'p', 'r', 'b')
53
54typedef struct {
55 UINT32 Signature;
56 LIST_ENTRY Link;
57 EFI_HANDLE Handle;
58 UINT64 AllocationAttributes;
59 UINT64 Attributes;
60 UINT64 Supports;
61 PCI_RES_NODE ResAllocNode[TypeMax];
66 PCI_ROOT_BRIDGE_APERTURE MemAbove4G;
67 PCI_ROOT_BRIDGE_APERTURE PMemAbove4G;
68 BOOLEAN DmaAbove4G;
69 BOOLEAN NoExtendedConfigSpace;
70 VOID *ConfigBuffer;
71 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
72 CHAR16 *DevicePathStr;
74
75 BOOLEAN ResourceSubmitted;
76 LIST_ENTRY Maps;
78
79#define ROOT_BRIDGE_FROM_THIS(a) CR (a, PCI_ROOT_BRIDGE_INSTANCE, RootBridgeIo, PCI_ROOT_BRIDGE_SIGNATURE)
80
81#define ROOT_BRIDGE_FROM_LINK(a) CR (a, PCI_ROOT_BRIDGE_INSTANCE, Link, PCI_ROOT_BRIDGE_SIGNATURE)
82
93 IN PCI_ROOT_BRIDGE *Bridge
94 );
95
96//
97// Protocol Member Function Prototypes
98//
99
120EFIAPI
124 IN UINT64 Address,
125 IN UINT64 Mask,
126 IN UINT64 Value,
127 IN UINT64 Delay,
128 OUT UINT64 *Result
129 )
130;
131
152EFIAPI
156 IN UINT64 Address,
157 IN UINT64 Mask,
158 IN UINT64 Value,
159 IN UINT64 Delay,
160 OUT UINT64 *Result
161 )
162;
163
180EFIAPI
184 IN UINT64 Address,
185 IN UINTN Count,
186 IN OUT VOID *Buffer
187 )
188;
189
206EFIAPI
210 IN UINT64 Address,
211 IN UINTN Count,
212 IN OUT VOID *Buffer
213 )
214;
215
233EFIAPI
237 IN UINT64 UserAddress,
238 IN UINTN Count,
239 IN OUT VOID *UserBuffer
240 )
241;
242
260EFIAPI
264 IN UINT64 UserAddress,
265 IN UINTN Count,
266 IN OUT VOID *UserBuffer
267 )
268;
269
287EFIAPI
291 IN UINT64 DestAddress,
292 IN UINT64 SrcAddress,
293 IN UINTN Count
294 )
295;
296
315EFIAPI
319 IN UINT64 Address,
320 IN UINTN Count,
321 IN OUT VOID *Buffer
322 )
323;
324
343EFIAPI
347 IN UINT64 Address,
348 IN UINTN Count,
349 IN OUT VOID *Buffer
350 )
351;
352
375EFIAPI
379 IN VOID *HostAddress,
380 IN OUT UINTN *NumberOfBytes,
381 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
382 OUT VOID **Mapping
383 )
384;
385
404EFIAPI
407 IN VOID *Mapping
408 )
409;
410
438EFIAPI
442 IN EFI_MEMORY_TYPE MemoryType,
443 IN UINTN Pages,
444 OUT VOID **HostAddress,
445 IN UINT64 Attributes
446 )
447;
448
464EFIAPI
467 IN UINTN Pages,
468 OUT VOID *HostAddress
469 )
470;
471
485EFIAPI
488 )
489;
490
514EFIAPI
517 OUT UINT64 *Supported,
518 OUT UINT64 *Attributes
519 )
520;
521
538EFIAPI
541 IN UINT64 Attributes,
542 IN OUT UINT64 *ResourceBase,
543 IN OUT UINT64 *ResourceLength
544 )
545;
546
563EFIAPI
566 OUT VOID **Resources
567 )
568;
569
570extern EFI_CPU_IO2_PROTOCOL *mCpuIo;
571#endif
UINT64 UINTN
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
EFI_STATUS EFIAPI RootBridgeIoPollMem(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
EFI_STATUS EFIAPI RootBridgeIoUnmap(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN VOID *Mapping)
PCI_ROOT_BRIDGE_INSTANCE * CreateRootBridge(IN PCI_ROOT_BRIDGE *Bridge)
EFI_STATUS EFIAPI RootBridgeIoPciWrite(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI RootBridgeIoSetAttributes(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN UINT64 Attributes, IN OUT UINT64 *ResourceBase, IN OUT UINT64 *ResourceLength)
EFI_STATUS EFIAPI RootBridgeIoMemWrite(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI RootBridgeIoIoRead(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 UserAddress, IN UINTN Count, IN OUT VOID *UserBuffer)
EFI_STATUS EFIAPI RootBridgeIoGetAttributes(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, OUT UINT64 *Supported, OUT UINT64 *Attributes)
EFI_STATUS EFIAPI RootBridgeIoMemRead(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI RootBridgeIoFreeBuffer(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN UINTN Pages, OUT VOID *HostAddress)
EFI_STATUS EFIAPI RootBridgeIoCopyMem(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 DestAddress, IN UINT64 SrcAddress, IN UINTN Count)
EFI_STATUS EFIAPI RootBridgeIoAllocateBuffer(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
EFI_STATUS EFIAPI RootBridgeIoConfiguration(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, OUT VOID **Resources)
EFI_STATUS EFIAPI RootBridgeIoMap(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION Operation, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
EFI_STATUS EFIAPI RootBridgeIoFlush(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This)
EFI_STATUS EFIAPI RootBridgeIoPollIo(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINT64 Mask, IN UINT64 Value, IN UINT64 Delay, OUT UINT64 *Result)
EFI_STATUS EFIAPI RootBridgeIoPciRead(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 Address, IN UINTN Count, IN OUT VOID *Buffer)
EFI_STATUS EFIAPI RootBridgeIoIoWrite(IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *This, IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width, IN UINT64 UserAddress, IN UINTN Count, IN OUT VOID *UserBuffer)
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_OPERATION
EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH
UINT64 EFI_PHYSICAL_ADDRESS
Definition: UefiBaseType.h:50
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29
VOID * EFI_HANDLE
Definition: UefiBaseType.h:33
EFI_MEMORY_TYPE
EFI_ALLOCATE_TYPE
Definition: UefiSpec.h:29