]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/IdeControllerInit.h
Refine SMM USB Dispatch Protocol definition.
[mirror_edk2.git] / IntelFrameworkPkg / Include / Protocol / IdeControllerInit.h
CommitLineData
79964ac8 1/** @file\r
2 This file declares EFI IDE Controller Init Protocol\r
8411f1c0 3 The EFI_IDE_CONTROLLER_INIT_PROTOCOL provides the chipset-specific information to\r
4 the IDE bus driver. This protocol is mandatory for IDE controllers if the IDE devices behind the\r
5 controller are to be enumerated by an IDE bus driver.\r
6 There can only be one instance of EFI_IDE_CONTROLLER_INIT_PROTOCOL for each IDE\r
7 controller in a system. It is installed on the handle that corresponds to the IDE controller. An IDE\r
8 bus driver that wishes to manage an IDE bus and possibly IDE devices in a system will have to\r
9 retrieve the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance that is associated with the\r
10 controller to be managed.\r
79964ac8 11\r
12 Copyright (c) 2007, Intel Corporation\r
13 All rights reserved. This program and the accompanying materials\r
14 are licensed and made available under the terms and conditions of the BSD License\r
15 which accompanies this distribution. The full text of the license may be found at\r
16 http://opensource.org/licenses/bsd-license.php\r
17\r
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
20\r
21 Module Name: IdeControllerInit.h\r
22\r
23 @par Revision Reference:\r
24 This Protocol is defined in IDE Controller Initialization Protocol Specification\r
0f899407 25 Version 0.9.\r
79964ac8 26\r
27**/\r
28\r
29#ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_\r
30#define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_\r
31\r
b80fbe85 32#include <PiDxe.h>\r
33\r
79964ac8 34//\r
35// Global ID for the EFI Platform IDE Protocol GUID\r
36//\r
37#define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \\r
38 { 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }\r
39\r
40//\r
41// Forward reference for pure ANSI compatability\r
42//\r
43typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL;\r
44\r
45//\r
46//////////////////////////////////////////////////////////////////////////////////////////\r
47// EFI_IDE_BUS_ENUMERATION_PHASE\r
48// EFI_IDE_CONTROLLER_ENUM_PHASE\r
49//\r
50typedef enum{\r
51 EfiIdeBeforeChannelEnumeration,\r
52 EfiIdeAfterChannelEnumeration,\r
53 EfiIdeBeforeChannelReset,\r
54 EfiIdeAfterChannelReset,\r
55 EfiIdeBusBeforeDevicePresenceDetection,\r
56 EfiIdeBusAfterDevicePresenceDetection,\r
57 EfiIdeResetMode,\r
58 EfiIdeBusPhaseMaximum\r
59} EFI_IDE_CONTROLLER_ENUM_PHASE;\r
60\r
61//\r
62//******************************************************\r
63// EFI_ATA_EXT_TRANSFER_PROTOCOL\r
64//******************************************************\r
65//\r
66// This extended mode describes the SATA physical protocol.\r
67// SATA physical layers can operate at different speeds.\r
68// These speeds are defined below. Various PATA protocols\r
69// and associated modes are not applicable to SATA devices.\r
70//\r
71\r
72typedef enum {\r
73 EfiAtaSataTransferProtocol\r
74} EFI_ATA_EXT_TRANSFER_PROTOCOL;\r
75\r
76#define EFI_SATA_AUTO_SPEED 0\r
77#define EFI_SATA_GEN1_SPEED 1\r
78#define EFI_SATA_GEN2_SPEED 2\r
79\r
80//\r
81//*******************************************************\r
82// EFI_IDE_CABLE_TYPE\r
83//*******************************************************\r
84//\r
85typedef enum {\r
86 EfiIdeCableTypeUnknown,\r
87 EfiIdeCableType40pin,\r
88 EfiIdeCableType80Pin,\r
89 EfiIdeCableTypeSerial,\r
90 EfiIdeCableTypeMaximum\r
91} EFI_IDE_CABLE_TYPE;\r
92\r
93//\r
94//******************************************************\r
95// EFI_ATA_MODE\r
96//******************************************************\r
97//\r
98typedef struct {\r
99 BOOLEAN Valid;\r
100 UINT32 Mode;\r
101} EFI_ATA_MODE;\r
102\r
103//\r
104//******************************************************\r
105// EFI_ATA_EXTENDED_MODE\r
106//******************************************************\r
107//\r
108typedef struct {\r
109 EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol;\r
110 UINT32 Mode;\r
111} EFI_ATA_EXTENDED_MODE;\r
112\r
113//\r
114//******************************************************\r
115// EFI_ATA_COLLECTIVE_MODE\r
116//******************************************************\r
117//\r
118typedef struct {\r
119 EFI_ATA_MODE PioMode;\r
120 EFI_ATA_MODE SingleWordDmaMode;\r
121 EFI_ATA_MODE MultiWordDmaMode;\r
122 EFI_ATA_MODE UdmaMode;\r
123 UINT32 ExtModeCount;\r
124 EFI_ATA_EXTENDED_MODE ExtMode[1];\r
125} EFI_ATA_COLLECTIVE_MODE;\r
126\r
127//\r
128//*******************************************************\r
129// EFI_ATA_IDENTIFY_DATA\r
130//*******************************************************\r
131//\r
132\r
133#pragma pack(1)\r
134\r
135typedef struct {\r
136 UINT16 config; // General Configuration\r
137 UINT16 cylinders; // Number of Cylinders\r
138 UINT16 reserved_2;\r
139 UINT16 heads; //Number of logical heads\r
140 UINT16 vendor_data1;\r
141 UINT16 vendor_data2;\r
142 UINT16 sectors_per_track;\r
143 UINT16 vendor_specific_7_9[3];\r
144 CHAR8 SerialNo[20]; // ASCII\r
145 UINT16 vendor_specific_20_21[2];\r
146 UINT16 ecc_bytes_available;\r
147 CHAR8 FirmwareVer[8]; // ASCII\r
148 CHAR8 ModelName[40]; // ASCII\r
149 UINT16 multi_sector_cmd_max_sct_cnt;\r
150 UINT16 reserved_48;\r
151 UINT16 capabilities;\r
152 UINT16 reserved_50;\r
153 UINT16 pio_cycle_timing;\r
154 UINT16 reserved_52;\r
155 UINT16 field_validity;\r
156 UINT16 current_cylinders;\r
157 UINT16 current_heads;\r
158 UINT16 current_sectors;\r
159 UINT16 CurrentCapacityLsb;\r
160 UINT16 CurrentCapacityMsb;\r
161 UINT16 reserved_59;\r
162 UINT16 user_addressable_sectors_lo;\r
163 UINT16 user_addressable_sectors_hi;\r
164 UINT16 reserved_62;\r
165 UINT16 multi_word_dma_mode;\r
166 UINT16 advanced_pio_modes;\r
167 UINT16 min_multi_word_dma_cycle_time;\r
168 UINT16 rec_multi_word_dma_cycle_time;\r
169 UINT16 min_pio_cycle_time_without_flow_control;\r
170 UINT16 min_pio_cycle_time_with_flow_control;\r
171 UINT16 reserved_69_79[11];\r
172 UINT16 major_version_no;\r
173 UINT16 minor_version_no;\r
174 UINT16 command_set_supported_82; // word 82\r
175 UINT16 command_set_supported_83; // word 83\r
176 UINT16 command_set_feature_extn; // word 84\r
177 UINT16 command_set_feature_enb_85; // word 85\r
178 UINT16 command_set_feature_enb_86; // word 86\r
179 UINT16 command_set_feature_default; // word 87\r
180 UINT16 ultra_dma_mode; // word 88\r
ef1ad620 181 UINT16 reserved_89_105[17];\r
182 UINT16 phy_logic_sector_support; // word 106\r
183 UINT16 reserved_107_116[10];\r
184 UINT16 logic_sector_size_lo; // word 117\r
185 UINT16 logic_sector_size_hi; // word 118\r
186 UINT16 reserved_119_127[9];\r
79964ac8 187 UINT16 security_status;\r
188 UINT16 vendor_data_129_159[31];\r
ef1ad620 189 UINT16 reserved_160_208[49];\r
190 UINT16 alignment_logic_in_phy_blocks; // word 209\r
191 UINT16 reserved_210_255[46];\r
79964ac8 192} EFI_ATA_IDENTIFY_DATA;\r
193\r
194#pragma pack()\r
195//\r
196//*******************************************************\r
197// EFI_ATAPI_IDENTIFY_DATA\r
198//*******************************************************\r
199//\r
200#pragma pack(1)\r
201typedef struct {\r
202 UINT16 config; // General Configuration\r
203 UINT16 obsolete_1;\r
204 UINT16 specific_config;\r
205 UINT16 obsolete_3;\r
206 UINT16 retired_4_5[2];\r
207 UINT16 obsolete_6;\r
208 UINT16 cfa_reserved_7_8[2];\r
209 UINT16 retired_9;\r
210 CHAR8 SerialNo[20]; // ASCII\r
211 UINT16 retired_20_21[2];\r
212 UINT16 obsolete_22;\r
213 CHAR8 FirmwareVer[8]; // ASCII\r
214 CHAR8 ModelName[40]; // ASCII\r
215 UINT16 multi_sector_cmd_max_sct_cnt;\r
216 UINT16 reserved_48;\r
217 UINT16 capabilities_49;\r
218 UINT16 capabilities_50;\r
219 UINT16 obsolete_51_52[2];\r
220 UINT16 field_validity;\r
221 UINT16 obsolete_54_58[5];\r
222 UINT16 mutil_sector_setting;\r
223 UINT16 user_addressable_sectors_lo;\r
224 UINT16 user_addressable_sectors_hi;\r
225 UINT16 obsolete_62;\r
226 UINT16 multi_word_dma_mode;\r
227 UINT16 advanced_pio_modes;\r
228 UINT16 min_multi_word_dma_cycle_time;\r
229 UINT16 rec_multi_word_dma_cycle_time;\r
230 UINT16 min_pio_cycle_time_without_flow_control;\r
231 UINT16 min_pio_cycle_time_with_flow_control;\r
232 UINT16 reserved_69_74[6];\r
233 UINT16 queue_depth;\r
234 UINT16 reserved_76_79[4];\r
235 UINT16 major_version_no;\r
236 UINT16 minor_version_no;\r
237 UINT16 cmd_set_support_82;\r
238 UINT16 cmd_set_support_83;\r
239 UINT16 cmd_feature_support;\r
240 UINT16 cmd_feature_enable_85;\r
241 UINT16 cmd_feature_enable_86;\r
242 UINT16 cmd_feature_default;\r
243 UINT16 ultra_dma_select;\r
244 UINT16 time_required_for_sec_erase;\r
245 UINT16 time_required_for_enhanced_sec_erase;\r
246 UINT16 current_advanced_power_mgmt_value;\r
247 UINT16 master_pwd_revison_code;\r
248 UINT16 hardware_reset_result;\r
249 UINT16 current_auto_acoustic_mgmt_value;\r
250 UINT16 reserved_95_99[5];\r
251 UINT16 max_user_lba_for_48bit_addr[4];\r
252 UINT16 reserved_104_126[23];\r
253 UINT16 removable_media_status_notification_support;\r
254 UINT16 security_status;\r
255 UINT16 vendor_data_129_159[31];\r
256 UINT16 cfa_power_mode;\r
257 UINT16 cfa_reserved_161_175[15];\r
258 UINT16 current_media_serial_no[30];\r
259 UINT16 reserved_206_254[49];\r
260 UINT16 integrity_word;\r
261} EFI_ATAPI_IDENTIFY_DATA;\r
262\r
263#pragma pack()\r
264//\r
265//*******************************************************\r
266// EFI_IDENTIFY_DATA\r
267//*******************************************************\r
268//\r
269typedef union {\r
270 EFI_ATA_IDENTIFY_DATA AtaData;\r
271 EFI_ATAPI_IDENTIFY_DATA AtapiData;\r
272} EFI_IDENTIFY_DATA;\r
273\r
274#define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000\r
275\r
276//\r
277/////////////////////////////////////////////////////////////////////////////////////////\r
278// Function prototype declaration, for ANSI compatability\r
279//\r
280/**\r
281 Returns the information about the specified IDE channel.\r
282\r
283 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
284 @param Channel Zero-based channel number.\r
285 @param Enabled TRUE if this channel is enabled. Disabled channels are not scanned\r
286 to see if any devices are present.\r
287 @param MaxDevices The maximum number of IDE devices that the bus driver\r
288 can expect on this channel.\r
289\r
290 @retval EFI_SUCCESS Information was returned without any errors.\r
291 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
292\r
293**/\r
294typedef\r
295EFI_STATUS\r
69686d56 296(EFIAPI *EFI_IDE_CONTROLLER_GET_CHANNEL_INFO)(\r
79964ac8 297 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
298 IN UINT8 Channel,\r
299 OUT BOOLEAN *Enabled,\r
300 OUT UINT8 *MaxDevices\r
301);\r
302\r
303/**\r
304 The notifications from the IDE bus driver that it is about to enter a certain\r
305 phase of the IDE channel enumeration process.\r
306\r
307 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
308 @param Phase The phase during enumeration.\r
309 @param Channel Zero-based channel number.\r
310\r
311 @retval EFI_SUCCESS The notification was accepted without any errors.\r
312 @retval EFI_NOT_SUPPORTED Phase is not supported.\r
313 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
314 @retval EFI_NOT_READY This phase cannot be entered at this time.\r
315\r
316**/\r
317typedef\r
318EFI_STATUS\r
69686d56 319(EFIAPI *EFI_IDE_CONTROLLER_NOTIFY_PHASE)(\r
79964ac8 320 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
321 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,\r
322 IN UINT8 Channel\r
323);\r
324\r
325/**\r
326 Submits the device information to the IDE controller driver.\r
327\r
328 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
329 @param Channel Zero-based channel number.\r
330 @param Device Zero-based device number on the Channel.\r
331 @param IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.\r
332\r
333 @retval EFI_SUCCESS The information was accepted without any errors.\r
334 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
335 Or Device is invalid.\r
336\r
337**/\r
338typedef\r
339EFI_STATUS\r
69686d56 340(EFIAPI *EFI_IDE_CONTROLLER_SUBMIT_DATA)(\r
79964ac8 341 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
342 IN UINT8 Channel,\r
343 IN UINT8 Device,\r
344 IN EFI_IDENTIFY_DATA *IdentifyData\r
345);\r
346\r
347/**\r
348 Disqualifies specific modes for an IDE device.\r
349\r
350 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
351 @param Channel Zero-based channel number.\r
352 @param Device Zero-based device number on the Channel.\r
353 @param BadModes The modes that the device does not support and that\r
354 should be disqualified.\r
355\r
356 @retval EFI_SUCCESS The modes were accepted without any errors.\r
357 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
534b8251 358 Or Device is invalid, \r
359 Or IdentifyData is NULL.\r
79964ac8 360\r
361**/\r
362typedef\r
363EFI_STATUS\r
69686d56 364(EFIAPI *EFI_IDE_CONTROLLER_DISQUALIFY_MODE)(\r
79964ac8 365 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
366 IN UINT8 Channel,\r
367 IN UINT8 Device,\r
368 IN EFI_ATA_COLLECTIVE_MODE *BadModes\r
369);\r
370\r
371/**\r
372 Returns the information about the optimum modes for the specified IDE device.\r
373\r
374 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
375 @param Channel Zero-based channel number.\r
376 @param Device Zero-based device number on the Channel.\r
377 @param SupportedModes The optimum modes for the device.\r
378\r
379 @retval EFI_SUCCESS SupportedModes was returned.\r
380 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
381 Or Device is invalid. Or SupportedModes is NULL.\r
382 @retval EFI_NOT_READY Modes cannot be calculated due to a lack of data.\r
383\r
384**/\r
385typedef\r
386EFI_STATUS\r
69686d56 387(EFIAPI *EFI_IDE_CONTROLLER_CALCULATE_MODE)(\r
79964ac8 388 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
389 IN UINT8 Channel,\r
390 IN UINT8 Device,\r
391 OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes\r
392);\r
393\r
394/**\r
395 Commands the IDE controller driver to program the IDE controller hardware\r
396 so that the specified device can operate at the specified mode.\r
397\r
398 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
399 @param Channel Zero-based channel number.\r
400 @param Device Zero-based device number on the Channel.\r
401 @param Modes The modes to set.\r
402\r
403 @retval EFI_SUCCESS The command was accepted without any errors.\r
404 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
405 Or Device is invalid.\r
406 @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.\r
407 @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.\r
408 The IDE bus driver should not use this device.\r
409\r
410**/\r
411typedef\r
412EFI_STATUS\r
69686d56 413(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING)(\r
79964ac8 414 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
415 IN UINT8 Channel,\r
416 IN UINT8 Device,\r
417 IN EFI_ATA_COLLECTIVE_MODE *Modes\r
418);\r
419\r
420//\r
421////////////////////////////////////////////////////////////////////////////////////////////////////\r
422// Interface structure\r
423// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.\r
424// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the\r
425// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.\r
426//\r
427/**\r
428 @par Protocol Description:\r
429 Provides the basic interfaces to abstract an IDE controller.\r
430\r
431 @param GetChannelInfo\r
432 Returns the information about a specific channel.\r
433\r
434 @param NotifyPhase\r
435 The notification that the IDE bus driver is about to enter the\r
436 specified phase during the enumeration process.\r
437\r
438 @param SubmitData\r
439 Submits the Drive Identify data that was returned by the device.\r
440\r
441 @param DisqualifyMode\r
442 Submits information about modes that should be disqualified.\r
443\r
444 @param CalculateMode\r
445 Calculates and returns the optimum mode for a particular IDE device.\r
446\r
447 @param SetTiming\r
448 Programs the IDE controller hardware to the default timing or per the modes\r
449 that were returned by the last call to CalculateMode().\r
450\r
451 @param EnumAll\r
452 Set to TRUE if the enumeration group includes all the channels that are\r
453 produced by this controller. FALSE if an enumeration group consists of\r
454 only one channel.\r
455\r
456 @param ChannelCount\r
457 The number of channels that are produced by this controller.\r
458\r
459**/\r
460struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {\r
461 EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo;\r
462 EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase;\r
463 EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData;\r
464 EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode;\r
465 EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode;\r
466 EFI_IDE_CONTROLLER_SET_TIMING SetTiming;\r
467 BOOLEAN EnumAll;\r
468 UINT8 ChannelCount;\r
469};\r
470\r
471extern EFI_GUID gEfiIdeControllerInitProtocolGuid;\r
472\r
473#endif\r