2 This file declares EFI IDE Controller Init Protocol
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
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.
13 Module Name: IdeControllerInit.h
15 @par Revision Reference:
16 This Protocol is defined in IDE Controller Initialization Protocol Specification
21 #ifndef _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H
22 #define _EFI_IDE_CONTROLLER_INIT_PROTOCOL_H
25 // Global ID for the EFI Platform IDE Protocol GUID
27 #define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
28 { 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }
31 // Forward reference for pure ANSI compatability
33 typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL
;
36 //////////////////////////////////////////////////////////////////////////////////////////
37 // EFI_IDE_BUS_ENUMERATION_PHASE
38 // EFI_IDE_CONTROLLER_ENUM_PHASE
41 EfiIdeBeforeChannelEnumeration
,
42 EfiIdeAfterChannelEnumeration
,
43 EfiIdeBeforeChannelReset
,
44 EfiIdeAfterChannelReset
,
45 EfiIdeBusBeforeDevicePresenceDetection
,
46 EfiIdeBusAfterDevicePresenceDetection
,
49 } EFI_IDE_CONTROLLER_ENUM_PHASE
;
52 //******************************************************
53 // EFI_ATA_EXT_TRANSFER_PROTOCOL
54 //******************************************************
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.
63 EfiAtaSataTransferProtocol
64 } EFI_ATA_EXT_TRANSFER_PROTOCOL
;
66 #define EFI_SATA_AUTO_SPEED 0
67 #define EFI_SATA_GEN1_SPEED 1
68 #define EFI_SATA_GEN2_SPEED 2
71 //*******************************************************
73 //*******************************************************
76 EfiIdeCableTypeUnknown
,
79 EfiIdeCableTypeSerial
,
80 EfiIdeCableTypeMaximum
84 //******************************************************
86 //******************************************************
94 //******************************************************
95 // EFI_ATA_EXTENDED_MODE
96 //******************************************************
99 EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol
;
101 } EFI_ATA_EXTENDED_MODE
;
104 //******************************************************
105 // EFI_ATA_COLLECTIVE_MODE
106 //******************************************************
109 EFI_ATA_MODE PioMode
;
110 EFI_ATA_MODE SingleWordDmaMode
;
111 EFI_ATA_MODE MultiWordDmaMode
;
112 EFI_ATA_MODE UdmaMode
;
114 EFI_ATA_EXTENDED_MODE ExtMode
[1];
115 } EFI_ATA_COLLECTIVE_MODE
;
118 //*******************************************************
119 // EFI_ATA_IDENTIFY_DATA
120 //*******************************************************
126 UINT16 config
; // General Configuration
127 UINT16 cylinders
; // Number of Cylinders
129 UINT16 heads
; //Number of logical heads
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
;
143 UINT16 pio_cycle_timing
;
145 UINT16 field_validity
;
146 UINT16 current_cylinders
;
147 UINT16 current_heads
;
148 UINT16 current_sectors
;
149 UINT16 CurrentCapacityLsb
;
150 UINT16 CurrentCapacityMsb
;
152 UINT16 user_addressable_sectors_lo
;
153 UINT16 user_addressable_sectors_hi
;
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
;
179 //*******************************************************
180 // EFI_ATAPI_IDENTIFY_DATA
181 //*******************************************************
185 UINT16 config
; // General Configuration
187 UINT16 specific_config
;
189 UINT16 retired_4_5
[2];
191 UINT16 cfa_reserved_7_8
[2];
193 CHAR8 SerialNo
[20]; // ASCII
194 UINT16 retired_20_21
[2];
196 CHAR8 FirmwareVer
[8]; // ASCII
197 CHAR8 ModelName
[40]; // ASCII
198 UINT16 multi_sector_cmd_max_sct_cnt
;
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
;
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];
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
;
248 //*******************************************************
250 //*******************************************************
253 EFI_ATA_IDENTIFY_DATA AtaData
;
254 EFI_ATAPI_IDENTIFY_DATA AtapiData
;
257 #define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000
260 /////////////////////////////////////////////////////////////////////////////////////////
261 // Function prototype declaration, for ANSI compatability
264 Returns the information about the specified IDE channel.
266 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
267 @param Channel Zero-based channel number.
268 @param Enabled TRUE if this channel is enabled. Disabled channels are not scanned
269 to see if any devices are present.
270 @param MaxDevices The maximum number of IDE devices that the bus driver
271 can expect on this channel.
273 @retval EFI_SUCCESS Information was returned without any errors.
274 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
279 (EFIAPI
*EFI_IDE_CONTROLLER_GET_CHANNEL_INFO
) (
280 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
282 OUT BOOLEAN
*Enabled
,
283 OUT UINT8
*MaxDevices
287 The notifications from the IDE bus driver that it is about to enter a certain
288 phase of the IDE channel enumeration process.
290 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
291 @param Phase The phase during enumeration.
292 @param Channel Zero-based channel number.
294 @retval EFI_SUCCESS The notification was accepted without any errors.
295 @retval EFI_NOT_SUPPORTED Phase is not supported.
296 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
297 @retval EFI_NOT_READY This phase cannot be entered at this time.
302 (EFIAPI
*EFI_IDE_CONTROLLER_NOTIFY_PHASE
) (
303 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
304 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase
,
309 Submits the device information to the IDE controller driver.
311 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
312 @param Channel Zero-based channel number.
313 @param Device Zero-based device number on the Channel.
314 @param IdentifyData The device¡¯s response to the ATA IDENTIFY_DEVICE command.
316 @retval EFI_SUCCESS The information was accepted without any errors.
317 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
318 Or Device is invalid.
323 (EFIAPI
*EFI_IDE_CONTROLLER_SUBMIT_DATA
) (
324 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
327 IN EFI_IDENTIFY_DATA
*IdentifyData
331 Disqualifies specific modes for an IDE device.
333 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
334 @param Channel Zero-based channel number.
335 @param Device Zero-based device number on the Channel.
336 @param BadModes The modes that the device does not support and that
337 should be disqualified.
339 @retval EFI_SUCCESS The modes were accepted without any errors.
340 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
341 Or Device is invalid.
346 (EFIAPI
*EFI_IDE_CONTROLLER_DISQUALIFY_MODE
) (
347 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
350 IN EFI_ATA_COLLECTIVE_MODE
*BadModes
354 Returns the information about the optimum modes for the specified IDE device.
356 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
357 @param Channel Zero-based channel number.
358 @param Device Zero-based device number on the Channel.
359 @param SupportedModes The optimum modes for the device.
361 @retval EFI_SUCCESS SupportedModes was returned.
362 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
363 Or Device is invalid. Or SupportedModes is NULL.
364 @retval EFI_NOT_READY Modes cannot be calculated due to a lack of data.
369 (EFIAPI
*EFI_IDE_CONTROLLER_CALCULATE_MODE
) (
370 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
373 OUT EFI_ATA_COLLECTIVE_MODE
**SupportedModes
377 Commands the IDE controller driver to program the IDE controller hardware
378 so that the specified device can operate at the specified mode.
380 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
381 @param Channel Zero-based channel number.
382 @param Device Zero-based device number on the Channel.
383 @param Modes The modes to set.
385 @retval EFI_SUCCESS The command was accepted without any errors.
386 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
387 Or Device is invalid.
388 @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
389 @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
390 The IDE bus driver should not use this device.
395 (EFIAPI
*EFI_IDE_CONTROLLER_SET_TIMING
) (
396 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
399 IN EFI_ATA_COLLECTIVE_MODE
*Modes
403 ////////////////////////////////////////////////////////////////////////////////////////////////////
404 // Interface structure
405 // EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.
406 // An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the
407 // EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.
410 @par Protocol Description:
411 Provides the basic interfaces to abstract an IDE controller.
413 @param GetChannelInfo
414 Returns the information about a specific channel.
417 The notification that the IDE bus driver is about to enter the
418 specified phase during the enumeration process.
421 Submits the Drive Identify data that was returned by the device.
423 @param DisqualifyMode
424 Submits information about modes that should be disqualified.
427 Calculates and returns the optimum mode for a particular IDE device.
430 Programs the IDE controller hardware to the default timing or per the modes
431 that were returned by the last call to CalculateMode().
434 Set to TRUE if the enumeration group includes all the channels that are
435 produced by this controller. FALSE if an enumeration group consists of
439 The number of channels that are produced by this controller.
442 struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL
{
443 EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo
;
444 EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase
;
445 EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData
;
446 EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode
;
447 EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode
;
448 EFI_IDE_CONTROLLER_SET_TIMING SetTiming
;
453 extern EFI_GUID gEfiIdeControllerInitProtocolGuid
;