aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArmen Baloyan <armen.baloyan@qlogic.com>2014-04-11 16:54:32 -0400
committerChristoph Hellwig <hch@lst.de>2014-05-19 07:31:03 -0400
commit42543fb946b249318e28c511bcf1bd4f80aade5e (patch)
tree58a7ebca7f7406c18d317ad06c205766c98d0f31
parentf934c9d082f9062a583c4a3980c1902814b7e950 (diff)
qla2xxx: Adjust adapter reset routine to the changes in firmware specification for ISPFx00.
Signed-off-by: Armen Baloyan <armen.baloyan@qlogic.com> Signed-off-by: Saurav Kashyap <saurav.kashyap@qlogic.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/qla2xxx/qla_mr.c55
-rw-r--r--drivers/scsi/qla2xxx/qla_mr.h1
2 files changed, 48 insertions, 8 deletions
diff --git a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c
index 3fdf844eb7cd..abeb3901498b 100644
--- a/drivers/scsi/qla2xxx/qla_mr.c
+++ b/drivers/scsi/qla2xxx/qla_mr.c
@@ -527,21 +527,63 @@ qlafx00_soc_cpu_reset(scsi_qla_host_t *vha)
527 struct qla_hw_data *ha = vha->hw; 527 struct qla_hw_data *ha = vha->hw;
528 int i, core; 528 int i, core;
529 uint32_t cnt; 529 uint32_t cnt;
530 uint32_t reg_val;
531
532 spin_lock_irqsave(&ha->hardware_lock, flags);
533
534 QLAFX00_SET_HBA_SOC_REG(ha, 0x80004, 0);
535 QLAFX00_SET_HBA_SOC_REG(ha, 0x82004, 0);
536
537 /* stop the XOR DMA engines */
538 QLAFX00_SET_HBA_SOC_REG(ha, 0x60920, 0x02);
539 QLAFX00_SET_HBA_SOC_REG(ha, 0x60924, 0x02);
540 QLAFX00_SET_HBA_SOC_REG(ha, 0xf0920, 0x02);
541 QLAFX00_SET_HBA_SOC_REG(ha, 0xf0924, 0x02);
542
543 /* stop the IDMA engines */
544 reg_val = QLAFX00_GET_HBA_SOC_REG(ha, 0x60840);
545 reg_val &= ~(1<<12);
546 QLAFX00_SET_HBA_SOC_REG(ha, 0x60840, reg_val);
547
548 reg_val = QLAFX00_GET_HBA_SOC_REG(ha, 0x60844);
549 reg_val &= ~(1<<12);
550 QLAFX00_SET_HBA_SOC_REG(ha, 0x60844, reg_val);
551
552 reg_val = QLAFX00_GET_HBA_SOC_REG(ha, 0x60848);
553 reg_val &= ~(1<<12);
554 QLAFX00_SET_HBA_SOC_REG(ha, 0x60848, reg_val);
555
556 reg_val = QLAFX00_GET_HBA_SOC_REG(ha, 0x6084C);
557 reg_val &= ~(1<<12);
558 QLAFX00_SET_HBA_SOC_REG(ha, 0x6084C, reg_val);
559
560 for (i = 0; i < 100000; i++) {
561 if ((QLAFX00_GET_HBA_SOC_REG(ha, 0xd0000) & 0x10000000) == 0 &&
562 (QLAFX00_GET_HBA_SOC_REG(ha, 0x10600) & 0x1) == 0)
563 break;
564 udelay(100);
565 }
530 566
531 /* Set all 4 cores in reset */ 567 /* Set all 4 cores in reset */
532 for (i = 0; i < 4; i++) { 568 for (i = 0; i < 4; i++) {
533 QLAFX00_SET_HBA_SOC_REG(ha, 569 QLAFX00_SET_HBA_SOC_REG(ha,
534 (SOC_SW_RST_CONTROL_REG_CORE0 + 8*i), (0xF01)); 570 (SOC_SW_RST_CONTROL_REG_CORE0 + 8*i), (0xF01));
535 }
536
537 /* Set all 4 core Clock gating control */
538 for (i = 0; i < 4; i++) {
539 QLAFX00_SET_HBA_SOC_REG(ha, 571 QLAFX00_SET_HBA_SOC_REG(ha,
540 (SOC_SW_RST_CONTROL_REG_CORE0 + 4 + 8*i), (0x01010101)); 572 (SOC_SW_RST_CONTROL_REG_CORE0 + 4 + 8*i), (0x01010101));
541 } 573 }
542 574
543 /* Reset all units in Fabric */ 575 /* Reset all units in Fabric */
544 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_RST_CONTROL_REG, (0x11F0101)); 576 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_RST_CONTROL_REG, (0x011f0101));
577
578 /* */
579 QLAFX00_SET_HBA_SOC_REG(ha, 0x10610, 1);
580 QLAFX00_SET_HBA_SOC_REG(ha, 0x10600, 0);
581
582 /* Set all 4 core Memory Power Down Registers */
583 for (i = 0; i < 5; i++) {
584 QLAFX00_SET_HBA_SOC_REG(ha,
585 (SOC_PWR_MANAGEMENT_PWR_DOWN_REG + 4*i), (0x0));
586 }
545 587
546 /* Reset all interrupt control registers */ 588 /* Reset all interrupt control registers */
547 for (i = 0; i < 115; i++) { 589 for (i = 0; i < 115; i++) {
@@ -564,8 +606,6 @@ qlafx00_soc_cpu_reset(scsi_qla_host_t *vha)
564 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_CONTROL_REG, (0x2)); 606 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_CONTROL_REG, (0x2));
565 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_CONFIG_REG, (0x3)); 607 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_CONFIG_REG, (0x3));
566 608
567 spin_lock_irqsave(&ha->hardware_lock, flags);
568
569 /* Kick in Fabric units */ 609 /* Kick in Fabric units */
570 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_RST_CONTROL_REG, (0x0)); 610 QLAFX00_SET_HBA_SOC_REG(ha, SOC_FABRIC_RST_CONTROL_REG, (0x0));
571 611
@@ -598,7 +638,6 @@ qlafx00_soft_reset(scsi_qla_host_t *vha)
598 638
599 ha->isp_ops->disable_intrs(ha); 639 ha->isp_ops->disable_intrs(ha);
600 qlafx00_soc_cpu_reset(vha); 640 qlafx00_soc_cpu_reset(vha);
601 ha->isp_ops->enable_intrs(ha);
602} 641}
603 642
604/** 643/**
diff --git a/drivers/scsi/qla2xxx/qla_mr.h b/drivers/scsi/qla2xxx/qla_mr.h
index 1e6941e122dd..aeaa1b40b1fc 100644
--- a/drivers/scsi/qla2xxx/qla_mr.h
+++ b/drivers/scsi/qla2xxx/qla_mr.h
@@ -351,6 +351,7 @@ struct config_info_data {
351#define SOC_FABRIC_RST_CONTROL_REG 0x0020840 351#define SOC_FABRIC_RST_CONTROL_REG 0x0020840
352#define SOC_FABRIC_CONTROL_REG 0x0020200 352#define SOC_FABRIC_CONTROL_REG 0x0020200
353#define SOC_FABRIC_CONFIG_REG 0x0020204 353#define SOC_FABRIC_CONFIG_REG 0x0020204
354#define SOC_PWR_MANAGEMENT_PWR_DOWN_REG 0x001820C
354 355
355#define SOC_INTERRUPT_SOURCE_I_CONTROL_REG 0x0020B00 356#define SOC_INTERRUPT_SOURCE_I_CONTROL_REG 0x0020B00
356#define SOC_CORE_TIMER_REG 0x0021850 357#define SOC_CORE_TIMER_REG 0x0021850