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