]> git.proxmox.com Git - mirror_edk2.git/blame - IntelFrameworkPkg/Include/Protocol/IdeControllerInit.h
Add more comments for IntelFramework's header 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
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
25 Version 0.9\r
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
181 UINT16 reserved_89_127[39];\r
182 UINT16 security_status;\r
183 UINT16 vendor_data_129_159[31];\r
184 UINT16 reserved_160_255[96];\r
185} EFI_ATA_IDENTIFY_DATA;\r
186\r
187#pragma pack()\r
188//\r
189//*******************************************************\r
190// EFI_ATAPI_IDENTIFY_DATA\r
191//*******************************************************\r
192//\r
193#pragma pack(1)\r
194typedef struct {\r
195 UINT16 config; // General Configuration\r
196 UINT16 obsolete_1;\r
197 UINT16 specific_config;\r
198 UINT16 obsolete_3;\r
199 UINT16 retired_4_5[2];\r
200 UINT16 obsolete_6;\r
201 UINT16 cfa_reserved_7_8[2];\r
202 UINT16 retired_9;\r
203 CHAR8 SerialNo[20]; // ASCII\r
204 UINT16 retired_20_21[2];\r
205 UINT16 obsolete_22;\r
206 CHAR8 FirmwareVer[8]; // ASCII\r
207 CHAR8 ModelName[40]; // ASCII\r
208 UINT16 multi_sector_cmd_max_sct_cnt;\r
209 UINT16 reserved_48;\r
210 UINT16 capabilities_49;\r
211 UINT16 capabilities_50;\r
212 UINT16 obsolete_51_52[2];\r
213 UINT16 field_validity;\r
214 UINT16 obsolete_54_58[5];\r
215 UINT16 mutil_sector_setting;\r
216 UINT16 user_addressable_sectors_lo;\r
217 UINT16 user_addressable_sectors_hi;\r
218 UINT16 obsolete_62;\r
219 UINT16 multi_word_dma_mode;\r
220 UINT16 advanced_pio_modes;\r
221 UINT16 min_multi_word_dma_cycle_time;\r
222 UINT16 rec_multi_word_dma_cycle_time;\r
223 UINT16 min_pio_cycle_time_without_flow_control;\r
224 UINT16 min_pio_cycle_time_with_flow_control;\r
225 UINT16 reserved_69_74[6];\r
226 UINT16 queue_depth;\r
227 UINT16 reserved_76_79[4];\r
228 UINT16 major_version_no;\r
229 UINT16 minor_version_no;\r
230 UINT16 cmd_set_support_82;\r
231 UINT16 cmd_set_support_83;\r
232 UINT16 cmd_feature_support;\r
233 UINT16 cmd_feature_enable_85;\r
234 UINT16 cmd_feature_enable_86;\r
235 UINT16 cmd_feature_default;\r
236 UINT16 ultra_dma_select;\r
237 UINT16 time_required_for_sec_erase;\r
238 UINT16 time_required_for_enhanced_sec_erase;\r
239 UINT16 current_advanced_power_mgmt_value;\r
240 UINT16 master_pwd_revison_code;\r
241 UINT16 hardware_reset_result;\r
242 UINT16 current_auto_acoustic_mgmt_value;\r
243 UINT16 reserved_95_99[5];\r
244 UINT16 max_user_lba_for_48bit_addr[4];\r
245 UINT16 reserved_104_126[23];\r
246 UINT16 removable_media_status_notification_support;\r
247 UINT16 security_status;\r
248 UINT16 vendor_data_129_159[31];\r
249 UINT16 cfa_power_mode;\r
250 UINT16 cfa_reserved_161_175[15];\r
251 UINT16 current_media_serial_no[30];\r
252 UINT16 reserved_206_254[49];\r
253 UINT16 integrity_word;\r
254} EFI_ATAPI_IDENTIFY_DATA;\r
255\r
256#pragma pack()\r
257//\r
258//*******************************************************\r
259// EFI_IDENTIFY_DATA\r
260//*******************************************************\r
261//\r
262typedef union {\r
263 EFI_ATA_IDENTIFY_DATA AtaData;\r
264 EFI_ATAPI_IDENTIFY_DATA AtapiData;\r
265} EFI_IDENTIFY_DATA;\r
266\r
267#define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000\r
268\r
269//\r
270/////////////////////////////////////////////////////////////////////////////////////////\r
271// Function prototype declaration, for ANSI compatability\r
272//\r
273/**\r
274 Returns the information about the specified IDE channel.\r
275\r
276 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
277 @param Channel Zero-based channel number.\r
278 @param Enabled TRUE if this channel is enabled. Disabled channels are not scanned\r
279 to see if any devices are present.\r
280 @param MaxDevices The maximum number of IDE devices that the bus driver\r
281 can expect on this channel.\r
282\r
283 @retval EFI_SUCCESS Information was returned without any errors.\r
284 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
285\r
286**/\r
287typedef\r
288EFI_STATUS\r
289(EFIAPI *EFI_IDE_CONTROLLER_GET_CHANNEL_INFO) (\r
290 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
291 IN UINT8 Channel,\r
292 OUT BOOLEAN *Enabled,\r
293 OUT UINT8 *MaxDevices\r
294);\r
295\r
296/**\r
297 The notifications from the IDE bus driver that it is about to enter a certain\r
298 phase of the IDE channel enumeration process.\r
299\r
300 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
301 @param Phase The phase during enumeration.\r
302 @param Channel Zero-based channel number.\r
303\r
304 @retval EFI_SUCCESS The notification was accepted without any errors.\r
305 @retval EFI_NOT_SUPPORTED Phase is not supported.\r
306 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
307 @retval EFI_NOT_READY This phase cannot be entered at this time.\r
308\r
309**/\r
310typedef\r
311EFI_STATUS\r
312(EFIAPI *EFI_IDE_CONTROLLER_NOTIFY_PHASE) (\r
313 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
314 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase,\r
315 IN UINT8 Channel\r
316);\r
317\r
318/**\r
319 Submits the device information to the IDE controller driver.\r
320\r
321 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
322 @param Channel Zero-based channel number.\r
323 @param Device Zero-based device number on the Channel.\r
324 @param IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.\r
325\r
326 @retval EFI_SUCCESS The information was accepted without any errors.\r
327 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
328 Or Device is invalid.\r
329\r
330**/\r
331typedef\r
332EFI_STATUS\r
333(EFIAPI *EFI_IDE_CONTROLLER_SUBMIT_DATA) (\r
334 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
335 IN UINT8 Channel,\r
336 IN UINT8 Device,\r
337 IN EFI_IDENTIFY_DATA *IdentifyData\r
338);\r
339\r
340/**\r
341 Disqualifies specific modes for an IDE device.\r
342\r
343 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
344 @param Channel Zero-based channel number.\r
345 @param Device Zero-based device number on the Channel.\r
346 @param BadModes The modes that the device does not support and that\r
347 should be disqualified.\r
348\r
349 @retval EFI_SUCCESS The modes were accepted without any errors.\r
350 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
351 Or Device is invalid.\r
352\r
353**/\r
354typedef\r
355EFI_STATUS\r
356(EFIAPI *EFI_IDE_CONTROLLER_DISQUALIFY_MODE) (\r
357 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
358 IN UINT8 Channel,\r
359 IN UINT8 Device,\r
360 IN EFI_ATA_COLLECTIVE_MODE *BadModes\r
361);\r
362\r
363/**\r
364 Returns the information about the optimum modes for the specified IDE device.\r
365\r
366 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
367 @param Channel Zero-based channel number.\r
368 @param Device Zero-based device number on the Channel.\r
369 @param SupportedModes The optimum modes for the device.\r
370\r
371 @retval EFI_SUCCESS SupportedModes was returned.\r
372 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
373 Or Device is invalid. Or SupportedModes is NULL.\r
374 @retval EFI_NOT_READY Modes cannot be calculated due to a lack of data.\r
375\r
376**/\r
377typedef\r
378EFI_STATUS\r
379(EFIAPI *EFI_IDE_CONTROLLER_CALCULATE_MODE) (\r
380 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
381 IN UINT8 Channel,\r
382 IN UINT8 Device,\r
383 OUT EFI_ATA_COLLECTIVE_MODE **SupportedModes\r
384);\r
385\r
386/**\r
387 Commands the IDE controller driver to program the IDE controller hardware\r
388 so that the specified device can operate at the specified mode.\r
389\r
390 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.\r
391 @param Channel Zero-based channel number.\r
392 @param Device Zero-based device number on the Channel.\r
393 @param Modes The modes to set.\r
394\r
395 @retval EFI_SUCCESS The command was accepted without any errors.\r
396 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).\r
397 Or Device is invalid.\r
398 @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.\r
399 @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.\r
400 The IDE bus driver should not use this device.\r
401\r
402**/\r
403typedef\r
404EFI_STATUS\r
405(EFIAPI *EFI_IDE_CONTROLLER_SET_TIMING) (\r
406 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL *This,\r
407 IN UINT8 Channel,\r
408 IN UINT8 Device,\r
409 IN EFI_ATA_COLLECTIVE_MODE *Modes\r
410);\r
411\r
412//\r
413////////////////////////////////////////////////////////////////////////////////////////////////////\r
414// Interface structure\r
415// EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.\r
416// An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the\r
417// EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.\r
418//\r
419/**\r
420 @par Protocol Description:\r
421 Provides the basic interfaces to abstract an IDE controller.\r
422\r
423 @param GetChannelInfo\r
424 Returns the information about a specific channel.\r
425\r
426 @param NotifyPhase\r
427 The notification that the IDE bus driver is about to enter the\r
428 specified phase during the enumeration process.\r
429\r
430 @param SubmitData\r
431 Submits the Drive Identify data that was returned by the device.\r
432\r
433 @param DisqualifyMode\r
434 Submits information about modes that should be disqualified.\r
435\r
436 @param CalculateMode\r
437 Calculates and returns the optimum mode for a particular IDE device.\r
438\r
439 @param SetTiming\r
440 Programs the IDE controller hardware to the default timing or per the modes\r
441 that were returned by the last call to CalculateMode().\r
442\r
443 @param EnumAll\r
444 Set to TRUE if the enumeration group includes all the channels that are\r
445 produced by this controller. FALSE if an enumeration group consists of\r
446 only one channel.\r
447\r
448 @param ChannelCount\r
449 The number of channels that are produced by this controller.\r
450\r
451**/\r
452struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL {\r
453 EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo;\r
454 EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase;\r
455 EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData;\r
456 EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode;\r
457 EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode;\r
458 EFI_IDE_CONTROLLER_SET_TIMING SetTiming;\r
459 BOOLEAN EnumAll;\r
460 UINT8 ChannelCount;\r
461};\r
462\r
463extern EFI_GUID gEfiIdeControllerInitProtocolGuid;\r
464\r
465#endif\r