Changeset 150 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Inc/IdeRegisters.inc
- Timestamp:
- Apr 29, 2011, 7:04:13 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/IdeRegisters.inc
r3 r150 1 ; File name : IdeRegisters.inc 2 ; Project name : IDE BIOS 3 ; Created date : 23.3.2010 4 ; Last update : 23.3.2010 5 ; Author : Tomi Tilli 1 ; Project name : XTIDE Universal BIOS 6 2 ; Description : Equates for IDE registers, flags and commands. 7 3 %ifndef IDEREGISTERS_INC … … 9 5 10 6 ; IDE Register offsets from Command Block base port 11 REG_IDE_DATA EQU 0 ; Data Register 12 REGR_IDE_ERROR EQU 1 ; Error Register 13 REGW_IDE_FEAT EQU 1 ; Features Register (ATA1+) 14 ; REGW_IDE_WRPC EQU 1 ; Write Precompensation Register (obsolete on ATA1+)15 REG_IDE_CNT EQU 2 ; Sector Count Register 16 REG_IDE_SECT EQU 3 ; Sector Number Register (LBA 7...0) 17 REG_IDE_LBA_LOW EQU 3 ; LBA LowRegister18 REG_IDE_LOCYL EQU 4 ; Low Cylinder Register (LBA 15...8) 19 REG_IDE_LBA_MID EQU 4 ; LBA Mid Register 20 REG_IDE_HICYL EQU 5 ; High Cylinder Register (LBA 23...16) 21 REG_IDE_LBA_HIGH EQU 5 ; LBA High Register 22 REG_IDE_DRVHD EQU 6 ; Drive and Head Register (LBA 27...24) 23 REGR_IDE_ST EQU 7 ; Status Register 24 REGW_IDE_CMD EQU 7 ; Command Register 25 REG_IDE_HIDATA EQU 8 ; XTIDE Data High Register(actually first Control Block reg)7 DATA_REGISTER EQU 0 8 ERROR_REGISTER_in EQU 1 ; Read only 9 FEATURES_REGISTER_out EQU 1 ; Write only, ATA1+ 10 ;WRITE_PRECOMPENSATION_out EQU 1 ; Write only, Obsolete on ATA1+ 11 SECTOR_COUNT_REGISTER EQU 2 12 SECTOR_NUMBER_REGISTER EQU 3 ; LBA Low Register 13 LOW_CYLINDER_REGISTER EQU 4 ; LBA Middle Register 14 HIGH_CYLINDER_REGISTER EQU 5 ; LBA High Register 15 LBA_LOW_REGISTER EQU 3 ; LBA 7...0, LBA48 31...24 16 LBA_MIDDLE_REGISTER EQU 4 ; LBA 15...8, LBA48 39...32 17 LBA_HIGH_REGISTER EQU 5 ; LBA 23...16, LBA48 47...40 18 DRIVE_AND_HEAD_SELECT_REGISTER EQU 6 ; LBA28 27...24 19 STATUS_REGISTER_in EQU 7 ; Read only 20 COMMAND_REGISTER_out EQU 7 ; Write only 21 XTIDE_DATA_HIGH_REGISTER EQU 8 ; Non-standard (actually first Control Block reg) 26 22 27 23 ; IDE Register offsets from Control Block base port 28 24 ; (usually Command Block base port + 200h) 29 REGR_IDEC_AST EQU 6 ; Alternate Status Register 30 REGW_IDEC_CTRL EQU 6 ; Device Control Register 31 ; REGR_IDEC_ADDR EQU 7 ; Drive Address Register (obsolete on ATA2+)25 ALTERNATE_STATUS_REGISTER_in EQU 6 ; Read only 26 DEVICE_CONTROL_REGISTER_out EQU 6 ; Write only 27 ;DRIVE_ADDRESS_REGISTER EQU 7 ; Obsolete on ATA2+ 32 28 29 ; Bit mask for XTIDE mod with reversed A0 and A3 address lines 30 MASK_A3_AND_A0_ADDRESS_LINES EQU ((1<<3) | (1<<0)) 33 31 34 32 ; Bit definitions for IDE Error Register 35 FLG_ IDE_ERR_BBK EQU (1<<7) ; Bad Block Detected (reserved on ATA2+, command dependent on ATA4+)36 FLG_ IDE_ERR_UNC EQU (1<<6) ; Uncorrectable Data Error (command dependent on ATA4+)37 FLG_ IDE_ERR_MC EQU (1<<5) ; Media Changed (command dependent on ATA4+)38 FLG_ IDE_ERR_IDNFEQU (1<<4) ; ID Not Found (command dependent on ATA4+)39 FLG_ IDE_ERR_MCR EQU (1<<3) ; Media Change Request (command dependent on ATA4+)40 FLG_ IDE_ERR_ABRTEQU (1<<2) ; Command Aborted41 FLG_ IDE_ERR_TK0NFEQU (1<<1) ; Track 0 Not Found (command dependent on ATA4+)42 FLG_ IDE_ERR_AMNFEQU (1<<0) ; Address Mark Not Found (command dependent on ATA4+)33 FLG_ERROR_BBK EQU (1<<7) ; Bad Block Detected (reserved on ATA2+, command dependent on ATA4+) 34 FLG_ERROR_UNC EQU (1<<6) ; Uncorrectable Data Error (command dependent on ATA4+) 35 FLG_ERROR_MC EQU (1<<5) ; Media Changed (command dependent on ATA4+) 36 FLG_ERROR_IDNF EQU (1<<4) ; ID Not Found (command dependent on ATA4+) 37 FLG_ERROR_MCR EQU (1<<3) ; Media Change Request (command dependent on ATA4+) 38 FLG_ERROR_ABRT EQU (1<<2) ; Command Aborted 39 FLG_ERROR_TK0NF EQU (1<<1) ; Track 0 Not Found (command dependent on ATA4+) 40 FLG_ERROR_AMNF EQU (1<<0) ; Address Mark Not Found (command dependent on ATA4+) 43 41 44 42 ; Bit definitions for IDE Drive and Head Select Register 45 FLG_ IDE_DRVHD_LBA EQU (1<<6) ; LBA Addressing enabled (instead of CHS)46 FLG_ IDE_DRVHD_DRV EQU (1<<4) ; Drive Select (0=Master, 1=Slave)47 MASK_ IDE_DRVHD_HEAD EQU 0Fh ; Head select bits (bits 0...3)48 MASK_ IDE_DRVHD_SET EQU 0A0h ; Bits that must be set to 1 on ATA1 (reserved on ATA2+)43 FLG_DRVNHEAD_LBA EQU (1<<6) ; LBA Addressing enabled (instead of CHS) 44 FLG_DRVNHEAD_DRV EQU (1<<4) ; Drive Select (0=Master, 1=Slave) 45 MASK_DRVNHEAD_HEAD EQU 0Fh ; Head select bits (bits 0...3) 46 MASK_DRVNHEAD_SET EQU 0A0h ; Bits that must be set to 1 on ATA1 (reserved on ATA2+) 49 47 50 48 ; Bit definitions for IDE Status Register 51 FLG_ IDE_ST_BSY EQU (1<<7) ; Busy (other flags undefined when set)52 FLG_ IDE_ST_DRDY EQU (1<<6) ; Device Ready53 FLG_ IDE_ST_DF EQU (1<<5) ; Device Fault (command dependent on ATA4+)54 FLG_ IDE_ST_DSC EQU (1<<4) ; Device Seek Complete (command dependent on ATA4+)55 FLG_ IDE_ST_DRQ EQU (1<<3) ; Data Request56 FLG_ IDE_ST_CORR EQU (1<<2) ; Corrected Data (obsolete on ATA4+)57 FLG_ IDE_ST_IDX EQU (1<<1) ; Index (vendor specific on ATA2+, obsolete on ATA4+)58 FLG_ IDE_ST_ERR EQU (1<<0) ; Error49 FLG_STATUS_BSY EQU (1<<7) ; Busy (other flags undefined when set) 50 FLG_STATUS_DRDY EQU (1<<6) ; Device Ready 51 FLG_STATUS_DF EQU (1<<5) ; Device Fault (command dependent on ATA4+) 52 FLG_STATUS_DSC EQU (1<<4) ; Device Seek Complete (command dependent on ATA4+) 53 FLG_STATUS_DRQ EQU (1<<3) ; Data Request 54 FLG_STATUS_CORR EQU (1<<2) ; Corrected Data (obsolete on ATA4+) 55 FLG_STATUS_IDX EQU (1<<1) ; Index (vendor specific on ATA2+, obsolete on ATA4+) 56 FLG_STATUS_ERR EQU (1<<0) ; Error 59 57 60 58 ; Bit definitions for IDE Device Control Register 61 59 ; Bit 0 must be zero, unlisted bits are reserved. 62 FLG_ IDE_CTRL_O8H EQU (1<<3) ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+)63 FLG_IDE_CTRL_SRST EQU (1<<2) ; Software Reset 64 FLG_ IDE_CTRL_nIEN EQU (1<<1) ; Negated Interrupt Enable (IRQ disabled when set)65 60 FLG_DEVCONTROL_HOB EQU (1<<7) ; High Order Byte (ATA6+) 61 ;FLG_DEVCONTROL_O8H EQU (1<<3) ; Drive has more than 8 heads (pre-ATA only, 1 on ATA1, reserved on ATA2+) 62 FLG_DEVCONTROL_SRST EQU (1<<2) ; Software Reset 63 FLG_DEVCONTROL_nIEN EQU (1<<1) ; Negated Interrupt Enable (IRQ disabled when set) 66 64 67 65 ; Commands for IDE Controller 68 ;HCMD_RECALIBRATE EQU 10h ; Recalibrate 69 HCMD_READ_SECT EQU 20h ; Read Sectors (with retries) 70 HCMD_WRITE_SECT EQU 30h ; Write Sectors (with retries) 71 HCMD_VERIFY_SECT EQU 40h ; Read Verify Sectors (with retries) 72 ;HCMD_FORMAT EQU 50h ; Format track 73 HCMD_SEEK EQU 70h ; Seek 74 ;HCMD_DIAGNOSTIC EQU 90h ; Execute Device Diagnostic 75 HCMD_INIT_DEV EQU 91h ; Initialize Device Parameters 76 HCMD_READ_MUL EQU 0C4h ; Read Multiple (=block) 77 HCMD_WRITE_MUL EQU 0C5h ; Write Multiple (=block) 78 HCMD_SET_MUL EQU 0C6h ; Set Multiple Mode (=block size) 79 HCMD_ID_DEV EQU 0ECh ; Identify Device 80 HCMD_SET_FEAT EQU 0EFh ; Set Features 81 82 ; Set Features subcommands 83 HFEAT_SET_XFER_MODE EQU 03h ; Set transfer mode based on value in Sector Count register 66 COMMAND_READ_SECTORS EQU 20h 67 COMMAND_READ_SECTORS_EXT EQU 24h ; LBA48 68 COMMAND_WRITE_SECTORS EQU 30h 69 COMMAND_WRITE_SECTORS_EXT EQU 34h ; LBA48 70 COMMAND_VERIFY_SECTORS EQU 40h 71 COMMAND_VERIFY_SECTORS_EXT EQU 42h ; LBA48 72 COMMAND_SEEK EQU 70h 73 COMMAND_INITIALIZE_DEVICE_PARAMETERS EQU 91h 74 COMMAND_SET_MULTIPLE_MODE EQU 0C6h ; Block mode 75 COMMAND_READ_MULTIPLE EQU 0C4h ; Block mode 76 COMMAND_READ_MULTIPLE_EXT EQU 29h ; LBA48, Block mode 77 COMMAND_WRITE_MULTIPLE EQU 0C5h ; Block mode 78 COMMAND_WRITE_MULTIPLE_EXT EQU 39h ; LBA48, Block mode 79 COMMAND_IDENTIFY_DEVICE EQU 0ECh 80 COMMAND_SET_FEATURES EQU 0EFh 84 81 85 82
Note:
See TracChangeset
for help on using the changeset viewer.