2 EFI PCAT ISA ACPI Driver for a Generic PC Platform
4 Copyright (c) 2006 - 2011, 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
;
48 #define PCAT_ISA_ACPI_DEV_FROM_THIS(a) BASE_CR(a, PCAT_ISA_ACPI_DEV, IsaAcpi)
53 extern EFI_DRIVER_BINDING_PROTOCOL gPcatIsaAcpiDriverBinding
;
55 extern EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2
;
57 extern EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName
;
61 // Prototypes for Driver model protocol interface
64 ControllerDriver Protocol Method
66 @param This Driver Binding protocol instance pointer.
67 @param Controller Handle of device to test.
68 @param RemainingDevicePath Optional parameter use to pick a specific child
70 @retval EFI_SUCCESS This driver supports this device.
71 @retval other This driver does not support this device.
76 PcatIsaAcpiDriverBindingSupported (
77 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
78 IN EFI_HANDLE Controller
,
79 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
83 Install EFI_ISA_ACPI_PROTOCOL.
85 @param This Driver Binding protocol instance pointer.
86 @param ControllerHandle Handle of device to bind driver to.
87 @param RemainingDevicePath Optional parameter use to pick a specific child
90 @retval EFI_SUCCESS This driver is added to ControllerHandle
91 @retval EFI_ALREADY_STARTED This driver is already running on ControllerHandle
92 @retval other This driver does not support this device
96 PcatIsaAcpiDriverBindingStart (
97 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
98 IN EFI_HANDLE Controller
,
99 IN EFI_DEVICE_PATH_PROTOCOL
*RemainingDevicePath
103 Stop this driver on ControllerHandle. Support stopping any child handles
104 created by this driver.
106 @param This Protocol instance pointer.
107 @param ControllerHandle Handle of device to stop driver on
108 @param NumberOfChildren Number of Handles in ChildHandleBuffer. If number of
109 children is zero stop the entire bus driver.
110 @param ChildHandleBuffer List of Child Handles to Stop.
112 @retval EFI_SUCCESS This driver is removed ControllerHandle
113 @retval other This driver was not removed from this device
118 PcatIsaAcpiDriverBindingStop (
119 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
120 IN EFI_HANDLE Controller
,
121 IN UINTN NumberOfChildren
,
122 IN EFI_HANDLE
*ChildHandleBuffer
126 // Prototypes for the ISA ACPI protocol interface
129 Enumerate the ISA devices on the ISA bus
132 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
133 @param Device Point to device ID instance
135 @retval EFI_NOT_FOUND Can not found the next Isa device.
136 @retval EFI_SUCESS Success retrieve the next Isa device for enumration.
142 IN EFI_ISA_ACPI_PROTOCOL
*This
,
143 OUT EFI_ISA_ACPI_DEVICE_ID
**Device
150 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
151 @param Device Point to device ID instance
152 @param OnOff TRUE for setting isa device power on,
153 FALSE for setting isa device power off
155 @return EFI_SUCCESS Sucess to change power status for isa device.
160 IN EFI_ISA_ACPI_PROTOCOL
*This
,
161 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
166 Get current resource for the specific ISA device.
168 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
169 @param Device Point to device ID instance
170 @param ResourceList On return, point to resources instances for given isa device
172 @retval EFI_NOT_FOUND Can not found the resource instance for given isa device
173 @retval EFI_SUCCESS Success to get resource instance for given isa device.
177 IsaGetCurrentResource (
178 IN EFI_ISA_ACPI_PROTOCOL
*This
,
179 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
180 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
184 Get possible resource for the specific ISA device.
186 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
187 @param Device Point to device ID instance
188 @param ResourceList On return, point to resources instances for given isa device
190 @retval EFI_SUCCESS Success to get resource instance for given isa device.
194 IsaGetPossibleResource (
195 IN EFI_ISA_ACPI_PROTOCOL
*This
,
196 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
197 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
201 Set resource for the specific ISA device.
203 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
204 @param Device Point to device ID instance
205 @param ResourceList Point to resources instances for given isa device
207 @return EFI_SUCESS Success to set resource.
213 IN EFI_ISA_ACPI_PROTOCOL
*This
,
214 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
215 IN EFI_ISA_ACPI_RESOURCE_LIST
*ResourceList
219 Enable/Disable the specific ISA device.
221 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
222 @param Device Point to device ID instance
223 @param Enable Enable/Disable
225 @return EFI_SUCESS Success to enable/disable.
231 IN EFI_ISA_ACPI_PROTOCOL
*This
,
232 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
237 Initialize the specific ISA device.
239 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
240 @param Device Point to device ID instance
242 @return EFI_SUCESS Success to initialize.
248 IN EFI_ISA_ACPI_PROTOCOL
*This
,
249 IN EFI_ISA_ACPI_DEVICE_ID
*Device
253 Initialize the ISA interface.
255 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
257 @return EFI_SUCESS Success to initialize ISA interface.
263 IN EFI_ISA_ACPI_PROTOCOL
*This
267 Initialize the ISA device list.
270 InitializePcatIsaAcpiDeviceList (