]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Include/Protocol/IsaAcpi.h
Add comments for Include header files
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / IsaAcpi.h
1 /** @file
2 ISA Acpi Protocol is used to operate and communicate with ISA device.
3
4 Copyright (c) 2006 - 2009, Intel Corporation
5 All rights reserved. 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
9
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.
12
13 **/
14
15 #ifndef __ISA_ACPI_H_
16 #define __ISA_ACPI_H_
17
18 #define EFI_ISA_ACPI_PROTOCOL_GUID \
19 { 0x64a892dc, 0x5561, 0x4536, { 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55 } }
20
21 typedef struct _EFI_ISA_ACPI_PROTOCOL EFI_ISA_ACPI_PROTOCOL;
22
23 //
24 // Resource Attribute definition
25 //
26 #define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_EDGE_SENSITIVE 0x01
27 #define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_EDGE_SENSITIVE 0x02
28 #define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_LEVEL_SENSITIVE 0x04
29 #define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_LEVEL_SENSITIVE 0x08
30
31 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_MASK 0x03
32
33 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00
34 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_A 0x01
35 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_B 0x02
36 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_F 0x03
37 #define EFI_ISA_ACPI_DMA_COUNT_BY_BYTE 0x04
38 #define EFI_ISA_ACPI_DMA_COUNT_BY_WORD 0x08
39 #define EFI_ISA_ACPI_DMA_BUS_MASTER 0x10
40 #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x20
41 #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x40
42 #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x80
43
44 #define EFI_ISA_ACPI_MEMORY_WIDTH_MASK 0x03
45
46 #define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT 0x00
47 #define EFI_ISA_ACPI_MEMORY_WIDTH_16_BIT 0x01
48 #define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT_AND_16_BIT 0x02
49 #define EFI_ISA_ACPI_MEMORY_WRITEABLE 0x04
50 #define EFI_ISA_ACPI_MEMORY_CACHEABLE 0x08
51 #define EFI_ISA_ACPI_MEMORY_SHADOWABLE 0x10
52 #define EFI_ISA_ACPI_MEMORY_EXPANSION_ROM 0x20
53
54 #define EFI_ISA_ACPI_IO_DECODE_10_BITS 0x01
55 #define EFI_ISA_ACPI_IO_DECODE_16_BITS 0x02
56
57 //
58 // Resource List definition:
59 //
60 typedef enum {
61 EfiIsaAcpiResourceEndOfList,
62 EfiIsaAcpiResourceIo,
63 EfiIsaAcpiResourceMemory,
64 EfiIsaAcpiResourceDma,
65 EfiIsaAcpiResourceInterrupt
66 } EFI_ISA_ACPI_RESOURCE_TYPE;
67
68 typedef struct {
69 EFI_ISA_ACPI_RESOURCE_TYPE Type;
70 UINT32 Attribute;
71 UINT32 StartRange;
72 UINT32 EndRange;
73 } EFI_ISA_ACPI_RESOURCE;
74
75 typedef struct {
76 UINT32 HID;
77 UINT32 UID;
78 } EFI_ISA_ACPI_DEVICE_ID;
79
80 typedef struct {
81 EFI_ISA_ACPI_DEVICE_ID Device;
82 EFI_ISA_ACPI_RESOURCE *ResourceItem;
83 } EFI_ISA_ACPI_RESOURCE_LIST;
84
85 /**
86 Enumerate the ISA devices on the ISA bus.
87
88 @param This Pointer to EFI_ISA_ACPI_PROTOCOL.
89 @param Device Found next ISA device.
90
91 @retval EFI_NOT_FOUND No device found.
92 @retval EFI_SUCCESS Success get the next ISA device.
93
94 **/
95 typedef
96 EFI_STATUS
97 (EFIAPI *EFI_ISA_ACPI_DEVICE_ENUMERATE) (
98 IN EFI_ISA_ACPI_PROTOCOL *This,
99 OUT EFI_ISA_ACPI_DEVICE_ID **Device
100 );
101
102 /**
103 Set ISA device power.
104
105 @param This Pointer to EFI_ISA_ACPI_PROTOCOL.
106 @param Device ISA device.
107 @param OnOff Whether to set power on or off.
108
109 @retval EFI_SUCCESS Successfully set ISA device.
110
111 **/
112 typedef
113 EFI_STATUS
114 (EFIAPI *EFI_ISA_ACPI_SET_DEVICE_POWER) (
115 IN EFI_ISA_ACPI_PROTOCOL *This,
116 IN EFI_ISA_ACPI_DEVICE_ID *Device,
117 IN BOOLEAN OnOff
118 );
119
120 /**
121 Get current Resource of the specific ISA device.
122
123 @param This Pointer to EFI_ISA_ACPI_PROTOCOL.
124 @param Device ISA device.
125 @param ResourceList Returned resource list.
126
127 @retval EFI_SUCCESS Successfully get current resource.
128 @retval EFI_NOT_FOUND No resource found.
129
130 **/
131 typedef
132 EFI_STATUS
133 (EFIAPI *EFI_ISA_ACPI_GET_CUR_RESOURCE) (
134 IN EFI_ISA_ACPI_PROTOCOL *This,
135 IN EFI_ISA_ACPI_DEVICE_ID *Device,
136 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList
137 );
138
139 /**
140 Get possible resource for the specific ISA device.
141
142 @param This Pointer to EFI_ISA_ACPI_PROTOCOL.
143 @param Device ISA device.
144 @param ResourceList Returned resource list.
145
146 @retval EFI_SUCCESS Successfully get possible resource.
147 @retval EFI_NOT_FOUND No resource found.
148 **/
149 typedef
150 EFI_STATUS
151 (EFIAPI *EFI_ISA_ACPI_GET_POS_RESOURCE) (
152 IN EFI_ISA_ACPI_PROTOCOL *This,
153 IN EFI_ISA_ACPI_DEVICE_ID *Device,
154 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList
155 );
156
157 /**
158 Set resources for the specific ISA device.
159
160 @param This Pointer to EFI_ISA_ACPI_PROTOCOL.
161 @param Device ISA device.
162 @param ResourceList Resource list will be set.
163
164 @retval EFI_SUCCESS Successfully set resource.
165
166 **/
167 typedef
168 EFI_STATUS
169 (EFIAPI *EFI_ISA_ACPI_SET_RESOURCE) (
170 IN EFI_ISA_ACPI_PROTOCOL *This,
171 IN EFI_ISA_ACPI_DEVICE_ID *Device,
172 IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList
173 );
174
175 /**
176 Enable or disable ISA device.
177
178 @param This Pointer of EFI_ISA_ACPI_PROTOCOL.
179 @param Device ISA device.
180 @param Enable Enable/Disable.
181
182 @retval EFI_SUCCESS Successfully perform this action.
183
184 **/
185 typedef
186 EFI_STATUS
187 (EFIAPI *EFI_ISA_ACPI_ENABLE_DEVICE) (
188 IN EFI_ISA_ACPI_PROTOCOL *This,
189 IN EFI_ISA_ACPI_DEVICE_ID *Device,
190 IN BOOLEAN Enable
191 );
192
193 /**
194 Init ISA device.
195
196 @param This Pointer to EFI_ISA_ACPI_PROTOCOL.
197 @param Device ISA device.
198
199 @retval EFI_SUCCESS Successfully initialize ISA device.
200
201 **/
202 typedef
203 EFI_STATUS
204 (EFIAPI *EFI_ISA_ACPI_INIT_DEVICE) (
205 IN EFI_ISA_ACPI_PROTOCOL *This,
206 IN EFI_ISA_ACPI_DEVICE_ID *Device
207 );
208
209 /**
210 ISA Interface Init.
211
212 @param This Pointer of EFI_ISA_ACPI_PROTOCOL.
213
214 @retval EFI_SUCCESS Successfully initialize ISA interface.
215
216 **/
217 typedef
218 EFI_STATUS
219 (EFIAPI *EFI_ISA_ACPI_INTERFACE_INIT) (
220 IN EFI_ISA_ACPI_PROTOCOL *This
221 );
222
223 //
224 // Interface structure for the ISA ACPI Protocol
225 //
226 struct _EFI_ISA_ACPI_PROTOCOL {
227 EFI_ISA_ACPI_DEVICE_ENUMERATE DeviceEnumerate;
228 EFI_ISA_ACPI_SET_DEVICE_POWER SetPower;
229 EFI_ISA_ACPI_GET_CUR_RESOURCE GetCurResource;
230 EFI_ISA_ACPI_GET_POS_RESOURCE GetPosResource;
231 EFI_ISA_ACPI_SET_RESOURCE SetResource;
232 EFI_ISA_ACPI_ENABLE_DEVICE EnableDevice;
233 EFI_ISA_ACPI_INIT_DEVICE InitDevice;
234 EFI_ISA_ACPI_INTERFACE_INIT InterfaceInit;
235 };
236
237 extern EFI_GUID gEfiIsaAcpiProtocolGuid;
238
239 #endif