2007-07-06 04:21:15 +02:00
|
|
|
/** @file
|
|
|
|
This file declares PciCfg PPI used to access PCI configuration space in PEI
|
|
|
|
|
2009-07-02 09:40:24 +02:00
|
|
|
Copyright (c) 2006 - 2009, Intel Corporation
|
2007-07-06 04:21:15 +02:00
|
|
|
All rights reserved. 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
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
Module Name: PciCfg.h
|
|
|
|
|
|
|
|
@par Revision Reference:
|
|
|
|
This PPI is defined in PEI CIS
|
|
|
|
Version 0.91.
|
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef __PEI_PCI_CFG_H__
|
|
|
|
#define __PEI_PCI_CFG_H__
|
|
|
|
|
2009-07-10 11:30:53 +02:00
|
|
|
#include <Ppi/PciCfg2.h>
|
2008-06-20 08:26:02 +02:00
|
|
|
//
|
|
|
|
// Get the common definitions for EFI_PEI_PCI_CFG_PPI_WIDTH.
|
|
|
|
//
|
2008-04-22 07:52:01 +02:00
|
|
|
|
2007-07-06 04:21:15 +02:00
|
|
|
#define EFI_PEI_PCI_CFG_PPI_INSTALLED_GUID \
|
|
|
|
{ \
|
|
|
|
0xe1f2eba0, 0xf7b9, 0x4a26, {0x86, 0x20, 0x13, 0x12, 0x21, 0x64, 0x2a, 0x90 } \
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _EFI_PEI_PCI_CFG_PPI EFI_PEI_PCI_CFG_PPI;
|
|
|
|
|
|
|
|
#define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \
|
|
|
|
(UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \
|
|
|
|
) & 0x00000000ffffffff
|
|
|
|
|
|
|
|
/**
|
|
|
|
PCI read and write operation.
|
|
|
|
|
|
|
|
@param PeiServices An indirect pointer to the PEI Services Table
|
|
|
|
published by the PEI Foundation.
|
|
|
|
@param This Pointer to local data for the interface.
|
|
|
|
@param Width The width of the access. Enumerated in bytes.
|
|
|
|
@param Address The physical address of the access.
|
|
|
|
@param Buffer A pointer to the buffer of data.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The function completed successfully.
|
|
|
|
@retval EFI_NOT_YET_AVAILABLE The service has not been installed.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_PEI_PCI_CFG_PPI_IO)(
|
2007-07-06 04:21:15 +02:00
|
|
|
IN EFI_PEI_SERVICES **PeiServices,
|
|
|
|
IN EFI_PEI_PCI_CFG_PPI *This,
|
|
|
|
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
|
|
|
IN UINT64 Address,
|
|
|
|
IN OUT VOID *Buffer
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
PCI read-modify-write operation.
|
|
|
|
|
|
|
|
@param PeiServices An indirect pointer to the PEI Services Table
|
|
|
|
published by the PEI Foundation.
|
|
|
|
@param This Pointer to local data for the interface.
|
|
|
|
@param Width The width of the access. Enumerated in bytes.
|
|
|
|
@param Address The physical address of the access.
|
|
|
|
@param SetBits Value of the bits to set.
|
|
|
|
@param ClearBits Value of the bits to clear.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The function completed successfully.
|
|
|
|
|
|
|
|
**/
|
|
|
|
typedef
|
|
|
|
EFI_STATUS
|
2008-07-31 09:44:54 +02:00
|
|
|
(EFIAPI *EFI_PEI_PCI_CFG_PPI_RW)(
|
2007-07-06 04:21:15 +02:00
|
|
|
IN EFI_PEI_SERVICES **PeiServices,
|
|
|
|
IN EFI_PEI_PCI_CFG_PPI *This,
|
|
|
|
IN EFI_PEI_PCI_CFG_PPI_WIDTH Width,
|
|
|
|
IN UINT64 Address,
|
|
|
|
IN UINTN SetBits,
|
|
|
|
IN UINTN ClearBits
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
The EFI_PEI_PCI_CFG_PPI interfaces are used to abstract accesses to PCI
|
|
|
|
controllers behind a PCI root bridge controller.
|
|
|
|
**/
|
|
|
|
struct _EFI_PEI_PCI_CFG_PPI {
|
2009-07-02 09:40:24 +02:00
|
|
|
///
|
|
|
|
/// PCI read services. See the Read() function description.
|
|
|
|
///
|
2007-07-06 04:21:15 +02:00
|
|
|
EFI_PEI_PCI_CFG_PPI_IO Read;
|
2009-07-02 09:40:24 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// PCI write services. See the Write() function description.
|
|
|
|
///
|
2007-07-06 04:21:15 +02:00
|
|
|
EFI_PEI_PCI_CFG_PPI_IO Write;
|
2009-07-02 09:40:24 +02:00
|
|
|
|
|
|
|
///
|
|
|
|
/// PCI read-modify-write services. See the Modify() function description.
|
|
|
|
///
|
2007-07-06 04:21:15 +02:00
|
|
|
EFI_PEI_PCI_CFG_PPI_RW Modify;
|
|
|
|
};
|
|
|
|
|
|
|
|
extern EFI_GUID gEfiPciCfgPpiInServiceTableGuid;
|
|
|
|
|
|
|
|
#endif
|