1. Create Intel Framework Module Package directory
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / IsaAcpi.h
CommitLineData
a9102619 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 IsaAcpi.h\r
15 \r
16Abstract:\r
17\r
18 EFI ISA Acpi Protocol\r
19\r
20Revision History\r
21\r
22--*/\r
23\r
24#ifndef __ISA_ACPI_H_\r
25#define __ISA_ACPI_H_\r
26\r
27#define EFI_ISA_ACPI_PROTOCOL_GUID \\r
28 { 0x64a892dc, 0x5561, 0x4536, { 0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55 } }\r
29\r
30typedef struct _EFI_ISA_ACPI_PROTOCOL EFI_ISA_ACPI_PROTOCOL;\r
31\r
32//\r
33// Resource Attribute definition\r
34//\r
35#define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_EDGE_SENSITIVE 0x01\r
36#define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_EDGE_SENSITIVE 0x02\r
37#define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_LEVEL_SENSITIVE 0x04\r
38#define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_LEVEL_SENSITIVE 0x08\r
39\r
40#define EFI_ISA_ACPI_DMA_SPEED_TYPE_MASK 0x03\r
41\r
42#define EFI_ISA_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00\r
43#define EFI_ISA_ACPI_DMA_SPEED_TYPE_A 0x01\r
44#define EFI_ISA_ACPI_DMA_SPEED_TYPE_B 0x02\r
45#define EFI_ISA_ACPI_DMA_SPEED_TYPE_F 0x03\r
46#define EFI_ISA_ACPI_DMA_COUNT_BY_BYTE 0x04\r
47#define EFI_ISA_ACPI_DMA_COUNT_BY_WORD 0x08\r
48#define EFI_ISA_ACPI_DMA_BUS_MASTER 0x10\r
49#define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x20\r
50#define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x40\r
51#define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x80\r
52\r
53#define EFI_ISA_ACPI_MEMORY_WIDTH_MASK 0x03\r
54\r
55#define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT 0x00\r
56#define EFI_ISA_ACPI_MEMORY_WIDTH_16_BIT 0x01\r
57#define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT_AND_16_BIT 0x02\r
58#define EFI_ISA_ACPI_MEMORY_WRITEABLE 0x04\r
59#define EFI_ISA_ACPI_MEMORY_CACHEABLE 0x08\r
60#define EFI_ISA_ACPI_MEMORY_SHADOWABLE 0x10\r
61#define EFI_ISA_ACPI_MEMORY_EXPANSION_ROM 0x20\r
62\r
63#define EFI_ISA_ACPI_IO_DECODE_10_BITS 0x01\r
64#define EFI_ISA_ACPI_IO_DECODE_16_BITS 0x02\r
65\r
66//\r
67// Resource List definition: \r
68// at first, the resource was defined as below\r
69// but in the future, it will be defined again that follow ACPI spec: ACPI resource type\r
70// so that, in this driver, we can interpret the ACPI table and get the ISA device information. \r
71//\r
72 \r
73typedef enum {\r
74 EfiIsaAcpiResourceEndOfList,\r
75 EfiIsaAcpiResourceIo,\r
76 EfiIsaAcpiResourceMemory,\r
77 EfiIsaAcpiResourceDma,\r
78 EfiIsaAcpiResourceInterrupt\r
79} EFI_ISA_ACPI_RESOURCE_TYPE;\r
80\r
81typedef struct {\r
82 EFI_ISA_ACPI_RESOURCE_TYPE Type;\r
83 UINT32 Attribute;\r
84 UINT32 StartRange;\r
85 UINT32 EndRange;\r
86} EFI_ISA_ACPI_RESOURCE;\r
87\r
88typedef struct {\r
89 UINT32 HID;\r
90 UINT32 UID;\r
91} EFI_ISA_ACPI_DEVICE_ID;\r
92\r
93typedef struct {\r
94 EFI_ISA_ACPI_DEVICE_ID Device;\r
95 EFI_ISA_ACPI_RESOURCE *ResourceItem;\r
96} EFI_ISA_ACPI_RESOURCE_LIST;\r
97\r
98//\r
99// Prototypes for the ISA ACPI Protocol\r
100//\r
101typedef\r
102EFI_STATUS\r
103(EFIAPI *EFI_ISA_ACPI_DEVICE_ENUMERATE) (\r
104 IN EFI_ISA_ACPI_PROTOCOL *This,\r
105 OUT EFI_ISA_ACPI_DEVICE_ID **Device\r
106 );\r
107 \r
108typedef\r
109EFI_STATUS\r
110(EFIAPI *EFI_ISA_ACPI_SET_DEVICE_POWER) (\r
111 IN EFI_ISA_ACPI_PROTOCOL *This,\r
112 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
113 IN BOOLEAN OnOff\r
114 );\r
115 \r
116typedef\r
117EFI_STATUS\r
118(EFIAPI *EFI_ISA_ACPI_GET_CUR_RESOURCE) (\r
119 IN EFI_ISA_ACPI_PROTOCOL *This,\r
120 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
121 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r
122 );\r
123\r
124typedef\r
125EFI_STATUS\r
126(EFIAPI *EFI_ISA_ACPI_GET_POS_RESOURCE) (\r
127 IN EFI_ISA_ACPI_PROTOCOL *This,\r
128 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
129 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r
130 );\r
131 \r
132typedef\r
133EFI_STATUS\r
134(EFIAPI *EFI_ISA_ACPI_SET_RESOURCE) (\r
135 IN EFI_ISA_ACPI_PROTOCOL *This,\r
136 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
137 IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList\r
138 ); \r
139\r
140typedef\r
141EFI_STATUS\r
142(EFIAPI *EFI_ISA_ACPI_ENABLE_DEVICE) (\r
143 IN EFI_ISA_ACPI_PROTOCOL *This,\r
144 IN EFI_ISA_ACPI_DEVICE_ID *Device,\r
145 IN BOOLEAN Enable\r
146 ); \r
147\r
148typedef\r
149EFI_STATUS\r
150(EFIAPI *EFI_ISA_ACPI_INIT_DEVICE) (\r
151 IN EFI_ISA_ACPI_PROTOCOL *This,\r
152 IN EFI_ISA_ACPI_DEVICE_ID *Device\r
153 ); \r
154\r
155typedef\r
156EFI_STATUS\r
157(EFIAPI *EFI_ISA_ACPI_INTERFACE_INIT) (\r
158 IN EFI_ISA_ACPI_PROTOCOL *This\r
159 );\r
160\r
161//\r
162// Interface structure for the ISA ACPI Protocol\r
163//\r
164struct _EFI_ISA_ACPI_PROTOCOL {\r
165 EFI_ISA_ACPI_DEVICE_ENUMERATE DeviceEnumerate;\r
166 EFI_ISA_ACPI_SET_DEVICE_POWER SetPower;\r
167 EFI_ISA_ACPI_GET_CUR_RESOURCE GetCurResource;\r
168 EFI_ISA_ACPI_GET_POS_RESOURCE GetPosResource;\r
169 EFI_ISA_ACPI_SET_RESOURCE SetResource;\r
170 EFI_ISA_ACPI_ENABLE_DEVICE EnableDevice;\r
171 EFI_ISA_ACPI_INIT_DEVICE InitDevice;\r
172 EFI_ISA_ACPI_INTERFACE_INIT InterfaceInit;\r
173};\r
174\r
175extern EFI_GUID gEfiIsaAcpiProtocolGuid;\r
176 \r
177#endif\r