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