]>
Commit | Line | Data |
---|---|---|
c69dd9df | 1 | /*++\r |
2 | \r | |
3 | Copyright (c) 2006, Intel Corporation \r | |
4 | All rights reserved. This program and the accompanying materials \r | |
5 | are licensed and made available under the terms and conditions of the BSD License \r | |
6 | which accompanies this distribution. The full text of the license may be found at \r | |
7 | http://opensource.org/licenses/bsd-license.php \r | |
8 | \r | |
9 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r | |
10 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r | |
11 | \r | |
12 | \r | |
13 | Module Name:\r | |
14 | \r | |
15 | IsaAcpi.c\r | |
16 | \r | |
17 | Abstract: \r | |
18 | \r | |
19 | ISA ACPI Protocol Implementation\r | |
20 | \r | |
21 | Revision History\r | |
22 | \r | |
23 | --*/\r | |
24 | \r | |
25 | #include "PcatIsaAcpi.h"\r | |
26 | \r | |
27 | //\r | |
28 | // Platform specific data for the ISA devices that are present.in the platform\r | |
29 | //\r | |
30 | \r | |
31 | //\r | |
32 | // COM 1 UART Controller\r | |
33 | //\r | |
e56dd2ce | 34 | EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom1DeviceResources[] = {\r |
c69dd9df | 35 | {EfiIsaAcpiResourceIo, 0, 0x3f8, 0x3ff},\r |
36 | {EfiIsaAcpiResourceInterrupt, 0, 4, 0},\r | |
37 | {EfiIsaAcpiResourceEndOfList, 0, 0, 0}\r | |
38 | };\r | |
39 | \r | |
40 | //\r | |
41 | // COM 2 UART Controller\r | |
42 | //\r | |
e56dd2ce | 43 | EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom2DeviceResources[] = {\r |
c69dd9df | 44 | {EfiIsaAcpiResourceIo, 0, 0x2f8, 0x2ff},\r |
45 | {EfiIsaAcpiResourceInterrupt, 0, 3, 0},\r | |
46 | {EfiIsaAcpiResourceEndOfList, 0, 0, 0}\r | |
47 | };\r | |
48 | \r | |
49 | //\r | |
50 | // PS/2 Keyboard Controller\r | |
51 | //\r | |
e56dd2ce | 52 | EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiPs2KeyboardDeviceResources[] = {\r |
c69dd9df | 53 | {EfiIsaAcpiResourceIo, 0, 0x60, 0x64},\r |
54 | {EfiIsaAcpiResourceInterrupt, 0, 1, 0},\r | |
55 | {EfiIsaAcpiResourceEndOfList, 0, 0, 0}\r | |
56 | };\r | |
57 | \r | |
58 | //\r | |
59 | // PS/2 Mouse Controller\r | |
60 | //\r | |
e56dd2ce | 61 | EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiPs2MouseDeviceResources[] = {\r |
c69dd9df | 62 | {EfiIsaAcpiResourceIo, 0, 0x60, 0x64},\r |
63 | {EfiIsaAcpiResourceInterrupt, 0, 12, 0},\r | |
64 | {EfiIsaAcpiResourceEndOfList, 0, 0, 0}\r | |
65 | };\r | |
66 | \r | |
67 | //\r | |
68 | // Floppy Disk Controller\r | |
69 | //\r | |
e56dd2ce | 70 | EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiFloppyResources[] = {\r |
c69dd9df | 71 | {EfiIsaAcpiResourceIo, 0, 0x3f0, 0x3f7},\r |
72 | {EfiIsaAcpiResourceInterrupt, 0, 6, 0},\r | |
73 | {EfiIsaAcpiResourceDma, EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE | EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8 | EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE, 2, 0},\r | |
74 | {EfiIsaAcpiResourceEndOfList, 0, 0, 0}\r | |
75 | };\r | |
76 | \r | |
77 | //\r | |
78 | // Table of ISA Controllers\r | |
79 | //\r | |
80 | EFI_ISA_ACPI_RESOURCE_LIST gPcatIsaAcpiDeviceList[] = {\r | |
81 | {{EISA_PNP_ID(0x501), 0}, mPcatIsaAcpiCom1DeviceResources }, // COM 1 UART Controller\r | |
82 | {{EISA_PNP_ID(0x501), 1}, mPcatIsaAcpiCom2DeviceResources }, // COM 2 UART Controller\r | |
83 | {{EISA_PNP_ID(0x303), 0}, mPcatIsaAcpiPs2KeyboardDeviceResources }, // PS/2 Keyboard Controller\r | |
84 | {{EISA_PNP_ID(0x303), 1}, mPcatIsaAcpiPs2MouseDeviceResources }, // PS/2 Mouse Controller\r | |
85 | {{EISA_PNP_ID(0x604), 0}, mPcatIsaAcpiFloppyResources }, // Floppy Disk Controller A:\r | |
86 | {{EISA_PNP_ID(0x604), 1}, mPcatIsaAcpiFloppyResources }, // Floppy Disk Controller B:\r | |
87 | {{0, 0}, NULL } // End if ISA Controllers\r | |
88 | };\r | |
89 | \r | |
90 | //\r | |
91 | // ISA ACPI Protocol Functions\r | |
92 | //\r | |
93 | VOID\r | |
94 | IsaDeviceLookup (\r | |
95 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
96 | OUT EFI_ISA_ACPI_RESOURCE_LIST **IsaAcpiDevice,\r | |
97 | OUT EFI_ISA_ACPI_RESOURCE_LIST **NextIsaAcpiDevice\r | |
98 | )\r | |
99 | /*++\r | |
100 | \r | |
101 | Routine Description:\r | |
102 | Enumerate the ISA devices on the ISA bus\r | |
103 | \r | |
104 | Arguments:\r | |
105 | \r | |
106 | Returns:\r | |
107 | \r | |
108 | --*/\r | |
109 | {\r | |
110 | UINTN Index;\r | |
111 | \r | |
112 | *IsaAcpiDevice = NULL;\r | |
113 | if (NextIsaAcpiDevice != NULL) {\r | |
114 | *NextIsaAcpiDevice = NULL;\r | |
115 | }\r | |
116 | if (Device == NULL) {\r | |
117 | Index = 0;\r | |
118 | } else {\r | |
119 | for(Index = 0; gPcatIsaAcpiDeviceList[Index].ResourceItem != NULL; Index++) {\r | |
120 | if (Device->HID == gPcatIsaAcpiDeviceList[Index].Device.HID && \r | |
121 | Device->UID == gPcatIsaAcpiDeviceList[Index].Device.UID ) {\r | |
122 | break;\r | |
123 | }\r | |
124 | }\r | |
125 | if (gPcatIsaAcpiDeviceList[Index].ResourceItem == NULL) {\r | |
126 | return;\r | |
127 | }\r | |
128 | *IsaAcpiDevice = &(gPcatIsaAcpiDeviceList[Index]);\r | |
129 | Index++;\r | |
130 | }\r | |
131 | if (gPcatIsaAcpiDeviceList[Index].ResourceItem != NULL && NextIsaAcpiDevice != NULL) {\r | |
132 | *NextIsaAcpiDevice = &(gPcatIsaAcpiDeviceList[Index]);\r | |
133 | }\r | |
134 | }\r | |
135 | \r | |
136 | EFI_STATUS\r | |
137 | EFIAPI\r | |
138 | IsaDeviceEnumerate (\r | |
139 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
140 | OUT EFI_ISA_ACPI_DEVICE_ID **Device\r | |
141 | )\r | |
142 | /*++\r | |
143 | \r | |
144 | Routine Description:\r | |
145 | Enumerate the ISA devices on the ISA bus\r | |
146 | \r | |
147 | Arguments:\r | |
148 | \r | |
149 | Returns:\r | |
150 | \r | |
151 | --*/\r | |
152 | {\r | |
153 | EFI_ISA_ACPI_RESOURCE_LIST *IsaAcpiDevice;\r | |
154 | EFI_ISA_ACPI_RESOURCE_LIST *NextIsaAcpiDevice;\r | |
155 | \r | |
156 | IsaDeviceLookup (*Device, &IsaAcpiDevice, &NextIsaAcpiDevice);\r | |
157 | if (NextIsaAcpiDevice == NULL) {\r | |
158 | return EFI_NOT_FOUND;\r | |
159 | }\r | |
160 | *Device = &(NextIsaAcpiDevice->Device);\r | |
161 | return EFI_SUCCESS;\r | |
162 | }\r | |
163 | \r | |
164 | EFI_STATUS\r | |
165 | EFIAPI\r | |
166 | IsaDeviceSetPower (\r | |
167 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
168 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
169 | IN BOOLEAN OnOff\r | |
170 | )\r | |
171 | /*++\r | |
172 | \r | |
173 | Routine Description:\r | |
174 | Set ISA device power \r | |
175 | \r | |
176 | Arguments:\r | |
177 | \r | |
178 | Returns:\r | |
179 | \r | |
180 | --*/\r | |
181 | {\r | |
182 | return EFI_SUCCESS;\r | |
183 | } \r | |
184 | \r | |
185 | EFI_STATUS\r | |
186 | EFIAPI\r | |
187 | IsaGetCurrentResource (\r | |
188 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
189 | IN EFI_ISA_ACPI_DEVICE_ID *Device, \r | |
190 | OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r | |
191 | )\r | |
192 | /*++\r | |
193 | \r | |
194 | Routine Description:\r | |
195 | Get current Resource of the specific ISA device\r | |
196 | \r | |
197 | Arguments:\r | |
198 | \r | |
199 | Returns:\r | |
200 | \r | |
201 | --*/\r | |
202 | {\r | |
203 | IsaDeviceLookup (Device, ResourceList, NULL);\r | |
204 | if (*ResourceList == NULL) {\r | |
205 | return EFI_NOT_FOUND;\r | |
206 | }\r | |
207 | return EFI_SUCCESS;\r | |
208 | }\r | |
209 | \r | |
210 | EFI_STATUS\r | |
211 | EFIAPI\r | |
212 | IsaGetPossibleResource (\r | |
213 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
214 | IN EFI_ISA_ACPI_DEVICE_ID *Device, \r | |
215 | OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList\r | |
216 | )\r | |
217 | /*++\r | |
218 | \r | |
219 | Routine Description:\r | |
220 | \r | |
221 | Arguments:\r | |
222 | \r | |
223 | Returns:\r | |
224 | \r | |
225 | --*/ \r | |
226 | {\r | |
227 | return EFI_SUCCESS;\r | |
228 | }\r | |
229 | \r | |
230 | EFI_STATUS\r | |
231 | EFIAPI\r | |
232 | IsaSetResource (\r | |
233 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
234 | IN EFI_ISA_ACPI_DEVICE_ID *Device, \r | |
235 | IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList\r | |
236 | )\r | |
237 | /*++\r | |
238 | \r | |
239 | Routine Description:\r | |
240 | \r | |
241 | Arguments:\r | |
242 | \r | |
243 | Returns:\r | |
244 | \r | |
245 | --*/\r | |
246 | {\r | |
247 | return EFI_SUCCESS;\r | |
248 | }\r | |
249 | \r | |
250 | EFI_STATUS\r | |
251 | EFIAPI\r | |
252 | IsaEnableDevice (\r | |
253 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
254 | IN EFI_ISA_ACPI_DEVICE_ID *Device,\r | |
255 | IN BOOLEAN Enable\r | |
256 | )\r | |
257 | /*++\r | |
258 | \r | |
259 | Routine Description:\r | |
260 | \r | |
261 | Arguments:\r | |
262 | \r | |
263 | Returns:\r | |
264 | \r | |
265 | --*/\r | |
266 | {\r | |
267 | return EFI_SUCCESS; \r | |
268 | }\r | |
269 | \r | |
270 | EFI_STATUS\r | |
271 | EFIAPI\r | |
272 | IsaInitDevice (\r | |
273 | IN EFI_ISA_ACPI_PROTOCOL *This,\r | |
274 | IN EFI_ISA_ACPI_DEVICE_ID *Device\r | |
275 | )\r | |
276 | /*++\r | |
277 | \r | |
278 | Routine Description:\r | |
279 | \r | |
280 | Arguments:\r | |
281 | \r | |
282 | Returns:\r | |
283 | \r | |
284 | --*/\r | |
285 | {\r | |
286 | return EFI_SUCCESS;\r | |
287 | }\r | |
288 | \r | |
289 | \r | |
290 | EFI_STATUS\r | |
291 | EFIAPI\r | |
292 | IsaInterfaceInit (\r | |
293 | IN EFI_ISA_ACPI_PROTOCOL *This\r | |
294 | ) \r | |
295 | /*++\r | |
296 | \r | |
297 | Routine Description:\r | |
298 | \r | |
299 | Arguments:\r | |
300 | \r | |
301 | Returns:\r | |
302 | \r | |
303 | --*/\r | |
304 | {\r | |
305 | return EFI_SUCCESS;\r | |
306 | } \r |