diff options
author | Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | 2013-11-05 06:37:09 -0500 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-11-08 11:10:30 -0500 |
commit | f1a3c6191369632ada5b709997b91a7f15045ff4 (patch) | |
tree | 12c79235cef48082be57f53b832acdfdab74d02c /drivers/block/skd_s1120.h | |
parent | 542d7b0015b8cb30d7c0772657408c6a6e9a8675 (diff) |
skd: fix formatting in skd_s1120.h
Cc: Akhil Bhansali <abhansali@stec-inc.com>
Cc: Jeff Moyer <jmoyer@redhat.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/skd_s1120.h')
-rw-r--r-- | drivers/block/skd_s1120.h | 230 |
1 files changed, 110 insertions, 120 deletions
diff --git a/drivers/block/skd_s1120.h b/drivers/block/skd_s1120.h index 426581e6d170..61c757ff0161 100644 --- a/drivers/block/skd_s1120.h +++ b/drivers/block/skd_s1120.h | |||
@@ -17,30 +17,29 @@ | |||
17 | /* | 17 | /* |
18 | * Q-channel, 64-bit r/w | 18 | * Q-channel, 64-bit r/w |
19 | */ | 19 | */ |
20 | #define FIT_Q_COMMAND 0x400u | 20 | #define FIT_Q_COMMAND 0x400u |
21 | #define FIT_QCMD_QID_MASK (0x3 << 1) | 21 | #define FIT_QCMD_QID_MASK (0x3 << 1) |
22 | #define FIT_QCMD_QID0 (0x0 << 1) | 22 | #define FIT_QCMD_QID0 (0x0 << 1) |
23 | #define FIT_QCMD_QID_NORMAL FIT_QCMD_QID0 | 23 | #define FIT_QCMD_QID_NORMAL FIT_QCMD_QID0 |
24 | #define FIT_QCMD_QID1 (0x1 << 1) | 24 | #define FIT_QCMD_QID1 (0x1 << 1) |
25 | #define FIT_QCMD_QID2 (0x2 << 1) | 25 | #define FIT_QCMD_QID2 (0x2 << 1) |
26 | #define FIT_QCMD_QID3 (0x3 << 1) | 26 | #define FIT_QCMD_QID3 (0x3 << 1) |
27 | #define FIT_QCMD_FLUSH_QUEUE (0ull) /* add QID */ | 27 | #define FIT_QCMD_FLUSH_QUEUE (0ull) /* add QID */ |
28 | #define FIT_QCMD_MSGSIZE_MASK (0x3 << 4) | 28 | #define FIT_QCMD_MSGSIZE_MASK (0x3 << 4) |
29 | #define FIT_QCMD_MSGSIZE_64 (0x0 << 4) | 29 | #define FIT_QCMD_MSGSIZE_64 (0x0 << 4) |
30 | #define FIT_QCMD_MSGSIZE_128 (0x1 << 4) | 30 | #define FIT_QCMD_MSGSIZE_128 (0x1 << 4) |
31 | #define FIT_QCMD_MSGSIZE_256 (0x2 << 4) | 31 | #define FIT_QCMD_MSGSIZE_256 (0x2 << 4) |
32 | #define FIT_QCMD_MSGSIZE_512 (0x3 << 4) | 32 | #define FIT_QCMD_MSGSIZE_512 (0x3 << 4) |
33 | #define FIT_QCMD_BASE_ADDRESS_MASK (0xFFFFFFFFFFFFFFC0ull) | 33 | #define FIT_QCMD_BASE_ADDRESS_MASK (0xFFFFFFFFFFFFFFC0ull) |
34 | |||
35 | 34 | ||
36 | /* | 35 | /* |
37 | * Control, 32-bit r/w | 36 | * Control, 32-bit r/w |
38 | */ | 37 | */ |
39 | #define FIT_CONTROL 0x500u | 38 | #define FIT_CONTROL 0x500u |
40 | #define FIT_CR_HARD_RESET (1u << 0u) | 39 | #define FIT_CR_HARD_RESET (1u << 0u) |
41 | #define FIT_CR_SOFT_RESET (1u << 1u) | 40 | #define FIT_CR_SOFT_RESET (1u << 1u) |
42 | #define FIT_CR_DIS_TIMESTAMPS (1u << 6u) | 41 | #define FIT_CR_DIS_TIMESTAMPS (1u << 6u) |
43 | #define FIT_CR_ENABLE_INTERRUPTS (1u << 7u) | 42 | #define FIT_CR_ENABLE_INTERRUPTS (1u << 7u) |
44 | 43 | ||
45 | /* | 44 | /* |
46 | * Status, 32-bit, r/o | 45 | * Status, 32-bit, r/o |
@@ -63,88 +62,82 @@ | |||
63 | #define FIT_SR_DRIVE_BUSY_ERASE 0x0B | 62 | #define FIT_SR_DRIVE_BUSY_ERASE 0x0B |
64 | #define FIT_SR_DRIVE_FW_BOOTING 0x0C | 63 | #define FIT_SR_DRIVE_FW_BOOTING 0x0C |
65 | #define FIT_SR_DRIVE_NEED_FW_DOWNLOAD 0xFE | 64 | #define FIT_SR_DRIVE_NEED_FW_DOWNLOAD 0xFE |
66 | #define FIT_SR_DEVICE_MISSING 0xFF | 65 | #define FIT_SR_DEVICE_MISSING 0xFF |
67 | #define FIT_SR__RESERVED 0xFFFFFF00u | 66 | #define FIT_SR__RESERVED 0xFFFFFF00u |
68 | 67 | ||
69 | /* | 68 | /* |
70 | * FIT_STATUS - Status register data definition | 69 | * FIT_STATUS - Status register data definition |
71 | */ | 70 | */ |
72 | #define FIT_SR_STATE_MASK (0xFF << 0) | 71 | #define FIT_SR_STATE_MASK (0xFF << 0) |
73 | #define FIT_SR_SIGNATURE (0xFF << 8) | 72 | #define FIT_SR_SIGNATURE (0xFF << 8) |
74 | #define FIT_SR_PIO_DMA (1 << 16) | 73 | #define FIT_SR_PIO_DMA (1 << 16) |
75 | |||
76 | 74 | ||
77 | /* | 75 | /* |
78 | * Interrupt status, 32-bit r/w1c (w1c ==> write 1 to clear) | 76 | * Interrupt status, 32-bit r/w1c (w1c ==> write 1 to clear) |
79 | */ | 77 | */ |
80 | #define FIT_INT_STATUS_HOST 0x520u | 78 | #define FIT_INT_STATUS_HOST 0x520u |
81 | #define FIT_ISH_FW_STATE_CHANGE (1u << 0u) | 79 | #define FIT_ISH_FW_STATE_CHANGE (1u << 0u) |
82 | #define FIT_ISH_COMPLETION_POSTED (1u << 1u) | 80 | #define FIT_ISH_COMPLETION_POSTED (1u << 1u) |
83 | #define FIT_ISH_MSG_FROM_DEV (1u << 2u) | 81 | #define FIT_ISH_MSG_FROM_DEV (1u << 2u) |
84 | #define FIT_ISH_UNDEFINED_3 (1u << 3u) | 82 | #define FIT_ISH_UNDEFINED_3 (1u << 3u) |
85 | #define FIT_ISH_UNDEFINED_4 (1u << 4u) | 83 | #define FIT_ISH_UNDEFINED_4 (1u << 4u) |
86 | #define FIT_ISH_Q0_FULL (1u << 5u) | 84 | #define FIT_ISH_Q0_FULL (1u << 5u) |
87 | #define FIT_ISH_Q1_FULL (1u << 6u) | 85 | #define FIT_ISH_Q1_FULL (1u << 6u) |
88 | #define FIT_ISH_Q2_FULL (1u << 7u) | 86 | #define FIT_ISH_Q2_FULL (1u << 7u) |
89 | #define FIT_ISH_Q3_FULL (1u << 8u) | 87 | #define FIT_ISH_Q3_FULL (1u << 8u) |
90 | #define FIT_ISH_QCMD_FIFO_OVERRUN (1u << 9u) | 88 | #define FIT_ISH_QCMD_FIFO_OVERRUN (1u << 9u) |
91 | #define FIT_ISH_BAD_EXP_ROM_READ (1u << 10u) | 89 | #define FIT_ISH_BAD_EXP_ROM_READ (1u << 10u) |
92 | 90 | ||
93 | 91 | #define FIT_INT_DEF_MASK \ | |
94 | #define FIT_INT_DEF_MASK \ | 92 | (FIT_ISH_FW_STATE_CHANGE | \ |
95 | (FIT_ISH_FW_STATE_CHANGE | \ | 93 | FIT_ISH_COMPLETION_POSTED | \ |
96 | FIT_ISH_COMPLETION_POSTED | \ | 94 | FIT_ISH_MSG_FROM_DEV | \ |
97 | FIT_ISH_MSG_FROM_DEV | \ | 95 | FIT_ISH_Q0_FULL | \ |
98 | FIT_ISH_Q0_FULL | \ | 96 | FIT_ISH_Q1_FULL | \ |
99 | FIT_ISH_Q1_FULL | \ | 97 | FIT_ISH_Q2_FULL | \ |
100 | FIT_ISH_Q2_FULL | \ | 98 | FIT_ISH_Q3_FULL | \ |
101 | FIT_ISH_Q3_FULL | \ | 99 | FIT_ISH_QCMD_FIFO_OVERRUN | \ |
102 | FIT_ISH_QCMD_FIFO_OVERRUN | \ | 100 | FIT_ISH_BAD_EXP_ROM_READ) |
103 | FIT_ISH_BAD_EXP_ROM_READ) | 101 | |
104 | 102 | #define FIT_INT_QUEUE_FULL \ | |
105 | #define FIT_INT_QUEUE_FULL \ | 103 | (FIT_ISH_Q0_FULL | \ |
106 | (FIT_ISH_Q0_FULL | \ | 104 | FIT_ISH_Q1_FULL | \ |
107 | FIT_ISH_Q1_FULL | \ | 105 | FIT_ISH_Q2_FULL | \ |
108 | FIT_ISH_Q2_FULL | \ | 106 | FIT_ISH_Q3_FULL) |
109 | FIT_ISH_Q3_FULL) | 107 | |
110 | 108 | #define MSI_MSG_NWL_ERROR_0 0x00000000 | |
111 | 109 | #define MSI_MSG_NWL_ERROR_1 0x00000001 | |
112 | #define MSI_MSG_NWL_ERROR_0 0x00000000 | 110 | #define MSI_MSG_NWL_ERROR_2 0x00000002 |
113 | #define MSI_MSG_NWL_ERROR_1 0x00000001 | 111 | #define MSI_MSG_NWL_ERROR_3 0x00000003 |
114 | #define MSI_MSG_NWL_ERROR_2 0x00000002 | 112 | #define MSI_MSG_STATE_CHANGE 0x00000004 |
115 | #define MSI_MSG_NWL_ERROR_3 0x00000003 | 113 | #define MSI_MSG_COMPLETION_POSTED 0x00000005 |
116 | #define MSI_MSG_STATE_CHANGE 0x00000004 | 114 | #define MSI_MSG_MSG_FROM_DEV 0x00000006 |
117 | #define MSI_MSG_COMPLETION_POSTED 0x00000005 | 115 | #define MSI_MSG_RESERVED_0 0x00000007 |
118 | #define MSI_MSG_MSG_FROM_DEV 0x00000006 | 116 | #define MSI_MSG_RESERVED_1 0x00000008 |
119 | #define MSI_MSG_RESERVED_0 0x00000007 | 117 | #define MSI_MSG_QUEUE_0_FULL 0x00000009 |
120 | #define MSI_MSG_RESERVED_1 0x00000008 | 118 | #define MSI_MSG_QUEUE_1_FULL 0x0000000A |
121 | #define MSI_MSG_QUEUE_0_FULL 0x00000009 | 119 | #define MSI_MSG_QUEUE_2_FULL 0x0000000B |
122 | #define MSI_MSG_QUEUE_1_FULL 0x0000000A | 120 | #define MSI_MSG_QUEUE_3_FULL 0x0000000C |
123 | #define MSI_MSG_QUEUE_2_FULL 0x0000000B | 121 | |
124 | #define MSI_MSG_QUEUE_3_FULL 0x0000000C | 122 | #define FIT_INT_RESERVED_MASK \ |
125 | 123 | (FIT_ISH_UNDEFINED_3 | \ | |
126 | 124 | FIT_ISH_UNDEFINED_4) | |
127 | 125 | ||
128 | #define FIT_INT_RESERVED_MASK \ | ||
129 | (FIT_ISH_UNDEFINED_3 | \ | ||
130 | FIT_ISH_UNDEFINED_4) | ||
131 | /* | 126 | /* |
132 | * Interrupt mask, 32-bit r/w | 127 | * Interrupt mask, 32-bit r/w |
133 | * Bit definitions are the same as FIT_INT_STATUS_HOST | 128 | * Bit definitions are the same as FIT_INT_STATUS_HOST |
134 | */ | 129 | */ |
135 | #define FIT_INT_MASK_HOST 0x528u | 130 | #define FIT_INT_MASK_HOST 0x528u |
136 | |||
137 | 131 | ||
138 | /* | 132 | /* |
139 | * Message to device, 32-bit r/w | 133 | * Message to device, 32-bit r/w |
140 | */ | 134 | */ |
141 | #define FIT_MSG_TO_DEVICE 0x540u | 135 | #define FIT_MSG_TO_DEVICE 0x540u |
142 | 136 | ||
143 | /* | 137 | /* |
144 | * Message from device, 32-bit, r/o | 138 | * Message from device, 32-bit, r/o |
145 | */ | 139 | */ |
146 | #define FIT_MSG_FROM_DEVICE 0x548u | 140 | #define FIT_MSG_FROM_DEVICE 0x548u |
147 | |||
148 | 141 | ||
149 | /* | 142 | /* |
150 | * 32-bit messages to/from device, composition/extraction macros | 143 | * 32-bit messages to/from device, composition/extraction macros |
@@ -153,52 +146,50 @@ | |||
153 | ((((TYPE) & 0xFFu) << 24u) | \ | 146 | ((((TYPE) & 0xFFu) << 24u) | \ |
154 | (((PARAM) & 0xFFu) << 16u) | \ | 147 | (((PARAM) & 0xFFu) << 16u) | \ |
155 | (((DATA) & 0xFFFFu) << 0u)) | 148 | (((DATA) & 0xFFFFu) << 0u)) |
156 | #define FIT_MXD_TYPE(MXD) (((MXD) >> 24u) & 0xFFu) | 149 | #define FIT_MXD_TYPE(MXD) (((MXD) >> 24u) & 0xFFu) |
157 | #define FIT_MXD_PARAM(MXD) (((MXD) >> 16u) & 0xFFu) | 150 | #define FIT_MXD_PARAM(MXD) (((MXD) >> 16u) & 0xFFu) |
158 | #define FIT_MXD_DATA(MXD) (((MXD) >> 0u) & 0xFFFFu) | 151 | #define FIT_MXD_DATA(MXD) (((MXD) >> 0u) & 0xFFFFu) |
159 | |||
160 | 152 | ||
161 | /* | 153 | /* |
162 | * Types of messages to/from device | 154 | * Types of messages to/from device |
163 | */ | 155 | */ |
164 | #define FIT_MTD_FITFW_INIT 0x01u | 156 | #define FIT_MTD_FITFW_INIT 0x01u |
165 | #define FIT_MTD_GET_CMDQ_DEPTH 0x02u | 157 | #define FIT_MTD_GET_CMDQ_DEPTH 0x02u |
166 | #define FIT_MTD_SET_COMPQ_DEPTH 0x03u | 158 | #define FIT_MTD_SET_COMPQ_DEPTH 0x03u |
167 | #define FIT_MTD_SET_COMPQ_ADDR 0x04u | 159 | #define FIT_MTD_SET_COMPQ_ADDR 0x04u |
168 | #define FIT_MTD_ARM_QUEUE 0x05u | 160 | #define FIT_MTD_ARM_QUEUE 0x05u |
169 | #define FIT_MTD_CMD_LOG_HOST_ID 0x07u | 161 | #define FIT_MTD_CMD_LOG_HOST_ID 0x07u |
170 | #define FIT_MTD_CMD_LOG_TIME_STAMP_LO 0x08u | 162 | #define FIT_MTD_CMD_LOG_TIME_STAMP_LO 0x08u |
171 | #define FIT_MTD_CMD_LOG_TIME_STAMP_HI 0x09u | 163 | #define FIT_MTD_CMD_LOG_TIME_STAMP_HI 0x09u |
172 | #define FIT_MFD_SMART_EXCEEDED 0x10u | 164 | #define FIT_MFD_SMART_EXCEEDED 0x10u |
173 | #define FIT_MFD_POWER_DOWN 0x11u | 165 | #define FIT_MFD_POWER_DOWN 0x11u |
174 | #define FIT_MFD_OFFLINE 0x12u | 166 | #define FIT_MFD_OFFLINE 0x12u |
175 | #define FIT_MFD_ONLINE 0x13u | 167 | #define FIT_MFD_ONLINE 0x13u |
176 | #define FIT_MFD_FW_RESTARTING 0x14u | 168 | #define FIT_MFD_FW_RESTARTING 0x14u |
177 | #define FIT_MFD_PM_ACTIVE 0x15u | 169 | #define FIT_MFD_PM_ACTIVE 0x15u |
178 | #define FIT_MFD_PM_STANDBY 0x16u | 170 | #define FIT_MFD_PM_STANDBY 0x16u |
179 | #define FIT_MFD_PM_SLEEP 0x17u | 171 | #define FIT_MFD_PM_SLEEP 0x17u |
180 | #define FIT_MFD_CMD_PROGRESS 0x18u | 172 | #define FIT_MFD_CMD_PROGRESS 0x18u |
181 | 173 | ||
182 | #define FIT_MTD_DEBUG 0xFEu | 174 | #define FIT_MTD_DEBUG 0xFEu |
183 | #define FIT_MFD_DEBUG 0xFFu | 175 | #define FIT_MFD_DEBUG 0xFFu |
184 | 176 | ||
185 | #define FIT_MFD_MASK (0xFFu) | 177 | #define FIT_MFD_MASK (0xFFu) |
186 | #define FIT_MFD_DATA_MASK (0xFFu) | 178 | #define FIT_MFD_DATA_MASK (0xFFu) |
187 | #define FIT_MFD_MSG(x) (((x) >> 24) & FIT_MFD_MASK) | 179 | #define FIT_MFD_MSG(x) (((x) >> 24) & FIT_MFD_MASK) |
188 | #define FIT_MFD_DATA(x) ((x) & FIT_MFD_MASK) | 180 | #define FIT_MFD_DATA(x) ((x) & FIT_MFD_MASK) |
189 | 181 | ||
190 | |||
191 | /* | 182 | /* |
192 | * Extra arg to FIT_MSG_TO_DEVICE, 64-bit r/w | 183 | * Extra arg to FIT_MSG_TO_DEVICE, 64-bit r/w |
193 | * Used to set completion queue address (FIT_MTD_SET_COMPQ_ADDR) | 184 | * Used to set completion queue address (FIT_MTD_SET_COMPQ_ADDR) |
194 | * (was Response buffer in docs) | 185 | * (was Response buffer in docs) |
195 | */ | 186 | */ |
196 | #define FIT_MSG_TO_DEVICE_ARG 0x580u | 187 | #define FIT_MSG_TO_DEVICE_ARG 0x580u |
197 | 188 | ||
198 | /* | 189 | /* |
199 | * Hardware (ASIC) version, 32-bit r/o | 190 | * Hardware (ASIC) version, 32-bit r/o |
200 | */ | 191 | */ |
201 | #define FIT_HW_VERSION 0x588u | 192 | #define FIT_HW_VERSION 0x588u |
202 | 193 | ||
203 | /* | 194 | /* |
204 | * Scatter/gather list descriptor. | 195 | * Scatter/gather list descriptor. |
@@ -213,8 +204,8 @@ struct fit_sg_descriptor { | |||
213 | uint64_t next_desc_ptr; | 204 | uint64_t next_desc_ptr; |
214 | }; | 205 | }; |
215 | 206 | ||
216 | #define FIT_SGD_CONTROL_NOT_LAST 0x000u | 207 | #define FIT_SGD_CONTROL_NOT_LAST 0x000u |
217 | #define FIT_SGD_CONTROL_LAST 0x40Eu | 208 | #define FIT_SGD_CONTROL_LAST 0x40Eu |
218 | 209 | ||
219 | /* | 210 | /* |
220 | * Header at the beginning of a FIT message. The header | 211 | * Header at the beginning of a FIT message. The header |
@@ -228,9 +219,9 @@ struct fit_msg_hdr { | |||
228 | uint8_t _reserved[62]; | 219 | uint8_t _reserved[62]; |
229 | }; | 220 | }; |
230 | 221 | ||
231 | #define FIT_PROTOCOL_ID_FIT 1 | 222 | #define FIT_PROTOCOL_ID_FIT 1 |
232 | #define FIT_PROTOCOL_ID_SSDI 2 | 223 | #define FIT_PROTOCOL_ID_SSDI 2 |
233 | #define FIT_PROTOCOL_ID_SOFIT 3 | 224 | #define FIT_PROTOCOL_ID_SOFIT 3 |
234 | 225 | ||
235 | 226 | ||
236 | #define FIT_PROTOCOL_MINOR_VER(mtd_val) ((mtd_val >> 16) & 0xF) | 227 | #define FIT_PROTOCOL_MINOR_VER(mtd_val) ((mtd_val >> 16) & 0xF) |
@@ -251,7 +242,7 @@ struct fit_msg_hdr { | |||
251 | * Command_context is opaque and taken verbatim from the SSDI command. | 242 | * Command_context is opaque and taken verbatim from the SSDI command. |
252 | * All other fields are big endian. | 243 | * All other fields are big endian. |
253 | */ | 244 | */ |
254 | #define FIT_PROTOCOL_VERSION_0 0 | 245 | #define FIT_PROTOCOL_VERSION_0 0 |
255 | 246 | ||
256 | /* | 247 | /* |
257 | * Protocol major version 1 completion entry. | 248 | * Protocol major version 1 completion entry. |
@@ -264,8 +255,8 @@ struct fit_completion_entry_v1 { | |||
264 | uint8_t status; /* SCSI status */ | 255 | uint8_t status; /* SCSI status */ |
265 | uint8_t cycle; | 256 | uint8_t cycle; |
266 | }; | 257 | }; |
267 | #define FIT_PROTOCOL_VERSION_1 1 | 258 | #define FIT_PROTOCOL_VERSION_1 1 |
268 | #define FIT_PROTOCOL_VERSION_CURRENT FIT_PROTOCOL_VERSION_1 | 259 | #define FIT_PROTOCOL_VERSION_CURRENT FIT_PROTOCOL_VERSION_1 |
269 | 260 | ||
270 | struct fit_comp_error_info { | 261 | struct fit_comp_error_info { |
271 | uint8_t type:7; /* 00: Bits0-6 indicates the type of sense data. */ | 262 | uint8_t type:7; /* 00: Bits0-6 indicates the type of sense data. */ |
@@ -293,10 +284,9 @@ struct fit_comp_error_info { | |||
293 | 284 | ||
294 | 285 | ||
295 | /* Task management constants */ | 286 | /* Task management constants */ |
296 | #define SOFT_TASK_SIMPLE 0x00 | 287 | #define SOFT_TASK_SIMPLE 0x00 |
297 | #define SOFT_TASK_HEAD_OF_QUEUE 0x01 | 288 | #define SOFT_TASK_HEAD_OF_QUEUE 0x01 |
298 | #define SOFT_TASK_ORDERED 0x02 | 289 | #define SOFT_TASK_ORDERED 0x02 |
299 | |||
300 | 290 | ||
301 | /* Version zero has the last 32 bits reserved, | 291 | /* Version zero has the last 32 bits reserved, |
302 | * Version one has the last 32 bits sg_list_len_bytes; | 292 | * Version one has the last 32 bits sg_list_len_bytes; |