]> git.proxmox.com Git - mirror_edk2.git/blob - EdkCompatibilityPkg/Foundation/Framework/Include/EfiPciCfg.h
Add in the 1st version of ECP.
[mirror_edk2.git] / EdkCompatibilityPkg / Foundation / Framework / Include / EfiPciCfg.h
1 /*++
2
3 Copyright (c) 2007, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 EfiPciCfg.h
15
16 Abstract:
17
18 Abstract the common fields of PciCfg definition between Framework 0.9x
19 and PI 1.0.
20
21 --*/
22
23 #ifndef _EFI_PCI_CFG_H_
24 #define _EFI_PCI_CFG_H_
25
26 //
27 // Framework specification 0.9x definition.
28 //
29 typedef enum {
30 PeiPciCfgWidthUint8 = 0,
31 PeiPciCfgWidthUint16 = 1,
32 PeiPciCfgWidthUint32 = 2,
33 PeiPciCfgWidthUint64 = 3,
34 PeiPciCfgWidthMaximum
35 } PEI_PCI_CFG_PPI_WIDTH;
36
37 #define PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) ( \
38 (UINT64) ((((UINTN) bus) << 24) + (((UINTN) dev) << 16) + (((UINTN) func) << 8) + ((UINTN) reg)) \
39 ) & 0x00000000ffffffff
40
41 //
42 // PI 1.0 definition.
43 //
44 typedef enum {
45 EfiPeiPciCfgWidthUint8 = 0,
46 EfiPeiPciCfgWidthUint16 = 1,
47 EfiPeiPciCfgWidthUint32 = 2,
48 EfiPeiPciCfgWidthUint64 = 3,
49 EfiPeiPciCfgWidthMaximum
50 } EFI_PEI_PCI_CFG_PPI_WIDTH;
51
52 #define EFI_PEI_PCI_CFG_ADDRESS(bus, dev, func, reg) \
53 ( ((bus) << 24) | \
54 ((dev) << 16) | \
55 ((func) << 8) | \
56 ((reg) < 256 ? (reg): ((UINT64)(reg) << 32)))
57
58
59 #if (PI_SPECIFICATION_VERSION < 0x00010000)
60
61 typedef struct {
62 UINT8 Register;
63 UINT8 Function;
64 UINT8 Device;
65 UINT8 Bus;
66 UINT8 Reserved[4];
67 } PEI_PCI_CFG_PPI_PCI_ADDRESS;
68
69 typedef PEI_PCI_CFG_PPI_PCI_ADDRESS EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS;
70
71 #else
72
73 typedef struct {
74 UINT8 Register;
75 UINT8 Function;
76 UINT8 Device;
77 UINT8 Bus;
78 UINT32 ExtendedRegister;
79 } EFI_PEI_PCI_CFG_PPI_PCI_ADDRESS;
80 #endif
81
82 #endif