1 /*++ 2 3 Copyright (c) 2004, Intel Corporation. All rights reserved.<BR> 4 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 IsaAcpi.h 15 16 Abstract: 17 18 EFI ISA Acpi Protocol 19 20 Revision History 21 22 --*/ 23 24 #ifndef _ISA_ACPI_H_ 25 #define _ISA_ACPI_H_ 26 27 #define EFI_ISA_ACPI_PROTOCOL_GUID \ 28 {0x64a892dc, 0x5561, 0x4536, {0x92, 0xc7, 0x79, 0x9b, 0xfc, 0x18, 0x33, 0x55}} 29 30 EFI_FORWARD_DECLARATION (EFI_ISA_ACPI); 31 32 // 33 // Resource Attribute definition 34 // 35 #define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_EDGE_SENSITIVE 0x01 36 #define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_EDGE_SENSITIVE 0x02 37 #define EFI_ISA_ACPI_IRQ_TYPE_HIGH_TRUE_LEVEL_SENSITIVE 0x04 38 #define EFI_ISA_ACPI_IRQ_TYPE_LOW_TRUE_LEVEL_SENSITIVE 0x08 39 40 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_MASK 0x03 41 42 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_COMPATIBILITY 0x00 43 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_A 0x01 44 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_B 0x02 45 #define EFI_ISA_ACPI_DMA_SPEED_TYPE_F 0x03 46 #define EFI_ISA_ACPI_DMA_COUNT_BY_BYTE 0x04 47 #define EFI_ISA_ACPI_DMA_COUNT_BY_WORD 0x08 48 #define EFI_ISA_ACPI_DMA_BUS_MASTER 0x10 49 #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT 0x20 50 #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_8_BIT_AND_16_BIT 0x40 51 #define EFI_ISA_ACPI_DMA_TRANSFER_TYPE_16_BIT 0x80 52 53 #define EFI_ISA_ACPI_MEMORY_WIDTH_MASK 0x03 54 55 #define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT 0x00 56 #define EFI_ISA_ACPI_MEMORY_WIDTH_16_BIT 0x01 57 #define EFI_ISA_ACPI_MEMORY_WIDTH_8_BIT_AND_16_BIT 0x02 58 #define EFI_ISA_ACPI_MEMORY_WRITEABLE 0x04 59 #define EFI_ISA_ACPI_MEMORY_CACHEABLE 0x08 60 #define EFI_ISA_ACPI_MEMORY_SHADOWABLE 0x10 61 #define EFI_ISA_ACPI_MEMORY_EXPANSION_ROM 0x20 62 63 #define EFI_ISA_ACPI_IO_DECODE_10_BITS 0x01 64 #define EFI_ISA_ACPI_IO_DECODE_16_BITS 0x02 65 66 // 67 // Resource List definition: 68 // at first, the resource was defined as below 69 // but in the future, it will be defined again that follow ACPI spec: ACPI resource type 70 // so that, in this driver, we can interpret the ACPI table and get the ISA device information. 71 // 72 73 typedef enum { 74 EfiIsaAcpiResourceEndOfList, 75 EfiIsaAcpiResourceIo, 76 EfiIsaAcpiResourceMemory, 77 EfiIsaAcpiResourceDma, 78 EfiIsaAcpiResourceInterrupt 79 } EFI_ISA_ACPI_RESOURCE_TYPE; 80 81 typedef struct { 82 EFI_ISA_ACPI_RESOURCE_TYPE Type; 83 UINT32 Attribute; 84 UINT32 StartRange; 85 UINT32 EndRange; 86 } EFI_ISA_ACPI_RESOURCE; 87 88 typedef struct { 89 UINT32 HID; 90 UINT32 UID; 91 } EFI_ISA_ACPI_DEVICE_ID; 92 93 typedef struct { 94 EFI_ISA_ACPI_DEVICE_ID Device; 95 EFI_ISA_ACPI_RESOURCE *ResourceItem; 96 } EFI_ISA_ACPI_RESOURCE_LIST; 97 98 // 99 // Prototypes for the ISA ACPI Protocol 100 // 101 typedef 102 EFI_STATUS 103 (EFIAPI *EFI_ISA_ACPI_DEVICE_ENUMERATE) ( 104 IN EFI_ISA_ACPI *This, 105 OUT EFI_ISA_ACPI_DEVICE_ID **Device 106 ); 107 108 typedef 109 EFI_STATUS 110 (EFIAPI *EFI_ISA_ACPI_SET_DEVICE_POWER) ( 111 IN EFI_ISA_ACPI *This, 112 IN EFI_ISA_ACPI_DEVICE_ID *Device, 113 IN BOOLEAN OnOff 114 ); 115 116 typedef 117 EFI_STATUS 118 (EFIAPI *EFI_ISA_ACPI_GET_CUR_RESOURCE) ( 119 IN EFI_ISA_ACPI *This, 120 IN EFI_ISA_ACPI_DEVICE_ID *Device, 121 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList 122 ); 123 124 typedef 125 EFI_STATUS 126 (EFIAPI *EFI_ISA_ACPI_GET_POS_RESOURCE) ( 127 IN EFI_ISA_ACPI *This, 128 IN EFI_ISA_ACPI_DEVICE_ID *Device, 129 OUT EFI_ISA_ACPI_RESOURCE_LIST **ResourceList 130 ); 131 132 typedef 133 EFI_STATUS 134 (EFIAPI *EFI_ISA_ACPI_SET_RESOURCE) ( 135 IN EFI_ISA_ACPI *This, 136 IN EFI_ISA_ACPI_DEVICE_ID *Device, 137 IN EFI_ISA_ACPI_RESOURCE_LIST *ResourceList 138 ); 139 140 typedef 141 EFI_STATUS 142 (EFIAPI *EFI_ISA_ACPI_ENABLE_DEVICE) ( 143 IN EFI_ISA_ACPI *This, 144 IN EFI_ISA_ACPI_DEVICE_ID *Device, 145 IN BOOLEAN Enable 146 ); 147 148 typedef 149 EFI_STATUS 150 (EFIAPI *EFI_ISA_ACPI_INIT_DEVICE) ( 151 IN EFI_ISA_ACPI *This, 152 IN EFI_ISA_ACPI_DEVICE_ID *Device 153 ); 154 155 typedef 156 EFI_STATUS 157 (EFIAPI *EFI_ISA_ACPI_INTERFACE_INIT) ( 158 IN EFI_ISA_ACPI *This 159 ); 160 161 // 162 // Interface structure for the ISA ACPI Protocol 163 // 164 typedef struct _EFI_ISA_ACPI { 165 EFI_ISA_ACPI_DEVICE_ENUMERATE DeviceEnumerate; 166 EFI_ISA_ACPI_SET_DEVICE_POWER SetPower; 167 EFI_ISA_ACPI_GET_CUR_RESOURCE GetCurResource; 168 EFI_ISA_ACPI_GET_POS_RESOURCE GetPosResource; 169 EFI_ISA_ACPI_SET_RESOURCE SetResource; 170 EFI_ISA_ACPI_ENABLE_DEVICE EnableDevice; 171 EFI_ISA_ACPI_INIT_DEVICE InitDevice; 172 EFI_ISA_ACPI_INTERFACE_INIT InterfaceInit; 173 } EFI_ISA_ACPI_PROTOCOL; 174 175 extern EFI_GUID gEfiIsaAcpiProtocolGuid; 176 177 #endif 178