revert between 56095 -> 55830 in arch
[AROS.git] / rom / devs / ata / include / hardware / ata.h
blob7373c49f77ef8a64e721ec0b1c44e05bf77f2a47
1 #ifndef _HARDWARE_ATA_H
2 #define _HARDWARE_ATA_H
4 /*
5 Copyright © 2004-2019, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: ATA hardware register definitions
9 Lang: English
12 /* Registers */
13 #define ata_Error 1
14 #define ata_Feature 1
15 #define ata_Count 2
16 #define ata_LBALow 3
17 #define ata_Sector 3
18 #define ata_LBAMid 4
19 #define ata_CylinderLow 4
20 #define ata_LBAHigh 5
21 #define ata_CylinderHigh 5
22 #define ata_DevHead 6
23 #define ata_Status 7
24 #define ata_Command 7
25 #define ata_AltStatus 0x2
26 #define ata_AltControl 0x2
28 #define atapi_Error 1
29 #define atapi_Features 1
30 #define atapi_Reason 2
31 #define atapi_ByteCntL 4
32 #define atapi_ByteCntH 5
33 #define atapi_DevSel 6
34 #define atapi_Status 7
35 #define atapi_Command 7
37 /* Status bits */
38 #define ATAB_SLAVE 4
39 #define ATAB_LBA 6
40 #define ATAB_ATAPI 7
41 #define ATAB_DATAREQ 3
42 #define ATAB_ERROR 0
43 #define ATAB_BUSY 7
45 #define ATAF_SLAVE 0x10
46 #define ATAF_LBA 0x40
47 #define ATAF_ATAPI 0x80
48 #define ATAF_DATAREQ 0x08
49 #define ATAF_ERROR 0x01
50 #define ATAF_BUSY 0x80
51 #define ATAF_DRDY 0x40
53 #define ATAPIF_CHECK 0x01
55 /* Commands */
56 #define ATA_RECALIBRATE 0x10
58 #define ATA_IDENTIFY_DEVICE 0xEC
59 #define ATA_CHECK_POWER_MODE 0xE5
60 #define ATA_STANDBY 0xE2
61 #define ATA_STANDBY_IMMED 0xE0
62 #define ATA_STANDBY_IMMEDIATE ATA_STANDBY_IMMED
63 #define ATA_IDLE_IMMED 0xE1
64 #define ATA_IDLE_IMMEDIATE ATA_IDLE_IMMED
65 #define ATA_IDLE 0xE3
66 #define ATA_FLUSH_CACHE 0xE7
67 #define ATA_FLUSH_CACHE_EXT 0xEA
68 #define ATA_READ_DMA_EXT 0x25
69 #define ATA_READ_DMA64 ATA_READ_DMA_EXT
70 #define ATA_READ_DMA 0xC8
71 #define ATA_READ_SECTORS_EXT 0x24
72 #define ATA_READ64 ATA_READ_SECTORS_EXT
73 #define ATA_READ_SECTORS 0x20
74 #define ATA_READ ATA_READ_SECTORS
75 #define ATA_WRITE_DMA_EXT 0x35
76 #define ATA_WRITE_DMA64 ATA_WRITE_DMA_EXT
77 #define ATA_WRITE_DMA 0xCA
78 #define ATA_WRITE_SECTORS_EXT 0x34
79 #define ATA_WRITE64 ATA_WRITE_SECTORS_EXT
80 #define ATA_WRITE_SECTORS 0x30
81 #define ATA_WRITE ATA_WRITE_SECTORS
82 #define ATA_WRITE_UNCORRECTABLE 0x45
83 #define ATA_READ_VERIFY_SECTORS 0x40
84 #define ATA_READ_VERIFY_SECTORS_EXT 0x42
85 #define ATA_READ_BUFFER 0xE4
86 #define ATA_WRITE_BUFFER 0xE8
87 #define ATA_EXECUTE_DEVICE_DIAG 0x90
88 #define ATA_EXECUTE_DIAG ATA_EXECUTE_DEVICE_DIAG
89 #define ATA_SET_FEATURES 0xEF
90 #define ATA_SMART 0xB0
91 #define ATA_PACKET_IDENTIFY 0xA1
92 #define ATA_IDENTIFY_ATAPI ATA_PACKET_IDENTIFY
93 #define ATA_PACKET 0xA0
94 #define ATA_READ_FPDMA 0x60
95 #define ATA_WRITE_FPDMA 0x61
96 #define ATA_READ_LOG_EXT 0x2F
97 #define ATA_NOP 0x00
98 #define ATA_DEVICE_RESET 0x08
99 #define ATA_MEDIA_EJECT 0xED
100 #define ATA_SECURITY_UNLOCK 0xF2
101 #define ATA_SECURITY_FREEZE_LOCK 0xF5
102 #define ATA_DATA_SET_MANAGEMENT 0x06
103 #define ATA_DOWNLOAD_MICROCODE 0x92
104 #define ATA_WRITE_STREAM_DMA_EXT 0x3A
105 #define ATA_READ_LOG_DMA_EXT 0x47
106 #define ATA_READ_STREAM_DMA_EXT 0x2A
107 #define ATA_WRITE_DMA_FUA 0x3D
108 #define ATA_WRITE_LOG_DMA_EXT 0x57
109 #define ATA_READ_DMA_QUEUED 0xC7
110 #define ATA_READ_DMA_QUEUED_EXT 0x26
111 #define ATA_WRITE_DMA_QUEUED 0xCC
112 #define ATA_WRITE_DMA_QUEUED_EXT 0x36
113 #define ATA_WRITE_DMA_QUEUED_FUA_EXT 0x3E
114 #define ATA_SET_MULTIPLE 0XC6
115 #define ATA_READ_MULTIPLE 0xC4
116 #define ATA_READ_MULTIPLE_EXT 0x29
117 #define ATA_READ_MULTIPLE64 ATA_READ_MULTIPLE_EXT
118 #define ATA_WRITE_MULTIPLE 0xC5
119 #define ATA_WRITE_MULTIPLE_EXT 0x39
120 #define ATA_WRITE_MULTIPLE64 ATA_WRITE_MULTIPLE_EXT
121 #define ATA_WRITE_MULTIPLE_FUA_EXT 0xCE
123 #define ATA_DEVICE_CONFIG_IDENTIFY 0xB1
124 #define ATA_DEVICE_CONFIG_ID_FEATURES 0xC2
127 /* SET_FEATURES sub-commands */
128 #define ATA_SET_FEATURES_ENABLE_CACHE 0x02
129 #define ATA_SET_FEATURES_DISABLE_CACHE 0x82
130 #define ATA_SET_FEATURES_DISABLE_READ_AHEAD 0x55
131 #define ATA_SET_FEATURES_ENABLE_READ_AHEAD 0xAA
132 #define ATA_SET_FEATURES_SET_TRANSFER_MODE 0x03
134 /* ATAPI reason flags */
135 #define ATAPIF_MASK 0x03
136 #define ATAPIF_COMMAND 0x01
137 #define ATAPIF_READ 0x02
138 #define ATAPIF_WRITE 0x00
140 /* AltControl bits */
141 #define ATACTLF_INT_DISABLE 0x02
142 #define ATACTLF_RESET 0x04
144 #endif