OvmfPkg[all]  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
IsaIo.h File Reference

Data Structures

struct  EFI_ISA_IO_PROTOCOL_ACCESS
 
struct  _EFI_ISA_IO_PROTOCOL
 

Macros

#define EFI_ISA_IO_PROTOCOL_GUID
 
#define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE   0x080
 Map a memory range so write are combined. More...
 
#define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED   0x800
 Map a memory range so all read and write accesses are cached. More...
 
#define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE   0x1000
 Disable a memory range. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE   0x001
 Set the speed of the DMA transfer in compatible mode. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A   0x002
 Not supported. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B   0x004
 Not supported. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C   0x008
 Not supported. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8   0x010
 Request 8-bit DMA transfers. Only available on channels 0..3. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16   0x020
 Request 16-bit DMA transfers. Only available on channels 4..7. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE   0x040
 Request a single DMA transfer. More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE   0x080
 Request multiple DMA transfers until TC (Terminal Count) or EOP (End of Process). More...
 
#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE   0x100
 Automatically reload base and count at the end of the DMA transfer. More...
 

Typedefs

typedef struct _EFI_ISA_IO_PROTOCOL EFI_ISA_IO_PROTOCOL
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_IO_MEM )(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_COPY_MEM )(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_WIDTH Width, IN UINT32 DestOffset, IN UINT32 SrcOffset, IN UINTN Count)
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_MAP )(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_OPERATION Operation, IN UINT8 ChannelNumber, IN UINT32 ChannelAttributes, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_UNMAP )(IN EFI_ISA_IO_PROTOCOL *This, IN VOID *Mapping)
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER )(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_FREE_BUFFER )(IN EFI_ISA_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)
 
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_FLUSH )(IN EFI_ISA_IO_PROTOCOL *This)
 

Enumerations

enum  EFI_ISA_IO_PROTOCOL_WIDTH {
  EfiIsaIoWidthUint8 = 0, EfiIsaIoWidthUint16, EfiIsaIoWidthUint32, EfiIsaIoWidthReserved,
  EfiIsaIoWidthFifoUint8, EfiIsaIoWidthFifoUint16, EfiIsaIoWidthFifoUint32, EfiIsaIoWidthFifoReserved,
  EfiIsaIoWidthFillUint8, EfiIsaIoWidthFillUint16, EfiIsaIoWidthFillUint32, EfiIsaIoWidthFillReserved,
  EfiIsaIoWidthMaximum
}
 
enum  EFI_ISA_IO_PROTOCOL_OPERATION {
  EfiIsaIoOperationBusMasterRead, EfiIsaIoOperationBusMasterWrite, EfiIsaIoOperationBusMasterCommonBuffer, EfiIsaIoOperationSlaveRead,
  EfiIsaIoOperationSlaveWrite, EfiIsaIoOperationMaximum
}
 

Variables

EFI_GUID gEfiIsaIoProtocolGuid
 

Detailed Description

ISA I/O Protocol is used by ISA device drivers to perform I/O, MMIO and DMA operations on the ISA controllers they manage.

Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Macro Definition Documentation

#define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED   0x800

Map a memory range so all read and write accesses are cached.

#define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE   0x1000

Disable a memory range.

#define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE   0x080

Map a memory range so write are combined.

Attributes for the EFI_ISA_IO_PROTOCOL common DMA buffer allocations.

#define EFI_ISA_IO_PROTOCOL_GUID
Value:
{ \
0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \
}

Global ID for the EFI_ISA_IO_PROTOCOL

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE   0x100

Automatically reload base and count at the end of the DMA transfer.

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE   0x080

Request multiple DMA transfers until TC (Terminal Count) or EOP (End of Process).

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE   0x040

Request a single DMA transfer.

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A   0x002

Not supported.

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B   0x004

Not supported.

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C   0x008

Not supported.

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE   0x001

Set the speed of the DMA transfer in compatible mode.

Channel attribute for EFI_ISA_IO_PROTOCOL slave DMA requests

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16   0x020

Request 16-bit DMA transfers. Only available on channels 4..7.

#define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8   0x010

Request 8-bit DMA transfers. Only available on channels 0..3.

Typedef Documentation

Forward declaration for the EFI_ISA_IO_PROTOCOL.

typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER)(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ALLOCATE_TYPE Type, IN EFI_MEMORY_TYPE MemoryType, IN UINTN Pages, OUT VOID **HostAddress, IN UINT64 Attributes)

Allocates pages that are suitable for an EfiIsaIoOperationBusMasterCommonBuffer mapping.

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
[in]TypeThe type allocation to perform.
[in]MemoryTypeThe type of memory to allocate.
[in]PagesThe number of pages to allocate.
[out]HostAddressA pointer to store the base address of the allocated range.
[in]AttributesThe requested bit mask of attributes for the allocated range.
Return values
EFI_SUCCESSThe requested memory pages were allocated.
EFI_INVALID_PARAMETERType is invalid.
EFI_INVALID_PARAMETERMemoryType is invalid.
EFI_INVALID_PARAMETERHostAddress is NULL.
EFI_UNSUPPORTEDAttributes is unsupported.
EFI_UNSUPPORTEDThe memory range specified by HostAddress, Pages, and Type is not available for common buffer use.
EFI_OUT_OF_RESOURCESThe memory pages could not be allocated.
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_COPY_MEM)(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_WIDTH Width, IN UINT32 DestOffset, IN UINT32 SrcOffset, IN UINTN Count)

Copies data from one region of ISA MMIO space to another region of ISA MMIO space.

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
[in]WidthSpecifies the width of the MMIO copy operation.
[in]DestOffsetThe offset of the destination in ISA MMIO space.
[in]SrcOffsetThe offset of the source in ISA MMIO space.
[in]CountThe number tranfers to perform for this copy operation.
Return values
EFI_SUCCESSThe data was copied successfully.
EFI_UNSUPPORTEDThe DestOffset or SrcOffset is not valid for this device.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_FLUSH)(IN EFI_ISA_IO_PROTOCOL *This)

Flushes a DMA buffer, which forces all DMA posted write transactions to complete.

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
Return values
EFI_SUCCESSThe DMA buffers were flushed.
EFI_DEVICE_ERRORThe buffers were not flushed due to a hardware error.
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_FREE_BUFFER)(IN EFI_ISA_IO_PROTOCOL *This, IN UINTN Pages, IN VOID *HostAddress)

Frees a common buffer that was allocated with EFI_ISA_IO_PROTOCOL.AllocateBuffer().

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
[in]PagesThe number of pages to free from the previously allocated common buffer.
[in]HostAddressThe base address of the previously allocated common buffer.
Return values
EFI_SUCCESSThe requested memory pages were freed.
EFI_INVALID_PARAMETERThe memory was not allocated with EFI_ISA_IO.AllocateBufer().
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_IO_MEM)(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_WIDTH Width, IN UINT32 Offset, IN UINTN Count, IN OUT VOID *Buffer)

Performs ISA I/O and MMIO Read/Write Cycles

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
[in]WidthSpecifies the width of the I/O or MMIO operation.
[in]OffsetThe offset into the ISA I/O or MMIO space to start the operation.
[in]CountThe number of I/O or MMIO operations to perform.
[in,out]BufferFor read operations, the destination buffer to store the results. For write operations, the source buffer to write data from.
Return values
EFI_SUCCESSThe data was successfully read from or written to the device.
EFI_UNSUPPORTEDThe Offset is not valid for this device.
EFI_INVALID_PARAMETERWidth or Count, or both, were invalid.
EFI_OUT_OF_RESOURCESThe request could not be completed due to a lack of resources.
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_MAP)(IN EFI_ISA_IO_PROTOCOL *This, IN EFI_ISA_IO_PROTOCOL_OPERATION Operation, IN UINT8 ChannelNumber, IN UINT32 ChannelAttributes, IN VOID *HostAddress, IN OUT UINTN *NumberOfBytes, OUT EFI_PHYSICAL_ADDRESS *DeviceAddress, OUT VOID **Mapping)

Maps a memory region for DMA.

This function returns the device-specific addresses required to access system memory. This function is used to map system memory for ISA DMA operations. All ISA DMA operations must be performed through their mapped addresses, and such mappings must be freed with EFI_ISA_IO_PROTOCOL.Unmap() after the DMA operation is completed.

If the DMA operation is a single read or write data transfer through an ISA bus master, then EfiIsaIoOperationBusMasterRead or EfiIsaIoOperationBusMasterWrite is used and the range is unmapped to complete the operation. If the DMA operation is a single read or write data transfer through an ISA slave controller, then EfiIsaIoOperationSlaveRead or EfiIsaIoOperationSlaveWrite is used and the range is unmapped to complete the operation.

If performing a DMA read operation, all the data must be present in system memory before the Map() is performed. Similarly, if performing a DMA write operation, the data must not be accessed in system memory until EFI_ISA_IO_PROTOCOL.Unmap() is performed. Bus master operations that require both read and write access or require multiple host device interactions within the same mapped region must use EfiIsaIoOperationBusMasterCommonBuffer. However, only memory allocated via the EFI_ISA_IO_PROTOCOL.AllocateBuffer() interface is guaranteed to be able to be mapped for this operation type. In all mapping requests the NumberOfBytes returned may be less than originally requested. It is the caller's responsibility to make additional requests to complete the entire transfer.

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
[in]OperationIndicates the type of DMA (slave or bus master), and if the DMA operation is going to read or write to system memory.
[in]ChannelNumberThe 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.
[in]ChannelAttributesA bitmask of the attributes used to configure the slave DMA channel for this DMA operation. See EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_* for the legal bit combinations.
[in]HostAddressThe system memory address to map to the device.
[in,out]NumberOfBytesOn input the number of bytes to map. On output the number of bytes that were mapped.
[out]DeviceAddressThe resulting map address for the bus master device to use to access the hosts HostAddress.
[out]MappingA returned value that must be passed to into EFI_ISA_IO_PROTOCOL.Unmap() to free all the the resources associated with this map request.
Return values
EFI_SUCCESSThe range was mapped for the returned NumberOfBytes.
EFI_INVALID_PARAMETERThe Operation is undefined.
EFI_INVALID_PARAMETERThe HostAddress is undefined.
EFI_UNSUPPORTEDThe HostAddress can not be mapped as a common buffer.
EFI_DEVICE_ERRORThe system hardware could not map the requested address.
EFI_OUT_OF_RESOURCESThe memory pages could not be allocated.
typedef EFI_STATUS(EFIAPI * EFI_ISA_IO_PROTOCOL_UNMAP)(IN EFI_ISA_IO_PROTOCOL *This, IN VOID *Mapping)

Unmaps a memory region that was previously mapped with EFI_ISA_IO_PROTOCOL.Map().

The EFI_ISA_IO_PROTOCOL.Map() operation is completed and any corresponding resources are released. If the operation was EfiIsaIoOperationSlaveWrite or EfiIsaIoOperationBusMasterWrite, the data is committed to system memory. Any resources used for the mapping are freed.

Parameters
[in]ThisA pointer to the EFI_ISA_IO_PROTOCOL instance.
[in]MappingThe mapping value returned from EFI_ISA_IO_PROTOCOL.Map().
Return values
EFI_SUCCESSThe memory region was unmapped.
EFI_DEVICE_ERRORThe data was not committed to the target system memory.

Enumeration Type Documentation

The DMA opreration type for EFI_ISA_IO_PROTOCOL DMA requests.

Enumerator
EfiIsaIoOperationBusMasterRead 

A read operation from system memory by a bus master.

EfiIsaIoOperationBusMasterWrite 

A write operation to system memory by a bus master.

EfiIsaIoOperationBusMasterCommonBuffer 

Provides both read and write access to system memory by both the processor and a bus master. The buffer is coherent from both the processor's and the bus master's point of view.

EfiIsaIoOperationSlaveRead 

A read operation from system memory by a slave device.

EfiIsaIoOperationSlaveWrite 

A write operation to system memory by a slave master.

EfiIsaIoOperationMaximum 

Width of EFI_ISA_IO_PROTOCOL I/O Port and MMIO operations.

Enumerator
EfiIsaIoWidthUint8 

8-bit operation.

EfiIsaIoWidthUint16 

16-bit operation.

EfiIsaIoWidthUint32 

32-bit operation

EfiIsaIoWidthReserved 
EfiIsaIoWidthFifoUint8 

8-bit FIFO operation.

EfiIsaIoWidthFifoUint16 

16-bit FIFO operation.

EfiIsaIoWidthFifoUint32 

32-bit FIFO operation.

EfiIsaIoWidthFifoReserved 
EfiIsaIoWidthFillUint8 

8-bit Fill operation.

EfiIsaIoWidthFillUint16 

16-bit Fill operation.

EfiIsaIoWidthFillUint32 

32-bit Fill operation.

EfiIsaIoWidthFillReserved 
EfiIsaIoWidthMaximum 

Variable Documentation

EFI_GUID gEfiIsaIoProtocolGuid