3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 ISA ACPI Protocol Implementation
25 #include "PcatIsaAcpi.h"
28 // Platform specific data for the ISA devices that are present.in the platform
32 // COM 1 UART Controller
34 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom1DeviceResources
[] = {
35 {EfiIsaAcpiResourceIo
, 0, 0x3f8, 0x3ff},
36 {EfiIsaAcpiResourceInterrupt
, 0, 4, 0},
37 {EfiIsaAcpiResourceEndOfList
, 0, 0, 0}
41 // COM 2 UART Controller
43 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiCom2DeviceResources
[] = {
44 {EfiIsaAcpiResourceIo
, 0, 0x2f8, 0x2ff},
45 {EfiIsaAcpiResourceInterrupt
, 0, 3, 0},
46 {EfiIsaAcpiResourceEndOfList
, 0, 0, 0}
50 // PS/2 Keyboard Controller
52 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiPs2KeyboardDeviceResources
[] = {
53 {EfiIsaAcpiResourceIo
, 0, 0x60, 0x64},
54 {EfiIsaAcpiResourceInterrupt
, 0, 1, 0},
55 {EfiIsaAcpiResourceEndOfList
, 0, 0, 0}
59 // PS/2 Mouse Controller
61 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiPs2MouseDeviceResources
[] = {
62 {EfiIsaAcpiResourceIo
, 0, 0x60, 0x64},
63 {EfiIsaAcpiResourceInterrupt
, 0, 12, 0},
64 {EfiIsaAcpiResourceEndOfList
, 0, 0, 0}
68 // Floppy Disk Controller
70 EFI_ISA_ACPI_RESOURCE mPcatIsaAcpiFloppyResources
[] = {
71 {EfiIsaAcpiResourceIo
, 0, 0x3f0, 0x3f7},
72 {EfiIsaAcpiResourceInterrupt
, 0, 6, 0},
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},
74 {EfiIsaAcpiResourceEndOfList
, 0, 0, 0}
78 // Table of ISA Controllers
80 EFI_ISA_ACPI_RESOURCE_LIST gPcatIsaAcpiDeviceList
[] = {
81 {{EISA_PNP_ID(0x501), 0}, mPcatIsaAcpiCom1DeviceResources
}, // COM 1 UART Controller
82 {{EISA_PNP_ID(0x501), 1}, mPcatIsaAcpiCom2DeviceResources
}, // COM 2 UART Controller
83 {{EISA_PNP_ID(0x303), 0}, mPcatIsaAcpiPs2KeyboardDeviceResources
}, // PS/2 Keyboard Controller
84 {{EISA_PNP_ID(0x303), 1}, mPcatIsaAcpiPs2MouseDeviceResources
}, // PS/2 Mouse Controller
85 {{EISA_PNP_ID(0x604), 0}, mPcatIsaAcpiFloppyResources
}, // Floppy Disk Controller A:
86 {{EISA_PNP_ID(0x604), 1}, mPcatIsaAcpiFloppyResources
}, // Floppy Disk Controller B:
87 {{0, 0}, NULL
} // End if ISA Controllers
91 // ISA ACPI Protocol Functions
95 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
96 OUT EFI_ISA_ACPI_RESOURCE_LIST
**IsaAcpiDevice
,
97 OUT EFI_ISA_ACPI_RESOURCE_LIST
**NextIsaAcpiDevice
102 Enumerate the ISA devices on the ISA bus
112 *IsaAcpiDevice
= NULL
;
113 if (NextIsaAcpiDevice
!= NULL
) {
114 *NextIsaAcpiDevice
= NULL
;
116 if (Device
== NULL
) {
119 for(Index
= 0; gPcatIsaAcpiDeviceList
[Index
].ResourceItem
!= NULL
; Index
++) {
120 if (Device
->HID
== gPcatIsaAcpiDeviceList
[Index
].Device
.HID
&&
121 Device
->UID
== gPcatIsaAcpiDeviceList
[Index
].Device
.UID
) {
125 if (gPcatIsaAcpiDeviceList
[Index
].ResourceItem
== NULL
) {
128 *IsaAcpiDevice
= &(gPcatIsaAcpiDeviceList
[Index
]);
131 if (gPcatIsaAcpiDeviceList
[Index
].ResourceItem
!= NULL
&& NextIsaAcpiDevice
!= NULL
) {
132 *NextIsaAcpiDevice
= &(gPcatIsaAcpiDeviceList
[Index
]);
139 IN EFI_ISA_ACPI_PROTOCOL
*This
,
140 OUT EFI_ISA_ACPI_DEVICE_ID
**Device
145 Enumerate the ISA devices on the ISA bus
153 EFI_ISA_ACPI_RESOURCE_LIST
*IsaAcpiDevice
;
154 EFI_ISA_ACPI_RESOURCE_LIST
*NextIsaAcpiDevice
;
156 IsaDeviceLookup (*Device
, &IsaAcpiDevice
, &NextIsaAcpiDevice
);
157 if (NextIsaAcpiDevice
== NULL
) {
158 return EFI_NOT_FOUND
;
160 *Device
= &(NextIsaAcpiDevice
->Device
);
167 IN EFI_ISA_ACPI_PROTOCOL
*This
,
168 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
187 IsaGetCurrentResource (
188 IN EFI_ISA_ACPI_PROTOCOL
*This
,
189 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
190 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
195 Get current Resource of the specific ISA device
203 IsaDeviceLookup (Device
, ResourceList
, NULL
);
204 if (*ResourceList
== NULL
) {
205 return EFI_NOT_FOUND
;
212 IsaGetPossibleResource (
213 IN EFI_ISA_ACPI_PROTOCOL
*This
,
214 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
215 OUT EFI_ISA_ACPI_RESOURCE_LIST
**ResourceList
233 IN EFI_ISA_ACPI_PROTOCOL
*This
,
234 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
235 IN EFI_ISA_ACPI_RESOURCE_LIST
*ResourceList
253 IN EFI_ISA_ACPI_PROTOCOL
*This
,
254 IN EFI_ISA_ACPI_DEVICE_ID
*Device
,
273 IN EFI_ISA_ACPI_PROTOCOL
*This
,
274 IN EFI_ISA_ACPI_DEVICE_ID
*Device
293 IN EFI_ISA_ACPI_PROTOCOL
*This