/** @file
Support for PCI 2.2 standard.
This file includes the definitions in the following specifications,
PCI Local Bus Specification, 2.2
PCI-to-PCI Bridge Architecture Specification, Revision 1.2
PC Card Standard, 8.0
Copyright (c) 2006 - 2009, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _PCI22_H_
#define _PCI22_H_
#pragma pack(1)
///
/// Common header region in PCI Configuration Space
/// Section 6.1, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// PCI Device header region in PCI Configuration Space
/// Section 6.1, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// PCI Device Configuration Space
/// Section 6.1, PCI Local Bus Specification, 2.2
///
typedef struct {
} PCI_TYPE00;
///
/// PCI-PCI Bridge header region in PCI Configuration Space
/// Section 3.2, PCI-PCI Bridge Architecture, Version 1.2
///
typedef struct {
///
/// PCI-to-PCI Bridge Configuration Space
/// Section 3.2, PCI-PCI Bridge Architecture, Version 1.2
///
typedef struct {
} PCI_TYPE01;
typedef union {
///
/// CardBus Conroller Configuration Space,
/// Section 4.5.1, PC Card Standard. 8.0
///
typedef struct {
//
// Definitions of PCI class bytes and manipulation macros.
//
#define PCI_IF_APIC_CONTROLLER 0x10 ///< I/O APIC interrupt controller , 32 bye none-prefectable memory.
/**
Macro that checks whether the Base Class code of device matched.
@param _p Specified device.
@param c Base Class code needs matching.
@retval TRUE Base Class code matches the specified device.
@retval FALSE Base Class code doesn't match the specified device.
**/
/**
Macro that checks whether the Base Class code and Sub-Class code of device matched.
@param _p Specified device.
@param c Base Class code needs matching.
@param s Sub-Class code needs matching.
@retval TRUE Base Class code and Sub-Class code match the specified device.
@retval FALSE Base Class code and Sub-Class code don't match the specified device.
**/
/**
Macro that checks whether the Base Class code, Sub-Class code and Interface code of device matched.
@param _p Specified device.
@param c Base Class code needs matching.
@param s Sub-Class code needs matching.
@param p Interface code needs matching.
@retval TRUE Base Class code, Sub-Class code and Interface code match the specified device.
@retval FALSE Base Class code, Sub-Class code and Interface code don't match the specified device.
**/
/**
Macro that checks whether device is a display controller.
@param _p Specified device.
@retval TRUE Device is a display controller.
@retval FALSE Device is not a display controller.
**/
/**
Macro that checks whether device is a VGA-compatible controller.
@param _p Specified device.
@retval TRUE Device is a VGA-compatible controller.
@retval FALSE Device is not a VGA-compatible controller.
**/
/**
Macro that checks whether device is an 8514-compatible controller.
@param _p Specified device.
@retval TRUE Device is an 8514-compatible controller.
@retval FALSE Device is not an 8514-compatible controller.
**/
/**
Macro that checks whether device is built before the Class Code field was defined.
@param _p Specified device.
@retval TRUE Device is an old device.
@retval FALSE Device is not an old device.
**/
/**
Macro that checks whether device is a VGA-compatible device built before the Class Code field was defined.
@param _p Specified device.
@retval TRUE Device is an old VGA-compatible device.
@retval FALSE Device is not an old VGA-compatible device.
**/
/**
Macro that checks whether device is an IDE controller.
@param _p Specified device.
@retval TRUE Device is an IDE controller.
@retval FALSE Device is not an IDE controller.
**/
/**
Macro that checks whether device is a SCSI bus controller.
@param _p Specified device.
@retval TRUE Device is a SCSI bus controller.
@retval FALSE Device is not a SCSI bus controller.
**/
/**
Macro that checks whether device is a RAID controller.
@param _p Specified device.
@retval TRUE Device is a RAID controller.
@retval FALSE Device is not a RAID controller.
**/
/**
Macro that checks whether device is an ISA bridge.
@param _p Specified device.
@retval TRUE Device is an ISA bridge.
@retval FALSE Device is not an ISA bridge.
**/
/**
Macro that checks whether device is a PCI-to-PCI bridge.
@param _p Specified device.
@retval TRUE Device is a PCI-to-PCI bridge.
@retval FALSE Device is not a PCI-to-PCI bridge.
**/
/**
Macro that checks whether device is a Subtractive Decode PCI-to-PCI bridge.
@param _p Specified device.
@retval TRUE Device is a Subtractive Decode PCI-to-PCI bridge.
@retval FALSE Device is not a Subtractive Decode PCI-to-PCI bridge.
**/
#define IS_PCI_P2P_SUB(_p) IS_CLASS3 (_p, PCI_CLASS_BRIDGE, PCI_CLASS_BRIDGE_P2P, PCI_IF_BRIDGE_P2P_SUBTRACTIVE)
/**
Macro that checks whether device is a 16550-compatible serial controller.
@param _p Specified device.
@retval TRUE Device is a 16550-compatible serial controller.
@retval FALSE Device is not a 16550-compatible serial controller.
**/
/**
Macro that checks whether device is a Universal Serial Bus controller.
@param _p Specified device.
@retval TRUE Device is a Universal Serial Bus controller.
@retval FALSE Device is not a Universal Serial Bus controller.
**/
//
// the definition of Header Type
//
//
// Mask of Header type
//
/**
Macro that checks whether device is a PCI-PCI bridge.
@param _p Specified device.
@retval TRUE Device is a PCI-PCI bridge.
@retval FALSE Device is not a PCI-PCI bridge.
**/
#define IS_PCI_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_PCI_TO_PCI_BRIDGE))
/**
Macro that checks whether device is a CardBus bridge.
@param _p Specified device.
@retval TRUE Device is a CardBus bridge.
@retval FALSE Device is not a CardBus bridge.
**/
#define IS_CARDBUS_BRIDGE(_p) (((_p)->Hdr.HeaderType & HEADER_LAYOUT_CODE) == (HEADER_TYPE_CARDBUS_BRIDGE))
/**
Macro that checks whether device is a multiple functions device.
@param _p Specified device.
@retval TRUE Device is a multiple functions device.
@retval FALSE Device is not a multiple functions device.
**/
///
/// Rom Base Address in Bridge, defined in PCI-to-PCI Bridge Architecure Specification,
///
//
// defined in PCI-to-PCI Bridge Architecture Specification
//
///
/// Interrupt Line "Unknown" or "No connection" value defined for x86 based system
///
///
/// PCI Access Data Format
///
typedef union {
struct {
} Bits;
#pragma pack()
//
// defined in PCI-to-PCI Bridge Architecture Specification
//
//
// Following are the PCI-CARDBUS bridge control bit, defined in PC Card Standard
//
//
// Following are the PCI status control bit
//
///
/// defined in PC Card Standard
///
#pragma pack(1)
//
// PCI Capability List IDs and records
//
///
/// Capabilities List Header
/// Section 6.7, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// Power Management Register Block Definition
/// Section 3.2, PCI Power Management Interface Specifiction, Revision 1.2
///
typedef struct {
///
/// A.G.P Capability
/// Section 6.1.4, Accelerated Graphics Port Interface Specification, Revision 1.0
///
typedef struct {
///
/// VPD Capability Structure
/// Appendix I, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// Slot Numbering Capabilities Register
/// Section 3.2.6, PCI-to-PCI Bridge Architeture Specification, Revision 1.2
///
typedef struct {
///
/// Message Capability Structure for 32-bit Message Address
/// Section 6.8.1, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// Message Capability Structure for 64-bit Message Address
/// Section 6.8.1, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// Capability EFI_PCI_CAPABILITY_ID_HOTPLUG,
/// CompactPCI Hot Swap Specification PICMG 2.1, R1.0
///
typedef struct {
///
/// not finished - fields need to go here
///
#define PCI_ACPI_UNUSED 0
#define PCI_BAR_NOCHANGE 0
///
/// EFI PCI Option ROM definitions
///
///
/// Standard PCI Expansion ROM Header
/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1
///
typedef struct {
///
/// Legacy ROM Header Extensions
/// Section 6.3.3.1, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// PCI Data Structure Format
/// Section 6.3.1.2, PCI Local Bus Specification, 2.2
///
typedef struct {
///
/// EFI PCI Expansion ROM Header
/// Section 13.4.2, Unified Extensible Firmware Interface Specification, Version 2.1
///
typedef struct {
typedef union {
#pragma pack()
#endif