diff options
Diffstat (limited to 'IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe')
6 files changed, 214 insertions, 36 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.c b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.c index bbf262d517..c525af7bc0 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.c +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.c @@ -1,4 +1,4 @@ -/**@file
+/** @file
UEFI Component Name(2) protocol implementation for IsaBus driver.
Copyright (c) 2006 - 2009, Intel Corporation. <BR>
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.h b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.h index 301142698b..3a42e027f4 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.h +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/ComponentName.h @@ -1,4 +1,4 @@ -/**@file
+/** @file
Header file for implementation of UEFI Component Name(2) protocol.
Copyright (c) 2006 - 2009, Intel Corporation<BR>
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaBus.h b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaBus.h index 672e449cf9..0a7831d233 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaBus.h +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaBus.h @@ -1,4 +1,4 @@ -/**@file
+/** @file
The header file for ISA bus driver
Copyright (c) 2006 - 2009, Intel Corporation. <BR>
@@ -178,9 +178,9 @@ typedef struct { EFI_STATUS
EFIAPI
IsaBusControllerDriverSupported (
- IN EFI_DRIVER_BINDING_PROTOCOL * This,
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
);
/**
@@ -213,9 +213,9 @@ IsaBusControllerDriverSupported ( EFI_STATUS
EFIAPI
IsaBusControllerDriverStart (
- IN EFI_DRIVER_BINDING_PROTOCOL * This,
+ IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
- IN EFI_DEVICE_PATH_PROTOCOL * RemainingDevicePath OPTIONAL
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
);
/**
@@ -264,7 +264,7 @@ IsaBusControllerDriverStop ( @param[in] PciIo The Pointer to the PCI protocol
@param[in] ParentDevicePath Device path of the ISA bus controller
@param[in] IsaDeviceResourceList The resource list of the ISA device
- @param[in] ChildDevicePath The pointer to the child device.
+ @param[out] ChildDevicePath The pointer to the child device.
@retval EFI_SUCCESS The handle for the child device was created.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
@@ -286,7 +286,6 @@ IsaCreateDevice ( @param[in] IsaIoDevice The iso device to be initialized.
@param[in] IsaDeviceResourceList The resource list.
- @retval None
**/
VOID
InitializeIsaIoInstance (
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaIo.h b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaIo.h index b5e6694ca2..9a711a5860 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaIo.h +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/InternalIsaIo.h @@ -1,4 +1,4 @@ -/**@file
+/** @file
The header file for EFI_ISA_IO protocol implementation.
Copyright (c) 2006 - 2009, Intel Corporation.<BR>
@@ -21,6 +21,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. // ISA I/O Support Function Prototypes
//
+/**
+ Verifies access to an ISA device
+
+ @param[in] IsaIoDevice The ISA device to be verified.
+ @param[in] Type The Access type. The input must be either IsaAccessTypeMem or IsaAccessTypeIo.
+ @param[in] Width The width of the memory operation.
+ @param[in] Count The number of memory operations to perform.
+ @param[in] Offset The offset in ISA memory space to start the memory operation.
+
+ @retval EFI_SUCCESS Verify success.
+ @retval EFI_INVALID_PARAMETER One of the parameters has an invalid value.
+ @retval EFI_UNSUPPORTED The device ont support the access type.
+**/
EFI_STATUS
IsaIoVerifyAccess (
IN ISA_IO_DEVICE *IsaIoDevice,
@@ -30,6 +43,20 @@ IsaIoVerifyAccess ( IN UINT32 Offset
);
+/**
+ Performs an ISA I/O Read Cycle
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Width Specifies the width of the I/O operation.
+ @param[in] Offset The offset in ISA I/O space to start the I/O operation.
+ @param[in] Count The number of I/O operations to perform.
+ @param[out] Buffer The destination buffer to store the results
+
+ @retval EFI_SUCCESS The data was read from the device sucessfully.
+ @retval EFI_UNSUPPORTED The Offset is not valid for this device.
+ @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
EFIAPI
IsaIoIoRead (
@@ -40,6 +67,20 @@ IsaIoIoRead ( OUT VOID *Buffer
);
+/**
+ Performs an ISA I/O Write Cycle
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Width Specifies the width of the I/O operation.
+ @param[in] Offset The offset in ISA I/O space to start the I/O operation.
+ @param[in] Count The number of I/O operations to perform.
+ @param[in] Buffer The source buffer to write data from
+
+ @retval EFI_SUCCESS The data was writen to the device sucessfully.
+ @retval EFI_UNSUPPORTED The Offset is not valid for this device.
+ @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
EFIAPI
IsaIoIoWrite (
@@ -50,6 +91,30 @@ IsaIoIoWrite ( IN VOID *Buffer
);
+/**
+ Maps a memory region for DMA
+
+ @param This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param Operation Indicates the type of DMA (slave or bus master), and if
+ the DMA operation is going to read or write to system memory.
+ @param ChannelNumber The slave channel number to use for this DMA operation.
+ If Operation and ChannelAttributes shows that this device
+ performs bus mastering DMA, then this field is ignored.
+ The legal range for this field is 0..7.
+ @param ChannelAttributes The attributes of the DMA channel to use for this DMA operation
+ @param HostAddress The system memory address to map to the device.
+ @param NumberOfBytes On input the number of bytes to map. On output the number
+ of bytes that were mapped.
+ @param DeviceAddress The resulting map address for the bus master device to use
+ to access the hosts HostAddress.
+ @param Mapping A resulting value to pass to EFI_ISA_IO.Unmap().
+
+ @retval EFI_SUCCESS The range was mapped for the returned NumberOfBytes.
+ @retval EFI_INVALID_PARAMETER The Operation or HostAddress is undefined.
+ @retval EFI_UNSUPPORTED The HostAddress can not be mapped as a common buffer.
+ @retval EFI_DEVICE_ERROR The system hardware could not map the requested address.
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
+**/
EFI_STATUS
EFIAPI
IsaIoMap (
@@ -63,6 +128,15 @@ IsaIoMap ( OUT VOID **Mapping
);
+/**
+ Unmaps a memory region for DMA
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Mapping The mapping value returned from EFI_ISA_IO.Map().
+
+ @retval EFI_SUCCESS The range was unmapped.
+ @retval EFI_DEVICE_ERROR The data was not committed to the target system memory.
+**/
EFI_STATUS
EFIAPI
IsaIoUnmap (
@@ -70,17 +144,47 @@ IsaIoUnmap ( IN VOID *Mapping
);
+/**
+ Flushes any posted write data to the system memory.
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The buffers were flushed.
+ @retval EFI_DEVICE_ERROR The buffers were not flushed due to a hardware error.
+**/
EFI_STATUS
EFIAPI
IsaIoFlush (
IN EFI_ISA_IO_PROTOCOL *This
);
+/**
+ report a error Status code
+
+ @param Code The error status code.
+
+ @return EFI_SUCCESS Success to report status code.
+**/
EFI_STATUS
ReportErrorStatusCode (
- EFI_STATUS_CODE_VALUE code
+ EFI_STATUS_CODE_VALUE Code
);
+/**
+ Writes I/O operation base address and count number to a 8 bit I/O Port.
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] AddrOffset The address' offset.
+ @param[in] PageOffset The page's offest.
+ @param[in] CountOffset The count's offset.
+ @param[in] BaseAddress The base address.
+ @param[in] Count The number of I/O operations to perform.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER Parameter is invalid.
+ @retval EFI_UNSUPPORTED The address range specified by these Offsets and Count is not valid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
WriteDmaPort (
IN EFI_ISA_IO_PROTOCOL *This,
@@ -91,6 +195,18 @@ WriteDmaPort ( IN UINT16 Count
);
+/**
+ Writes an 8-bit I/O Port
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Offset The offset in ISA IO space to start the IO operation.
+ @param[in] Value The data to write port.
+
+ @retval EFI_SUCCESS Success.
+ @retval EFI_INVALID_PARAMETER Parameter is invalid.
+ @retval EFI_UNSUPPORTED The address range specified by Offset is not valid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
WritePort (
IN EFI_ISA_IO_PROTOCOL *This,
@@ -98,6 +214,20 @@ WritePort ( IN UINT8 Value
);
+/**
+ Performs an ISA Memory Read Cycle
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Width Specifies the width of the memory operation.
+ @param[in] Offset The offset in ISA memory space to start the memory operation.
+ @param[in] Count The number of memory operations to perform.
+ @param[out] Buffer The destination buffer to store the results
+
+ @retval EFI_SUCCESS The data was read from the device successfully.
+ @retval EFI_UNSUPPORTED The Offset is not valid for this device.
+ @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
EFIAPI
IsaIoMemRead (
@@ -109,6 +239,20 @@ IsaIoMemRead ( );
+/**
+ Performs an ISA Memory Write Cycle
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Width Specifies the width of the memory operation.
+ @param[in] Offset The offset in ISA memory space to start the memory operation.
+ @param[in] Count The number of memory operations to perform.
+ @param[in] Buffer The source buffer to write data from
+
+ @retval EFI_SUCCESS The data was written to the device sucessfully.
+ @retval EFI_UNSUPPORTED The Offset is not valid for this device.
+ @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
EFIAPI
IsaIoMemWrite (
@@ -119,6 +263,20 @@ IsaIoMemWrite ( IN VOID *Buffer
);
+/**
+ Copy one region of ISA memory space to another region of ISA memory space on the ISA controller.
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Width Specifies the width of the memory copy operation.
+ @param[in] DestOffset The offset of the destination
+ @param[in] SrcOffset The offset of the source
+ @param[in] Count The number of memory copy operations to perform
+
+ @retval EFI_SUCCESS The data was copied sucessfully.
+ @retval EFI_UNSUPPORTED The DestOffset or SrcOffset is not valid for this device.
+ @retval EFI_INVALID_PARAMETER Width or Count, or both, were invalid.
+ @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
+**/
EFI_STATUS
EFIAPI
IsaIoCopyMem (
@@ -129,6 +287,22 @@ IsaIoCopyMem ( IN UINTN Count
);
+/**
+ Allocates pages that are suitable for an EfiIsaIoOperationBusMasterCommonBuffer mapping.
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Type The type allocation to perform.
+ @param[in] MemoryType The type of memory to allocate.
+ @param[in] Pages The number of pages to allocate.
+ @param[out] HostAddress A pointer to store the base address of the allocated range.
+ @param[in] Attributes The requested bit mask of attributes for the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were allocated.
+ @retval EFI_INVALID_PARAMETER Type is invalid or MemoryType is invalid or HostAddress is NULL
+ @retval EFI_UNSUPPORTED Attributes is unsupported or the memory range specified
+ by HostAddress, Pages, and Type is not available for common buffer use.
+ @retval EFI_OUT_OF_RESOURCES The memory pages could not be allocated.
+**/
EFI_STATUS
EFIAPI
IsaIoAllocateBuffer (
@@ -140,6 +314,16 @@ IsaIoAllocateBuffer ( IN UINT64 Attributes
);
+/**
+ Frees memory that was allocated with EFI_ISA_IO.AllocateBuffer().
+
+ @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
+ @param[in] Pages The number of pages to free.
+ @param[in] HostAddress The base address of the allocated range.
+
+ @retval EFI_SUCCESS The requested memory pages were freed.
+ @retval EFI_INVALID_PARAMETER The memory was not allocated with EFI_ISA_IO.AllocateBufer().
+**/
EFI_STATUS
EFIAPI
IsaIoFreeBuffer (
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.c b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.c index 8cf9ac9c2c..c90b4cdb43 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.c +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaBus.c @@ -1,4 +1,4 @@ -/**@file
+/** @file
ISA Bus UEFI driver.
Discovers all the ISA Controllers and their resources by using the ISA ACPI
@@ -564,7 +564,7 @@ IsaBusControllerDriverStop ( @param[in] PciIo The Pointer to the PCI protocol
@param[in] ParentDevicePath Device path of the ISA bus controller
@param[in] IsaDeviceResourceList The resource list of the ISA device
- @param[in] ChildDevicePath The pointer to the child device.
+ @param[out] ChildDevicePath The pointer to the child device.
@retval EFI_SUCCESS The handle for the child device was created.
@retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.
diff --git a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c index 815fa6bcab..4673d8379a 100644 --- a/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c +++ b/IntelFrameworkModulePkg/Bus/Isa/IsaBusDxe/IsaIo.c @@ -1,4 +1,4 @@ -/**@file
+/** @file
The implementation for EFI_ISA_IO_PROTOCOL.
Copyright (c) 2006 - 2009, Intel Corporation.<BR>
@@ -104,7 +104,6 @@ ReportErrorStatusCode ( @param[in] IsaIoDevice The iso device to be initialized.
@param[in] IsaDeviceResourceList The resource list.
- @retval None
**/
VOID
InitializeIsaIoInstance (
@@ -624,7 +623,7 @@ IsaIoMemWrite ( @param[in] This A pointer to the EFI_ISA_IO_PROTOCOL instance.
@param[in] Width Specifies the width of the memory copy operation.
- @param[out] DestOffset The offset of the destination
+ @param[in] DestOffset The offset of the destination
@param[in] SrcOffset The offset of the source
@param[in] Count The number of memory copy operations to perform
@@ -1037,17 +1036,14 @@ IsaIoMapFullSupport ( //
// This implementation only support COMPATIBLE DMA Transfers
//
- if (!(ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE)) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE) == 0) {
return EFI_INVALID_PARAMETER;
}
- if (ChannelAttributes &
- (
- EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A |
- EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B |
- EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C
- )
- ) {
+ if ((ChannelAttributes &
+ (EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A |
+ EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B |
+ EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C)) != 0) {
return EFI_INVALID_PARAMETER;
}
@@ -1055,8 +1051,8 @@ IsaIoMapFullSupport ( //
// If this is Channel 0..3, then the width must be 8 bit
//
- if (!(ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8) ||
- (ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16)
+ if (((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8) == 0) ||
+ ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16) != 0)
) {
return EFI_INVALID_PARAMETER;
}
@@ -1064,21 +1060,20 @@ IsaIoMapFullSupport ( //
// If this is Channel 4..7, then the width must be 16 bit
//
- if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8) ||
- (!(ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16))
- ) {
+ if (((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8) != 0) ||
+ ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16) == 0)) {
return EFI_INVALID_PARAMETER;
}
}
//
// Either Demand Mode or Single Mode must be selected, but not both
//
- if (ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE) {
- if (ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE) != 0) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE) != 0) {
return EFI_INVALID_PARAMETER;
}
} else {
- if (!(ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE)) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE) == 0) {
return EFI_INVALID_PARAMETER;
}
}
@@ -1173,15 +1168,15 @@ IsaIoMapFullSupport ( DmaMode |= V_8237_DMA_CHMODE_IO2MEM;
}
- if (ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE) != 0) {
DmaMode |= B_8237_DMA_CHMODE_AE;
}
- if (ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE) != 0) {
DmaMode |= V_8237_DMA_CHMODE_DEMAND;
}
- if (ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE) {
+ if ((ChannelAttributes & EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE) != 0) {
DmaMode |= V_8237_DMA_CHMODE_SINGLE;
}
//
@@ -1392,7 +1387,7 @@ IsaIoAllocateBuffer ( return EFI_INVALID_PARAMETER;
}
- if (Attributes & ~(EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED)) {
+ if ((Attributes & ~(EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE | EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED)) != 0) {
return EFI_UNSUPPORTED;
}
|