TianoCore EDK2 master
Loading...
Searching...
No Matches
PciCommand.h
Go to the documentation of this file.
1
9#ifndef _EFI_PCI_COMMAND_H_
10#define _EFI_PCI_COMMAND_H_
11
12//
13// The PCI Command register bits owned by PCI Bus driver.
14//
15// They should be cleared at the beginning. The other registers
16// are owned by chipset, we should not touch them.
17//
18#define EFI_PCI_COMMAND_BITS_OWNED ( \
19 EFI_PCI_COMMAND_IO_SPACE | \
20 EFI_PCI_COMMAND_MEMORY_SPACE | \
21 EFI_PCI_COMMAND_BUS_MASTER | \
22 EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE | \
23 EFI_PCI_COMMAND_VGA_PALETTE_SNOOP | \
24 EFI_PCI_COMMAND_FAST_BACK_TO_BACK \
25 )
26
27//
28// The PCI Bridge Control register bits owned by PCI Bus driver.
29//
30// They should be cleared at the beginning. The other registers
31// are owned by chipset, we should not touch them.
32//
33#define EFI_PCI_BRIDGE_CONTROL_BITS_OWNED ( \
34 EFI_PCI_BRIDGE_CONTROL_ISA | \
35 EFI_PCI_BRIDGE_CONTROL_VGA | \
36 EFI_PCI_BRIDGE_CONTROL_VGA_16 | \
37 EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK \
38 )
39
40//
41// The PCCard Bridge Control register bits owned by PCI Bus driver.
42//
43// They should be cleared at the beginning. The other registers
44// are owned by chipset, we should not touch them.
45//
46#define EFI_PCCARD_BRIDGE_CONTROL_BITS_OWNED ( \
47 EFI_PCI_BRIDGE_CONTROL_ISA | \
48 EFI_PCI_BRIDGE_CONTROL_VGA | \
49 EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK \
50 )
51
52#define EFI_GET_REGISTER 1
53#define EFI_SET_REGISTER 2
54#define EFI_ENABLE_REGISTER 3
55#define EFI_DISABLE_REGISTER 4
56
71 IN PCI_IO_DEVICE *PciIoDevice,
72 IN UINT16 Command,
73 IN UINT8 Offset,
74 IN UINT8 Operation,
75 OUT UINT16 *PtrCommand
76 );
77
87BOOLEAN
89 IN PCI_IO_DEVICE *PciIoDevice
90 );
91
107 IN PCI_IO_DEVICE *PciIoDevice,
108 IN UINT8 CapId,
109 IN OUT UINT8 *Offset,
110 OUT UINT8 *NextRegBlock OPTIONAL
111 );
112
128 IN PCI_IO_DEVICE *PciIoDevice,
129 IN UINT16 CapId,
130 IN OUT UINT32 *Offset,
131 OUT UINT32 *NextRegBlock OPTIONAL
132 );
133
143#define PCI_READ_COMMAND_REGISTER(a, b) \
144 PciOperateRegister (a, 0, PCI_COMMAND_OFFSET, EFI_GET_REGISTER, b)
145
155#define PCI_SET_COMMAND_REGISTER(a, b) \
156 PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_SET_REGISTER, NULL)
157
167#define PCI_ENABLE_COMMAND_REGISTER(a, b) \
168 PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_ENABLE_REGISTER, NULL)
169
179#define PCI_DISABLE_COMMAND_REGISTER(a, b) \
180 PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_DISABLE_REGISTER, NULL)
181
191#define PCI_READ_BRIDGE_CONTROL_REGISTER(a, b) \
192 PciOperateRegister (a, 0, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_GET_REGISTER, b)
193
203#define PCI_SET_BRIDGE_CONTROL_REGISTER(a, b) \
204 PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_SET_REGISTER, NULL)
205
215#define PCI_ENABLE_BRIDGE_CONTROL_REGISTER(a, b) \
216 PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_ENABLE_REGISTER, NULL)
217
227#define PCI_DISABLE_BRIDGE_CONTROL_REGISTER(a, b) \
228 PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_DISABLE_REGISTER, NULL)
229
230#endif
#define IN
Definition: Base.h:279
#define OUT
Definition: Base.h:284
BOOLEAN PciCapabilitySupport(IN PCI_IO_DEVICE *PciIoDevice)
Definition: PciCommand.c:81
EFI_STATUS LocatePciExpressCapabilityRegBlock(IN PCI_IO_DEVICE *PciIoDevice, IN UINT16 CapId, IN OUT UINT32 *Offset, OUT UINT32 *NextRegBlock OPTIONAL)
Definition: PciCommand.c:195
EFI_STATUS PciOperateRegister(IN PCI_IO_DEVICE *PciIoDevice, IN UINT16 Command, IN UINT8 Offset, IN UINT8 Operation, OUT UINT16 *PtrCommand)
Definition: PciCommand.c:24
EFI_STATUS LocateCapabilityRegBlock(IN PCI_IO_DEVICE *PciIoDevice, IN UINT8 CapId, IN OUT UINT8 *Offset, OUT UINT8 *NextRegBlock OPTIONAL)
Definition: PciCommand.c:106
RETURN_STATUS EFI_STATUS
Definition: UefiBaseType.h:29