573d5a4a60ba4c8b0e4c0c238264a38f3469a8fa
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / IsaAcpi.h
1 /** @file
2 EFI ISA Acpi Protocol
3
4 Copyright (c) 2006 - 2007, 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 // at first, the resource was defined as below
60 // but in the future, it will be defined again that follow ACPI spec: ACPI resource type
61 // so that, in this driver, we can interpret the ACPI table and get the ISA device information.
62 //
63
64 typedef enum {
65 EfiIsaAcpiResourceEndOfList,
66 EfiIsaAcpiResourceIo,
67 EfiIsaAcpiResourceMemory,
68 EfiIsaAcpiResourceDma,
69 EfiIsaAcpiResourceInterrupt
70 } EFI_ISA_ACPI_RESOURCE_TYPE;
71
72 typedef struct {
73 EFI_ISA_ACPI_RESOURCE_TYPE Type;
74 UINT32 Attribute;
75 UINT32 StartRange;
76 UINT32 EndRange;
77 } EFI_ISA_ACPI_RESOURCE;
78
79 typedef struct {
80 UINT32 HID;
81 UINT32 UID;
82 } EFI_ISA_ACPI_DEVICE_ID;
83
84 typedef struct {
85 EFI_ISA_ACPI_DEVICE_ID Device;
86 EFI_ISA_ACPI_RESOURCE *ResourceItem;
87 } EFI_ISA_ACPI_RESOURCE_LIST;
88
89 //
90 // Prototypes for the ISA ACPI Protocol
91 //
92 typedef
93 EFI_STATUS
94 (EFIAPI *EFI_ISA_ACPI_DEVICE_ENUMERATE) (
95 IN EFI_ISA_ACPI_PROTOCOL *This,
96 OUT EFI_ISA_ACPI_DEVICE_ID **Device
97 );
98
99 typedef
100 EFI_STATUS
101 (EFIAPI *EFI_ISA_ACPI_SET_DEVICE_POWER) (
102 IN EFI_ISA_ACPI_PROTOCOL *This,
103 IN EFI_ISA_ACPI_DEVICE_ID *Device,
104 IN BOOLEAN OnOff
105 );
106
107 typedef
108 EFI_STATUS
109 (EFIAPI *EFI_ISA_ACPI_GET_CUR_RESOURCE) (
110 IN EFI_ISA_ACPI_PROTOCOL *This,
111 IN EFI_ISA_ACPI_DEVICE_ID *Device,
112 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList
113 );
114
115 typedef
116 EFI_STATUS
117 (EFIAPI *EFI_ISA_ACPI_GET_POS_RESOURCE) (
118 IN EFI_ISA_ACPI_PROTOCOL *This,
119 IN EFI_ISA_ACPI_DEVICE_ID *Device,
120 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList
121 );
122
123 typedef
124 EFI_STATUS
125 (EFIAPI *EFI_ISA_ACPI_SET_RESOURCE) (
126 IN EFI_ISA_ACPI_PROTOCOL *This,
127 IN EFI_ISA_ACPI_DEVICE_ID *Device,
128 IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList
129 );
130
131 typedef
132 EFI_STATUS
133 (EFIAPI *EFI_ISA_ACPI_ENABLE_DEVICE) (
134 IN EFI_ISA_ACPI_PROTOCOL *This,
135 IN EFI_ISA_ACPI_DEVICE_ID *Device,
136 IN BOOLEAN Enable
137 );
138
139 typedef
140 EFI_STATUS
141 (EFIAPI *EFI_ISA_ACPI_INIT_DEVICE) (
142 IN EFI_ISA_ACPI_PROTOCOL *This,
143 IN EFI_ISA_ACPI_DEVICE_ID *Device
144 );
145
146 typedef
147 EFI_STATUS
148 (EFIAPI *EFI_ISA_ACPI_INTERFACE_INIT) (
149 IN EFI_ISA_ACPI_PROTOCOL *This
150 );
151
152 //
153 // Interface structure for the ISA ACPI Protocol
154 //
155 struct _EFI_ISA_ACPI_PROTOCOL {
156 EFI_ISA_ACPI_DEVICE_ENUMERATE DeviceEnumerate;
157 EFI_ISA_ACPI_SET_DEVICE_POWER SetPower;
158 EFI_ISA_ACPI_GET_CUR_RESOURCE GetCurResource;
159 EFI_ISA_ACPI_GET_POS_RESOURCE GetPosResource;
160 EFI_ISA_ACPI_SET_RESOURCE SetResource;
161 EFI_ISA_ACPI_ENABLE_DEVICE EnableDevice;
162 EFI_ISA_ACPI_INIT_DEVICE InitDevice;
163 EFI_ISA_ACPI_INTERFACE_INIT InterfaceInit;
164 };
165
166 extern EFI_GUID gEfiIsaAcpiProtocolGuid;
167
168 #endif