3 Copyright (c) 2006 - 2007, Intel Corporation<BR>
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.
18 The header file for ISA bus driver
24 #ifndef _EFI_ISA_BUS_H
25 #define _EFI_ISA_BUS_H
28 // The package level header files this module uses
31 #include <FrameworkDxe.h>
33 // The protocols, PPI and GUID defintions for this module
35 #include <Protocol/PciIo.h>
36 #include <Protocol/ComponentName.h>
37 #include <Protocol/IsaIo.h>
38 #include <Protocol/DevicePath.h>
39 #include <Protocol/IsaAcpi.h>
40 #include <Protocol/DriverBinding.h>
41 #include <Protocol/GenericMemoryTest.h>
42 #include <Guid/StatusCodeDataTypeId.h>
44 // The Library classes this module consumes
46 #include <Library/DebugLib.h>
47 #include <Library/UefiDriverEntryPoint.h>
48 #include <Library/UefiLib.h>
49 #include <Library/DevicePathLib.h>
50 #include <Library/BaseMemoryLib.h>
51 #include <Library/MemoryAllocationLib.h>
52 #include <Library/UefiBootServicesTableLib.h>
53 #include <Library/ReportStatusCodeLib.h>
54 #include <Library/PcdLib.h>
56 #include "ComponentName.h"
58 extern EFI_ISA_IO_PROTOCOL IsaIoInterface
;
70 #define ISA_MAX_MEMORY_ADDRESS 0x1000000
74 #define ISA_MAX_IO_ADDRESS 0x10000
80 } EFI_ISA_DMA_REGISTERS
;
83 // ISA I/O Device Structure
85 #define ISA_IO_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('i', 's', 'a', 'i')
90 EFI_ISA_IO_PROTOCOL IsaIo
;
91 EFI_DEVICE_PATH_PROTOCOL
*DevicePath
;
92 EFI_PCI_IO_PROTOCOL
*PciIo
;
95 #define ISA_IO_DEVICE_FROM_ISA_IO_THIS(a) CR (a, ISA_IO_DEVICE, IsaIo, ISA_IO_DEVICE_SIGNATURE)
100 extern EFI_DRIVER_BINDING_PROTOCOL gIsaBusControllerDriver
;
103 // Mapping structure for performing ISA DMA to a buffer above 16 MB
106 EFI_ISA_IO_PROTOCOL_OPERATION Operation
;
109 EFI_PHYSICAL_ADDRESS HostAddress
;
110 EFI_PHYSICAL_ADDRESS MappedHostAddress
;
114 // EFI Driver Binding Protocol Interface Functions
119 IsaBusControllerDriverSupported (
120 IN EFI_DRIVER_BINDING_PROTOCOL
* This
,
121 IN EFI_HANDLE Controller
,
122 IN EFI_DEVICE_PATH_PROTOCOL
* RemainingDevicePath OPTIONAL
128 This function checks to see if a controller can be managed by the ISA Bus
129 Driver. This is done by checking to see if the controller supports the
130 EFI_PCI_IO_PROTOCOL protocol, and then looking at the PCI Configuration
131 Header to see if the device is a PCI to ISA bridge. The class code of
132 PCI to ISA bridge: Base class 06h, Sub class 01h Interface 00h
136 This - The EFI_DRIVER_BINDING_PROTOCOL instance.
137 Controller - The handle of the device to check.
138 RemainingDevicePath - A pointer to the remaining portion of a device path.
142 EFI_SUCCESS - The device is supported by this driver.
143 EFI_UNSUPPORTED - The device is not supported by this driver.
150 IsaBusControllerDriverStart (
151 IN EFI_DRIVER_BINDING_PROTOCOL
* This
,
152 IN EFI_HANDLE Controller
,
153 IN EFI_DEVICE_PATH_PROTOCOL
* RemainingDevicePath OPTIONAL
159 This function tells the ISA Bus Driver to start managing a PCI to ISA
164 This - The EFI_DRIVER_BINDING_PROTOCOL instance.
165 Controller - A handle to the device being started.
166 RemainingDevicePath - A pointer to the remaining portion of a device path.
170 EFI_SUCCESS - The device was started.
171 EFI_UNSUPPORTED - The device is not supported.
172 EFI_DEVICE_ERROR - The device could not be started due to a device error.
173 EFI_ALREADY_STARTED - The device has already been started.
174 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
175 EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
183 IsaBusControllerDriverStop (
184 IN EFI_DRIVER_BINDING_PROTOCOL
* This
,
185 IN EFI_HANDLE Controller
,
186 IN UINTN NumberOfChildren
,
187 IN EFI_HANDLE
* ChildHandleBuffer OPTIONAL
193 This function tells the ISA Bus Driver to stop managing a PCI to ISA
198 This - The EFI_DRIVER_BINDING_PROTOCOL instance.
199 Controller - A handle to the device being stopped.
200 NumberOfChindren - The number of child device handles in ChildHandleBuffer.
201 ChildHandleBuffer - An array of child handles to be freed.
206 EFI_SUCCESS - The device was stopped.
207 EFI_DEVICE_ERROR - The device could not be stopped due to a device error.
208 EFI_NOT_STARTED - The device has not been started.
209 EFI_INVALID_PARAMETER - One of the parameters has an invalid value.
210 EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
217 // Function Prototypes
222 IN EFI_DRIVER_BINDING_PROTOCOL
*This
,
223 IN EFI_HANDLE Controller
,
224 IN EFI_PCI_IO_PROTOCOL
*PciIo
,
225 IN EFI_DEVICE_PATH_PROTOCOL
*ParentDevicePath
,
226 IN EFI_ISA_ACPI_RESOURCE_LIST
*IsaDeviceResourceList
,
227 OUT EFI_DEVICE_PATH_PROTOCOL
**ChildDevicePath
233 Create ISA device found by IsaPnpProtocol
237 This - The EFI_DRIVER_BINDING_PROTOCOL instance.
238 Controller - The handle of ISA bus controller(PCI to ISA bridge)
239 PciIo - The Pointer to the PCI protocol
240 ParentDevicePath - Device path of the ISA bus controller
241 IsaDeviceResourceList - The resource list of the ISA device
242 ChildDevicePath - The pointer to the child device.
246 EFI_SUCCESS - Create the child device.
247 EFI_OUT_OF_RESOURCES - The request could not be completed due to a lack of
249 EFI_DEVICE_ERROR - Can not create child device.
255 InitializeIsaIoInstance (
256 IN ISA_IO_DEVICE
*IsaIoDevice
,
257 IN EFI_ISA_ACPI_RESOURCE_LIST
*IsaDevice
263 Initializes an ISA I/O Instance
267 IsaIoDevice - The iso device to be initialized.
268 IsaDevice - The resource list.
272 EFI_SUCCESS - Initial success.