2 EFI PCAT ISA ACPI Driver for a Generic PC Platform
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
15 #ifndef _PCAT_ISA_ACPI_H_
16 #define _PCAT_ISA_ACPI_H_
20 #include <IndustryStandard/Pci.h>
22 #include <Protocol/DevicePath.h>
23 #include <Protocol/PciIo.h>
24 #include <Protocol/IsaIo.h>
25 #include <Protocol/DriverBinding.h>
26 #include <Protocol/ComponentName.h>
27 #include <Protocol/ComponentName2.h>
30 #include <Library/UefiLib.h>
31 #include <Library/UefiBootServicesTableLib.h>
32 #include <Library/BaseMemoryLib.h>
33 #include <Library/PcdLib.h>
35 #include <Protocol/IsaAcpi.h>
37 // PCAT ISA ACPI device private data structure
39 #define PCAT_ISA_ACPI_DEV_SIGNATURE SIGNATURE_32('L','P','C','D')
44 EFI_ISA_ACPI_PROTOCOL IsaAcpi
;
45 EFI_PCI_IO_PROTOCOL
*PciIo
;
46 UINT64 OriginalAttributes
;
49 #define PCAT_ISA_ACPI_DEV_FROM_THIS(a) BASE_CR(a, PCAT_ISA_ACPI_DEV, IsaAcpi)
54 extern EFI_DRIVER_BINDING_PROTOCOL gPcatIsaAcpiDriverBinding
;
56 extern EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2
;
58 extern EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName
;
62 // Prototypes for Driver model protocol interface
65 ControllerDriver Protocol Method
67 @param This Driver Binding protocol instance pointer.
68 @param Controller Handle of device to test.
69 @param RemainingDevicePath Optional parameter use to pick a specific child
71 @retval EFI_SUCCESS This driver supports this device.
72 @retval other This driver does not support this device.
77 PcatIsaAcpiDriverBindingSupported (
78 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
79 IN EFI_HANDLE Controller
,
80 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
84 Install EFI_ISA_ACPI_PROTOCOL.
86 @param This Driver Binding protocol instance pointer.
87 @param ControllerHandle Handle of device to bind driver to.
88 @param RemainingDevicePath Optional parameter use to pick a specific child
91 @retval EFI_SUCCESS This driver is added to ControllerHandle
92 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
93 @retval other This driver does not support this device
97 PcatIsaAcpiDriverBindingStart (
98 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
99 IN EFI_HANDLE Controller
,
100 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
104 Stop this driver on ControllerHandle. Support stopping any child handles
105 created by this driver.
107 @param This Protocol instance pointer.
108 @param ControllerHandle Handle of device to stop driver on
109 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
110 children is zero stop the entire bus driver.
111 @param ChildHandleBuffer List of Child Handles to Stop.
113 @retval EFI_SUCCESS This driver is removed ControllerHandle
114 @retval other This driver was not removed from this device
119 PcatIsaAcpiDriverBindingStop (
120 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
121 IN EFI_HANDLE Controller
,
122 IN UINTN NumberOfChildren
,
123 IN EFI_HANDLE
*ChildHandleBuffer
127 // Prototypes for the ISA ACPI protocol interface
130 Enumerate the ISA devices on the ISA bus
133 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
134 @param Device Point to device ID instance
136 @retval EFI_NOT_FOUND Can not found the next Isa device.
137 @retval EFI_SUCCESS Success retrieve the next Isa device for enumration.
143 IN EFI_ISA_ACPI_PROTOCOL
*This
,
144 OUT EFI_ISA_ACPI_DEVICE_ID
**Device
151 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
152 @param Device Point to device ID instance
153 @param OnOff TRUE for setting isa device power on,
154 FALSE for setting isa device power off
156 @return EFI_SUCCESS Success to change power status for isa device.
161 IN EFI_ISA_ACPI_PROTOCOL
*This
,
162 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
167 Get current resource for the specific ISA device.
169 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
170 @param Device Point to device ID instance
171 @param ResourceList On return, point to resources instances for given isa device
173 @retval EFI_NOT_FOUND Can not found the resource instance for given isa device
174 @retval EFI_SUCCESS Success to get resource instance for given isa device.
178 IsaGetCurrentResource (
179 IN EFI_ISA_ACPI_PROTOCOL
*This
,
180 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
181 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
185 Get possible resource for the specific ISA device.
187 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
188 @param Device Point to device ID instance
189 @param ResourceList On return, point to resources instances for given isa device
191 @retval EFI_SUCCESS Success to get resource instance for given isa device.
195 IsaGetPossibleResource (
196 IN EFI_ISA_ACPI_PROTOCOL
*This
,
197 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
198 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
202 Set resource for the specific ISA device.
204 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
205 @param Device Point to device ID instance
206 @param ResourceList Point to resources instances for given isa device
208 @return EFI_SUCCESS Success to set resource.
214 IN EFI_ISA_ACPI_PROTOCOL
*This
,
215 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
216 IN EFI_ISA_ACPI_RESOURCE_LIST
*ResourceList
220 Enable/Disable the specific ISA device.
222 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
223 @param Device Point to device ID instance
224 @param Enable Enable/Disable
226 @return EFI_SUCCESS Success to enable/disable.
232 IN EFI_ISA_ACPI_PROTOCOL
*This
,
233 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
238 Initialize the specific ISA device.
240 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
241 @param Device Point to device ID instance
243 @return EFI_SUCCESS Success to initialize.
249 IN EFI_ISA_ACPI_PROTOCOL
*This
,
250 IN EFI_ISA_ACPI_DEVICE_ID
*Device
254 Initialize the ISA interface.
256 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
258 @return EFI_SUCCESS Success to initialize ISA interface.
264 IN EFI_ISA_ACPI_PROTOCOL
*This
268 Initialize the ISA device list.
271 InitializePcatIsaAcpiDeviceList (