2 This file declares EFI IDE Controller Init Protocol
4 Copyright (c) 2007, 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_
27 // Global ID for the EFI Platform IDE Protocol GUID
29 #define EFI_IDE_CONTROLLER_INIT_PROTOCOL_GUID \
30 { 0xa1e37052, 0x80d9, 0x4e65, {0xa3, 0x17, 0x3e, 0x9a, 0x55, 0xc4, 0x3e, 0xc9 } }
33 // Forward reference for pure ANSI compatability
35 typedef struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL EFI_IDE_CONTROLLER_INIT_PROTOCOL
;
38 //////////////////////////////////////////////////////////////////////////////////////////
39 // EFI_IDE_BUS_ENUMERATION_PHASE
40 // EFI_IDE_CONTROLLER_ENUM_PHASE
43 EfiIdeBeforeChannelEnumeration
,
44 EfiIdeAfterChannelEnumeration
,
45 EfiIdeBeforeChannelReset
,
46 EfiIdeAfterChannelReset
,
47 EfiIdeBusBeforeDevicePresenceDetection
,
48 EfiIdeBusAfterDevicePresenceDetection
,
51 } EFI_IDE_CONTROLLER_ENUM_PHASE
;
54 //******************************************************
55 // EFI_ATA_EXT_TRANSFER_PROTOCOL
56 //******************************************************
58 // This extended mode describes the SATA physical protocol.
59 // SATA physical layers can operate at different speeds.
60 // These speeds are defined below. Various PATA protocols
61 // and associated modes are not applicable to SATA devices.
65 EfiAtaSataTransferProtocol
66 } EFI_ATA_EXT_TRANSFER_PROTOCOL
;
68 #define EFI_SATA_AUTO_SPEED 0
69 #define EFI_SATA_GEN1_SPEED 1
70 #define EFI_SATA_GEN2_SPEED 2
73 //*******************************************************
75 //*******************************************************
78 EfiIdeCableTypeUnknown
,
81 EfiIdeCableTypeSerial
,
82 EfiIdeCableTypeMaximum
86 //******************************************************
88 //******************************************************
96 //******************************************************
97 // EFI_ATA_EXTENDED_MODE
98 //******************************************************
101 EFI_ATA_EXT_TRANSFER_PROTOCOL TransferProtocol
;
103 } EFI_ATA_EXTENDED_MODE
;
106 //******************************************************
107 // EFI_ATA_COLLECTIVE_MODE
108 //******************************************************
111 EFI_ATA_MODE PioMode
;
112 EFI_ATA_MODE SingleWordDmaMode
;
113 EFI_ATA_MODE MultiWordDmaMode
;
114 EFI_ATA_MODE UdmaMode
;
116 EFI_ATA_EXTENDED_MODE ExtMode
[1];
117 } EFI_ATA_COLLECTIVE_MODE
;
120 //*******************************************************
121 // EFI_ATA_IDENTIFY_DATA
122 //*******************************************************
128 UINT16 config
; // General Configuration
129 UINT16 cylinders
; // Number of Cylinders
131 UINT16 heads
; //Number of logical heads
134 UINT16 sectors_per_track
;
135 UINT16 vendor_specific_7_9
[3];
136 CHAR8 SerialNo
[20]; // ASCII
137 UINT16 vendor_specific_20_21
[2];
138 UINT16 ecc_bytes_available
;
139 CHAR8 FirmwareVer
[8]; // ASCII
140 CHAR8 ModelName
[40]; // ASCII
141 UINT16 multi_sector_cmd_max_sct_cnt
;
145 UINT16 pio_cycle_timing
;
147 UINT16 field_validity
;
148 UINT16 current_cylinders
;
149 UINT16 current_heads
;
150 UINT16 current_sectors
;
151 UINT16 CurrentCapacityLsb
;
152 UINT16 CurrentCapacityMsb
;
154 UINT16 user_addressable_sectors_lo
;
155 UINT16 user_addressable_sectors_hi
;
157 UINT16 multi_word_dma_mode
;
158 UINT16 advanced_pio_modes
;
159 UINT16 min_multi_word_dma_cycle_time
;
160 UINT16 rec_multi_word_dma_cycle_time
;
161 UINT16 min_pio_cycle_time_without_flow_control
;
162 UINT16 min_pio_cycle_time_with_flow_control
;
163 UINT16 reserved_69_79
[11];
164 UINT16 major_version_no
;
165 UINT16 minor_version_no
;
166 UINT16 command_set_supported_82
; // word 82
167 UINT16 command_set_supported_83
; // word 83
168 UINT16 command_set_feature_extn
; // word 84
169 UINT16 command_set_feature_enb_85
; // word 85
170 UINT16 command_set_feature_enb_86
; // word 86
171 UINT16 command_set_feature_default
; // word 87
172 UINT16 ultra_dma_mode
; // word 88
173 UINT16 reserved_89_127
[39];
174 UINT16 security_status
;
175 UINT16 vendor_data_129_159
[31];
176 UINT16 reserved_160_255
[96];
177 } EFI_ATA_IDENTIFY_DATA
;
181 //*******************************************************
182 // EFI_ATAPI_IDENTIFY_DATA
183 //*******************************************************
187 UINT16 config
; // General Configuration
189 UINT16 specific_config
;
191 UINT16 retired_4_5
[2];
193 UINT16 cfa_reserved_7_8
[2];
195 CHAR8 SerialNo
[20]; // ASCII
196 UINT16 retired_20_21
[2];
198 CHAR8 FirmwareVer
[8]; // ASCII
199 CHAR8 ModelName
[40]; // ASCII
200 UINT16 multi_sector_cmd_max_sct_cnt
;
202 UINT16 capabilities_49
;
203 UINT16 capabilities_50
;
204 UINT16 obsolete_51_52
[2];
205 UINT16 field_validity
;
206 UINT16 obsolete_54_58
[5];
207 UINT16 mutil_sector_setting
;
208 UINT16 user_addressable_sectors_lo
;
209 UINT16 user_addressable_sectors_hi
;
211 UINT16 multi_word_dma_mode
;
212 UINT16 advanced_pio_modes
;
213 UINT16 min_multi_word_dma_cycle_time
;
214 UINT16 rec_multi_word_dma_cycle_time
;
215 UINT16 min_pio_cycle_time_without_flow_control
;
216 UINT16 min_pio_cycle_time_with_flow_control
;
217 UINT16 reserved_69_74
[6];
219 UINT16 reserved_76_79
[4];
220 UINT16 major_version_no
;
221 UINT16 minor_version_no
;
222 UINT16 cmd_set_support_82
;
223 UINT16 cmd_set_support_83
;
224 UINT16 cmd_feature_support
;
225 UINT16 cmd_feature_enable_85
;
226 UINT16 cmd_feature_enable_86
;
227 UINT16 cmd_feature_default
;
228 UINT16 ultra_dma_select
;
229 UINT16 time_required_for_sec_erase
;
230 UINT16 time_required_for_enhanced_sec_erase
;
231 UINT16 current_advanced_power_mgmt_value
;
232 UINT16 master_pwd_revison_code
;
233 UINT16 hardware_reset_result
;
234 UINT16 current_auto_acoustic_mgmt_value
;
235 UINT16 reserved_95_99
[5];
236 UINT16 max_user_lba_for_48bit_addr
[4];
237 UINT16 reserved_104_126
[23];
238 UINT16 removable_media_status_notification_support
;
239 UINT16 security_status
;
240 UINT16 vendor_data_129_159
[31];
241 UINT16 cfa_power_mode
;
242 UINT16 cfa_reserved_161_175
[15];
243 UINT16 current_media_serial_no
[30];
244 UINT16 reserved_206_254
[49];
245 UINT16 integrity_word
;
246 } EFI_ATAPI_IDENTIFY_DATA
;
250 //*******************************************************
252 //*******************************************************
255 EFI_ATA_IDENTIFY_DATA AtaData
;
256 EFI_ATAPI_IDENTIFY_DATA AtapiData
;
259 #define EFI_ATAPI_DEVICE_IDENTIFY_DATA 0x8000
262 /////////////////////////////////////////////////////////////////////////////////////////
263 // Function prototype declaration, for ANSI compatability
266 Returns the information about the specified IDE channel.
268 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
269 @param Channel Zero-based channel number.
270 @param Enabled TRUE if this channel is enabled. Disabled channels are not scanned
271 to see if any devices are present.
272 @param MaxDevices The maximum number of IDE devices that the bus driver
273 can expect on this channel.
275 @retval EFI_SUCCESS Information was returned without any errors.
276 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
281 (EFIAPI
*EFI_IDE_CONTROLLER_GET_CHANNEL_INFO
) (
282 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
284 OUT BOOLEAN
*Enabled
,
285 OUT UINT8
*MaxDevices
289 The notifications from the IDE bus driver that it is about to enter a certain
290 phase of the IDE channel enumeration process.
292 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
293 @param Phase The phase during enumeration.
294 @param Channel Zero-based channel number.
296 @retval EFI_SUCCESS The notification was accepted without any errors.
297 @retval EFI_NOT_SUPPORTED Phase is not supported.
298 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
299 @retval EFI_NOT_READY This phase cannot be entered at this time.
304 (EFIAPI
*EFI_IDE_CONTROLLER_NOTIFY_PHASE
) (
305 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
306 IN EFI_IDE_CONTROLLER_ENUM_PHASE Phase
,
311 Submits the device information to the IDE controller driver.
313 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
314 @param Channel Zero-based channel number.
315 @param Device Zero-based device number on the Channel.
316 @param IdentifyData The device's response to the ATA IDENTIFY_DEVICE command.
318 @retval EFI_SUCCESS The information was accepted without any errors.
319 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
320 Or Device is invalid.
325 (EFIAPI
*EFI_IDE_CONTROLLER_SUBMIT_DATA
) (
326 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
329 IN EFI_IDENTIFY_DATA
*IdentifyData
333 Disqualifies specific modes for an IDE device.
335 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
336 @param Channel Zero-based channel number.
337 @param Device Zero-based device number on the Channel.
338 @param BadModes The modes that the device does not support and that
339 should be disqualified.
341 @retval EFI_SUCCESS The modes were accepted without any errors.
342 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
343 Or Device is invalid.
348 (EFIAPI
*EFI_IDE_CONTROLLER_DISQUALIFY_MODE
) (
349 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
352 IN EFI_ATA_COLLECTIVE_MODE
*BadModes
356 Returns the information about the optimum modes for the specified IDE device.
358 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
359 @param Channel Zero-based channel number.
360 @param Device Zero-based device number on the Channel.
361 @param SupportedModes The optimum modes for the device.
363 @retval EFI_SUCCESS SupportedModes was returned.
364 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
365 Or Device is invalid. Or SupportedModes is NULL.
366 @retval EFI_NOT_READY Modes cannot be calculated due to a lack of data.
371 (EFIAPI
*EFI_IDE_CONTROLLER_CALCULATE_MODE
) (
372 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
375 OUT EFI_ATA_COLLECTIVE_MODE
**SupportedModes
379 Commands the IDE controller driver to program the IDE controller hardware
380 so that the specified device can operate at the specified mode.
382 @param This Pointer to the EFI_IDE_CONTROLLER_INIT_PROTOCOL instance.
383 @param Channel Zero-based channel number.
384 @param Device Zero-based device number on the Channel.
385 @param Modes The modes to set.
387 @retval EFI_SUCCESS The command was accepted without any errors.
388 @retval EFI_INVALID_PARAMETER Channel is invalid (Channel >= ChannelCount).
389 Or Device is invalid.
390 @retval EFI_NOT_READY Modes cannot be set at this time due to lack of data.
391 @retval EFI_DEVICE_ERROR Modes cannot be set due to hardware failure.
392 The IDE bus driver should not use this device.
397 (EFIAPI
*EFI_IDE_CONTROLLER_SET_TIMING
) (
398 IN EFI_IDE_CONTROLLER_INIT_PROTOCOL
*This
,
401 IN EFI_ATA_COLLECTIVE_MODE
*Modes
405 ////////////////////////////////////////////////////////////////////////////////////////////////////
406 // Interface structure
407 // EFI_IDE_CONTROLLER_INIT_PROTOCOL protocol provides the chipset specific information to the IDE bus driver.
408 // An IDE Bus driver wants to manage an IDE bus and possible IDE devices will have to retrieve the
409 // EFI_IDE_CONTROLLER_INIT_PROTOCOL instances.
412 @par Protocol Description:
413 Provides the basic interfaces to abstract an IDE controller.
415 @param GetChannelInfo
416 Returns the information about a specific channel.
419 The notification that the IDE bus driver is about to enter the
420 specified phase during the enumeration process.
423 Submits the Drive Identify data that was returned by the device.
425 @param DisqualifyMode
426 Submits information about modes that should be disqualified.
429 Calculates and returns the optimum mode for a particular IDE device.
432 Programs the IDE controller hardware to the default timing or per the modes
433 that were returned by the last call to CalculateMode().
436 Set to TRUE if the enumeration group includes all the channels that are
437 produced by this controller. FALSE if an enumeration group consists of
441 The number of channels that are produced by this controller.
444 struct _EFI_IDE_CONTROLLER_INIT_PROTOCOL
{
445 EFI_IDE_CONTROLLER_GET_CHANNEL_INFO GetChannelInfo
;
446 EFI_IDE_CONTROLLER_NOTIFY_PHASE NotifyPhase
;
447 EFI_IDE_CONTROLLER_SUBMIT_DATA SubmitData
;
448 EFI_IDE_CONTROLLER_DISQUALIFY_MODE DisqualifyMode
;
449 EFI_IDE_CONTROLLER_CALCULATE_MODE CalculateMode
;
450 EFI_IDE_CONTROLLER_SET_TIMING SetTiming
;
455 extern EFI_GUID gEfiIdeControllerInitProtocolGuid
;