diff options
author | Sakthivel K <Sakthivel.SaravananKamalRaju@pmcs.com> | 2013-03-19 08:35:55 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-05-10 10:47:48 -0400 |
commit | 54792dc2856e27d7c9d798589d45cabe1230990a (patch) | |
tree | 6f221687936649debf48fba023265ae30ceae2ee | |
parent | f5860992db55c9e36b0f120dff73f0c34abe510d (diff) |
[SCSI] pm80xx: SPC new firmware changes for device id 0x8081 alone
Additional bar shift for new SPC firmware, applicable to device
id 0x8081 only.
Signed-off-by: Sakthivel K <Sakthivel.SaravananKamalRaju@pmcs.com>
Signed-off-by: Anand Kumar S <AnandKumar.Santhanam@pmcs.com>
Acked-by: Jack Wang <jack_wang@usish.com>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.c | 31 | ||||
-rw-r--r-- | drivers/scsi/pm8001/pm8001_hwi.h | 2 |
2 files changed, 30 insertions, 3 deletions
diff --git a/drivers/scsi/pm8001/pm8001_hwi.c b/drivers/scsi/pm8001/pm8001_hwi.c index c486fe868e37..eea0c3a291ec 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.c +++ b/drivers/scsi/pm8001/pm8001_hwi.c | |||
@@ -640,6 +640,18 @@ static void init_pci_device_addresses(struct pm8001_hba_info *pm8001_ha) | |||
640 | static int pm8001_chip_init(struct pm8001_hba_info *pm8001_ha) | 640 | static int pm8001_chip_init(struct pm8001_hba_info *pm8001_ha) |
641 | { | 641 | { |
642 | u8 i = 0; | 642 | u8 i = 0; |
643 | u16 deviceid; | ||
644 | pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid); | ||
645 | /* 8081 controllers need BAR shift to access MPI space | ||
646 | * as this is shared with BIOS data */ | ||
647 | if (deviceid == 0x8081) { | ||
648 | if (-1 == pm8001_bar4_shift(pm8001_ha, GSM_SM_BASE)) { | ||
649 | PM8001_FAIL_DBG(pm8001_ha, | ||
650 | pm8001_printk("Shift Bar4 to 0x%x failed\n", | ||
651 | GSM_SM_BASE)); | ||
652 | return -1; | ||
653 | } | ||
654 | } | ||
643 | /* check the firmware status */ | 655 | /* check the firmware status */ |
644 | if (-1 == check_fw_ready(pm8001_ha)) { | 656 | if (-1 == check_fw_ready(pm8001_ha)) { |
645 | PM8001_FAIL_DBG(pm8001_ha, | 657 | PM8001_FAIL_DBG(pm8001_ha, |
@@ -660,9 +672,12 @@ static int pm8001_chip_init(struct pm8001_hba_info *pm8001_ha) | |||
660 | update_inbnd_queue_table(pm8001_ha, i); | 672 | update_inbnd_queue_table(pm8001_ha, i); |
661 | for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) | 673 | for (i = 0; i < PM8001_MAX_OUTB_NUM; i++) |
662 | update_outbnd_queue_table(pm8001_ha, i); | 674 | update_outbnd_queue_table(pm8001_ha, i); |
663 | mpi_set_phys_g3_with_ssc(pm8001_ha, 0); | 675 | /* 8081 controller donot require these operations */ |
664 | /* 7->130ms, 34->500ms, 119->1.5s */ | 676 | if (deviceid != 0x8081) { |
665 | mpi_set_open_retry_interval_reg(pm8001_ha, 119); | 677 | mpi_set_phys_g3_with_ssc(pm8001_ha, 0); |
678 | /* 7->130ms, 34->500ms, 119->1.5s */ | ||
679 | mpi_set_open_retry_interval_reg(pm8001_ha, 119); | ||
680 | } | ||
666 | /* notify firmware update finished and check initialization status */ | 681 | /* notify firmware update finished and check initialization status */ |
667 | if (0 == mpi_init_check(pm8001_ha)) { | 682 | if (0 == mpi_init_check(pm8001_ha)) { |
668 | PM8001_INIT_DBG(pm8001_ha, | 683 | PM8001_INIT_DBG(pm8001_ha, |
@@ -684,6 +699,16 @@ static int mpi_uninit_check(struct pm8001_hba_info *pm8001_ha) | |||
684 | u32 max_wait_count; | 699 | u32 max_wait_count; |
685 | u32 value; | 700 | u32 value; |
686 | u32 gst_len_mpistate; | 701 | u32 gst_len_mpistate; |
702 | u16 deviceid; | ||
703 | pci_read_config_word(pm8001_ha->pdev, PCI_DEVICE_ID, &deviceid); | ||
704 | if (deviceid == 0x8081) { | ||
705 | if (-1 == pm8001_bar4_shift(pm8001_ha, GSM_SM_BASE)) { | ||
706 | PM8001_FAIL_DBG(pm8001_ha, | ||
707 | pm8001_printk("Shift Bar4 to 0x%x failed\n", | ||
708 | GSM_SM_BASE)); | ||
709 | return -1; | ||
710 | } | ||
711 | } | ||
687 | init_pci_device_addresses(pm8001_ha); | 712 | init_pci_device_addresses(pm8001_ha); |
688 | /* Write bit1=1 to Inbound DoorBell Register to tell the SPC FW the | 713 | /* Write bit1=1 to Inbound DoorBell Register to tell the SPC FW the |
689 | table is stop */ | 714 | table is stop */ |
diff --git a/drivers/scsi/pm8001/pm8001_hwi.h b/drivers/scsi/pm8001/pm8001_hwi.h index 2399aabbc4e4..d7c1e2034226 100644 --- a/drivers/scsi/pm8001/pm8001_hwi.h +++ b/drivers/scsi/pm8001/pm8001_hwi.h | |||
@@ -131,6 +131,8 @@ | |||
131 | #define LINKRATE_30 (0x02 << 8) | 131 | #define LINKRATE_30 (0x02 << 8) |
132 | #define LINKRATE_60 (0x04 << 8) | 132 | #define LINKRATE_60 (0x04 << 8) |
133 | 133 | ||
134 | /* for new SPC controllers MEMBASE III is shared between BIOS and DATA */ | ||
135 | #define GSM_SM_BASE 0x4F0000 | ||
134 | struct mpi_msg_hdr{ | 136 | struct mpi_msg_hdr{ |
135 | __le32 header; /* Bits [11:0] - Message operation code */ | 137 | __le32 header; /* Bits [11:0] - Message operation code */ |
136 | /* Bits [15:12] - Message Category */ | 138 | /* Bits [15:12] - Message Category */ |