44 #define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0"
74 # define PERF_MODE_INT 0
75 # define DOORBELL_INT 1
76 # define SIMPLE_MODE_INT 2
77 # define MEMQ_MODE_INT 3
139 #define HPSATMF_BITS_SUPPORTED (1 << 0)
140 #define HPSATMF_PHYS_LUN_RESET (1 << 1)
141 #define HPSATMF_PHYS_NEX_RESET (1 << 2)
142 #define HPSATMF_PHYS_TASK_ABORT (1 << 3)
143 #define HPSATMF_PHYS_TSET_ABORT (1 << 4)
144 #define HPSATMF_PHYS_CLEAR_ACA (1 << 5)
145 #define HPSATMF_PHYS_CLEAR_TSET (1 << 6)
146 #define HPSATMF_PHYS_QRY_TASK (1 << 7)
147 #define HPSATMF_PHYS_QRY_TSET (1 << 8)
148 #define HPSATMF_PHYS_QRY_ASYNC (1 << 9)
149 #define HPSATMF_MASK_SUPPORTED (1 << 16)
150 #define HPSATMF_LOG_LUN_RESET (1 << 17)
151 #define HPSATMF_LOG_NEX_RESET (1 << 18)
152 #define HPSATMF_LOG_TASK_ABORT (1 << 19)
153 #define HPSATMF_LOG_TSET_ABORT (1 << 20)
154 #define HPSATMF_LOG_CLEAR_ACA (1 << 21)
155 #define HPSATMF_LOG_CLEAR_TSET (1 << 22)
156 #define HPSATMF_LOG_QRY_TASK (1 << 23)
157 #define HPSATMF_LOG_QRY_TSET (1 << 24)
158 #define HPSATMF_LOG_QRY_ASYNC (1 << 25)
160 #define HPSA_ABORT_MSG 0
161 #define HPSA_DEVICE_RESET_MSG 1
162 #define HPSA_RESET_TYPE_CONTROLLER 0x00
163 #define HPSA_RESET_TYPE_BUS 0x01
164 #define HPSA_RESET_TYPE_TARGET 0x03
165 #define HPSA_RESET_TYPE_LUN 0x04
166 #define HPSA_MSG_SEND_RETRY_LIMIT 10
167 #define HPSA_MSG_SEND_RETRY_INTERVAL_MSECS (10000)
172 #define HPSA_MAX_POLL_TIME_SECS (20)
181 #define HPSA_TUR_RETRY_LIMIT (20)
182 #define HPSA_MAX_WAIT_INTERVAL_SECS (30)
191 #define HPSA_BOARD_READY_WAIT_SECS (120)
192 #define HPSA_BOARD_NOT_READY_WAIT_SECS (100)
193 #define HPSA_BOARD_READY_POLL_INTERVAL_MSECS (100)
194 #define HPSA_BOARD_READY_POLL_INTERVAL \
195 ((HPSA_BOARD_READY_POLL_INTERVAL_MSECS * HZ) / 1000)
196 #define HPSA_BOARD_READY_ITERATIONS \
197 ((HPSA_BOARD_READY_WAIT_SECS * 1000) / \
198 HPSA_BOARD_READY_POLL_INTERVAL_MSECS)
199 #define HPSA_BOARD_NOT_READY_ITERATIONS \
200 ((HPSA_BOARD_NOT_READY_WAIT_SECS * 1000) / \
201 HPSA_BOARD_READY_POLL_INTERVAL_MSECS)
202 #define HPSA_POST_RESET_PAUSE_MSECS (3000)
203 #define HPSA_POST_RESET_NOOP_RETRIES (12)
209 #define SA5_DOORBELL 0x20
210 #define SA5_REQUEST_PORT_OFFSET 0x40
211 #define SA5_REPLY_INTR_MASK_OFFSET 0x34
212 #define SA5_REPLY_PORT_OFFSET 0x44
213 #define SA5_INTR_STATUS 0x30
214 #define SA5_SCRATCHPAD_OFFSET 0xB0
216 #define SA5_CTCFG_OFFSET 0xB4
217 #define SA5_CTMEM_OFFSET 0xB8
219 #define SA5_INTR_OFF 0x08
220 #define SA5B_INTR_OFF 0x04
221 #define SA5_INTR_PENDING 0x08
222 #define SA5B_INTR_PENDING 0x04
223 #define FIFO_EMPTY 0xffffffff
224 #define HPSA_FIRMWARE_READY 0xffff0000
226 #define HPSA_ERROR_BIT 0x02
229 #define SA5_PERF_INTR_PENDING 0x04
230 #define SA5_PERF_INTR_OFF 0x05
231 #define SA5_OUTDB_STATUS_PERF_BIT 0x01
232 #define SA5_OUTDB_CLEAR_PERF_BIT 0x01
233 #define SA5_OUTDB_CLEAR 0xA0
234 #define SA5_OUTDB_CLEAR_PERF_BIT 0x01
235 #define SA5_OUTDB_STATUS 0x9C
238 #define HPSA_INTR_ON 1
239 #define HPSA_INTR_OFF 0
243 static void SA5_submit_command(
struct ctlr_info *
h,
257 static void SA5_intr_mask(
struct ctlr_info *
h,
unsigned long val)
271 static void SA5_performant_intr_mask(
struct ctlr_info *h,
unsigned long val)
285 static unsigned long SA5_performant_completed(
struct ctlr_info *h,
u8 q)
308 spin_unlock_irqrestore(&h->
lock, flags);
317 return register_value;
324 static unsigned long SA5_fifo_full(
struct ctlr_info *h)
336 static unsigned long SA5_completed(
struct ctlr_info *h,
339 unsigned long register_value
346 spin_unlock_irqrestore(&h->
lock, flags);
351 dev_dbg(&h->
pdev->dev,
"Read %lx back from board\n",
357 return register_value;
362 static bool SA5_intr_pending(
struct ctlr_info *h)
364 unsigned long register_value =
366 dev_dbg(&h->
pdev->dev,
"intr_pending %lx\n", register_value);
370 static bool SA5_performant_intr_pending(
struct ctlr_info *h)
395 SA5_performant_intr_mask,
397 SA5_performant_intr_pending,
398 SA5_performant_completed,