X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdePkg%2FInclude%2FIndustryStandard%2FAtapi.h;h=28c810814e9875b40d4bdd3755416c6825cd1689;hb=884a173010382cb2cad11f5c9ada2e8c1068b48a;hp=695e5cf25d8fadf2282df5925f074c3419455530;hpb=4777d7fc9eb5925845654492d40fa433a931f454;p=mirror_edk2.git diff --git a/MdePkg/Include/IndustryStandard/Atapi.h b/MdePkg/Include/IndustryStandard/Atapi.h index 695e5cf25d..28c810814e 100644 --- a/MdePkg/Include/IndustryStandard/Atapi.h +++ b/MdePkg/Include/IndustryStandard/Atapi.h @@ -2,13 +2,13 @@ This file contains just some basic definitions that are needed by drivers that dealing with ATA/ATAPI interface. -Copyright (c) 2007 - 2010, Intel Corporation -All rights reserved. This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at -http://opensource.org/licenses/bsd-license.php - -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
+This program and the accompanying materials are licensed and made available under +the terms and conditions of the BSD License that accompanies this distribution. +The full text of the license may be found at +http://opensource.org/licenses/bsd-license.php. + +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -19,16 +19,16 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #pragma pack(1) /// -/// ATA5_IDENTIFY_DATA is defined in ATA-5 -/// (This structure is provided here mainly for backward-compatibility support. -/// Old drivers may reference some field that is marked "obsolete" in -/// ATA_IDENTIFY_DATA, which current conforms to ATA-8) +/// ATA5_IDENTIFY_DATA is defined in ATA-5. +/// (This structure is provided mainly for backward-compatibility support. +/// Old drivers may reference fields that are marked "obsolete" in +/// ATA_IDENTIFY_DATA, which currently conforms to ATA-8.) /// typedef struct { - UINT16 config; ///< General Configuration - UINT16 cylinders; ///< Number of Cylinders + UINT16 config; ///< General Configuration. + UINT16 cylinders; ///< Number of Cylinders. UINT16 reserved_2; - UINT16 heads; ///< Number of logical heads + UINT16 heads; ///< Number of logical heads. UINT16 vendor_data1; UINT16 vendor_data2; UINT16 sectors_per_track; @@ -77,14 +77,14 @@ typedef struct { } ATA5_IDENTIFY_DATA; /// -/// ATA_IDENTIFY_DATA is strictly complied with ATA/ATAPI-8 Spec +/// ATA_IDENTIFY_DATA strictly complies with ATA/ATAPI-8 Spec /// to define the data returned by an ATA device upon successful -/// completion of the ATA IDENTIFY_DEVICE command +/// completion of the ATA IDENTIFY_DEVICE command. /// typedef struct { - UINT16 config; ///< General Configuration + UINT16 config; ///< General Configuration. UINT16 obsolete_1; - UINT16 specific_config; ///< Specific Configuration + UINT16 specific_config; ///< Specific Configuration. UINT16 obsolete_3; UINT16 retired_4_5[2]; UINT16 obsolete_6; @@ -102,7 +102,7 @@ typedef struct { UINT16 obsolete_51_52[2]; UINT16 field_validity; UINT16 obsolete_54_58[5]; - UINT16 multi_sector_setting; + UINT16 multi_sector_setting; UINT16 user_addressable_sectors_lo; UINT16 user_addressable_sectors_hi; UINT16 obsolete_62; @@ -112,9 +112,14 @@ typedef struct { UINT16 rec_multi_word_dma_cycle_time; UINT16 min_pio_cycle_time_without_flow_control; UINT16 min_pio_cycle_time_with_flow_control; - UINT16 reserved_69_74[6]; + UINT16 additional_supported; ///< word 69 + UINT16 reserved_70; + UINT16 reserved_71_74[4]; ///< Reserved for IDENTIFY PACKET DEVICE cmd. UINT16 queue_depth; - UINT16 reserved_76_79[4]; ///< reserved for Serial ATA + UINT16 serial_ata_capabilities; + UINT16 reserved_77; ///< Reserved for Serial ATA + UINT16 serial_ata_features_supported; + UINT16 serial_ata_features_enabled; UINT16 major_version_no; UINT16 minor_version_no; UINT16 command_set_supported_82; ///< word 82 @@ -129,14 +134,14 @@ typedef struct { UINT16 advanced_power_management_level; UINT16 master_password_identifier; UINT16 hardware_configuration_test_result; - UINT16 acoustic_management_value; + UINT16 obsolete_94; UINT16 stream_minimum_request_size; UINT16 streaming_transfer_time_for_dma; UINT16 streaming_access_latency_for_dma_and_pio; UINT16 streaming_performance_granularity[2]; ///< word 98~99 UINT16 maximum_lba_for_48bit_addressing[4]; ///< word 100~103 UINT16 streaming_transfer_time_for_pio; - UINT16 reserved_105; + UINT16 max_no_of_512byte_blocks_per_data_set_cmd; UINT16 phy_logic_sector_support; ///< word 106 UINT16 interseek_delay_for_iso7779; UINT16 world_wide_name[4]; ///< word 108~111 @@ -146,12 +151,16 @@ typedef struct { UINT16 logic_sector_size_hi; ///< word 118 UINT16 features_and_command_sets_supported_ext; ///< word 119 UINT16 features_and_command_sets_enabled_ext; ///< word 120 - UINT16 reserved_121_126[8]; + UINT16 reserved_121_126[6]; UINT16 obsolete_127; UINT16 security_status; ///< word 128 UINT16 vendor_specific_129_159[31]; UINT16 cfa_power_mode; ///< word 160 - UINT16 reserved_for_compactflash_161_175[15]; + UINT16 reserved_for_compactflash_161_167[7]; + UINT16 device_nominal_form_factor; + UINT16 is_data_set_cmd_supported; + CHAR8 additional_product_identifier[8]; + UINT16 reserved_174_175[2]; CHAR8 media_serial_number[60]; ///< word 176~205 UINT16 sct_command_transport; ///< word 206 UINT16 reserved_207_208[2]; @@ -161,14 +170,15 @@ typedef struct { UINT16 nv_cache_capabilities; UINT16 nv_cache_size_in_logical_block_lsw; ///< word 215 UINT16 nv_cache_size_in_logical_block_msw; ///< word 216 - UINT16 nv_cache_read_speed; - UINT16 nv_cache_write_speed; + UINT16 nominal_media_rotation_rate; + UINT16 reserved_218; UINT16 nv_cache_options; ///< word 219 UINT16 write_read_verify_mode; ///< word 220 UINT16 reserved_221; UINT16 transport_major_revision_number; UINT16 transport_minor_revision_number; - UINT16 reserved_224_233[10]; + UINT16 reserved_224_229[6]; + UINT64 extended_no_of_addressable_sectors; UINT16 min_number_per_download_microcode_mode3; ///< word 234 UINT16 max_number_per_download_microcode_mode3; ///< word 235 UINT16 reserved_236_254[19]; @@ -176,14 +186,14 @@ typedef struct { } ATA_IDENTIFY_DATA; /// -/// ATAPI_IDENTIFY_DATA is strictly complied with ATA/ATAPI-8 Spec +/// ATAPI_IDENTIFY_DATA strictly complies with ATA/ATAPI-8 Spec /// to define the data returned by an ATAPI device upon successful -/// completion of the ATA IDENTIFY_PACKET_DEVICE command +/// completion of the ATA IDENTIFY_PACKET_DEVICE command. /// typedef struct { - UINT16 config; ///< General Configuration + UINT16 config; ///< General Configuration. UINT16 reserved_1; - UINT16 specific_config; ///< Specific Configuration + UINT16 specific_config; ///< Specific Configuration. UINT16 reserved_3_9[7]; CHAR8 SerialNo[20]; ///< word 10~19 UINT16 reserved_20_22[3]; @@ -206,8 +216,11 @@ typedef struct { UINT16 reserved_69_70[2]; UINT16 obsolete_71_72[2]; UINT16 reserved_73_74[2]; - UINT16 queue_depth; - UINT16 reserved_76_79[4]; + UINT16 obsolete_75; + UINT16 serial_ata_capabilities; + UINT16 reserved_77; ///< Reserved for Serial ATA + UINT16 serial_ata_features_supported; + UINT16 serial_ata_features_enabled; UINT16 major_version_no; ///< word 80 UINT16 minor_version_no; ///< word 81 UINT16 cmd_set_support_82; @@ -219,34 +232,39 @@ typedef struct { UINT16 ultra_dma_select; UINT16 time_required_for_sec_erase; ///< word 89 UINT16 time_required_for_enhanced_sec_erase; ///< word 90 - UINT16 reserved_91; + UINT16 advanced_power_management_level; UINT16 master_pwd_revison_code; UINT16 hardware_reset_result; ///< word 93 - UINT16 current_auto_acoustic_mgmt_value; + UINT16 obsolete_94; UINT16 reserved_95_107[13]; UINT16 world_wide_name[4]; ///< word 108~111 UINT16 reserved_for_128bit_wwn_112_115[4]; - UINT16 reserved_116_124[9]; + UINT16 reserved_116_118[3]; + UINT16 command_and_feature_sets_supported; ///< word 119 + UINT16 command_and_feature_sets_supported_enabled; + UINT16 reserved_121_124[4]; UINT16 atapi_byte_count_0_behavior; ///< word 125 - UINT16 obsolete_126; - UINT16 removable_media_status_notification_support; + UINT16 obsolete_126_127[2]; UINT16 security_status; - UINT16 reserved_129_160[32]; - UINT16 cfa_reserved_161_175[15]; - UINT16 reserved_176_254[79]; + UINT16 reserved_129_159[31]; + UINT16 cfa_reserved_160_175[16]; + UINT16 reserved_176_221[46]; + UINT16 transport_major_version; + UINT16 transport_minor_version; + UINT16 reserved_224_254[31]; UINT16 integrity_word; } ATAPI_IDENTIFY_DATA; /// -/// Standard Quiry Data format, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// Standard Quiry Data format, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 peripheral_type; UINT8 RMB; UINT8 version; UINT8 response_data_format; - UINT8 addnl_length; ///< n - 4, Numbers of bytes following this one + UINT8 addnl_length; ///< n - 4, Numbers of bytes following this one. UINT8 reserved_5; UINT8 reserved_6; UINT8 reserved_7; @@ -256,14 +274,14 @@ typedef struct { UINT8 vendor_specific_36_55[55 - 36 + 1]; UINT8 reserved_56_95[95 - 56 + 1]; /// - /// Vendor specific parameters fields, the sizeof (ATAPI_INQUIRY_DATA) is 254 + /// Vendor-specific parameters fields. The sizeof (ATAPI_INQUIRY_DATA) is 254 /// since allocation_length is one byte in ATAPI_INQUIRY_CMD. /// UINT8 vendor_specific_96_253[253 - 96 + 1]; } ATAPI_INQUIRY_DATA; /// -/// Request Sense Standard Data, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// Request Sense Standard Data, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 error_code : 7; @@ -291,7 +309,7 @@ typedef struct { } ATAPI_REQUEST_SENSE_DATA; /// -/// READ CAPACITY Data, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// READ CAPACITY Data, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 LastLba3; @@ -306,7 +324,7 @@ typedef struct { /// /// Capacity List Header + Current/Maximum Capacity Descriptor, -/// defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 reserved_0; @@ -325,7 +343,7 @@ typedef struct { } ATAPI_READ_FORMAT_CAPACITY_DATA; /// -/// Test Unit Ready Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// Test Unit Ready Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 opcode; @@ -343,7 +361,7 @@ typedef struct { } ATAPI_TEST_UNIT_READY_CMD; /// -/// INQUIRY Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// INQUIRY Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 opcode; @@ -362,7 +380,7 @@ typedef struct { } ATAPI_INQUIRY_CMD; /// -/// REQUEST SENSE Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// REQUEST SENSE Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 opcode; @@ -381,7 +399,7 @@ typedef struct { } ATAPI_REQUEST_SENSE_CMD; /// -/// READ (10) Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// READ (10) Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 opcode; @@ -400,7 +418,7 @@ typedef struct { } ATAPI_READ10_CMD; /// -/// READ Format Capacity Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// READ Format Capacity Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 opcode; @@ -419,7 +437,7 @@ typedef struct { } ATAPI_READ_FORMAT_CAP_CMD; /// -/// MODE SENSE Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification) +/// MODE SENSE Command, defined in SFF-8070i(ATAPI Removable Rewritable Specification). /// typedef struct { UINT8 opcode; @@ -439,8 +457,8 @@ typedef struct { } ATAPI_MODE_SENSE_CMD; /// -/// ATAPI_PACKET_COMMAND is not defined in ATA specification. -/// We add it here for the convenience for ATA/ATAPI module writer. +/// ATAPI_PACKET_COMMAND is not defined in the ATA specification. +/// We add it here for the convenience of ATA/ATAPI module writers. /// typedef union { UINT16 Data16[6]; @@ -472,6 +490,18 @@ typedef union { #define ATA_CMD_READ_CAPACITY 0x25 ///< defined in ATAPI Removable Rewritable Media Devcies #define ATA_CMD_READ_10 0x28 ///< defined in ATAPI Removable Rewritable Media Devcies #define ATA_CMD_WRITE_10 0x2A ///< defined in ATAPI Removable Rewritable Media Devcies +#define ATA_CMD_READ_12 0xA8 ///< defined in ATAPI Removable Rewritable Media Devcies +#define ATA_CMD_WRITE_12 0xAA ///< defined in ATAPI Removable Rewritable Media Devcies +#define ATA_CMD_START_STOP_UNIT 0x1B ///< defined in ATAPI Removable Rewritable Media Devcies +/// +/// Start/Stop and Eject Operations +/// +///@{ +#define ATA_CMD_SUBOP_STOP_DISC 0x00 ///< Stop the Disc +#define ATA_CMD_SUBOP_START_DISC 0x01 ///< Start the Disc and acquire the format type +#define ATA_CMD_SUBOP_EJECT_DISC 0x02 ///< Eject the Disc if possible +#define ATA_CMD_SUBOP_CLOSE_TRAY 0x03 ///< Load the Disc (Close Tray) +///@} // // ATA Commands Code @@ -547,13 +577,13 @@ typedef union { #define ATA_CMD_WRITE_DMA_EXT 0x35 ///< defined from ATA-6 /// -/// default content of device control register, disable INT, +/// Default content of device control register, disable INT, /// Bit3 is set to 1 according ATA-1 /// #define ATA_DEFAULT_CTL (0x0a) /// -/// default context of Device/Head Register, -/// Bit7 and Bit5 are set to 1 for back-compatibilities +/// Default context of Device/Head Register, +/// Bit7 and Bit5 are set to 1 for back-compatibilities. /// #define ATA_DEFAULT_CMD (0xa0) @@ -598,7 +628,7 @@ typedef union { #define ATA_ASC_INVALID_FIELD (0x24) #define ATA_ASC_WRITE_PROTECTED (0x27) #define ATA_ASC_MEDIA_CHANGE (0x28) -#define ATA_ASC_RESET (0x29) ///< Power On Reset or Bus Reset occurred +#define ATA_ASC_RESET (0x29) ///< Power On Reset or Bus Reset occurred. #define ATA_ASC_ILLEGAL_FIELD (0x26) #define ATA_ASC_NO_MEDIA (0x3A) #define ATA_ASC_ILLEGAL_MODE_FOR_THIS_TRACK (0x64) @@ -636,8 +666,8 @@ typedef union { // // Device Control Register // -#define ATA_CTLREG_SRST BIT2 ///< Software Reset -#define ATA_CTLREG_IEN_L BIT1 ///< Interrupt Enable # +#define ATA_CTLREG_SRST BIT2 ///< Software Reset. +#define ATA_CTLREG_IEN_L BIT1 ///< Interrupt Enable #. #endif