]> git.proxmox.com Git - mirror_edk2.git/blob - IntelFrameworkModulePkg/Include/Protocol/IsaIo.h
09ac26057205a7086083a81ca0ab46ac09734d0f
[mirror_edk2.git] / IntelFrameworkModulePkg / Include / Protocol / IsaIo.h
1 /*++
2
3 Copyright (c) 2006 - 2007, 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
8
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.
11
12 Module Name:
13
14 IsaIo.h
15
16 Abstract:
17
18 EFI ISA I/O Protocol
19
20 Revision History
21
22 --*/
23
24 #ifndef _EFI_ISA_IO_H
25 #define _EFI_ISA_IO_H
26
27
28 #include <Protocol/IsaAcpi.h>
29
30 //
31 // Global ID for the ISA I/O Protocol
32 //
33
34 #define EFI_ISA_IO_PROTOCOL_GUID \
35 { 0x7ee2bd44, 0x3da0, 0x11d4, { 0x9a, 0x38, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } }
36
37 typedef struct _EFI_ISA_IO_PROTOCOL EFI_ISA_IO_PROTOCOL;
38
39 //
40 // Prototypes for the ISA I/O Protocol
41 //
42
43 typedef enum {
44 EfiIsaIoWidthUint8,
45 EfiIsaIoWidthUint16,
46 EfiIsaIoWidthUint32,
47 EfiIsaIoWidthReserved,
48 EfiIsaIoWidthFifoUint8,
49 EfiIsaIoWidthFifoUint16,
50 EfiIsaIoWidthFifoUint32,
51 EfiIsaIoWidthFifoReserved,
52 EfiIsaIoWidthFillUint8,
53 EfiIsaIoWidthFillUint16,
54 EfiIsaIoWidthFillUint32,
55 EfiIsaIoWidthFillReserved,
56 EfiIsaIoWidthMaximum
57 } EFI_ISA_IO_PROTOCOL_WIDTH;
58
59 //
60 // Attributes for common buffer allocations
61 //
62 #define EFI_ISA_IO_ATTRIBUTE_MEMORY_WRITE_COMBINE 0x080 // Map a memory range so write are combined
63 #define EFI_ISA_IO_ATTRIBUTE_MEMORY_CACHED 0x800 // Map a memory range so all r/w accesses are cached
64 #define EFI_ISA_IO_ATTRIBUTE_MEMORY_DISABLE 0x1000 // Disable a memory range
65
66 //
67 // Channel attribute for DMA operations
68 //
69 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_COMPATIBLE 0x001
70 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_A 0x002
71 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_B 0x004
72 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SPEED_C 0x008
73 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_8 0x010
74 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_WIDTH_16 0x020
75 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_SINGLE_MODE 0x040
76 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_DEMAND_MODE 0x080
77 #define EFI_ISA_IO_SLAVE_DMA_ATTRIBUTE_AUTO_INITIALIZE 0x100
78
79 typedef enum {
80 EfiIsaIoOperationBusMasterRead,
81 EfiIsaIoOperationBusMasterWrite,
82 EfiIsaIoOperationBusMasterCommonBuffer,
83 EfiIsaIoOperationSlaveRead,
84 EfiIsaIoOperationSlaveWrite,
85 EfiIsaIoOperationMaximum
86 } EFI_ISA_IO_PROTOCOL_OPERATION;
87
88 typedef
89 EFI_STATUS
90 (EFIAPI *EFI_ISA_IO_PROTOCOL_IO_MEM) (
91 IN EFI_ISA_IO_PROTOCOL *This,
92 IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
93 IN UINT32 Offset,
94 IN UINTN Count,
95 IN OUT VOID *Buffer
96 );
97
98 typedef struct {
99 EFI_ISA_IO_PROTOCOL_IO_MEM Read;
100 EFI_ISA_IO_PROTOCOL_IO_MEM Write;
101 } EFI_ISA_IO_PROTOCOL_ACCESS;
102
103 typedef
104 EFI_STATUS
105 (EFIAPI *EFI_ISA_IO_PROTOCOL_COPY_MEM) (
106 IN EFI_ISA_IO_PROTOCOL *This,
107 IN EFI_ISA_IO_PROTOCOL_WIDTH Width,
108 IN UINT32 DestOffset,
109 IN UINT32 SrcOffset,
110 IN UINTN Count
111 );
112
113 typedef
114 EFI_STATUS
115 (EFIAPI *EFI_ISA_IO_PROTOCOL_MAP) (
116 IN EFI_ISA_IO_PROTOCOL *This,
117 IN EFI_ISA_IO_PROTOCOL_OPERATION Operation,
118 IN UINT8 ChannelNumber OPTIONAL,
119 IN UINT32 ChannelAttributes,
120 IN VOID *HostAddress,
121 IN OUT UINTN *NumberOfBytes,
122 OUT EFI_PHYSICAL_ADDRESS *DeviceAddress,
123 OUT VOID **Mapping
124 );
125
126 typedef
127 EFI_STATUS
128 (EFIAPI *EFI_ISA_IO_PROTOCOL_UNMAP) (
129 IN EFI_ISA_IO_PROTOCOL *This,
130 IN VOID *Mapping
131 );
132
133 typedef
134 EFI_STATUS
135 (EFIAPI *EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER) (
136 IN EFI_ISA_IO_PROTOCOL *This,
137 IN EFI_ALLOCATE_TYPE Type,
138 IN EFI_MEMORY_TYPE MemoryType,
139 IN UINTN Pages,
140 OUT VOID **HostAddress,
141 IN UINT64 Attributes
142 );
143
144 typedef
145 EFI_STATUS
146 (EFIAPI *EFI_ISA_IO_PROTOCOL_FREE_BUFFER) (
147 IN EFI_ISA_IO_PROTOCOL *This,
148 IN UINTN Pages,
149 IN VOID *HostAddress
150 );
151
152 typedef
153 EFI_STATUS
154 (EFIAPI *EFI_ISA_IO_PROTOCOL_FLUSH) (
155 IN EFI_ISA_IO_PROTOCOL *This
156 );
157
158 //
159 // Interface structure for the ISA I/O Protocol
160 //
161 struct _EFI_ISA_IO_PROTOCOL {
162 EFI_ISA_IO_PROTOCOL_ACCESS Mem;
163 EFI_ISA_IO_PROTOCOL_ACCESS Io;
164 EFI_ISA_IO_PROTOCOL_COPY_MEM CopyMem;
165 EFI_ISA_IO_PROTOCOL_MAP Map;
166 EFI_ISA_IO_PROTOCOL_UNMAP Unmap;
167 EFI_ISA_IO_PROTOCOL_ALLOCATE_BUFFER AllocateBuffer;
168 EFI_ISA_IO_PROTOCOL_FREE_BUFFER FreeBuffer;
169 EFI_ISA_IO_PROTOCOL_FLUSH Flush;
170 EFI_ISA_ACPI_RESOURCE_LIST *ResourceList;
171 UINT32 RomSize;
172 VOID *RomImage;
173 };
174
175 extern EFI_GUID gEfiIsaIoProtocolGuid;
176
177 #endif