TianoCore EDK2 master
Loading...
Searching...
No Matches
PciCommand.h File Reference

Go to the source code of this file.

Macros

#define EFI_PCI_COMMAND_BITS_OWNED
 
#define EFI_PCI_BRIDGE_CONTROL_BITS_OWNED
 
#define EFI_PCCARD_BRIDGE_CONTROL_BITS_OWNED
 
#define EFI_GET_REGISTER   1
 
#define EFI_SET_REGISTER   2
 
#define EFI_ENABLE_REGISTER   3
 
#define EFI_DISABLE_REGISTER   4
 
#define PCI_READ_COMMAND_REGISTER(a, b)    PciOperateRegister (a, 0, PCI_COMMAND_OFFSET, EFI_GET_REGISTER, b)
 
#define PCI_SET_COMMAND_REGISTER(a, b)    PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_SET_REGISTER, NULL)
 
#define PCI_ENABLE_COMMAND_REGISTER(a, b)    PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_ENABLE_REGISTER, NULL)
 
#define PCI_DISABLE_COMMAND_REGISTER(a, b)    PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_DISABLE_REGISTER, NULL)
 
#define PCI_READ_BRIDGE_CONTROL_REGISTER(a, b)    PciOperateRegister (a, 0, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_GET_REGISTER, b)
 
#define PCI_SET_BRIDGE_CONTROL_REGISTER(a, b)    PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_SET_REGISTER, NULL)
 
#define PCI_ENABLE_BRIDGE_CONTROL_REGISTER(a, b)    PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_ENABLE_REGISTER, NULL)
 
#define PCI_DISABLE_BRIDGE_CONTROL_REGISTER(a, b)    PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_DISABLE_REGISTER, NULL)
 

Functions

EFI_STATUS PciOperateRegister (IN PCI_IO_DEVICE *PciIoDevice, IN UINT16 Command, IN UINT8 Offset, IN UINT8 Operation, OUT UINT16 *PtrCommand)
 
BOOLEAN PciCapabilitySupport (IN PCI_IO_DEVICE *PciIoDevice)
 
EFI_STATUS LocateCapabilityRegBlock (IN PCI_IO_DEVICE *PciIoDevice, IN UINT8 CapId, IN OUT UINT8 *Offset, OUT UINT8 *NextRegBlock OPTIONAL)
 
EFI_STATUS LocatePciExpressCapabilityRegBlock (IN PCI_IO_DEVICE *PciIoDevice, IN UINT16 CapId, IN OUT UINT32 *Offset, OUT UINT32 *NextRegBlock OPTIONAL)
 

Detailed Description

PCI command register operations supporting functions declaration for PCI Bus module.

Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file PciCommand.h.

Macro Definition Documentation

◆ EFI_DISABLE_REGISTER

#define EFI_DISABLE_REGISTER   4

Definition at line 55 of file PciCommand.h.

◆ EFI_ENABLE_REGISTER

#define EFI_ENABLE_REGISTER   3

Definition at line 54 of file PciCommand.h.

◆ EFI_GET_REGISTER

#define EFI_GET_REGISTER   1

Definition at line 52 of file PciCommand.h.

◆ EFI_PCCARD_BRIDGE_CONTROL_BITS_OWNED

#define EFI_PCCARD_BRIDGE_CONTROL_BITS_OWNED
Value:
( \
)
#define EFI_PCI_BRIDGE_CONTROL_VGA
0x0008
Definition: Pci22.h:608
#define EFI_PCI_BRIDGE_CONTROL_FAST_BACK_TO_BACK
0x0080
Definition: Pci22.h:612
#define EFI_PCI_BRIDGE_CONTROL_ISA
0x0004
Definition: Pci22.h:607

Definition at line 46 of file PciCommand.h.

◆ EFI_PCI_BRIDGE_CONTROL_BITS_OWNED

#define EFI_PCI_BRIDGE_CONTROL_BITS_OWNED
Value:

Definition at line 33 of file PciCommand.h.

◆ EFI_PCI_COMMAND_BITS_OWNED

#define EFI_PCI_COMMAND_BITS_OWNED
Value:
( \
)
#define EFI_PCI_COMMAND_MEMORY_WRITE_AND_INVALIDATE
0x0010
Definition: Pci22.h:595
#define EFI_PCI_COMMAND_MEMORY_SPACE
0x0002
Definition: Pci22.h:592
#define EFI_PCI_COMMAND_IO_SPACE
0x0001
Definition: Pci22.h:591
#define EFI_PCI_COMMAND_BUS_MASTER
0x0004
Definition: Pci22.h:593
#define EFI_PCI_COMMAND_FAST_BACK_TO_BACK
0x0200
Definition: Pci22.h:600
#define EFI_PCI_COMMAND_VGA_PALETTE_SNOOP
0x0020
Definition: Pci22.h:596

Definition at line 18 of file PciCommand.h.

◆ EFI_SET_REGISTER

#define EFI_SET_REGISTER   2

Definition at line 53 of file PciCommand.h.

◆ PCI_DISABLE_BRIDGE_CONTROL_REGISTER

#define PCI_DISABLE_BRIDGE_CONTROL_REGISTER (   a,
 
)     PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_DISABLE_REGISTER, NULL)

Macro that disables PCI bridge control register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[in]The disabled value written into command register.
Returns
status of PciIo operation

Definition at line 227 of file PciCommand.h.

◆ PCI_DISABLE_COMMAND_REGISTER

#define PCI_DISABLE_COMMAND_REGISTER (   a,
 
)     PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_DISABLE_REGISTER, NULL)

Macro that disables command register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[in]The disabled value written into command register.
Returns
status of PciIo operation

Definition at line 179 of file PciCommand.h.

◆ PCI_ENABLE_BRIDGE_CONTROL_REGISTER

#define PCI_ENABLE_BRIDGE_CONTROL_REGISTER (   a,
 
)     PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_ENABLE_REGISTER, NULL)

Macro that enables PCI bridge control register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[in]The enabled value written into command register.
Returns
status of PciIo operation

Definition at line 215 of file PciCommand.h.

◆ PCI_ENABLE_COMMAND_REGISTER

#define PCI_ENABLE_COMMAND_REGISTER (   a,
 
)     PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_ENABLE_REGISTER, NULL)

Macro that enables command register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[in]The enabled value written into command register.
Returns
status of PciIo operation

Definition at line 167 of file PciCommand.h.

◆ PCI_READ_BRIDGE_CONTROL_REGISTER

#define PCI_READ_BRIDGE_CONTROL_REGISTER (   a,
 
)     PciOperateRegister (a, 0, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_GET_REGISTER, b)

Macro that reads PCI bridge control register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[out]The 16-bit value read from control register.
Returns
status of PciIo operation

Definition at line 191 of file PciCommand.h.

◆ PCI_READ_COMMAND_REGISTER

#define PCI_READ_COMMAND_REGISTER (   a,
 
)     PciOperateRegister (a, 0, PCI_COMMAND_OFFSET, EFI_GET_REGISTER, b)

Macro that reads command register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[out]Pointer to the 16-bit value read from command register.
Returns
status of PciIo operation

Definition at line 143 of file PciCommand.h.

◆ PCI_SET_BRIDGE_CONTROL_REGISTER

#define PCI_SET_BRIDGE_CONTROL_REGISTER (   a,
 
)     PciOperateRegister (a, b, PCI_BRIDGE_CONTROL_REGISTER_OFFSET, EFI_SET_REGISTER, NULL)

Macro that writes PCI bridge control register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[in]The 16-bit value written into control register.
Returns
status of PciIo operation

Definition at line 203 of file PciCommand.h.

◆ PCI_SET_COMMAND_REGISTER

#define PCI_SET_COMMAND_REGISTER (   a,
 
)     PciOperateRegister (a, b, PCI_COMMAND_OFFSET, EFI_SET_REGISTER, NULL)

Macro that writes command register.

Parameters
a[in]Pointer to instance of PCI_IO_DEVICE.
b[in]The 16-bit value written into command register.
Returns
status of PciIo operation

Definition at line 155 of file PciCommand.h.

Function Documentation

◆ LocateCapabilityRegBlock()

EFI_STATUS LocateCapabilityRegBlock ( IN PCI_IO_DEVICE PciIoDevice,
IN UINT8  CapId,
IN OUT UINT8 *  Offset,
OUT UINT8 *NextRegBlock  OPTIONAL 
)

Locate capability register block per capability ID.

Parameters
PciIoDeviceA pointer to the PCI_IO_DEVICE.
CapIdThe capability ID.
OffsetA pointer to the offset returned.
NextRegBlockA pointer to the next block returned.
Return values
EFI_SUCCESSSuccessfully located capability register block.
EFI_UNSUPPORTEDPci device does not support capability.
EFI_NOT_FOUNDPci device support but can not find register block.

Definition at line 106 of file PciCommand.c.

◆ LocatePciExpressCapabilityRegBlock()

EFI_STATUS LocatePciExpressCapabilityRegBlock ( IN PCI_IO_DEVICE PciIoDevice,
IN UINT16  CapId,
IN OUT UINT32 *  Offset,
OUT UINT32 *NextRegBlock  OPTIONAL 
)

Locate PciExpress capability register block per capability ID.

Parameters
PciIoDeviceA pointer to the PCI_IO_DEVICE.
CapIdThe capability ID.
OffsetA pointer to the offset returned.
NextRegBlockA pointer to the next block returned.
Return values
EFI_SUCCESSSuccessfully located capability register block.
EFI_UNSUPPORTEDPci device does not support capability.
EFI_NOT_FOUNDPci device support but can not find register block.

Definition at line 195 of file PciCommand.c.

◆ PciCapabilitySupport()

BOOLEAN PciCapabilitySupport ( IN PCI_IO_DEVICE PciIoDevice)

Check the capability supporting by given device.

Parameters
PciIoDevicePointer to instance of PCI_IO_DEVICE.
Return values
TRUECapability supported.
FALSECapability not supported.

Definition at line 81 of file PciCommand.c.

◆ PciOperateRegister()

EFI_STATUS PciOperateRegister ( IN PCI_IO_DEVICE PciIoDevice,
IN UINT16  Command,
IN UINT8  Offset,
IN UINT8  Operation,
OUT UINT16 *  PtrCommand 
)

Operate the PCI register via PciIo function interface.

Parameters
PciIoDevicePointer to instance of PCI_IO_DEVICE.
CommandOperator command.
OffsetThe address within the PCI configuration space for the PCI controller.
OperationType of Operation.
PtrCommandReturn buffer holding old PCI command, if operation is not EFI_SET_REGISTER.
Returns
Status of PciIo operation.

Definition at line 24 of file PciCommand.c.