]> git.proxmox.com Git - mirror_edk2.git/blob - PcAtChipsetPkg/IsaAcpiDxe/PcatIsaAcpi.h
4b7cc2a1a19ad05eb068bac60c209e04481f66a0
[mirror_edk2.git] / PcAtChipsetPkg / IsaAcpiDxe / PcatIsaAcpi.h
1 /** @file
2 EFI PCAT ISA ACPI Driver for a Generic PC Platform
3
4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef _PCAT_ISA_ACPI_H_
10 #define _PCAT_ISA_ACPI_H_
11
12 #include <PiDxe.h>
13
14 #include <IndustryStandard/Pci.h>
15
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>
22
23
24 #include <Library/UefiLib.h>
25 #include <Library/UefiBootServicesTableLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/PcdLib.h>
28
29 #include <Protocol/IsaAcpi.h>
30 //
31 // PCAT ISA ACPI device private data structure
32 //
33 #define PCAT_ISA_ACPI_DEV_SIGNATURE SIGNATURE_32('L','P','C','D')
34
35 typedef struct {
36 UINTN Signature;
37 EFI_HANDLE Handle;
38 EFI_ISA_ACPI_PROTOCOL IsaAcpi;
39 EFI_PCI_IO_PROTOCOL *PciIo;
40 UINT64 OriginalAttributes;
41 } PCAT_ISA_ACPI_DEV;
42
43 #define PCAT_ISA_ACPI_DEV_FROM_THIS(a) BASE_CR(a, PCAT_ISA_ACPI_DEV, IsaAcpi)
44
45 //
46 // Global Variables
47 //
48 extern EFI_DRIVER_BINDING_PROTOCOL gPcatIsaAcpiDriverBinding;
49
50 extern EFI_COMPONENT_NAME2_PROTOCOL gPcatIsaAcpiComponentName2;
51
52 extern EFI_COMPONENT_NAME_PROTOCOL gPcatIsaAcpiComponentName;
53
54
55 //
56 // Prototypes for Driver model protocol interface
57 //
58 /**
59 ControllerDriver Protocol Method
60
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
64 device to start.
65 @retval EFI_SUCCESS This driver supports this device.
66 @retval other This driver does not support this device.
67
68 **/
69 EFI_STATUS
70 EFIAPI
71 PcatIsaAcpiDriverBindingSupported (
72 IN EFI_DRIVER_BINDING_PROTOCOL *This,
73 IN EFI_HANDLE Controller,
74 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
75 );
76
77 /**
78 Install EFI_ISA_ACPI_PROTOCOL.
79
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
83 device to start.
84
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
88 **/
89 EFI_STATUS
90 EFIAPI
91 PcatIsaAcpiDriverBindingStart (
92 IN EFI_DRIVER_BINDING_PROTOCOL *This,
93 IN EFI_HANDLE Controller,
94 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
95 );
96
97 /**
98 Stop this driver on ControllerHandle. Support stopping any child handles
99 created by this driver.
100
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.
106
107 @retval EFI_SUCCESS This driver is removed ControllerHandle
108 @retval other This driver was not removed from this device
109
110 **/
111 EFI_STATUS
112 EFIAPI
113 PcatIsaAcpiDriverBindingStop (
114 IN EFI_DRIVER_BINDING_PROTOCOL *This,
115 IN EFI_HANDLE Controller,
116 IN UINTN NumberOfChildren,
117 IN EFI_HANDLE *ChildHandleBuffer
118 );
119
120 //
121 // Prototypes for the ISA ACPI protocol interface
122 //
123 /**
124 Enumerate the ISA devices on the ISA bus
125
126
127 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
128 @param Device Point to device ID instance
129
130 @retval EFI_NOT_FOUND Can not found the next Isa device.
131 @retval EFI_SUCCESS Success retrieve the next Isa device for enumration.
132
133 **/
134 EFI_STATUS
135 EFIAPI
136 IsaDeviceEnumerate (
137 IN EFI_ISA_ACPI_PROTOCOL *This,
138 OUT EFI_ISA_ACPI_DEVICE_ID **Device
139 );
140
141 /**
142 Set ISA device power
143
144
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
149
150 @return EFI_SUCCESS Success to change power status for isa device.
151 **/
152 EFI_STATUS
153 EFIAPI
154 IsaDeviceSetPower (
155 IN EFI_ISA_ACPI_PROTOCOL *This,
156 IN EFI_ISA_ACPI_DEVICE_ID *Device,
157 IN BOOLEAN OnOff
158 );
159
160 /**
161 Get current resource for the specific ISA device.
162
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
166
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.
169 **/
170 EFI_STATUS
171 EFIAPI
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
176 );
177
178 /**
179 Get possible resource for the specific ISA device.
180
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
184
185 @retval EFI_SUCCESS Success to get resource instance for given isa device.
186 **/
187 EFI_STATUS
188 EFIAPI
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
193 );
194
195 /**
196 Set resource for the specific ISA device.
197
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
201
202 @return EFI_SUCCESS Success to set resource.
203
204 **/
205 EFI_STATUS
206 EFIAPI
207 IsaSetResource (
208 IN EFI_ISA_ACPI_PROTOCOL *This,
209 IN EFI_ISA_ACPI_DEVICE_ID *Device,
210 IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList
211 );
212
213 /**
214 Enable/Disable the specific ISA device.
215
216 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
217 @param Device Point to device ID instance
218 @param Enable Enable/Disable
219
220 @return EFI_SUCCESS Success to enable/disable.
221
222 **/
223 EFI_STATUS
224 EFIAPI
225 IsaEnableDevice (
226 IN EFI_ISA_ACPI_PROTOCOL *This,
227 IN EFI_ISA_ACPI_DEVICE_ID *Device,
228 IN BOOLEAN Enable
229 );
230
231 /**
232 Initialize the specific ISA device.
233
234 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
235 @param Device Point to device ID instance
236
237 @return EFI_SUCCESS Success to initialize.
238
239 **/
240 EFI_STATUS
241 EFIAPI
242 IsaInitDevice (
243 IN EFI_ISA_ACPI_PROTOCOL *This,
244 IN EFI_ISA_ACPI_DEVICE_ID *Device
245 );
246
247 /**
248 Initialize the ISA interface.
249
250 @param This Point to instance of EFI_ISA_ACPI_PROTOCOL
251
252 @return EFI_SUCCESS Success to initialize ISA interface.
253
254 **/
255 EFI_STATUS
256 EFIAPI
257 IsaInterfaceInit (
258 IN EFI_ISA_ACPI_PROTOCOL *This
259 );
260
261 /**
262 Initialize the ISA device list.
263 **/
264 VOID
265 InitializePcatIsaAcpiDeviceList (
266 VOID
267 );
268
269 #endif