2 This file declares EFI IDE Controller Init Protocol
3 The EFI_IDE_CONTROLLER_INIT_PROTOCOL provides the chipset-specific information to
4 the IDE bus driver. This protocol is mandatory for IDE controllers if the IDE devices behind the
5 controller are to be enumerated by an IDE bus driver.
6 There can only be one instance of EFI_IDE_CONTROLLER_INIT_PROTOCOL for each IDE
7 controller in a system. It is installed on the handle that corresponds to the IDE controller. An IDE
8 bus driver that wishes to manage an IDE bus and possibly IDE devices in a system will have to
9 retrieve the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance that is associated with the
10 controller to be managed.
12 Copyright (c) 2007, Intel Corporation
13 All rights reserved. This program and the accompanying materials
14 are licensed and made available under the terms and conditions of the BSD License
15 which accompanies this distribution. The full text of the license may be found at
16 http://opensource.org/licenses/bsd-license.php
18 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
19 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
21 Module Name: IdeControllerInit.h
23 @par Revision Reference:
24 This Protocol is defined in IDE Controller Initialization Protocol Specification
29 #ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_
30 #define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H_
35 // Global ID for the EFI Platform IDE Protocol GUID
37 #define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
38 { 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }
41 // Forward reference for pure ANSI compatability
43 typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL
;
46 //////////////////////////////////////////////////////////////////////////////////////////
47 // EFI_IDE_BUS_ENUMERATION_PHASE
48 // EFI_IDE_CONTROLLER_ENUM_PHASE
51 EfiIdeBeforeChannelEnumeration
,
52 EfiIdeAfterChannelEnumeration
,
53 EfiIdeBeforeChannelReset
,
54 EfiIdeAfterChannelReset
,
55 EfiIdeBusBeforeDevicePresenceDetection
,
56 EfiIdeBusAfterDevicePresenceDetection
,
59 } EFI_IDE_CONTROLLER_ENUM_PHASE
;
62 //******************************************************
63 // EFI_ATA_EXT_TRANSFER_PROTOCOL
64 //******************************************************
66 // This extended mode describes the SATA physical protocol.
67 // SATA physical layers can operate at different speeds.
68 // These speeds are defined below. Various PATA protocols
69 // and associated modes are not applicable to SATA devices.
73 EfiAtaSataTransferProtocol
74 } EFI_ATA_EXT_TRANSFER_PROTOCOL
;
76 #define EFI_SATA_AUTO_SPEED 0
77 #define EFI_SATA_GEN1_SPEED 1
78 #define EFI_SATA_GEN2_SPEED 2
81 //*******************************************************
83 //*******************************************************
86 EfiIdeCableTypeUnknown
,
89 EfiIdeCableTypeSerial
,
90 EfiIdeCableTypeMaximum
94 //******************************************************
96 //******************************************************
104 //******************************************************
105 // EFI_ATA_EXTENDED_MODE
106 //******************************************************
109 EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol
;
111 } EFI_ATA_EXTENDED_MODE
;
114 //******************************************************
115 // EFI_ATA_COLLECTIVE_MODE
116 //******************************************************
119 EFI_ATA_MODE PioMode
;
120 EFI_ATA_MODE SingleWordDmaMode
;
121 EFI_ATA_MODE MultiWordDmaMode
;
122 EFI_ATA_MODE UdmaMode
;
124 EFI_ATA_EXTENDED_MODE ExtMode
[1];
125 } EFI_ATA_COLLECTIVE_MODE
;
128 //*******************************************************
129 // EFI_ATA_IDENTIFY_DATA
130 //*******************************************************
136 UINT16 config
; // General Configuration
137 UINT16 cylinders
; // Number of Cylinders
139 UINT16 heads
; //Number of logical heads
142 UINT16 sectors_per_track
;
143 UINT16 vendor_specific_7_9
[3];
144 CHAR8 SerialNo
[20]; // ASCII
145 UINT16 vendor_specific_20_21
[2];
146 UINT16 ecc_bytes_available
;
147 CHAR8 FirmwareVer
[8]; // ASCII
148 CHAR8 ModelName
[40]; // ASCII
149 UINT16 multi_sector_cmd_max_sct_cnt
;
153 UINT16 pio_cycle_timing
;
155 UINT16 field_validity
;
156 UINT16 current_cylinders
;
157 UINT16 current_heads
;
158 UINT16 current_sectors
;
159 UINT16 CurrentCapacityLsb
;
160 UINT16 CurrentCapacityMsb
;
162 UINT16 user_addressable_sectors_lo
;
163 UINT16 user_addressable_sectors_hi
;
165 UINT16 multi_word_dma_mode
;
166 UINT16 advanced_pio_modes
;
167 UINT16 min_multi_word_dma_cycle_time
;
168 UINT16 rec_multi_word_dma_cycle_time
;
169 UINT16 min_pio_cycle_time_without_flow_control
;
170 UINT16 min_pio_cycle_time_with_flow_control
;
171 UINT16 reserved_69_79
[11];
172 UINT16 major_version_no
;
173 UINT16 minor_version_no
;
174 UINT16 command_set_supported_82
; // word 82
175 UINT16 command_set_supported_83
; // word 83
176 UINT16 command_set_feature_extn
; // word 84
177 UINT16 command_set_feature_enb_85
; // word 85
178 UINT16 command_set_feature_enb_86
; // word 86
179 UINT16 command_set_feature_default
; // word 87
180 UINT16 ultra_dma_mode
; // word 88
181 UINT16 reserved_89_127
[39];
182 UINT16 security_status
;
183 UINT16 vendor_data_129_159
[31];
184 UINT16 reserved_160_255
[96];
185 } EFI_ATA_IDENTIFY_DATA
;
189 //*******************************************************
190 // EFI_ATAPI_IDENTIFY_DATA
191 //*******************************************************
195 UINT16 config
; // General Configuration
197 UINT16 specific_config
;
199 UINT16 retired_4_5
[2];
201 UINT16 cfa_reserved_7_8
[2];
203 CHAR8 SerialNo
[20]; // ASCII
204 UINT16 retired_20_21
[2];
206 CHAR8 FirmwareVer
[8]; // ASCII
207 CHAR8 ModelName
[40]; // ASCII
208 UINT16 multi_sector_cmd_max_sct_cnt
;
210 UINT16 capabilities_49
;
211 UINT16 capabilities_50
;
212 UINT16 obsolete_51_52
[2];
213 UINT16 field_validity
;
214 UINT16 obsolete_54_58
[5];
215 UINT16 mutil_sector_setting
;
216 UINT16 user_addressable_sectors_lo
;
217 UINT16 user_addressable_sectors_hi
;
219 UINT16 multi_word_dma_mode
;
220 UINT16 advanced_pio_modes
;
221 UINT16 min_multi_word_dma_cycle_time
;
222 UINT16 rec_multi_word_dma_cycle_time
;
223 UINT16 min_pio_cycle_time_without_flow_control
;
224 UINT16 min_pio_cycle_time_with_flow_control
;
225 UINT16 reserved_69_74
[6];
227 UINT16 reserved_76_79
[4];
228 UINT16 major_version_no
;
229 UINT16 minor_version_no
;
230 UINT16 cmd_set_support_82
;
231 UINT16 cmd_set_support_83
;
232 UINT16 cmd_feature_support
;
233 UINT16 cmd_feature_enable_85
;
234 UINT16 cmd_feature_enable_86
;
235 UINT16 cmd_feature_default
;
236 UINT16 ultra_dma_select
;
237 UINT16 time_required_for_sec_erase
;
238 UINT16 time_required_for_enhanced_sec_erase
;
239 UINT16 current_advanced_power_mgmt_value
;
240 UINT16 master_pwd_revison_code
;
241 UINT16 hardware_reset_result
;
242 UINT16 current_auto_acoustic_mgmt_value
;
243 UINT16 reserved_95_99
[5];
244 UINT16 max_user_lba_for_48bit_addr
[4];
245 UINT16 reserved_104_126
[23];
246 UINT16 removable_media_status_notification_support
;
247 UINT16 security_status
;
248 UINT16 vendor_data_129_159
[31];
249 UINT16 cfa_power_mode
;
250 UINT16 cfa_reserved_161_175
[15];
251 UINT16 current_media_serial_no
[30];
252 UINT16 reserved_206_254
[49];
253 UINT16 integrity_word
;
254 } EFI_ATAPI_IDENTIFY_DATA
;
258 //*******************************************************
260 //*******************************************************
263 EFI_ATA_IDENTIFY_DATA AtaData
;
264 EFI_ATAPI_IDENTIFY_DATA AtapiData
;
267 #define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000
270 /////////////////////////////////////////////////////////////////////////////////////////
271 // Function prototype declaration, for ANSI compatability
274 Returns the information about the specified IDE channel.
276 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
277 @param Channel Zero-based channel number.
278 @param Enabled TRUE if this channel is enabled. Disabled channels are not scanned
279 to see if any devices are present.
280 @param MaxDevices The maximum number of IDE devices that the bus driver
281 can expect on this channel.
283 @retval EFI_SUCCESS Information was returned without any errors.
284 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
289 (EFIAPI
*EFI_IDE_CONTROLLER_GET_CHANNEL_INFO
) (
290 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
292 OUT BOOLEAN
*Enabled
,
293 OUT UINT8
*MaxDevices
297 The notifications from the IDE bus driver that it is about to enter a certain
298 phase of the IDE channel enumeration process.
300 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
301 @param Phase The phase during enumeration.
302 @param Channel Zero-based channel number.
304 @retval EFI_SUCCESS The notification was accepted without any errors.
305 @retval EFI_NOT_SUPPORTED Phase is not supported.
306 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
307 @retval EFI_NOT_READY This phase cannot be entered at this time.
312 (EFIAPI
*EFI_IDE_CONTROLLER_NOTIFY_PHASE
) (
313 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
314 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase
,
319 Submits the device information to the IDE controller driver.
321 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
322 @param Channel Zero-based channel number.
323 @param Device Zero-based device number on the Channel.
324 @param IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.
326 @retval EFI_SUCCESS The information was accepted without any errors.
327 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
328 Or Device is invalid.
333 (EFIAPI
*EFI_IDE_CONTROLLER_SUBMIT_DATA
) (
334 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
337 IN EFI_IDENTIFY_DATA
*IdentifyData
341 Disqualifies specific modes for an IDE device.
343 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
344 @param Channel Zero-based channel number.
345 @param Device Zero-based device number on the Channel.
346 @param BadModes The modes that the device does not support and that
347 should be disqualified.
349 @retval EFI_SUCCESS The modes were accepted without any errors.
350 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
351 Or Device is invalid.
356 (EFIAPI
*EFI_IDE_CONTROLLER_DISQUALIFY_MODE
) (
357 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
360 IN EFI_ATA_COLLECTIVE_MODE
*BadModes
364 Returns the information about the optimum modes for the specified IDE device.
366 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
367 @param Channel Zero-based channel number.
368 @param Device Zero-based device number on the Channel.
369 @param SupportedModes The optimum modes for the device.
371 @retval EFI_SUCCESS SupportedModes was returned.
372 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
373 Or Device is invalid. Or SupportedModes is NULL.
374 @retval EFI_NOT_READY Modes cannot be calculated due to a lack of data.
379 (EFIAPI
*EFI_IDE_CONTROLLER_CALCULATE_MODE
) (
380 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
383 OUT EFI_ATA_COLLECTIVE_MODE
**SupportedModes
387 Commands the IDE controller driver to program the IDE controller hardware
388 so that the specified device can operate at the specified mode.
390 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
391 @param Channel Zero-based channel number.
392 @param Device Zero-based device number on the Channel.
393 @param Modes The modes to set.
395 @retval EFI_SUCCESS The command was accepted without any errors.
396 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
397 Or Device is invalid.
398 @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
399 @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
400 The IDE bus driver should not use this device.
405 (EFIAPI
*EFI_IDE_CONTROLLER_SET_TIMING
) (
406 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
409 IN EFI_ATA_COLLECTIVE_MODE
*Modes
413 ////////////////////////////////////////////////////////////////////////////////////////////////////
414 // Interface structure
415 // EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.
416 // An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the
417 // EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.
420 @par Protocol Description:
421 Provides the basic interfaces to abstract an IDE controller.
423 @param GetChannelInfo
424 Returns the information about a specific channel.
427 The notification that the IDE bus driver is about to enter the
428 specified phase during the enumeration process.
431 Submits the Drive Identify data that was returned by the device.
433 @param DisqualifyMode
434 Submits information about modes that should be disqualified.
437 Calculates and returns the optimum mode for a particular IDE device.
440 Programs the IDE controller hardware to the default timing or per the modes
441 that were returned by the last call to CalculateMode().
444 Set to TRUE if the enumeration group includes all the channels that are
445 produced by this controller. FALSE if an enumeration group consists of
449 The number of channels that are produced by this controller.
452 struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL
{
453 EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo
;
454 EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase
;
455 EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData
;
456 EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode
;
457 EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode
;
458 EFI_IDE_CONTROLLER_SET_TIMING SetTiming
;
463 extern EFI_GUID gEfiIdeControllerInitProtocolGuid
;