diff options
Diffstat (limited to 'drivers/scsi/csiostor/csio_hw.c')
-rw-r--r-- | drivers/scsi/csiostor/csio_hw.c | 61 |
1 files changed, 15 insertions, 46 deletions
diff --git a/drivers/scsi/csiostor/csio_hw.c b/drivers/scsi/csiostor/csio_hw.c index 5c31fa603de4..35c5f83b08a0 100644 --- a/drivers/scsi/csiostor/csio_hw.c +++ b/drivers/scsi/csiostor/csio_hw.c | |||
@@ -60,37 +60,10 @@ int csio_msi = 2; | |||
60 | static int dev_num; | 60 | static int dev_num; |
61 | 61 | ||
62 | /* FCoE Adapter types & its description */ | 62 | /* FCoE Adapter types & its description */ |
63 | static const struct csio_adap_desc csio_t4_fcoe_adapters[] = { | ||
64 | {"T440-Dbg 10G", "Chelsio T440-Dbg 10G [FCoE]"}, | ||
65 | {"T420-CR 10G", "Chelsio T420-CR 10G [FCoE]"}, | ||
66 | {"T422-CR 10G/1G", "Chelsio T422-CR 10G/1G [FCoE]"}, | ||
67 | {"T440-CR 10G", "Chelsio T440-CR 10G [FCoE]"}, | ||
68 | {"T420-BCH 10G", "Chelsio T420-BCH 10G [FCoE]"}, | ||
69 | {"T440-BCH 10G", "Chelsio T440-BCH 10G [FCoE]"}, | ||
70 | {"T440-CH 10G", "Chelsio T440-CH 10G [FCoE]"}, | ||
71 | {"T420-SO 10G", "Chelsio T420-SO 10G [FCoE]"}, | ||
72 | {"T420-CX4 10G", "Chelsio T420-CX4 10G [FCoE]"}, | ||
73 | {"T420-BT 10G", "Chelsio T420-BT 10G [FCoE]"}, | ||
74 | {"T404-BT 1G", "Chelsio T404-BT 1G [FCoE]"}, | ||
75 | {"B420-SR 10G", "Chelsio B420-SR 10G [FCoE]"}, | ||
76 | {"B404-BT 1G", "Chelsio B404-BT 1G [FCoE]"}, | ||
77 | {"T480-CR 10G", "Chelsio T480-CR 10G [FCoE]"}, | ||
78 | {"T440-LP-CR 10G", "Chelsio T440-LP-CR 10G [FCoE]"}, | ||
79 | {"AMSTERDAM 10G", "Chelsio AMSTERDAM 10G [FCoE]"}, | ||
80 | {"HUAWEI T480 10G", "Chelsio HUAWEI T480 10G [FCoE]"}, | ||
81 | {"HUAWEI T440 10G", "Chelsio HUAWEI T440 10G [FCoE]"}, | ||
82 | {"HUAWEI STG 10G", "Chelsio HUAWEI STG 10G [FCoE]"}, | ||
83 | {"ACROMAG XAUI 10G", "Chelsio ACROMAG XAUI 10G [FCoE]"}, | ||
84 | {"ACROMAG SFP+ 10G", "Chelsio ACROMAG SFP+ 10G [FCoE]"}, | ||
85 | {"QUANTA SFP+ 10G", "Chelsio QUANTA SFP+ 10G [FCoE]"}, | ||
86 | {"HUAWEI 10Gbase-T", "Chelsio HUAWEI 10Gbase-T [FCoE]"}, | ||
87 | {"HUAWEI T4TOE 10G", "Chelsio HUAWEI T4TOE 10G [FCoE]"} | ||
88 | }; | ||
89 | |||
90 | static const struct csio_adap_desc csio_t5_fcoe_adapters[] = { | 63 | static const struct csio_adap_desc csio_t5_fcoe_adapters[] = { |
91 | {"T580-Dbg 10G", "Chelsio T580-Dbg 10G [FCoE]"}, | 64 | {"T580-Dbg 10G", "Chelsio T580-Dbg 10G [FCoE]"}, |
92 | {"T520-CR 10G", "Chelsio T520-CR 10G [FCoE]"}, | 65 | {"T520-CR 10G", "Chelsio T520-CR 10G [FCoE]"}, |
93 | {"T522-CR 10G/1G", "Chelsio T452-CR 10G/1G [FCoE]"}, | 66 | {"T522-CR 10G/1G", "Chelsio T522-CR 10G/1G [FCoE]"}, |
94 | {"T540-CR 10G", "Chelsio T540-CR 10G [FCoE]"}, | 67 | {"T540-CR 10G", "Chelsio T540-CR 10G [FCoE]"}, |
95 | {"T520-BCH 10G", "Chelsio T520-BCH 10G [FCoE]"}, | 68 | {"T520-BCH 10G", "Chelsio T520-BCH 10G [FCoE]"}, |
96 | {"T540-BCH 10G", "Chelsio T540-BCH 10G [FCoE]"}, | 69 | {"T540-BCH 10G", "Chelsio T540-BCH 10G [FCoE]"}, |
@@ -107,7 +80,9 @@ static const struct csio_adap_desc csio_t5_fcoe_adapters[] = { | |||
107 | {"T580-LP-CR 40G", "Chelsio T580-LP-CR 40G [FCoE]"}, | 80 | {"T580-LP-CR 40G", "Chelsio T580-LP-CR 40G [FCoE]"}, |
108 | {"T520-LL-CR 10G", "Chelsio T520-LL-CR 10G [FCoE]"}, | 81 | {"T520-LL-CR 10G", "Chelsio T520-LL-CR 10G [FCoE]"}, |
109 | {"T560-CR 40G", "Chelsio T560-CR 40G [FCoE]"}, | 82 | {"T560-CR 40G", "Chelsio T560-CR 40G [FCoE]"}, |
110 | {"T580-CR 40G", "Chelsio T580-CR 40G [FCoE]"} | 83 | {"T580-CR 40G", "Chelsio T580-CR 40G [FCoE]"}, |
84 | {"T580-SO 40G", "Chelsio T580-SO 40G [FCoE]"}, | ||
85 | {"T502-BT 1G", "Chelsio T502-BT 1G [FCoE]"} | ||
111 | }; | 86 | }; |
112 | 87 | ||
113 | static void csio_mgmtm_cleanup(struct csio_mgmtm *); | 88 | static void csio_mgmtm_cleanup(struct csio_mgmtm *); |
@@ -1716,9 +1691,9 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path) | |||
1716 | uint32_t *cfg_data; | 1691 | uint32_t *cfg_data; |
1717 | int value_to_add = 0; | 1692 | int value_to_add = 0; |
1718 | 1693 | ||
1719 | if (request_firmware(&cf, CSIO_CF_FNAME(hw), dev) < 0) { | 1694 | if (request_firmware(&cf, FW_CFG_NAME_T5, dev) < 0) { |
1720 | csio_err(hw, "could not find config file %s, err: %d\n", | 1695 | csio_err(hw, "could not find config file %s, err: %d\n", |
1721 | CSIO_CF_FNAME(hw), ret); | 1696 | FW_CFG_NAME_T5, ret); |
1722 | return -ENOENT; | 1697 | return -ENOENT; |
1723 | } | 1698 | } |
1724 | 1699 | ||
@@ -1758,8 +1733,8 @@ csio_hw_flash_config(struct csio_hw *hw, u32 *fw_cfg_param, char *path) | |||
1758 | } | 1733 | } |
1759 | if (ret == 0) { | 1734 | if (ret == 0) { |
1760 | csio_info(hw, "config file upgraded to %s\n", | 1735 | csio_info(hw, "config file upgraded to %s\n", |
1761 | CSIO_CF_FNAME(hw)); | 1736 | FW_CFG_NAME_T5); |
1762 | snprintf(path, 64, "%s%s", "/lib/firmware/", CSIO_CF_FNAME(hw)); | 1737 | snprintf(path, 64, "%s%s", "/lib/firmware/", FW_CFG_NAME_T5); |
1763 | } | 1738 | } |
1764 | 1739 | ||
1765 | leave: | 1740 | leave: |
@@ -2123,9 +2098,9 @@ csio_hw_flash_fw(struct csio_hw *hw, int *reset) | |||
2123 | return -EINVAL; | 2098 | return -EINVAL; |
2124 | } | 2099 | } |
2125 | 2100 | ||
2126 | if (request_firmware(&fw, CSIO_FW_FNAME(hw), dev) < 0) { | 2101 | if (request_firmware(&fw, FW_FNAME_T5, dev) < 0) { |
2127 | csio_err(hw, "could not find firmware image %s, err: %d\n", | 2102 | csio_err(hw, "could not find firmware image %s, err: %d\n", |
2128 | CSIO_FW_FNAME(hw), ret); | 2103 | FW_FNAME_T5, ret); |
2129 | return -EINVAL; | 2104 | return -EINVAL; |
2130 | } | 2105 | } |
2131 | 2106 | ||
@@ -3207,7 +3182,7 @@ static void csio_ncsi_intr_handler(struct csio_hw *hw) | |||
3207 | */ | 3182 | */ |
3208 | static void csio_xgmac_intr_handler(struct csio_hw *hw, int port) | 3183 | static void csio_xgmac_intr_handler(struct csio_hw *hw, int port) |
3209 | { | 3184 | { |
3210 | uint32_t v = csio_rd_reg32(hw, CSIO_MAC_INT_CAUSE_REG(hw, port)); | 3185 | uint32_t v = csio_rd_reg32(hw, T5_PORT_REG(port, MAC_PORT_INT_CAUSE_A)); |
3211 | 3186 | ||
3212 | v &= TXFIFO_PRTY_ERR_F | RXFIFO_PRTY_ERR_F; | 3187 | v &= TXFIFO_PRTY_ERR_F | RXFIFO_PRTY_ERR_F; |
3213 | if (!v) | 3188 | if (!v) |
@@ -3217,7 +3192,7 @@ static void csio_xgmac_intr_handler(struct csio_hw *hw, int port) | |||
3217 | csio_fatal(hw, "XGMAC %d Tx FIFO parity error\n", port); | 3192 | csio_fatal(hw, "XGMAC %d Tx FIFO parity error\n", port); |
3218 | if (v & RXFIFO_PRTY_ERR_F) | 3193 | if (v & RXFIFO_PRTY_ERR_F) |
3219 | csio_fatal(hw, "XGMAC %d Rx FIFO parity error\n", port); | 3194 | csio_fatal(hw, "XGMAC %d Rx FIFO parity error\n", port); |
3220 | csio_wr_reg32(hw, v, CSIO_MAC_INT_CAUSE_REG(hw, port)); | 3195 | csio_wr_reg32(hw, v, T5_PORT_REG(port, MAC_PORT_INT_CAUSE_A)); |
3221 | csio_hw_fatal_err(hw); | 3196 | csio_hw_fatal_err(hw); |
3222 | } | 3197 | } |
3223 | 3198 | ||
@@ -3966,13 +3941,7 @@ csio_hw_set_description(struct csio_hw *hw, uint16_t ven_id, uint16_t dev_id) | |||
3966 | prot_type = (dev_id & CSIO_ASIC_DEVID_PROTO_MASK); | 3941 | prot_type = (dev_id & CSIO_ASIC_DEVID_PROTO_MASK); |
3967 | adap_type = (dev_id & CSIO_ASIC_DEVID_TYPE_MASK); | 3942 | adap_type = (dev_id & CSIO_ASIC_DEVID_TYPE_MASK); |
3968 | 3943 | ||
3969 | if (prot_type == CSIO_T4_FCOE_ASIC) { | 3944 | if (prot_type == CSIO_T5_FCOE_ASIC) { |
3970 | memcpy(hw->hw_ver, | ||
3971 | csio_t4_fcoe_adapters[adap_type].model_no, 16); | ||
3972 | memcpy(hw->model_desc, | ||
3973 | csio_t4_fcoe_adapters[adap_type].description, | ||
3974 | 32); | ||
3975 | } else if (prot_type == CSIO_T5_FCOE_ASIC) { | ||
3976 | memcpy(hw->hw_ver, | 3945 | memcpy(hw->hw_ver, |
3977 | csio_t5_fcoe_adapters[adap_type].model_no, 16); | 3946 | csio_t5_fcoe_adapters[adap_type].model_no, 16); |
3978 | memcpy(hw->model_desc, | 3947 | memcpy(hw->model_desc, |
@@ -4009,8 +3978,8 @@ csio_hw_init(struct csio_hw *hw) | |||
4009 | 3978 | ||
4010 | strcpy(hw->name, CSIO_HW_NAME); | 3979 | strcpy(hw->name, CSIO_HW_NAME); |
4011 | 3980 | ||
4012 | /* Initialize the HW chip ops with T4/T5 specific ops */ | 3981 | /* Initialize the HW chip ops T5 specific ops */ |
4013 | hw->chip_ops = csio_is_t4(hw->chip_id) ? &t4_ops : &t5_ops; | 3982 | hw->chip_ops = &t5_ops; |
4014 | 3983 | ||
4015 | /* Set the model & its description */ | 3984 | /* Set the model & its description */ |
4016 | 3985 | ||