2 EFI PCAT ISA ACPI Driver for a Generic PC Platform
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
9 #ifndef _PCAT_ISA_ACPI_H_
10 #define _PCAT_ISA_ACPI_H_
14 #include <IndustryStandard/Pci.h>
16 #include <Protocol/DevicePath.h>
17 #include <Protocol/PciIo.h>
18 #include <Protocol/IsaIo.h>
19 #include <Protocol/DriverBinding.h>
20 #include <Protocol/ComponentName.h>
21 #include <Protocol/ComponentName2.h>
24 #include <Library/UefiLib.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/PcdLib.h>
29 #include <Protocol/IsaAcpi.h>
31 // PCAT ISA ACPI device private data structure
33 #define PCAT_ISA_ACPI_DEV_SIGNATURE SIGNATURE_32('L','P','C','D')
38 EFI_ISA_ACPI_PROTOCOL IsaAcpi
;
39 EFI_PCI_IO_PROTOCOL
*PciIo
;
40 UINT64 OriginalAttributes
;
43 #define PCAT_ISA_ACPI_DEV_FROM_THIS(a) BASE_CR(a, PCAT_ISA_ACPI_DEV, IsaAcpi)
48 extern EFI_DRIVER_BINDING_PROTOCOL gPcatIsaAcpiDriverBinding
;
50 extern EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2
;
52 extern EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName
;
56 // Prototypes for Driver model protocol interface
59 ControllerDriver Protocol Method
61 @param This Driver Binding protocol instance pointer.
62 @param Controller Handle of device to test.
63 @param RemainingDevicePath Optional parameter use to pick a specific child
65 @retval EFI_SUCCESS This driver supports this device.
66 @retval other This driver does not support this device.
71 PcatIsaAcpiDriverBindingSupported (
72 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
73 IN EFI_HANDLE Controller
,
74 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
78 Install EFI_ISA_ACPI_PROTOCOL.
80 @param This Driver Binding protocol instance pointer.
81 @param ControllerHandle Handle of device to bind driver to.
82 @param RemainingDevicePath Optional parameter use to pick a specific child
85 @retval EFI_SUCCESS This driver is added to ControllerHandle
86 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
87 @retval other This driver does not support this device
91 PcatIsaAcpiDriverBindingStart (
92 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
93 IN EFI_HANDLE Controller
,
94 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
98 Stop this driver on ControllerHandle. Support stopping any child handles
99 created by this driver.
101 @param This Protocol instance pointer.
102 @param ControllerHandle Handle of device to stop driver on
103 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
104 children is zero stop the entire bus driver.
105 @param ChildHandleBuffer List of Child Handles to Stop.
107 @retval EFI_SUCCESS This driver is removed ControllerHandle
108 @retval other This driver was not removed from this device
113 PcatIsaAcpiDriverBindingStop (
114 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
115 IN EFI_HANDLE Controller
,
116 IN UINTN NumberOfChildren
,
117 IN EFI_HANDLE
*ChildHandleBuffer
121 // Prototypes for the ISA ACPI protocol interface
124 Enumerate the ISA devices on the ISA bus
127 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
128 @param Device Point to device ID instance
130 @retval EFI_NOT_FOUND Can not found the next Isa device.
131 @retval EFI_SUCCESS Success retrieve the next Isa device for enumration.
137 IN EFI_ISA_ACPI_PROTOCOL
*This
,
138 OUT EFI_ISA_ACPI_DEVICE_ID
**Device
145 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
146 @param Device Point to device ID instance
147 @param OnOff TRUE for setting isa device power on,
148 FALSE for setting isa device power off
150 @return EFI_SUCCESS Success to change power status for isa device.
155 IN EFI_ISA_ACPI_PROTOCOL
*This
,
156 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
161 Get current resource for the specific ISA device.
163 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
164 @param Device Point to device ID instance
165 @param ResourceList On return, point to resources instances for given isa device
167 @retval EFI_NOT_FOUND Can not found the resource instance for given isa device
168 @retval EFI_SUCCESS Success to get resource instance for given isa device.
172 IsaGetCurrentResource (
173 IN EFI_ISA_ACPI_PROTOCOL
*This
,
174 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
175 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
179 Get possible resource for the specific ISA device.
181 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
182 @param Device Point to device ID instance
183 @param ResourceList On return, point to resources instances for given isa device
185 @retval EFI_SUCCESS Success to get resource instance for given isa device.
189 IsaGetPossibleResource (
190 IN EFI_ISA_ACPI_PROTOCOL
*This
,
191 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
192 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
196 Set resource for the specific ISA device.
198 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
199 @param Device Point to device ID instance
200 @param ResourceList Point to resources instances for given isa device
202 @return EFI_SUCCESS Success to set resource.
208 IN EFI_ISA_ACPI_PROTOCOL
*This
,
209 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
210 IN EFI_ISA_ACPI_RESOURCE_LIST
*ResourceList
214 Enable/Disable the specific ISA device.
216 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
217 @param Device Point to device ID instance
218 @param Enable Enable/Disable
220 @return EFI_SUCCESS Success to enable/disable.
226 IN EFI_ISA_ACPI_PROTOCOL
*This
,
227 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
232 Initialize the specific ISA device.
234 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
235 @param Device Point to device ID instance
237 @return EFI_SUCCESS Success to initialize.
243 IN EFI_ISA_ACPI_PROTOCOL
*This
,
244 IN EFI_ISA_ACPI_DEVICE_ID
*Device
248 Initialize the ISA interface.
250 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
252 @return EFI_SUCCESS Success to initialize ISA interface.
258 IN EFI_ISA_ACPI_PROTOCOL
*This
262 Initialize the ISA device list.
265 InitializePcatIsaAcpiDeviceList (