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