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