]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Include/Library/PciIncompatibleDeviceSupportLib.h
f490ae4106e5de59ee908e275ae6de676b841880
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Library / PciIncompatibleDeviceSupportLib.h
1 /** @file
2 PCI Incompatible device support Libary. Platform can implement an
3 instance to support the incompatible PCI devices.
4
5 Copyright (c) 2006 - 2009, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15
16 #ifndef __PCI_INCOMPATIBLE_DEVICE_SUPPORT_LIB_H__
17 #define __PCI_INCOMPATIBLE_DEVICE_SUPPORT_LIB_H__
18
19 #define PCI_REGISTER_READ 0xfffffffffffffff1ULL
20 #define PCI_REGISTER_WRITE 0xfffffffffffffff2ULL
21 #define VALUE_NOCARE 0xffffffffffffffffULL
22
23 //
24 // PCI device device information
25 //
26 typedef struct {
27 UINT64 VendorID;
28 UINT64 DeviceID;
29 UINT64 RevisionID;
30 UINT64 SubsystemVendorID;
31 UINT64 SubsystemID;
32 } EFI_PCI_DEVICE_INFO;
33
34
35 //
36 // store hardcode value of resgister
37 //
38 typedef struct {
39 UINT64 AndValue;
40 UINT64 OrValue;
41 } EFI_PCI_REGISTER_VALUE_DATA;
42
43 //
44 // store access width information
45 //
46 typedef struct {
47 UINT64 StartOffset;
48 UINT64 EndOffset;
49 UINT64 Width;
50 } EFI_PCI_REGISTER_ACCESS_DATA;
51
52
53 //
54 // ACPI resource descriptor
55 //
56 typedef struct {
57 UINT64 ResType;
58 UINT64 GenFlag;
59 UINT64 SpecificFlag;
60 UINT64 AddrSpaceGranularity;
61 UINT64 AddrRangeMin;
62 UINT64 AddrRangeMax;
63 UINT64 AddrTranslationOffset;
64 UINT64 AddrLen;
65 } EFI_PCI_RESOUCE_DESCRIPTOR;
66
67 /**
68 Check the incompatible device list for ACPI resource update and return
69 the configuration.
70
71 This function searches the incompatible device list according to request
72 information. If the PCI device belongs to the devices list, corresponding
73 configuration informtion will be returned, in the meantime return EFI_SUCCESS.
74
75 @param PciDeviceInfo A pointer to PCI device information.
76 @param Configuration Returned information.
77
78 @retval EFI_SUCCESS If check incompatible device successfully.
79 @retval EFI_ABORTED No any resource type.
80 @retval EFI_OUT_OF_RESOURCES No memory available.
81 @retval EFI_UNSUPPORTED Invalid Tag encounted.
82
83 **/
84 EFI_STATUS
85 EFIAPI
86 PciResourceUpdateCheck (
87 IN EFI_PCI_DEVICE_INFO *PciDeviceInfo,
88 OUT VOID *Configuration
89 );
90
91 /**
92 Check the incompatible device list and return configuraton register mask values.
93
94 This function searches the incompatible device list according to request
95 information. If the PCI device belongs to the devices list, corresponding
96 configuration informtion will be returned, in the meantime return EFI_SUCCESS.
97
98 @param PciDeviceInfo A pointer to EFI_PCI_DEVICE_INFO.
99 @param AccessType Access Type, READ or WRITE.
100 @param Offset The address within the PCI configuration space.
101 @param Configuration Returned information.
102
103 @retval EFI_SUCCESS If check incompatible device successfully.
104 @retval EFI_UNSUPPORTED Failed to check incompatibility device.
105
106 **/
107 EFI_STATUS
108 EFIAPI
109 PciRegisterUpdateCheck (
110 IN EFI_PCI_DEVICE_INFO *PciDeviceInfo,
111 IN UINT64 AccessType,
112 IN UINT64 Offset,
113 OUT VOID *Configuration
114 );
115
116 /**
117 Check the incompatible device list for access width incompatibility and
118 return the configuration.
119
120 This function searches the incompatible device list for access width
121 incompatibility according to request information. If the PCI device
122 belongs to the devices list, corresponding configuration informtion
123 will be returned, in the meantime return EFI_SUCCESS.
124
125 @param PciDeviceInfo A pointer to PCI device information.
126 @param AccessType Access type, READ or WRITE.
127 @param Offset The address within the PCI configuration space.
128 @param AccessWidth Access width needs to check incompatibility.
129 @param Configuration Returned information.
130
131 @retval EFI_SUCCESS If check incompatible device successfully.
132 @retval EFI_UNSUPPORTED Failed to check incompatibility device.
133
134 **/
135 EFI_STATUS
136 EFIAPI
137 PciRegisterAccessCheck (
138 IN EFI_PCI_DEVICE_INFO *PciDeviceInfo,
139 IN UINT64 AccessType,
140 IN UINT64 Offset,
141 IN UINT64 AccessWidth,
142 OUT VOID *Configuration
143 );
144
145 #endif
146