aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/csiostor/csio_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/csiostor/csio_hw.c')
-rw-r--r--drivers/scsi/csiostor/csio_hw.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c
index 890d93ac2066..04ec5867de43 100644
--- a/drivers/scsi/csiostor/csio_hw.c
+++ b/drivers/scsi/csiostor/csio_hw.c
@@ -959,8 +959,8 @@ retry:
959 * timeout ... and then retry if we haven't exhausted 959 * timeout ... and then retry if we haven't exhausted
960 * our retries ... 960 * our retries ...
961 */ 961 */
962 pcie_fw = csio_rd_reg32(hw, PCIE_FW); 962 pcie_fw = csio_rd_reg32(hw, PCIE_FW_A);
963 if (!(pcie_fw & (PCIE_FW_ERR|PCIE_FW_INIT))) { 963 if (!(pcie_fw & (PCIE_FW_ERR_F|PCIE_FW_INIT_F))) {
964 if (waiting <= 0) { 964 if (waiting <= 0) {
965 if (retries-- > 0) 965 if (retries-- > 0)
966 goto retry; 966 goto retry;
@@ -976,10 +976,10 @@ retry:
976 * report errors preferentially. 976 * report errors preferentially.
977 */ 977 */
978 if (state) { 978 if (state) {
979 if (pcie_fw & PCIE_FW_ERR) { 979 if (pcie_fw & PCIE_FW_ERR_F) {
980 *state = CSIO_DEV_STATE_ERR; 980 *state = CSIO_DEV_STATE_ERR;
981 rv = -ETIMEDOUT; 981 rv = -ETIMEDOUT;
982 } else if (pcie_fw & PCIE_FW_INIT) 982 } else if (pcie_fw & PCIE_FW_INIT_F)
983 *state = CSIO_DEV_STATE_INIT; 983 *state = CSIO_DEV_STATE_INIT;
984 } 984 }
985 985
@@ -988,9 +988,9 @@ retry:
988 * there's not a valid Master PF, grab its identity 988 * there's not a valid Master PF, grab its identity
989 * for our caller. 989 * for our caller.
990 */ 990 */
991 if (mpfn == PCIE_FW_MASTER_MASK && 991 if (mpfn == PCIE_FW_MASTER_M &&
992 (pcie_fw & PCIE_FW_MASTER_VLD)) 992 (pcie_fw & PCIE_FW_MASTER_VLD_F))
993 mpfn = PCIE_FW_MASTER_GET(pcie_fw); 993 mpfn = PCIE_FW_MASTER_G(pcie_fw);
994 break; 994 break;
995 } 995 }
996 hw->flags &= ~CSIO_HWF_MASTER; 996 hw->flags &= ~CSIO_HWF_MASTER;
@@ -1156,7 +1156,7 @@ csio_hw_fw_halt(struct csio_hw *hw, uint32_t mbox, int32_t force)
1156 * If a legitimate mailbox is provided, issue a RESET command 1156 * If a legitimate mailbox is provided, issue a RESET command
1157 * with a HALT indication. 1157 * with a HALT indication.
1158 */ 1158 */
1159 if (mbox <= PCIE_FW_MASTER_MASK) { 1159 if (mbox <= PCIE_FW_MASTER_M) {
1160 struct csio_mb *mbp; 1160 struct csio_mb *mbp;
1161 1161
1162 mbp = mempool_alloc(hw->mb_mempool, GFP_ATOMIC); 1162 mbp = mempool_alloc(hw->mb_mempool, GFP_ATOMIC);
@@ -1194,7 +1194,8 @@ csio_hw_fw_halt(struct csio_hw *hw, uint32_t mbox, int32_t force)
1194 */ 1194 */
1195 if (retval == 0 || force) { 1195 if (retval == 0 || force) {
1196 csio_set_reg_field(hw, CIM_BOOT_CFG, UPCRST, UPCRST); 1196 csio_set_reg_field(hw, CIM_BOOT_CFG, UPCRST, UPCRST);
1197 csio_set_reg_field(hw, PCIE_FW, PCIE_FW_HALT, PCIE_FW_HALT); 1197 csio_set_reg_field(hw, PCIE_FW_A, PCIE_FW_HALT_F,
1198 PCIE_FW_HALT_F);
1198 } 1199 }
1199 1200
1200 /* 1201 /*
@@ -1234,7 +1235,7 @@ csio_hw_fw_restart(struct csio_hw *hw, uint32_t mbox, int32_t reset)
1234 * doing it automatically, we need to clear the PCIE_FW.HALT 1235 * doing it automatically, we need to clear the PCIE_FW.HALT
1235 * bit. 1236 * bit.
1236 */ 1237 */
1237 csio_set_reg_field(hw, PCIE_FW, PCIE_FW_HALT, 0); 1238 csio_set_reg_field(hw, PCIE_FW_A, PCIE_FW_HALT_F, 0);
1238 1239
1239 /* 1240 /*
1240 * If we've been given a valid mailbox, first try to get the 1241 * If we've been given a valid mailbox, first try to get the
@@ -1243,7 +1244,7 @@ csio_hw_fw_restart(struct csio_hw *hw, uint32_t mbox, int32_t reset)
1243 * valid mailbox or the RESET command failed, fall back to 1244 * valid mailbox or the RESET command failed, fall back to
1244 * hitting the chip with a hammer. 1245 * hitting the chip with a hammer.
1245 */ 1246 */
1246 if (mbox <= PCIE_FW_MASTER_MASK) { 1247 if (mbox <= PCIE_FW_MASTER_M) {
1247 csio_set_reg_field(hw, CIM_BOOT_CFG, UPCRST, 0); 1248 csio_set_reg_field(hw, CIM_BOOT_CFG, UPCRST, 0);
1248 msleep(100); 1249 msleep(100);
1249 if (csio_do_reset(hw, true) == 0) 1250 if (csio_do_reset(hw, true) == 0)
@@ -1257,7 +1258,7 @@ csio_hw_fw_restart(struct csio_hw *hw, uint32_t mbox, int32_t reset)
1257 1258
1258 csio_set_reg_field(hw, CIM_BOOT_CFG, UPCRST, 0); 1259 csio_set_reg_field(hw, CIM_BOOT_CFG, UPCRST, 0);
1259 for (ms = 0; ms < FW_CMD_MAX_TIMEOUT; ) { 1260 for (ms = 0; ms < FW_CMD_MAX_TIMEOUT; ) {
1260 if (!(csio_rd_reg32(hw, PCIE_FW) & PCIE_FW_HALT)) 1261 if (!(csio_rd_reg32(hw, PCIE_FW_A) & PCIE_FW_HALT_F))
1261 return 0; 1262 return 0;
1262 msleep(100); 1263 msleep(100);
1263 ms += 100; 1264 ms += 100;
@@ -2237,11 +2238,11 @@ csio_hw_intr_enable(struct csio_hw *hw)
2237 * by FW, so do nothing for INTX. 2238 * by FW, so do nothing for INTX.
2238 */ 2239 */
2239 if (hw->intr_mode == CSIO_IM_MSIX) 2240 if (hw->intr_mode == CSIO_IM_MSIX)
2240 csio_set_reg_field(hw, MYPF_REG(PCIE_PF_CFG), 2241 csio_set_reg_field(hw, MYPF_REG(PCIE_PF_CFG_A),
2241 AIVEC(AIVEC_MASK), vec); 2242 AIVEC_V(AIVEC_M), vec);
2242 else if (hw->intr_mode == CSIO_IM_MSI) 2243 else if (hw->intr_mode == CSIO_IM_MSI)
2243 csio_set_reg_field(hw, MYPF_REG(PCIE_PF_CFG), 2244 csio_set_reg_field(hw, MYPF_REG(PCIE_PF_CFG_A),
2244 AIVEC(AIVEC_MASK), 0); 2245 AIVEC_V(AIVEC_M), 0);
2245 2246
2246 csio_wr_reg32(hw, PF_INTR_MASK, MYPF_REG(PL_PF_INT_ENABLE)); 2247 csio_wr_reg32(hw, PF_INTR_MASK, MYPF_REG(PL_PF_INT_ENABLE));
2247 2248