]>
Commit | Line | Data |
---|---|---|
8ca67c46 | 1 | /** @file\r |
099fae5d | 2 | EFI ISA ACPI Protocol is used to enumerate and manage all the ISA controllers on\r |
3 | the platform's ISA Bus.\r | |
a9102619 | 4 | \r |
099fae5d | 5 | Copyright (c) 2006 - 2009, Intel Corporation\r |
6 | All rights reserved. This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
a9102619 | 13 | \r |
3db51098 | 14 | **/\r |
a9102619 | 15 | \r |
16 | #ifndef __ISA_ACPI_H_\r | |
17 | #define __ISA_ACPI_H_\r | |
18 | \r | |
099fae5d | 19 | ///\r |
20 | /// Global ID for the EFI ISA ACPI Protocol\r | |
21 | ///\r | |
a9102619 | 22 | #define EFI_ISA_ACPI_PROTOCOL_GUID \\r |
099fae5d | 23 | { \\r |
24 | 0x64a892dc, 0x5561, 0x4536, { 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55 } \\r | |
25 | }\r | |
a9102619 | 26 | \r |
099fae5d | 27 | ///\r |
28 | /// Forward declaration fo the EFI ISA ACPI Protocol\r | |
29 | ///\r | |
a9102619 | 30 | typedef struct _EFI_ISA_ACPI_PROTOCOL EFI_ISA_ACPI_PROTOCOL;\r |
31 | \r | |
099fae5d | 32 | ///\r |
33 | /// ISA ACPI Protocol interrupt resource attributes\r | |
34 | ///\r | |
35 | #define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_EDGE_SENSITIVE 0x01 ///< Edge triggered interrupt on a rising edge\r | |
36 | #define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_EDGE_SENSITIVE 0x02 ///< Edge triggered interrupt on a falling edge\r | |
37 | #define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_LEVEL_SENSITIVE 0x04 ///< Level sensitive interrupt active high\r | |
38 | #define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_LEVEL_SENSITIVE 0x08 ///< Level sensitive interrupt active low\r | |
39 | \r | |
40 | ///\r | |
41 | /// ISA ACPI Protocol DMA resource attributes\r | |
42 | ///\r | |
43 | #define EFI_ISA_ACPI_DMA_SPEED_TYPE_MASK 0x03 ///< Bit mask of supported DMA speed attributes\r | |
44 | #define EFI_ISA_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00 ///< ISA controller supports compatibility mode DMA transfers\r | |
45 | #define EFI_ISA_ACPI_DMA_SPEED_TYPE_A 0x01 ///< ISA controller supports type A DMA transfers \r | |
46 | #define EFI_ISA_ACPI_DMA_SPEED_TYPE_B 0x02 ///< ISA controller supports type B DMA transfers\r | |
47 | #define EFI_ISA_ACPI_DMA_SPEED_TYPE_F 0x03 ///< ISA controller supports type F DMA transfers\r | |
48 | #define EFI_ISA_ACPI_DMA_COUNT_BY_BYTE 0x04 ///< ISA controller increments DMA address by bytes (8-bit)\r | |
49 | #define EFI_ISA_ACPI_DMA_COUNT_BY_WORD 0x08 ///< ISA controller increments DMA address by words (16-bit)\r | |
50 | #define EFI_ISA_ACPI_DMA_BUS_MASTER 0x10 ///< ISA controller is a DMA bus master\r | |
51 | #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x20 ///< ISA controller only supports 8-bit DMA transfers\r | |
52 | #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x40 ///< ISA controller both 8-bit and 16-bit DMA transfers\r | |
53 | #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x80 ///< ISA controller only supports 16-bit DMA transfers\r | |
54 | \r | |
55 | ///\r | |
56 | /// ISA ACPI Protocol MMIO resource attributes\r | |
57 | ///\r | |
58 | #define EFI_ISA_ACPI_MEMORY_WIDTH_MASK 0x03 ///< Bit mask of supported ISA memory width attributes\r | |
59 | #define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT 0x00 ///< ISA MMIO region only supports 8-bit access\r | |
60 | #define EFI_ISA_ACPI_MEMORY_WIDTH_16_BIT 0x01 ///< ISA MMIO region only supports 16-bit access\r | |
61 | #define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT_AND_16_BIT 0x02 ///< ISA MMIO region supports both 8-bit and 16-bit access \r | |
62 | #define EFI_ISA_ACPI_MEMORY_WRITEABLE 0x04 ///< ISA MMIO region supports write transactions\r | |
63 | #define EFI_ISA_ACPI_MEMORY_CACHEABLE 0x08 ///< ISA MMIO region supports being cached\r | |
64 | #define EFI_ISA_ACPI_MEMORY_SHADOWABLE 0x10 ///< ISA MMIO region may be shadowed\r | |
65 | #define EFI_ISA_ACPI_MEMORY_EXPANSION_ROM 0x20 ///< ISA MMIO region is an expansion ROM\r | |
66 | \r | |
67 | ///\r | |
68 | /// ISA ACPI Protocol I/O resource attributes\r | |
69 | ///\r | |
70 | #define EFI_ISA_ACPI_IO_DECODE_10_BITS 0x01 ///< ISA controllers uses a 10-bit address decoder for I/O cycles\r | |
71 | #define EFI_ISA_ACPI_IO_DECODE_16_BITS 0x02 ///< ISA controllers uses a 16-bit address decoder for I/O cycles\r | |
72 | \r | |
73 | ///\r | |
74 | /// EFI ISA ACPI resource type \r | |
75 | ///\r | |
a9102619 | 76 | typedef enum {\r |
099fae5d | 77 | EfiIsaAcpiResourceEndOfList, ///< Marks the end if a resource list\r |
78 | EfiIsaAcpiResourceIo, ///< ISA I/O port resource range\r | |
79 | EfiIsaAcpiResourceMemory, ///< ISA MMIO resource range \r | |
80 | EfiIsaAcpiResourceDma, ///< ISA DMA resource \r | |
81 | EfiIsaAcpiResourceInterrupt ///< ISA interrupt resource\r | |
a9102619 | 82 | } EFI_ISA_ACPI_RESOURCE_TYPE;\r |
83 | \r | |
099fae5d | 84 | ///\r |
85 | /// EFI ISA ACPI generic resource structure\r | |
86 | ///\r | |
a9102619 | 87 | typedef struct {\r |
099fae5d | 88 | EFI_ISA_ACPI_RESOURCE_TYPE Type; ///< The type of resource (I/O, MMIO, DMA, Interrupt)\r |
89 | UINT32 Attribute; ///< Bit mask of attributes associated with this resource. See EFI_ISA_ACPI_xxx macros for valid combinations.\r | |
90 | UINT32 StartRange; ///< The start of the resource range\r | |
91 | UINT32 EndRange; ///< The end of the resource range\r | |
a9102619 | 92 | } EFI_ISA_ACPI_RESOURCE;\r |
93 | \r | |
099fae5d | 94 | ///\r |
95 | /// EFI ISA ACPI resource device identifier\r | |
96 | ///\r | |
a9102619 | 97 | typedef struct {\r |
099fae5d | 98 | UINT32 HID; ///< The ACPI Hardware Identifier value associated with an ISA controller. Matchs ACPI DSDT contents.\r |
99 | UINT32 UID; ///< The ACPI Unique Identifier value associated with an ISA controller. Matches ACPI DSDT contents.\r | |
a9102619 | 100 | } EFI_ISA_ACPI_DEVICE_ID;\r |
101 | \r | |
099fae5d | 102 | ///\r |
103 | /// EFI ISA ACPI resource list\r | |
104 | ///\r | |
a9102619 | 105 | typedef struct {\r |
099fae5d | 106 | EFI_ISA_ACPI_DEVICE_ID Device; ///< The ACPI HID/UID associated with an ISA controller\r |
107 | EFI_ISA_ACPI_RESOURCE *ResourceItem; ///< Pointer to the list of resources associated with an ISA controller\r | |
a9102619 | 108 | } EFI_ISA_ACPI_RESOURCE_LIST;\r |
109 | \r | |
f4671790 | 110 | /**\r |
099fae5d | 111 | Enumerates the ISA controllers on an ISA bus.\r |
112 | \r | |
113 | This service allows all the ISA controllers on an ISA bus to be enumerated. If\r | |
114 | Device is a pointer to a NULL value, then the first ISA controller on the ISA\r | |
115 | bus is returned in Device and EFI_SUCESS is returned. If Device is a pointer \r | |
116 | to value that was returned on a prior call to DeviceEnumerate(), then the next \r | |
117 | ISA controller on the ISA bus is returned in Device and EFI_SUCCESS is returned.\r | |
118 | If Device is a pointer to the last ISA controller on the ISA bus, then \r | |
119 | EFI_NOT_FOUND is returned.\r | |
f4671790 | 120 | \r |
099fae5d | 121 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r |
122 | @param[out] Device Pointer to an ISA controller named by ACPI HID/UID.\r | |
f4671790 | 123 | \r |
099fae5d | 124 | @retval EFI_SUCCESS The next ISA controller on the ISA bus was returned.\r |
125 | @retval EFI_NOT_FOUND No device found.\r | |
f4671790 LG |
126 | \r |
127 | **/\r | |
a9102619 | 128 | typedef\r |
129 | EFI_STATUS\r | |
099fae5d | 130 | (EFIAPI *EFI_ISA_ACPI_DEVICE_ENUMERATE)(\r |
131 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
132 | OUT EFI_ISA_ACPI_DEVICE_ID **Device\r | |
a9102619 | 133 | );\r |
f4671790 LG |
134 | \r |
135 | /**\r | |
099fae5d | 136 | Sets the power state of an ISA controller.\r |
f4671790 | 137 | \r |
099fae5d | 138 | This services sets the power state of the ISA controller specified by Device to \r |
139 | the power state specified by OnOff. If OnOff is TRUE, then power is applied to \r | |
140 | the ISA controller. If OnOff is FALSE, then power is remobed from the ISA \r | |
141 | controller. If the power state is sucessfully set on the ISA Controller, then\r | |
142 | EFI_SUCCESS is returned.\r | |
f4671790 | 143 | \r |
099fae5d | 144 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r |
145 | @param[in] Device Pointer to an ISA controller named by ACPI HID/UID.\r | |
146 | @param[in] OnOff TRUE to apply power to the ISA controller. FALSE to remove\r | |
147 | power from the ISA controller.\r | |
148 | \r | |
149 | @retval EFI_SUCCESS Successfully set the power state of the ISA controller.\r | |
150 | @retval Other The ISA controller cound not be placed in the requested power state.\r | |
f4671790 LG |
151 | \r |
152 | **/\r | |
a9102619 | 153 | typedef\r |
154 | EFI_STATUS\r | |
099fae5d | 155 | (EFIAPI *EFI_ISA_ACPI_SET_DEVICE_POWER)(\r |
156 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
157 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
158 | IN BOOLEAN OnOff\r | |
a9102619 | 159 | );\r |
160 | \r | |
f4671790 | 161 | /**\r |
099fae5d | 162 | Retrieves the current set of resource associated with an ISA controller.\r |
163 | \r | |
164 | Retrieves the set of I/O, MMIO, DMA, and interrupt resources currently \r | |
165 | assigned to the ISA controller specified by Device. These resources\r | |
166 | are returned in ResourceList.\r | |
f4671790 | 167 | \r |
099fae5d | 168 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r |
169 | @param[in] Device Pointer to an ISA controller named by ACPI HID/UID.\r | |
170 | @param[out] ResourceList Pointer to the current resource list for Device.\r | |
f4671790 | 171 | \r |
099fae5d | 172 | @retval EFI_SUCCESS Successfully retrieved the current resource list.\r |
173 | @retval EFI_NOT_FOUND The resource list could not be retrieved.\r | |
f4671790 LG |
174 | \r |
175 | **/\r | |
a9102619 | 176 | typedef\r |
177 | EFI_STATUS\r | |
099fae5d | 178 | (EFIAPI *EFI_ISA_ACPI_GET_CUR_RESOURCE)(\r |
179 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
180 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
181 | OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r | |
a9102619 | 182 | );\r |
183 | \r | |
f4671790 | 184 | /**\r |
099fae5d | 185 | Retrieves the set of possible resources that may be assigned to an ISA controller\r |
186 | with SetResource().\r | |
f4671790 | 187 | \r |
099fae5d | 188 | Retrieves the possible sets of I/O, MMIO, DMA, and interrupt resources for the\r |
189 | ISA controller specified by Device. The sets are returned in ResourceList.\r | |
190 | \r | |
191 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r | |
192 | @param[in] Device Pointer to an ISA controller named by ACPI HID/UID.\r | |
193 | @param[out] ResourceList Pointer to the returned list of resource lists.\r | |
194 | \r | |
195 | @retval EFI_UNSUPPORTED This services is not supported.\r | |
f4671790 | 196 | \r |
f4671790 | 197 | **/\r |
a9102619 | 198 | typedef\r |
199 | EFI_STATUS\r | |
099fae5d | 200 | (EFIAPI *EFI_ISA_ACPI_GET_POS_RESOURCE)(\r |
201 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
202 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
203 | OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r | |
a9102619 | 204 | );\r |
f4671790 LG |
205 | \r |
206 | /**\r | |
099fae5d | 207 | Assigns resources to an ISA controller.\r |
f4671790 | 208 | \r |
099fae5d | 209 | Assigns the I/O, MMIO, DMA, and interrupt resources specified by ResourceList\r |
210 | to the ISA controller specified by Device. ResourceList must match on of the\r | |
211 | possible resource lists returned by GetPosResource() for the same ISA controller.\r | |
f4671790 | 212 | \r |
099fae5d | 213 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r |
214 | @param[in] Device Pointer to an ISA controller named by ACPI HID/UID.\r | |
215 | @param[in] ResourceList Pointer to a resources list that must be one of the \r | |
216 | resource lists returned by GetPosResource() for the\r | |
217 | ISA controller specified by Device.\r | |
218 | \r | |
219 | @retval EFI_SUCCESS Successfully set resources on the ISA controller.\r | |
220 | @retval Other The resources could not be set for the ISA controller.\r | |
f4671790 LG |
221 | \r |
222 | **/\r | |
a9102619 | 223 | typedef\r |
224 | EFI_STATUS\r | |
099fae5d | 225 | (EFIAPI *EFI_ISA_ACPI_SET_RESOURCE)(\r |
226 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
227 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
228 | IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList\r | |
a9102619 | 229 | ); \r |
230 | \r | |
f4671790 | 231 | /**\r |
099fae5d | 232 | Enables or disables an ISA controller.\r |
f4671790 | 233 | \r |
099fae5d | 234 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r |
235 | @param[in] Device Pointer to the ISA controller to enable/disable.\r | |
236 | @param[in] Enable TRUE to enable the ISA controller. FALSE to disable the\r | |
237 | ISA controller.\r | |
f4671790 | 238 | \r |
099fae5d | 239 | @retval EFI_SUCCESS Successfully enabled/disabled the ISA controller.\r |
240 | @retval Other The ISA controller cound not be placed in the requested state.\r | |
f4671790 LG |
241 | \r |
242 | **/\r | |
a9102619 | 243 | typedef\r |
244 | EFI_STATUS\r | |
099fae5d | 245 | (EFIAPI *EFI_ISA_ACPI_ENABLE_DEVICE)(\r |
246 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
247 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
248 | IN BOOLEAN Enable\r | |
a9102619 | 249 | ); \r |
250 | \r | |
f4671790 | 251 | /**\r |
099fae5d | 252 | Places an ISA controller into a usable state. This service must be called\r |
253 | before SetResource(), EnableDevice(), or SetPower() will behave as expected.\r | |
f4671790 | 254 | \r |
099fae5d | 255 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r |
256 | @param[in] Device Pointer to an ISA controller named by ACPI HID/UID.\r | |
f4671790 | 257 | \r |
099fae5d | 258 | @retval EFI_SUCCESS Successfully initialized an ISA controller.\r |
259 | @retval Other The ISA controller could not be initialized.\r | |
f4671790 LG |
260 | \r |
261 | **/\r | |
a9102619 | 262 | typedef\r |
263 | EFI_STATUS\r | |
099fae5d | 264 | (EFIAPI *EFI_ISA_ACPI_INIT_DEVICE)(\r |
265 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
266 | IN EFI_ISA_ACPI_DEVICE_ID *Device\r | |
a9102619 | 267 | ); \r |
268 | \r | |
f4671790 | 269 | /**\r |
099fae5d | 270 | Initializes all the HW state required for the ISA controlers on the ISA bus \r |
271 | to be enumerated and managed by this rest of the services in this prorotol.\r | |
272 | This service must be called before any of the other services in this\r | |
273 | protocol will function as expected.\r | |
274 | \r | |
275 | @param[in] This Pointer to the EFI_ISA_ACPI_PROTOCOL instance.\r | |
f4671790 | 276 | \r |
099fae5d | 277 | @retval EFI_SUCCESS Successfully initialized the ISA interface.\r |
278 | @retval Other The ISA interface could not be initialized.\r | |
f4671790 LG |
279 | \r |
280 | **/\r | |
a9102619 | 281 | typedef\r |
282 | EFI_STATUS\r | |
099fae5d | 283 | (EFIAPI *EFI_ISA_ACPI_INTERFACE_INIT)(\r |
284 | IN EFI_ISA_ACPI_PROTOCOL *This\r | |
a9102619 | 285 | );\r |
286 | \r | |
099fae5d | 287 | ///\r |
288 | /// The EFI_ISA_ACPI_PROTOCOL provides the services to enumberate and manage\r | |
289 | /// ISA controllers on an ISA bus. This include the ability to initialize, \r | |
290 | /// enable, disable, and manag the power state of ISA controllers. It also \r | |
291 | /// includes services to query current ressources, query possible resources, \r | |
292 | /// and assign resources to an ISA controller.\r | |
293 | ///\r | |
a9102619 | 294 | struct _EFI_ISA_ACPI_PROTOCOL {\r |
099fae5d | 295 | EFI_ISA_ACPI_DEVICE_ENUMERATE DeviceEnumerate;\r |
296 | EFI_ISA_ACPI_SET_DEVICE_POWER SetPower;\r | |
297 | EFI_ISA_ACPI_GET_CUR_RESOURCE GetCurResource;\r | |
298 | EFI_ISA_ACPI_GET_POS_RESOURCE GetPosResource;\r | |
299 | EFI_ISA_ACPI_SET_RESOURCE SetResource;\r | |
300 | EFI_ISA_ACPI_ENABLE_DEVICE EnableDevice;\r | |
301 | EFI_ISA_ACPI_INIT_DEVICE InitDevice;\r | |
302 | EFI_ISA_ACPI_INTERFACE_INIT InterfaceInit;\r | |
a9102619 | 303 | };\r |
304 | \r | |
305 | extern EFI_GUID gEfiIsaAcpiProtocolGuid;\r | |
306 | \r | |
307 | #endif\r |