Lines Matching refs:asd_ha
46 static int asd_pause_cseq(struct asd_ha_struct *asd_ha) in asd_pause_cseq() argument
51 arp2ctl = asd_read_reg_dword(asd_ha, CARP2CTL); in asd_pause_cseq()
55 asd_write_reg_dword(asd_ha, CARP2CTL, arp2ctl | EPAUSE); in asd_pause_cseq()
57 arp2ctl = asd_read_reg_dword(asd_ha, CARP2CTL); in asd_pause_cseq()
73 static int asd_unpause_cseq(struct asd_ha_struct *asd_ha) in asd_unpause_cseq() argument
78 arp2ctl = asd_read_reg_dword(asd_ha, CARP2CTL); in asd_unpause_cseq()
82 asd_write_reg_dword(asd_ha, CARP2CTL, arp2ctl & ~EPAUSE); in asd_unpause_cseq()
84 arp2ctl = asd_read_reg_dword(asd_ha, CARP2CTL); in asd_unpause_cseq()
101 static int asd_seq_pause_lseq(struct asd_ha_struct *asd_ha, int lseq) in asd_seq_pause_lseq() argument
106 arp2ctl = asd_read_reg_dword(asd_ha, LmARP2CTL(lseq)); in asd_seq_pause_lseq()
110 asd_write_reg_dword(asd_ha, LmARP2CTL(lseq), arp2ctl | EPAUSE); in asd_seq_pause_lseq()
112 arp2ctl = asd_read_reg_dword(asd_ha, LmARP2CTL(lseq)); in asd_seq_pause_lseq()
129 static int asd_pause_lseq(struct asd_ha_struct *asd_ha, u8 lseq_mask) in asd_pause_lseq() argument
135 err = asd_seq_pause_lseq(asd_ha, lseq); in asd_pause_lseq()
150 static int asd_seq_unpause_lseq(struct asd_ha_struct *asd_ha, int lseq) in asd_seq_unpause_lseq() argument
155 arp2ctl = asd_read_reg_dword(asd_ha, LmARP2CTL(lseq)); in asd_seq_unpause_lseq()
159 asd_write_reg_dword(asd_ha, LmARP2CTL(lseq), arp2ctl & ~EPAUSE); in asd_seq_unpause_lseq()
161 arp2ctl = asd_read_reg_dword(asd_ha, LmARP2CTL(lseq)); in asd_seq_unpause_lseq()
174 static int asd_verify_cseq(struct asd_ha_struct *asd_ha, const u8 *_prog, in asd_verify_cseq() argument
182 u32 val = asd_read_reg_dword(asd_ha, addr); in asd_verify_cseq()
187 pci_name(asd_ha->pcidev), in asd_verify_cseq()
208 static int asd_verify_lseq(struct asd_ha_struct *asd_ha, const u8 *_prog, in asd_verify_lseq() argument
219 asd_write_reg_dword(asd_ha, LmBISTCTL1(lseq), in asd_verify_lseq()
224 u32 val = asd_read_reg_dword(asd_ha, LmSEQRAM(lseq)+i); in asd_verify_lseq()
229 pci_name(asd_ha->pcidev), in asd_verify_lseq()
249 static int asd_verify_seq(struct asd_ha_struct *asd_ha, const u8 *prog, in asd_verify_seq() argument
253 return asd_verify_cseq(asd_ha, prog, size); in asd_verify_seq()
258 err = asd_verify_lseq(asd_ha, prog, size, lseq); in asd_verify_seq()
270 static int asd_download_seq(struct asd_ha_struct *asd_ha, in asd_download_seq() argument
285 asd_pause_cseq(asd_ha); in asd_download_seq()
286 asd_pause_lseq(asd_ha, 0xFF); in asd_download_seq()
289 comstaten = asd_read_reg_dword(asd_ha, COMSTATEN); in asd_download_seq()
290 asd_write_reg_dword(asd_ha, COMSTATEN, 0); in asd_download_seq()
291 asd_write_reg_dword(asd_ha, COMSTAT, COMSTAT_MASK); in asd_download_seq()
293 asd_write_reg_dword(asd_ha, CHIMINTEN, RST_CHIMINTEN); in asd_download_seq()
294 asd_write_reg_dword(asd_ha, CHIMINT, CHIMINT_MASK); in asd_download_seq()
296 token = asd_alloc_coherent(asd_ha, MAX_DMA_OVLY_COUNT, GFP_KERNEL); in asd_download_seq()
310 asd_write_reg_addr(asd_ha, OVLYDMAADR, token->dma_handle); in asd_download_seq()
311 asd_write_reg_dword(asd_ha, OVLYDMACNT, left); in asd_download_seq()
316 asd_write_reg_dword(asd_ha, OVLYDMACTL, reg); in asd_download_seq()
319 u32 dmadone = asd_read_reg_dword(asd_ha, OVLYDMACTL); in asd_download_seq()
326 reg = asd_read_reg_dword(asd_ha, COMSTAT); in asd_download_seq()
328 || (asd_read_reg_dword(asd_ha, CHIMINT) & DEVEXCEPT_MASK)){ in asd_download_seq()
330 pci_name(asd_ha->pcidev)); in asd_download_seq()
334 asd_free_coherent(asd_ha, token); in asd_download_seq()
336 asd_write_reg_dword(asd_ha, COMSTATEN, comstaten); in asd_download_seq()
338 return err ? : asd_verify_seq(asd_ha, prog, size, lseq_mask); in asd_download_seq()
341 static int asd_download_seq(struct asd_ha_struct *asd_ha, const u8 *_prog, in asd_download_seq() argument
353 asd_pause_cseq(asd_ha); in asd_download_seq()
354 asd_pause_lseq(asd_ha, 0xFF); in asd_download_seq()
359 asd_write_reg_dword(asd_ha, OVLYDMACNT, size); in asd_download_seq()
360 asd_write_reg_dword(asd_ha, OVLYDMACTL, reg); in asd_download_seq()
366 asd_write_reg_dword(asd_ha, SPIODATA, *prog); in asd_download_seq()
369 asd_write_reg_dword(asd_ha, OVLYDMACTL, reg); in asd_download_seq()
371 return asd_verify_seq(asd_ha, _prog, size, lseq_mask); in asd_download_seq()
381 static int asd_seq_download_seqs(struct asd_ha_struct *asd_ha) in asd_seq_download_seqs() argument
385 if (!asd_ha->hw_prof.enabled_phys) { in asd_seq_download_seqs()
386 asd_printk("%s: no enabled phys!\n", pci_name(asd_ha->pcidev)); in asd_seq_download_seqs()
392 err = asd_download_seq(asd_ha, cseq_code, cseq_code_size, 0); in asd_seq_download_seqs()
402 err = asd_download_seq(asd_ha, lseq_code, lseq_code_size, in asd_seq_download_seqs()
403 asd_ha->hw_prof.enabled_phys); in asd_seq_download_seqs()
407 u8 lseq_mask = asd_ha->hw_prof.enabled_phys; in asd_seq_download_seqs()
410 err = asd_download_seq(asd_ha, lseq_code, in asd_seq_download_seqs()
428 static void asd_init_cseq_mip(struct asd_ha_struct *asd_ha) in asd_init_cseq_mip() argument
431 asd_write_reg_word(asd_ha, CSEQ_Q_EXE_HEAD, 0xFFFF); in asd_init_cseq_mip()
432 asd_write_reg_word(asd_ha, CSEQ_Q_EXE_TAIL, 0xFFFF); in asd_init_cseq_mip()
433 asd_write_reg_word(asd_ha, CSEQ_Q_DONE_HEAD, 0xFFFF); in asd_init_cseq_mip()
434 asd_write_reg_word(asd_ha, CSEQ_Q_DONE_TAIL, 0xFFFF); in asd_init_cseq_mip()
435 asd_write_reg_word(asd_ha, CSEQ_Q_SEND_HEAD, 0xFFFF); in asd_init_cseq_mip()
436 asd_write_reg_word(asd_ha, CSEQ_Q_SEND_TAIL, 0xFFFF); in asd_init_cseq_mip()
437 asd_write_reg_word(asd_ha, CSEQ_Q_DMA2CHIM_HEAD, 0xFFFF); in asd_init_cseq_mip()
438 asd_write_reg_word(asd_ha, CSEQ_Q_DMA2CHIM_TAIL, 0xFFFF); in asd_init_cseq_mip()
439 asd_write_reg_word(asd_ha, CSEQ_Q_COPY_HEAD, 0xFFFF); in asd_init_cseq_mip()
440 asd_write_reg_word(asd_ha, CSEQ_Q_COPY_TAIL, 0xFFFF); in asd_init_cseq_mip()
441 asd_write_reg_word(asd_ha, CSEQ_REG0, 0); in asd_init_cseq_mip()
442 asd_write_reg_word(asd_ha, CSEQ_REG1, 0); in asd_init_cseq_mip()
443 asd_write_reg_dword(asd_ha, CSEQ_REG2, 0); in asd_init_cseq_mip()
444 asd_write_reg_byte(asd_ha, CSEQ_LINK_CTL_Q_MAP, 0); in asd_init_cseq_mip()
446 u8 con = asd_read_reg_byte(asd_ha, CCONEXIST); in asd_init_cseq_mip()
448 asd_write_reg_byte(asd_ha, CSEQ_MAX_CSEQ_MODE, (val<<4)|val); in asd_init_cseq_mip()
450 asd_write_reg_word(asd_ha, CSEQ_FREE_LIST_HACK_COUNT, 0); in asd_init_cseq_mip()
453 asd_write_reg_dword(asd_ha, CSEQ_EST_NEXUS_REQ_QUEUE, 0); in asd_init_cseq_mip()
454 asd_write_reg_dword(asd_ha, CSEQ_EST_NEXUS_REQ_QUEUE+4, 0); in asd_init_cseq_mip()
455 asd_write_reg_dword(asd_ha, CSEQ_EST_NEXUS_REQ_COUNT, 0); in asd_init_cseq_mip()
456 asd_write_reg_dword(asd_ha, CSEQ_EST_NEXUS_REQ_COUNT+4, 0); in asd_init_cseq_mip()
457 asd_write_reg_word(asd_ha, CSEQ_Q_EST_NEXUS_HEAD, 0xFFFF); in asd_init_cseq_mip()
458 asd_write_reg_word(asd_ha, CSEQ_Q_EST_NEXUS_TAIL, 0xFFFF); in asd_init_cseq_mip()
459 asd_write_reg_word(asd_ha, CSEQ_NEED_EST_NEXUS_SCB, 0); in asd_init_cseq_mip()
460 asd_write_reg_byte(asd_ha, CSEQ_EST_NEXUS_REQ_HEAD, 0); in asd_init_cseq_mip()
461 asd_write_reg_byte(asd_ha, CSEQ_EST_NEXUS_REQ_TAIL, 0); in asd_init_cseq_mip()
462 asd_write_reg_byte(asd_ha, CSEQ_EST_NEXUS_SCB_OFFSET, 0); in asd_init_cseq_mip()
465 asd_write_reg_word(asd_ha, CSEQ_INT_ROUT_RET_ADDR0, 0); in asd_init_cseq_mip()
466 asd_write_reg_word(asd_ha, CSEQ_INT_ROUT_RET_ADDR1, 0); in asd_init_cseq_mip()
467 asd_write_reg_word(asd_ha, CSEQ_INT_ROUT_SCBPTR, 0); in asd_init_cseq_mip()
468 asd_write_reg_byte(asd_ha, CSEQ_INT_ROUT_MODE, 0); in asd_init_cseq_mip()
469 asd_write_reg_byte(asd_ha, CSEQ_ISR_SCRATCH_FLAGS, 0); in asd_init_cseq_mip()
470 asd_write_reg_word(asd_ha, CSEQ_ISR_SAVE_SINDEX, 0); in asd_init_cseq_mip()
471 asd_write_reg_word(asd_ha, CSEQ_ISR_SAVE_DINDEX, 0); in asd_init_cseq_mip()
472 asd_write_reg_word(asd_ha, CSEQ_Q_MONIRTT_HEAD, 0xFFFF); in asd_init_cseq_mip()
473 asd_write_reg_word(asd_ha, CSEQ_Q_MONIRTT_TAIL, 0xFFFF); in asd_init_cseq_mip()
476 u16 cmdctx = asd_get_cmdctx_size(asd_ha); in asd_init_cseq_mip()
478 asd_write_reg_byte(asd_ha, CSEQ_FREE_SCB_MASK, (u8)cmdctx); in asd_init_cseq_mip()
480 asd_write_reg_word(asd_ha, CSEQ_BUILTIN_FREE_SCB_HEAD, in asd_init_cseq_mip()
482 asd_write_reg_word(asd_ha, CSEQ_BUILTIN_FREE_SCB_TAIL, in asd_init_cseq_mip()
484 asd_write_reg_word(asd_ha, CSEQ_EXTENDED_FREE_SCB_HEAD, 0xFFFF); in asd_init_cseq_mip()
485 asd_write_reg_word(asd_ha, CSEQ_EXTENDED_FREE_SCB_TAIL, 0xFFFF); in asd_init_cseq_mip()
488 asd_write_reg_dword(asd_ha, CSEQ_EMPTY_REQ_QUEUE, 0); in asd_init_cseq_mip()
489 asd_write_reg_dword(asd_ha, CSEQ_EMPTY_REQ_QUEUE+4, 0); in asd_init_cseq_mip()
490 asd_write_reg_dword(asd_ha, CSEQ_EMPTY_REQ_COUNT, 0); in asd_init_cseq_mip()
491 asd_write_reg_dword(asd_ha, CSEQ_EMPTY_REQ_COUNT+4, 0); in asd_init_cseq_mip()
492 asd_write_reg_word(asd_ha, CSEQ_Q_EMPTY_HEAD, 0xFFFF); in asd_init_cseq_mip()
493 asd_write_reg_word(asd_ha, CSEQ_Q_EMPTY_TAIL, 0xFFFF); in asd_init_cseq_mip()
494 asd_write_reg_word(asd_ha, CSEQ_NEED_EMPTY_SCB, 0); in asd_init_cseq_mip()
495 asd_write_reg_byte(asd_ha, CSEQ_EMPTY_REQ_HEAD, 0); in asd_init_cseq_mip()
496 asd_write_reg_byte(asd_ha, CSEQ_EMPTY_REQ_TAIL, 0); in asd_init_cseq_mip()
497 asd_write_reg_byte(asd_ha, CSEQ_EMPTY_SCB_OFFSET, 0); in asd_init_cseq_mip()
498 asd_write_reg_word(asd_ha, CSEQ_PRIMITIVE_DATA, 0); in asd_init_cseq_mip()
499 asd_write_reg_dword(asd_ha, CSEQ_TIMEOUT_CONST, 0); in asd_init_cseq_mip()
506 static void asd_init_cseq_mdp(struct asd_ha_struct *asd_ha) in asd_init_cseq_mdp() argument
515 asd_write_reg_word(asd_ha, i*moffs+CSEQ_LRM_SAVE_SINDEX, 0); in asd_init_cseq_mdp()
516 asd_write_reg_word(asd_ha, i*moffs+CSEQ_LRM_SAVE_SCBPTR, 0); in asd_init_cseq_mdp()
517 asd_write_reg_word(asd_ha, i*moffs+CSEQ_Q_LINK_HEAD, 0xFFFF); in asd_init_cseq_mdp()
518 asd_write_reg_word(asd_ha, i*moffs+CSEQ_Q_LINK_TAIL, 0xFFFF); in asd_init_cseq_mdp()
519 asd_write_reg_byte(asd_ha, i*moffs+CSEQ_LRM_SAVE_SCRPAGE, 0); in asd_init_cseq_mdp()
525 asd_write_reg_word(asd_ha, CSEQ_RET_ADDR, 0xFFFF); in asd_init_cseq_mdp()
526 asd_write_reg_word(asd_ha, CSEQ_RET_SCBPTR, 0); in asd_init_cseq_mdp()
527 asd_write_reg_word(asd_ha, CSEQ_SAVE_SCBPTR, 0); in asd_init_cseq_mdp()
528 asd_write_reg_word(asd_ha, CSEQ_EMPTY_TRANS_CTX, 0); in asd_init_cseq_mdp()
529 asd_write_reg_word(asd_ha, CSEQ_RESP_LEN, 0); in asd_init_cseq_mdp()
530 asd_write_reg_word(asd_ha, CSEQ_TMF_SCBPTR, 0); in asd_init_cseq_mdp()
531 asd_write_reg_word(asd_ha, CSEQ_GLOBAL_PREV_SCB, 0); in asd_init_cseq_mdp()
532 asd_write_reg_word(asd_ha, CSEQ_GLOBAL_HEAD, 0); in asd_init_cseq_mdp()
533 asd_write_reg_word(asd_ha, CSEQ_CLEAR_LU_HEAD, 0); in asd_init_cseq_mdp()
534 asd_write_reg_byte(asd_ha, CSEQ_TMF_OPCODE, 0); in asd_init_cseq_mdp()
535 asd_write_reg_byte(asd_ha, CSEQ_SCRATCH_FLAGS, 0); in asd_init_cseq_mdp()
536 asd_write_reg_word(asd_ha, CSEQ_HSB_SITE, 0); in asd_init_cseq_mdp()
537 asd_write_reg_word(asd_ha, CSEQ_FIRST_INV_SCB_SITE, in asd_init_cseq_mdp()
539 asd_write_reg_word(asd_ha, CSEQ_FIRST_INV_DDB_SITE, in asd_init_cseq_mdp()
540 (u16)asd_ha->hw_prof.max_ddbs); in asd_init_cseq_mdp()
543 asd_write_reg_dword(asd_ha, CSEQ_LUN_TO_CLEAR, 0); in asd_init_cseq_mdp()
544 asd_write_reg_dword(asd_ha, CSEQ_LUN_TO_CLEAR + 4, 0); in asd_init_cseq_mdp()
545 asd_write_reg_dword(asd_ha, CSEQ_LUN_TO_CHECK, 0); in asd_init_cseq_mdp()
546 asd_write_reg_dword(asd_ha, CSEQ_LUN_TO_CHECK + 4, 0); in asd_init_cseq_mdp()
550 asd_write_reg_addr(asd_ha, CSEQ_HQ_NEW_POINTER, in asd_init_cseq_mdp()
551 asd_ha->seq.next_scb.dma_handle); in asd_init_cseq_mdp()
553 (unsigned long long)asd_ha->seq.next_scb.dma_handle); in asd_init_cseq_mdp()
556 asd_write_reg_addr(asd_ha, CSEQ_HQ_DONE_BASE, in asd_init_cseq_mdp()
557 asd_ha->seq.actual_dl->dma_handle); in asd_init_cseq_mdp()
561 asd_write_reg_dword(asd_ha, CSEQ_HQ_DONE_POINTER, in asd_init_cseq_mdp()
562 ASD_BUSADDR_LO(asd_ha->seq.actual_dl->dma_handle)); in asd_init_cseq_mdp()
564 asd_write_reg_byte(asd_ha, CSEQ_HQ_DONE_PASS, ASD_DEF_DL_TOGGLE); in asd_init_cseq_mdp()
576 static void asd_init_cseq_scratch(struct asd_ha_struct *asd_ha) in asd_init_cseq_scratch() argument
578 asd_init_cseq_mip(asd_ha); in asd_init_cseq_scratch()
579 asd_init_cseq_mdp(asd_ha); in asd_init_cseq_scratch()
587 static void asd_init_lseq_mip(struct asd_ha_struct *asd_ha, u8 lseq) in asd_init_lseq_mip() argument
592 asd_write_reg_word(asd_ha, LmSEQ_Q_TGTXFR_HEAD(lseq), 0xFFFF); in asd_init_lseq_mip()
593 asd_write_reg_word(asd_ha, LmSEQ_Q_TGTXFR_TAIL(lseq), 0xFFFF); in asd_init_lseq_mip()
594 asd_write_reg_byte(asd_ha, LmSEQ_LINK_NUMBER(lseq), lseq); in asd_init_lseq_mip()
595 asd_write_reg_byte(asd_ha, LmSEQ_SCRATCH_FLAGS(lseq), in asd_init_lseq_mip()
597 asd_write_reg_dword(asd_ha, LmSEQ_CONNECTION_STATE(lseq),0x08000000); in asd_init_lseq_mip()
598 asd_write_reg_word(asd_ha, LmSEQ_CONCTL(lseq), 0); in asd_init_lseq_mip()
599 asd_write_reg_byte(asd_ha, LmSEQ_CONSTAT(lseq), 0); in asd_init_lseq_mip()
600 asd_write_reg_byte(asd_ha, LmSEQ_CONNECTION_MODES(lseq), 0); in asd_init_lseq_mip()
601 asd_write_reg_word(asd_ha, LmSEQ_REG1_ISR(lseq), 0); in asd_init_lseq_mip()
602 asd_write_reg_word(asd_ha, LmSEQ_REG2_ISR(lseq), 0); in asd_init_lseq_mip()
603 asd_write_reg_word(asd_ha, LmSEQ_REG3_ISR(lseq), 0); in asd_init_lseq_mip()
604 asd_write_reg_dword(asd_ha, LmSEQ_REG0_ISR(lseq), 0); in asd_init_lseq_mip()
605 asd_write_reg_dword(asd_ha, LmSEQ_REG0_ISR(lseq)+4, 0); in asd_init_lseq_mip()
608 asd_write_reg_word(asd_ha, LmSEQ_EST_NEXUS_SCBPTR0(lseq), 0xFFFF); in asd_init_lseq_mip()
609 asd_write_reg_word(asd_ha, LmSEQ_EST_NEXUS_SCBPTR1(lseq), 0xFFFF); in asd_init_lseq_mip()
610 asd_write_reg_word(asd_ha, LmSEQ_EST_NEXUS_SCBPTR2(lseq), 0xFFFF); in asd_init_lseq_mip()
611 asd_write_reg_word(asd_ha, LmSEQ_EST_NEXUS_SCBPTR3(lseq), 0xFFFF); in asd_init_lseq_mip()
612 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_SCB_OPCODE0(lseq), 0); in asd_init_lseq_mip()
613 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_SCB_OPCODE1(lseq), 0); in asd_init_lseq_mip()
614 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_SCB_OPCODE2(lseq), 0); in asd_init_lseq_mip()
615 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_SCB_OPCODE3(lseq), 0); in asd_init_lseq_mip()
616 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_SCB_HEAD(lseq), 0); in asd_init_lseq_mip()
617 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_SCB_TAIL(lseq), 0); in asd_init_lseq_mip()
618 asd_write_reg_byte(asd_ha, LmSEQ_EST_NEXUS_BUF_AVAIL(lseq), 0); in asd_init_lseq_mip()
619 asd_write_reg_dword(asd_ha, LmSEQ_TIMEOUT_CONST(lseq), 0); in asd_init_lseq_mip()
620 asd_write_reg_word(asd_ha, LmSEQ_ISR_SAVE_SINDEX(lseq), 0); in asd_init_lseq_mip()
621 asd_write_reg_word(asd_ha, LmSEQ_ISR_SAVE_DINDEX(lseq), 0); in asd_init_lseq_mip()
624 asd_write_reg_word(asd_ha, LmSEQ_EMPTY_SCB_PTR0(lseq), 0xFFFF); in asd_init_lseq_mip()
625 asd_write_reg_word(asd_ha, LmSEQ_EMPTY_SCB_PTR1(lseq), 0xFFFF); in asd_init_lseq_mip()
626 asd_write_reg_word(asd_ha, LmSEQ_EMPTY_SCB_PTR2(lseq), 0xFFFF); in asd_init_lseq_mip()
627 asd_write_reg_word(asd_ha, LmSEQ_EMPTY_SCB_PTR3(lseq), 0xFFFF); in asd_init_lseq_mip()
628 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_SCB_OPCD0(lseq), 0); in asd_init_lseq_mip()
629 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_SCB_OPCD1(lseq), 0); in asd_init_lseq_mip()
630 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_SCB_OPCD2(lseq), 0); in asd_init_lseq_mip()
631 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_SCB_OPCD3(lseq), 0); in asd_init_lseq_mip()
632 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_SCB_HEAD(lseq), 0); in asd_init_lseq_mip()
633 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_SCB_TAIL(lseq), 0); in asd_init_lseq_mip()
634 asd_write_reg_byte(asd_ha, LmSEQ_EMPTY_BUFS_AVAIL(lseq), 0); in asd_init_lseq_mip()
636 asd_write_reg_dword(asd_ha, LmSEQ_ATA_SCR_REGS(lseq) + i, 0); in asd_init_lseq_mip()
641 asd_write_reg_dword(asd_ha, LmSEQ_DEV_PRES_TMR_TOUT_CONST(lseq), in asd_init_lseq_mip()
645 asd_write_reg_dword(asd_ha, LmSEQ_SATA_INTERLOCK_TIMEOUT(lseq), in asd_init_lseq_mip()
650 asd_write_reg_dword(asd_ha, LmSEQ_STP_SHUTDOWN_TIMEOUT(lseq), in asd_init_lseq_mip()
653 asd_write_reg_dword(asd_ha, LmSEQ_SRST_ASSERT_TIMEOUT(lseq), in asd_init_lseq_mip()
656 asd_write_reg_dword(asd_ha, LmSEQ_RCV_FIS_TIMEOUT(lseq), in asd_init_lseq_mip()
659 asd_write_reg_dword(asd_ha, LmSEQ_ONE_MILLISEC_TIMEOUT(lseq), in asd_init_lseq_mip()
663 asd_write_reg_dword(asd_ha, LmSEQ_TEN_MS_COMINIT_TIMEOUT(lseq), in asd_init_lseq_mip()
666 asd_write_reg_dword(asd_ha, LmSEQ_SMP_RCV_TIMEOUT(lseq), in asd_init_lseq_mip()
675 static void asd_init_lseq_mdp(struct asd_ha_struct *asd_ha, int lseq) in asd_init_lseq_mdp() argument
694 asd_write_reg_word(asd_ha, LmSEQ_RET_ADDR(lseq)+moffs, in asd_init_lseq_mdp()
696 asd_write_reg_word(asd_ha, LmSEQ_REG0_MODE(lseq)+moffs, 0); in asd_init_lseq_mdp()
697 asd_write_reg_word(asd_ha, LmSEQ_MODE_FLAGS(lseq)+moffs, 0); in asd_init_lseq_mdp()
698 asd_write_reg_word(asd_ha, LmSEQ_RET_ADDR2(lseq)+moffs,0xFFFF); in asd_init_lseq_mdp()
699 asd_write_reg_word(asd_ha, LmSEQ_RET_ADDR1(lseq)+moffs,0xFFFF); in asd_init_lseq_mdp()
700 asd_write_reg_byte(asd_ha, LmSEQ_OPCODE_TO_CSEQ(lseq)+moffs,0); in asd_init_lseq_mdp()
701 asd_write_reg_word(asd_ha, LmSEQ_DATA_TO_CSEQ(lseq)+moffs,0); in asd_init_lseq_mdp()
706 asd_write_reg_word(asd_ha, in asd_init_lseq_mdp()
709 asd_write_reg_word(asd_ha, in asd_init_lseq_mdp()
711 asd_write_reg_word(asd_ha, in asd_init_lseq_mdp()
713 asd_write_reg_word(asd_ha, in asd_init_lseq_mdp()
715 asd_write_reg_word(asd_ha, in asd_init_lseq_mdp()
717 asd_write_reg_byte(asd_ha, in asd_init_lseq_mdp()
719 asd_write_reg_word(asd_ha, in asd_init_lseq_mdp()
723 asd_write_reg_word(asd_ha, LmSEQ_FIRST_INV_DDB_SITE(lseq), in asd_init_lseq_mdp()
724 (u16)asd_ha->hw_prof.max_ddbs); in asd_init_lseq_mdp()
725 asd_write_reg_word(asd_ha, LmSEQ_EMPTY_TRANS_CTX(lseq), 0); in asd_init_lseq_mdp()
726 asd_write_reg_word(asd_ha, LmSEQ_RESP_LEN(lseq), 0); in asd_init_lseq_mdp()
727 asd_write_reg_word(asd_ha, LmSEQ_FIRST_INV_SCB_SITE(lseq), in asd_init_lseq_mdp()
729 asd_write_reg_word(asd_ha, LmSEQ_INTEN_SAVE(lseq), in asd_init_lseq_mdp()
731 asd_write_reg_word(asd_ha, LmSEQ_INTEN_SAVE(lseq) + 2, in asd_init_lseq_mdp()
733 asd_write_reg_byte(asd_ha, LmSEQ_LINK_RST_FRM_LEN(lseq), 0); in asd_init_lseq_mdp()
734 asd_write_reg_byte(asd_ha, LmSEQ_LINK_RST_PROTOCOL(lseq), 0); in asd_init_lseq_mdp()
735 asd_write_reg_byte(asd_ha, LmSEQ_RESP_STATUS(lseq), 0); in asd_init_lseq_mdp()
736 asd_write_reg_byte(asd_ha, LmSEQ_LAST_LOADED_SGE(lseq), 0); in asd_init_lseq_mdp()
737 asd_write_reg_word(asd_ha, LmSEQ_SAVE_SCBPTR(lseq), 0); in asd_init_lseq_mdp()
740 asd_write_reg_word(asd_ha, LmSEQ_Q_XMIT_HEAD(lseq), 0xFFFF); in asd_init_lseq_mdp()
741 asd_write_reg_word(asd_ha, LmSEQ_M1_EMPTY_TRANS_CTX(lseq), 0); in asd_init_lseq_mdp()
742 asd_write_reg_word(asd_ha, LmSEQ_INI_CONN_TAG(lseq), 0); in asd_init_lseq_mdp()
743 asd_write_reg_byte(asd_ha, LmSEQ_FAILED_OPEN_STATUS(lseq), 0); in asd_init_lseq_mdp()
744 asd_write_reg_byte(asd_ha, LmSEQ_XMIT_REQUEST_TYPE(lseq), 0); in asd_init_lseq_mdp()
745 asd_write_reg_byte(asd_ha, LmSEQ_M1_RESP_STATUS(lseq), 0); in asd_init_lseq_mdp()
746 asd_write_reg_byte(asd_ha, LmSEQ_M1_LAST_LOADED_SGE(lseq), 0); in asd_init_lseq_mdp()
747 asd_write_reg_word(asd_ha, LmSEQ_M1_SAVE_SCBPTR(lseq), 0); in asd_init_lseq_mdp()
750 asd_write_reg_word(asd_ha, LmSEQ_PORT_COUNTER(lseq), 0); in asd_init_lseq_mdp()
751 asd_write_reg_word(asd_ha, LmSEQ_PM_TABLE_PTR(lseq), 0); in asd_init_lseq_mdp()
752 asd_write_reg_word(asd_ha, LmSEQ_SATA_INTERLOCK_TMR_SAVE(lseq), 0); in asd_init_lseq_mdp()
753 asd_write_reg_word(asd_ha, LmSEQ_IP_BITL(lseq), 0); in asd_init_lseq_mdp()
754 asd_write_reg_word(asd_ha, LmSEQ_COPY_SMP_CONN_TAG(lseq), 0); in asd_init_lseq_mdp()
755 asd_write_reg_byte(asd_ha, LmSEQ_P0M2_OFFS1AH(lseq), 0); in asd_init_lseq_mdp()
758 asd_write_reg_byte(asd_ha, LmSEQ_SAVED_OOB_STATUS(lseq), 0); in asd_init_lseq_mdp()
759 asd_write_reg_byte(asd_ha, LmSEQ_SAVED_OOB_MODE(lseq), 0); in asd_init_lseq_mdp()
760 asd_write_reg_word(asd_ha, LmSEQ_Q_LINK_HEAD(lseq), 0xFFFF); in asd_init_lseq_mdp()
761 asd_write_reg_byte(asd_ha, LmSEQ_LINK_RST_ERR(lseq), 0); in asd_init_lseq_mdp()
762 asd_write_reg_byte(asd_ha, LmSEQ_SAVED_OOB_SIGNALS(lseq), 0); in asd_init_lseq_mdp()
763 asd_write_reg_byte(asd_ha, LmSEQ_SAS_RESET_MODE(lseq), 0); in asd_init_lseq_mdp()
764 asd_write_reg_byte(asd_ha, LmSEQ_LINK_RESET_RETRY_COUNT(lseq), 0); in asd_init_lseq_mdp()
765 asd_write_reg_byte(asd_ha, LmSEQ_NUM_LINK_RESET_RETRIES(lseq), 0); in asd_init_lseq_mdp()
766 asd_write_reg_word(asd_ha, LmSEQ_OOB_INT_ENABLES(lseq), 0); in asd_init_lseq_mdp()
771 asd_write_reg_word(asd_ha, LmSEQ_NOTIFY_TIMER_TIMEOUT(lseq), in asd_init_lseq_mdp()
774 asd_write_reg_word(asd_ha, LmSEQ_NOTIFY_TIMER_DOWN_COUNT(lseq), in asd_init_lseq_mdp()
776 asd_write_reg_word(asd_ha, LmSEQ_NOTIFY_TIMER_INITIAL_COUNT(lseq), in asd_init_lseq_mdp()
786 asd_write_reg_dword(asd_ha, LmSCRATCH(lseq)+moffs+j,0); in asd_init_lseq_mdp()
790 asd_write_reg_dword(asd_ha, LmSEQ_INVALID_DWORD_COUNT(lseq), 0); in asd_init_lseq_mdp()
791 asd_write_reg_dword(asd_ha, LmSEQ_DISPARITY_ERROR_COUNT(lseq), 0); in asd_init_lseq_mdp()
792 asd_write_reg_dword(asd_ha, LmSEQ_LOSS_OF_SYNC_COUNT(lseq), 0); in asd_init_lseq_mdp()
796 asd_write_reg_dword(asd_ha, LmSEQ_FRAME_TYPE_MASK(lseq)+i, 0); in asd_init_lseq_mdp()
797 asd_write_reg_byte(asd_ha, LmSEQ_FRAME_TYPE_MASK(lseq), 0xFF); in asd_init_lseq_mdp()
798 asd_write_reg_byte(asd_ha, LmSEQ_HASHED_DEST_ADDR_MASK(lseq), 0xFF); in asd_init_lseq_mdp()
799 asd_write_reg_byte(asd_ha, LmSEQ_HASHED_DEST_ADDR_MASK(lseq)+1,0xFF); in asd_init_lseq_mdp()
800 asd_write_reg_byte(asd_ha, LmSEQ_HASHED_DEST_ADDR_MASK(lseq)+2,0xFF); in asd_init_lseq_mdp()
801 asd_write_reg_byte(asd_ha, LmSEQ_HASHED_SRC_ADDR_MASK(lseq), 0xFF); in asd_init_lseq_mdp()
802 asd_write_reg_byte(asd_ha, LmSEQ_HASHED_SRC_ADDR_MASK(lseq)+1, 0xFF); in asd_init_lseq_mdp()
803 asd_write_reg_byte(asd_ha, LmSEQ_HASHED_SRC_ADDR_MASK(lseq)+2, 0xFF); in asd_init_lseq_mdp()
804 asd_write_reg_dword(asd_ha, LmSEQ_DATA_OFFSET(lseq), 0xFFFFFFFF); in asd_init_lseq_mdp()
807 asd_write_reg_dword(asd_ha, LmSEQ_SMP_RCV_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
808 asd_write_reg_byte(asd_ha, LmSEQ_DEVICE_BITS(lseq), 0); in asd_init_lseq_mdp()
809 asd_write_reg_word(asd_ha, LmSEQ_SDB_DDB(lseq), 0); in asd_init_lseq_mdp()
810 asd_write_reg_byte(asd_ha, LmSEQ_SDB_NUM_TAGS(lseq), 0); in asd_init_lseq_mdp()
811 asd_write_reg_byte(asd_ha, LmSEQ_SDB_CURR_TAG(lseq), 0); in asd_init_lseq_mdp()
814 asd_write_reg_dword(asd_ha, LmSEQ_TX_ID_ADDR_FRAME(lseq), 0); in asd_init_lseq_mdp()
815 asd_write_reg_dword(asd_ha, LmSEQ_TX_ID_ADDR_FRAME(lseq)+4, 0); in asd_init_lseq_mdp()
816 asd_write_reg_dword(asd_ha, LmSEQ_OPEN_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
817 asd_write_reg_dword(asd_ha, LmSEQ_SRST_AS_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
818 asd_write_reg_dword(asd_ha, LmSEQ_LAST_LOADED_SG_EL(lseq), 0); in asd_init_lseq_mdp()
823 asd_write_reg_dword(asd_ha, LmSEQ_STP_SHUTDOWN_TIMER_TERM_TS(lseq),0); in asd_init_lseq_mdp()
824 asd_write_reg_dword(asd_ha, LmSEQ_CLOSE_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
825 asd_write_reg_dword(asd_ha, LmSEQ_BREAK_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
826 asd_write_reg_dword(asd_ha, LmSEQ_DWS_RESET_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
827 asd_write_reg_dword(asd_ha,LmSEQ_SATA_INTERLOCK_TIMER_TERM_TS(lseq),0); in asd_init_lseq_mdp()
828 asd_write_reg_dword(asd_ha, LmSEQ_MCTL_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
831 asd_write_reg_dword(asd_ha, LmSEQ_COMINIT_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
832 asd_write_reg_dword(asd_ha, LmSEQ_RCV_ID_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
833 asd_write_reg_dword(asd_ha, LmSEQ_RCV_FIS_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
834 asd_write_reg_dword(asd_ha, LmSEQ_DEV_PRES_TIMER_TERM_TS(lseq), 0); in asd_init_lseq_mdp()
841 static void asd_init_lseq_scratch(struct asd_ha_struct *asd_ha) in asd_init_lseq_scratch() argument
846 lseq_mask = asd_ha->hw_prof.enabled_phys; in asd_init_lseq_scratch()
848 asd_init_lseq_mip(asd_ha, lseq); in asd_init_lseq_scratch()
849 asd_init_lseq_mdp(asd_ha, lseq); in asd_init_lseq_scratch()
861 static void asd_init_scb_sites(struct asd_ha_struct *asd_ha) in asd_init_scb_sites() argument
866 for (site_no = asd_ha->hw_prof.max_scbs-1; in asd_init_scb_sites()
873 asd_scbsite_write_dword(asd_ha, site_no, i, 0); in asd_init_scb_sites()
876 asd_scbsite_write_byte(asd_ha, site_no, in asd_init_scb_sites()
883 asd_scbsite_write_byte(asd_ha, site_no, 0x49, 0x01); in asd_init_scb_sites()
898 asd_scbsite_write_word(asd_ha, site_no, 0, first_scb_site_no); in asd_init_scb_sites()
903 asd_ha->hw_prof.max_scbs = max_scbs; in asd_init_scb_sites()
904 ASD_DPRINTK("max_scbs:%d\n", asd_ha->hw_prof.max_scbs); in asd_init_scb_sites()
913 static void asd_init_cseq_cio(struct asd_ha_struct *asd_ha) in asd_init_cseq_cio() argument
917 asd_write_reg_byte(asd_ha, CSEQCOMINTEN, 0); in asd_init_cseq_cio()
918 asd_write_reg_byte(asd_ha, CSEQDLCTL, ASD_DL_SIZE_BITS); in asd_init_cseq_cio()
919 asd_write_reg_byte(asd_ha, CSEQDLOFFS, 0); in asd_init_cseq_cio()
920 asd_write_reg_byte(asd_ha, CSEQDLOFFS+1, 0); in asd_init_cseq_cio()
921 asd_ha->seq.scbpro = 0; in asd_init_cseq_cio()
922 asd_write_reg_dword(asd_ha, SCBPRO, 0); in asd_init_cseq_cio()
923 asd_write_reg_dword(asd_ha, CSEQCON, 0); in asd_init_cseq_cio()
929 asd_write_reg_word(asd_ha, CM11INTVEC0, cseq_vecs[0]); in asd_init_cseq_cio()
930 asd_write_reg_word(asd_ha, CM11INTVEC1, cseq_vecs[1]); in asd_init_cseq_cio()
931 asd_write_reg_word(asd_ha, CM11INTVEC2, cseq_vecs[2]); in asd_init_cseq_cio()
934 asd_write_reg_byte(asd_ha, CARP2INTEN, EN_ARP2HALTC); in asd_init_cseq_cio()
937 asd_write_reg_byte(asd_ha, CSCRATCHPAGE, 0x04); in asd_init_cseq_cio()
942 asd_write_reg_byte(asd_ha, CMnSCRATCHPAGE(i), 0); in asd_init_cseq_cio()
945 asd_write_reg_word(asd_ha, CPRGMCNT, cseq_idle_loop); in asd_init_cseq_cio()
949 asd_write_reg_dword(asd_ha, CMnINTEN(i), EN_CMnRSPMBXF); in asd_init_cseq_cio()
951 asd_write_reg_dword(asd_ha, CMnREQMBX(i), 0); in asd_init_cseq_cio()
960 static void asd_init_lseq_cio(struct asd_ha_struct *asd_ha, int lseq) in asd_init_lseq_cio() argument
966 asd_write_reg_dword(asd_ha, LmARP2INTEN(lseq), EN_ARP2HALTC); in asd_init_lseq_cio()
968 asd_write_reg_byte(asd_ha, LmSCRATCHPAGE(lseq), 0); in asd_init_lseq_cio()
972 asd_write_reg_byte(asd_ha, LmMnSCRATCHPAGE(lseq, i), 0); in asd_init_lseq_cio()
975 asd_write_reg_byte(asd_ha, LmMnSCRATCHPAGE(lseq, 5), 0); in asd_init_lseq_cio()
977 asd_write_reg_dword(asd_ha, LmRSPMBX(lseq), 0); in asd_init_lseq_cio()
980 asd_write_reg_dword(asd_ha, LmMnINTEN(lseq, 0), LmM0INTEN_MASK); in asd_init_lseq_cio()
981 asd_write_reg_dword(asd_ha, LmMnINT(lseq, 0), 0xFFFFFFFF); in asd_init_lseq_cio()
983 asd_write_reg_dword(asd_ha, LmMnINTEN(lseq, 1), LmM1INTEN_MASK); in asd_init_lseq_cio()
984 asd_write_reg_dword(asd_ha, LmMnINT(lseq, 1), 0xFFFFFFFF); in asd_init_lseq_cio()
986 asd_write_reg_dword(asd_ha, LmMnINTEN(lseq, 2), LmM2INTEN_MASK); in asd_init_lseq_cio()
987 asd_write_reg_dword(asd_ha, LmMnINT(lseq, 2), 0xFFFFFFFF); in asd_init_lseq_cio()
989 asd_write_reg_dword(asd_ha, LmMnINTEN(lseq, 5), LmM5INTEN_MASK); in asd_init_lseq_cio()
990 asd_write_reg_dword(asd_ha, LmMnINT(lseq, 5), 0xFFFFFFFF); in asd_init_lseq_cio()
993 asd_write_reg_byte(asd_ha, LmHWTSTATEN(lseq), LmHWTSTATEN_MASK); in asd_init_lseq_cio()
996 asd_write_reg_dword(asd_ha, LmPRIMSTAT0EN(lseq), LmPRIMSTAT0EN_MASK); in asd_init_lseq_cio()
997 asd_write_reg_dword(asd_ha, LmPRIMSTAT1EN(lseq), LmPRIMSTAT1EN_MASK); in asd_init_lseq_cio()
1000 asd_write_reg_dword(asd_ha, LmFRMERREN(lseq), LmFRMERREN_MASK); in asd_init_lseq_cio()
1001 asd_write_reg_byte(asd_ha, LmMnHOLDLVL(lseq, 0), 0x50); in asd_init_lseq_cio()
1004 asd_write_reg_byte(asd_ha, LmMnXFRLVL(lseq, 0), LmMnXFRLVL_512); in asd_init_lseq_cio()
1006 asd_write_reg_byte(asd_ha, LmMnXFRLVL(lseq, 1), LmMnXFRLVL_256); in asd_init_lseq_cio()
1009 asd_write_reg_word(asd_ha, LmPRGMCNT(lseq), lseq_idle_loop); in asd_init_lseq_cio()
1012 asd_write_reg_dword(asd_ha, LmMODECTL(lseq), LmBLIND48); in asd_init_lseq_cio()
1013 asd_write_reg_word(asd_ha, LmM3SATATIMER(lseq), in asd_init_lseq_cio()
1016 (void) asd_read_reg_dword(asd_ha, LmREQMBX(lseq)); in asd_init_lseq_cio()
1019 asd_write_reg_dword(asd_ha, LmPRMSTAT0(lseq), 0xFFFFFFFF); in asd_init_lseq_cio()
1020 asd_write_reg_dword(asd_ha, LmPRMSTAT1(lseq), 0xFFFFFFFF); in asd_init_lseq_cio()
1023 asd_write_reg_byte(asd_ha, LmHWTSTAT(lseq), 0xFF); in asd_init_lseq_cio()
1026 asd_write_reg_byte(asd_ha, LmMnDMAERRS(lseq, 0), 0xFF); in asd_init_lseq_cio()
1027 asd_write_reg_byte(asd_ha, LmMnDMAERRS(lseq, 1), 0xFF); in asd_init_lseq_cio()
1030 asd_write_reg_byte(asd_ha, LmMnSGDMAERRS(lseq, 0), 0xFF); in asd_init_lseq_cio()
1031 asd_write_reg_byte(asd_ha, LmMnSGDMAERRS(lseq, 1), 0xFF); in asd_init_lseq_cio()
1034 asd_write_reg_byte(asd_ha, LmMnBUFSTAT(lseq, 0), LmMnBUFPERR); in asd_init_lseq_cio()
1037 asd_write_reg_dword(asd_ha, LmMnFRMERR(lseq, 0), 0xFFFFFFFF); in asd_init_lseq_cio()
1040 asd_write_reg_byte(asd_ha, LmARP2INTCTL(lseq), RSTINTCTL); in asd_init_lseq_cio()
1043 sas_addr = asd_ha->phys[lseq].phy_desc->sas_addr; in asd_init_lseq_cio()
1045 asd_write_reg_byte(asd_ha, LmWWN(lseq) + i, sas_addr[i]); in asd_init_lseq_cio()
1048 asd_write_reg_byte(asd_ha, LmMnXMTSIZE(lseq, 1), 0); in asd_init_lseq_cio()
1051 asd_write_reg_word(asd_ha, LmBITL_TIMER(lseq), 9); in asd_init_lseq_cio()
1054 asd_write_reg_byte(asd_ha, LmMnSATAFS(lseq, 1), 0x80); in asd_init_lseq_cio()
1058 asd_write_reg_word(asd_ha, LmM3INTVEC0(lseq), lseq_vecs[0]); in asd_init_lseq_cio()
1059 asd_write_reg_word(asd_ha, LmM3INTVEC1(lseq), lseq_vecs[1]); in asd_init_lseq_cio()
1060 asd_write_reg_word(asd_ha, LmM3INTVEC2(lseq), lseq_vecs[2]); in asd_init_lseq_cio()
1061 asd_write_reg_word(asd_ha, LmM3INTVEC3(lseq), lseq_vecs[3]); in asd_init_lseq_cio()
1062 asd_write_reg_word(asd_ha, LmM3INTVEC4(lseq), lseq_vecs[4]); in asd_init_lseq_cio()
1063 asd_write_reg_word(asd_ha, LmM3INTVEC5(lseq), lseq_vecs[5]); in asd_init_lseq_cio()
1064 asd_write_reg_word(asd_ha, LmM3INTVEC6(lseq), lseq_vecs[6]); in asd_init_lseq_cio()
1065 asd_write_reg_word(asd_ha, LmM3INTVEC7(lseq), lseq_vecs[7]); in asd_init_lseq_cio()
1066 asd_write_reg_word(asd_ha, LmM3INTVEC8(lseq), lseq_vecs[8]); in asd_init_lseq_cio()
1067 asd_write_reg_word(asd_ha, LmM3INTVEC9(lseq), lseq_vecs[9]); in asd_init_lseq_cio()
1068 asd_write_reg_word(asd_ha, LmM3INTVEC10(lseq), lseq_vecs[10]); in asd_init_lseq_cio()
1073 asd_write_reg_dword(asd_ha, LmCONTROL(lseq), in asd_init_lseq_cio()
1077 asd_write_reg_byte(asd_ha, LmM1SASALIGN(lseq), SAS_ALIGN_DEFAULT); in asd_init_lseq_cio()
1078 asd_write_reg_byte(asd_ha, LmM1STPALIGN(lseq), STP_ALIGN_DEFAULT); in asd_init_lseq_cio()
1086 static void asd_post_init_cseq(struct asd_ha_struct *asd_ha) in asd_post_init_cseq() argument
1091 asd_write_reg_dword(asd_ha, CMnINT(i), 0xFFFFFFFF); in asd_post_init_cseq()
1093 asd_read_reg_dword(asd_ha, CMnRSPMBX(i)); in asd_post_init_cseq()
1095 asd_write_reg_byte(asd_ha, CARP2INTCTL, RSTINTCTL); in asd_post_init_cseq()
1104 static void asd_init_ddb_0(struct asd_ha_struct *asd_ha) in asd_init_ddb_0() argument
1110 asd_ddbsite_write_dword(asd_ha, 0, i, 0); in asd_init_ddb_0()
1112 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1114 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1116 asd_ha->hw_prof.max_ddbs-1); in asd_init_ddb_0()
1117 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1119 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1121 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1123 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1125 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1127 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1129 asd_ddbsite_write_word(asd_ha, 0, in asd_init_ddb_0()
1131 asd_ha->hw_prof.num_phys * 2); in asd_init_ddb_0()
1132 asd_ddbsite_write_byte(asd_ha, 0, in asd_init_ddb_0()
1134 asd_ddbsite_write_byte(asd_ha, 0, in asd_init_ddb_0()
1136 asd_ddbsite_write_byte(asd_ha, 0, in asd_init_ddb_0()
1139 set_bit(0, asd_ha->hw_prof.ddb_bitmap); in asd_init_ddb_0()
1142 static void asd_seq_init_ddb_sites(struct asd_ha_struct *asd_ha) in asd_seq_init_ddb_sites() argument
1149 asd_ddbsite_write_dword(asd_ha, ddb_site, i, 0); in asd_seq_init_ddb_sites()
1156 static void asd_seq_setup_seqs(struct asd_ha_struct *asd_ha) in asd_seq_setup_seqs() argument
1162 asd_seq_init_ddb_sites(asd_ha); in asd_seq_setup_seqs()
1166 asd_init_scb_sites(asd_ha); in asd_seq_setup_seqs()
1169 asd_init_cseq_scratch(asd_ha); in asd_seq_setup_seqs()
1172 asd_init_lseq_scratch(asd_ha); in asd_seq_setup_seqs()
1175 asd_init_cseq_cio(asd_ha); in asd_seq_setup_seqs()
1177 asd_init_ddb_0(asd_ha); in asd_seq_setup_seqs()
1180 lseq_mask = asd_ha->hw_prof.enabled_phys; in asd_seq_setup_seqs()
1182 asd_init_lseq_cio(asd_ha, lseq); in asd_seq_setup_seqs()
1183 asd_post_init_cseq(asd_ha); in asd_seq_setup_seqs()
1191 static int asd_seq_start_cseq(struct asd_ha_struct *asd_ha) in asd_seq_start_cseq() argument
1194 asd_write_reg_word(asd_ha, CPRGMCNT, cseq_idle_loop); in asd_seq_start_cseq()
1197 return asd_unpause_cseq(asd_ha); in asd_seq_start_cseq()
1205 static int asd_seq_start_lseq(struct asd_ha_struct *asd_ha, int lseq) in asd_seq_start_lseq() argument
1208 asd_write_reg_word(asd_ha, LmPRGMCNT(lseq), lseq_idle_loop); in asd_seq_start_lseq()
1211 return asd_seq_unpause_lseq(asd_ha, lseq); in asd_seq_start_lseq()
1220 static int asd_request_firmware(struct asd_ha_struct *asd_ha) in asd_request_firmware() argument
1234 &asd_ha->pcidev->dev); in asd_request_firmware()
1299 int asd_init_seqs(struct asd_ha_struct *asd_ha) in asd_init_seqs() argument
1303 err = asd_request_firmware(asd_ha); in asd_init_seqs()
1311 err = asd_seq_download_seqs(asd_ha); in asd_init_seqs()
1314 pci_name(asd_ha->pcidev)); in asd_init_seqs()
1318 asd_seq_setup_seqs(asd_ha); in asd_init_seqs()
1323 int asd_start_seqs(struct asd_ha_struct *asd_ha) in asd_start_seqs() argument
1329 err = asd_seq_start_cseq(asd_ha); in asd_start_seqs()
1332 pci_name(asd_ha->pcidev)); in asd_start_seqs()
1336 lseq_mask = asd_ha->hw_prof.enabled_phys; in asd_start_seqs()
1338 err = asd_seq_start_lseq(asd_ha, lseq); in asd_start_seqs()
1341 pci_name(asd_ha->pcidev)); in asd_start_seqs()
1367 void asd_update_port_links(struct asd_ha_struct *asd_ha, struct asd_phy *phy) in asd_update_port_links() argument
1375 spin_lock_irqsave(&asd_ha->hw_prof.ddb_lock, flags); in asd_update_port_links()
1377 asd_ddbsite_write_byte(asd_ha, 0, in asd_update_port_links()
1382 phy_is_up = asd_ddbsite_read_byte(asd_ha, 0, in asd_update_port_links()
1384 err = asd_ddbsite_update_byte(asd_ha, 0, in asd_update_port_links()
1395 spin_unlock_irqrestore(&asd_ha->hw_prof.ddb_lock, flags); in asd_update_port_links()