2 PCI Incompatible device support Libary. Platform can implement an
3 instance to support the incompatible PCI devices.
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
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.
16 #ifndef __PCI_INCOMPATIBLE_DEVICE_SUPPORT_LIB_H__
17 #define __PCI_INCOMPATIBLE_DEVICE_SUPPORT_LIB_H__
19 #define PCI_REGISTER_READ 0xfffffffffffffff1ULL
20 #define PCI_REGISTER_WRITE 0xfffffffffffffff2ULL
21 #define VALUE_NOCARE 0xffffffffffffffffULL
24 // PCI device device information
30 UINT64 SubsystemVendorID
;
32 } EFI_PCI_DEVICE_INFO
;
36 // store hardcode value of resgister
41 } EFI_PCI_REGISTER_VALUE_DATA
;
44 // store access width information
50 } EFI_PCI_REGISTER_ACCESS_DATA
;
54 // ACPI resource descriptor
60 UINT64 AddrSpaceGranularity
;
63 UINT64 AddrTranslationOffset
;
65 } EFI_PCI_RESOUCE_DESCRIPTOR
;
68 Check the incompatible device list for ACPI resource update and return
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.
75 @param PciDeviceInfo A pointer to PCI device information.
76 @param Configuration Returned information.
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.
86 PciResourceUpdateCheck (
87 IN EFI_PCI_DEVICE_INFO
*PciDeviceInfo
,
88 OUT VOID
*Configuration
92 Check the incompatible device list and return configuraton register mask values.
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.
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.
103 @retval EFI_SUCCESS If check incompatible device successfully.
104 @retval EFI_UNSUPPORTED Failed to check incompatibility device.
109 PciRegisterUpdateCheck (
110 IN EFI_PCI_DEVICE_INFO
*PciDeviceInfo
,
111 IN UINT64 AccessType
,
113 OUT VOID
*Configuration
117 Check the incompatible device list for access width incompatibility and
118 return the configuration.
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.
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.
131 @retval EFI_SUCCESS If check incompatible device successfully.
132 @retval EFI_UNSUPPORTED Failed to check incompatibility device.
137 PciRegisterAccessCheck (
138 IN EFI_PCI_DEVICE_INFO
*PciDeviceInfo
,
139 IN UINT64 AccessType
,
141 IN UINT64 AccessWidth
,
142 OUT VOID
*Configuration