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