Commit 6246b8a1 authored by Giridhar Malavali's avatar Giridhar Malavali Committed by James Bottomley
parent 050c9bb1
...@@ -356,7 +356,8 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj, ...@@ -356,7 +356,8 @@ qla2x00_sysfs_write_optrom_ctl(struct file *filp, struct kobject *kobj,
else if (start == (ha->flt_region_boot * 4) || else if (start == (ha->flt_region_boot * 4) ||
start == (ha->flt_region_fw * 4)) start == (ha->flt_region_fw * 4))
valid = 1; valid = 1;
else if (IS_QLA25XX(ha) || IS_QLA8XXX_TYPE(ha)) else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha)
|| IS_CNA_CAPABLE(ha) || IS_QLA2031(ha))
valid = 1; valid = 1;
if (!valid) { if (!valid) {
ql_log(ql_log_warn, vha, 0x7065, ql_log(ql_log_warn, vha, 0x7065,
...@@ -898,7 +899,7 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha) ...@@ -898,7 +899,7 @@ qla2x00_alloc_sysfs_attr(scsi_qla_host_t *vha)
continue; continue;
if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw)) if (iter->is4GBp_only == 2 && !IS_QLA25XX(vha->hw))
continue; continue;
if (iter->is4GBp_only == 3 && !(IS_QLA8XXX_TYPE(vha->hw))) if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw)))
continue; continue;
ret = sysfs_create_bin_file(&host->shost_gendev.kobj, ret = sysfs_create_bin_file(&host->shost_gendev.kobj,
...@@ -926,7 +927,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *vha) ...@@ -926,7 +927,7 @@ qla2x00_free_sysfs_attr(scsi_qla_host_t *vha)
continue; continue;
if (iter->is4GBp_only == 2 && !IS_QLA25XX(ha)) if (iter->is4GBp_only == 2 && !IS_QLA25XX(ha))
continue; continue;
if (iter->is4GBp_only == 3 && !!(IS_QLA8XXX_TYPE(vha->hw))) if (iter->is4GBp_only == 3 && !(IS_CNA_CAPABLE(vha->hw)))
continue; continue;
sysfs_remove_bin_file(&host->shost_gendev.kobj, sysfs_remove_bin_file(&host->shost_gendev.kobj,
...@@ -1231,7 +1232,7 @@ qla2x00_optrom_gold_fw_version_show(struct device *dev, ...@@ -1231,7 +1232,7 @@ qla2x00_optrom_gold_fw_version_show(struct device *dev,
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA81XX(ha)) if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha))
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%d)\n", return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%d)\n",
...@@ -1278,7 +1279,7 @@ qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr, ...@@ -1278,7 +1279,7 @@ qla2x00_mpi_version_show(struct device *dev, struct device_attribute *attr,
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA81XX(ha)) if (!IS_QLA81XX(ha) && !IS_QLA8031(ha))
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n", return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d (%x)\n",
...@@ -1293,7 +1294,7 @@ qla2x00_phy_version_show(struct device *dev, struct device_attribute *attr, ...@@ -1293,7 +1294,7 @@ qla2x00_phy_version_show(struct device *dev, struct device_attribute *attr,
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA81XX(ha)) if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha))
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n", return snprintf(buf, PAGE_SIZE, "%d.%02d.%02d\n",
...@@ -1316,7 +1317,7 @@ qla2x00_vlan_id_show(struct device *dev, struct device_attribute *attr, ...@@ -1316,7 +1317,7 @@ qla2x00_vlan_id_show(struct device *dev, struct device_attribute *attr,
{ {
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
if (!IS_QLA8XXX_TYPE(vha->hw)) if (!IS_CNA_CAPABLE(vha->hw))
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
return snprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id); return snprintf(buf, PAGE_SIZE, "%d\n", vha->fcoe_vlan_id);
...@@ -1328,7 +1329,7 @@ qla2x00_vn_port_mac_address_show(struct device *dev, ...@@ -1328,7 +1329,7 @@ qla2x00_vn_port_mac_address_show(struct device *dev,
{ {
scsi_qla_host_t *vha = shost_priv(class_to_shost(dev)); scsi_qla_host_t *vha = shost_priv(class_to_shost(dev));
if (!IS_QLA8XXX_TYPE(vha->hw)) if (!IS_CNA_CAPABLE(vha->hw))
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n", return snprintf(buf, PAGE_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x\n",
...@@ -1493,6 +1494,9 @@ qla2x00_get_host_speed(struct Scsi_Host *shost) ...@@ -1493,6 +1494,9 @@ qla2x00_get_host_speed(struct Scsi_Host *shost)
case PORT_SPEED_10GB: case PORT_SPEED_10GB:
speed = FC_PORTSPEED_10GBIT; speed = FC_PORTSPEED_10GBIT;
break; break;
case PORT_SPEED_16GB:
speed = FC_PORTSPEED_16GBIT;
break;
} }
fc_host_speed(shost) = speed; fc_host_speed(shost) = speed;
} }
...@@ -1889,6 +1893,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable) ...@@ -1889,6 +1893,7 @@ qla24xx_vport_create(struct fc_vport *fc_vport, bool disable)
break; break;
} }
} }
if (qos) { if (qos) {
ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, 0, ret = qla25xx_create_req_que(ha, options, vha->vp_idx, 0, 0,
qos); qos);
...@@ -2086,7 +2091,7 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha) ...@@ -2086,7 +2091,7 @@ qla2x00_init_host_attr(scsi_qla_host_t *vha)
fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports; fc_host_max_npiv_vports(vha->host) = ha->max_npiv_vports;
fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count; fc_host_npiv_vports_inuse(vha->host) = ha->cur_vport_count;
if (IS_QLA8XXX_TYPE(ha)) if (IS_CNA_CAPABLE(ha))
speed = FC_PORTSPEED_10GBIT; speed = FC_PORTSPEED_10GBIT;
else if (IS_QLA25XX(ha)) else if (IS_QLA25XX(ha))
speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT | speed = FC_PORTSPEED_8GBIT | FC_PORTSPEED_4GBIT |
......
...@@ -540,7 +540,7 @@ qla81xx_set_internal_loopback(scsi_qla_host_t *vha, uint16_t *config, ...@@ -540,7 +540,7 @@ qla81xx_set_internal_loopback(scsi_qla_host_t *vha, uint16_t *config,
int rval = 0; int rval = 0;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA81XX(ha)) if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha))
goto done_set_internal; goto done_set_internal;
new_config[0] = config[0] | (ENABLE_INTERNAL_LOOPBACK << 1); new_config[0] = config[0] | (ENABLE_INTERNAL_LOOPBACK << 1);
...@@ -582,7 +582,7 @@ qla81xx_reset_internal_loopback(scsi_qla_host_t *vha, uint16_t *config, ...@@ -582,7 +582,7 @@ qla81xx_reset_internal_loopback(scsi_qla_host_t *vha, uint16_t *config,
uint16_t new_config[4]; uint16_t new_config[4];
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA81XX(ha)) if (!IS_QLA81XX(ha) && !IS_QLA83XX(ha))
goto done_reset_internal; goto done_reset_internal;
memset(new_config, 0 , sizeof(new_config)); memset(new_config, 0 , sizeof(new_config));
...@@ -707,7 +707,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) ...@@ -707,7 +707,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
if ((ha->current_topology == ISP_CFG_F || if ((ha->current_topology == ISP_CFG_F ||
(atomic_read(&vha->loop_state) == LOOP_DOWN) || (atomic_read(&vha->loop_state) == LOOP_DOWN) ||
(IS_QLA81XX(ha) && ((IS_QLA81XX(ha) || IS_QLA83XX(ha)) &&
le32_to_cpu(*(uint32_t *)req_data) == ELS_OPCODE_BYTE le32_to_cpu(*(uint32_t *)req_data) == ELS_OPCODE_BYTE
&& req_data_len == MAX_ELS_FRAME_PAYLOAD)) && && req_data_len == MAX_ELS_FRAME_PAYLOAD)) &&
elreq.options == EXTERNAL_LOOPBACK) { elreq.options == EXTERNAL_LOOPBACK) {
...@@ -717,7 +717,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job) ...@@ -717,7 +717,7 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
command_sent = INT_DEF_LB_ECHO_CMD; command_sent = INT_DEF_LB_ECHO_CMD;
rval = qla2x00_echo_test(vha, &elreq, response); rval = qla2x00_echo_test(vha, &elreq, response);
} else { } else {
if (IS_QLA81XX(ha)) { if (IS_QLA81XX(ha) || IS_QLA8031(ha)) {
memset(config, 0, sizeof(config)); memset(config, 0, sizeof(config));
memset(new_config, 0, sizeof(new_config)); memset(new_config, 0, sizeof(new_config));
if (qla81xx_get_port_config(vha, config)) { if (qla81xx_get_port_config(vha, config)) {
...@@ -1331,7 +1331,7 @@ qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha, ...@@ -1331,7 +1331,7 @@ qla2x00_optrom_setup(struct fc_bsg_job *bsg_job, scsi_qla_host_t *vha,
start == (ha->flt_region_fw * 4)) start == (ha->flt_region_fw * 4))
valid = 1; valid = 1;
else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha) || else if (IS_QLA24XX_TYPE(ha) || IS_QLA25XX(ha) ||
IS_QLA8XXX_TYPE(ha)) IS_CNA_CAPABLE(ha) || IS_QLA2031(ha))
valid = 1; valid = 1;
if (!valid) { if (!valid) {
ql_log(ql_log_warn, vha, 0x7058, ql_log(ql_log_warn, vha, 0x7058,
......
This diff is collapsed.
...@@ -165,6 +165,54 @@ struct qla81xx_fw_dump { ...@@ -165,6 +165,54 @@ struct qla81xx_fw_dump {
uint32_t ext_mem[1]; uint32_t ext_mem[1];
}; };
struct qla83xx_fw_dump {
uint32_t host_status;
uint32_t host_risc_reg[48];
uint32_t pcie_regs[4];
uint32_t host_reg[32];
uint32_t shadow_reg[11];
uint32_t risc_io_reg;
uint16_t mailbox_reg[32];
uint32_t xseq_gp_reg[256];
uint32_t xseq_0_reg[48];
uint32_t xseq_1_reg[16];
uint32_t xseq_2_reg[16];
uint32_t rseq_gp_reg[256];
uint32_t rseq_0_reg[32];
uint32_t rseq_1_reg[16];
uint32_t rseq_2_reg[16];
uint32_t rseq_3_reg[16];
uint32_t aseq_gp_reg[256];
uint32_t aseq_0_reg[32];
uint32_t aseq_1_reg[16];
uint32_t aseq_2_reg[16];
uint32_t aseq_3_reg[16];
uint32_t cmd_dma_reg[64];
uint32_t req0_dma_reg[15];
uint32_t resp0_dma_reg[15];
uint32_t req1_dma_reg[15];
uint32_t xmt0_dma_reg[32];
uint32_t xmt1_dma_reg[32];
uint32_t xmt2_dma_reg[32];
uint32_t xmt3_dma_reg[32];
uint32_t xmt4_dma_reg[32];
uint32_t xmt_data_dma_reg[16];
uint32_t rcvt0_data_dma_reg[32];
uint32_t rcvt1_data_dma_reg[32];
uint32_t risc_gp_reg[128];
uint32_t lmc_reg[128];
uint32_t fpm_hdw_reg[256];
uint32_t rq0_array_reg[256];
uint32_t rq1_array_reg[256];
uint32_t rp0_array_reg[256];
uint32_t rp1_array_reg[256];
uint32_t queue_control_reg[16];
uint32_t fb_hdw_reg[432];
uint32_t at0_array_reg[128];
uint32_t code_ram[0x2400];
uint32_t ext_mem[1];
};
#define EFT_NUM_BUFFERS 4 #define EFT_NUM_BUFFERS 4
#define EFT_BYTES_PER_BUFFER 0x4000 #define EFT_BYTES_PER_BUFFER 0x4000
#define EFT_SIZE ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS)) #define EFT_SIZE ((EFT_BYTES_PER_BUFFER) * (EFT_NUM_BUFFERS))
...@@ -242,6 +290,7 @@ struct qla2xxx_fw_dump { ...@@ -242,6 +290,7 @@ struct qla2xxx_fw_dump {
struct qla24xx_fw_dump isp24; struct qla24xx_fw_dump isp24;
struct qla25xx_fw_dump isp25; struct qla25xx_fw_dump isp25;
struct qla81xx_fw_dump isp81; struct qla81xx_fw_dump isp81;
struct qla83xx_fw_dump isp83;
} isp; } isp;
}; };
......
...@@ -653,6 +653,7 @@ typedef struct { ...@@ -653,6 +653,7 @@ typedef struct {
#define MBC_DIAGNOSTIC_LOOP_BACK 0x45 /* Diagnostic loop back. */ #define MBC_DIAGNOSTIC_LOOP_BACK 0x45 /* Diagnostic loop back. */
#define MBC_ONLINE_SELF_TEST 0x46 /* Online self-test. */ #define MBC_ONLINE_SELF_TEST 0x46 /* Online self-test. */
#define MBC_ENHANCED_GET_PORT_DATABASE 0x47 /* Get port database + login */ #define MBC_ENHANCED_GET_PORT_DATABASE 0x47 /* Get port database + login */
#define MBC_CONFIGURE_VF 0x4b /* Configure VFs */
#define MBC_RESET_LINK_STATUS 0x52 /* Reset Link Error Status */ #define MBC_RESET_LINK_STATUS 0x52 /* Reset Link Error Status */
#define MBC_IOCB_COMMAND_A64 0x54 /* Execute IOCB command (64) */ #define MBC_IOCB_COMMAND_A64 0x54 /* Execute IOCB command (64) */
#define MBC_SEND_RNID_ELS 0x57 /* Send RNID ELS request */ #define MBC_SEND_RNID_ELS 0x57 /* Send RNID ELS request */
...@@ -2261,6 +2262,7 @@ struct isp_operations { ...@@ -2261,6 +2262,7 @@ struct isp_operations {
#define QLA_MIDX_DEFAULT 0 #define QLA_MIDX_DEFAULT 0
#define QLA_MIDX_RSP_Q 1 #define QLA_MIDX_RSP_Q 1
#define QLA_PCI_MSIX_CONTROL 0xa2 #define QLA_PCI_MSIX_CONTROL 0xa2
#define QLA_83XX_PCI_MSIX_CONTROL 0x92
struct scsi_qla_host; struct scsi_qla_host;
...@@ -2341,7 +2343,7 @@ struct qla_statistics { ...@@ -2341,7 +2343,7 @@ struct qla_statistics {
#define QLA_MQ_SIZE 32 #define QLA_MQ_SIZE 32
#define QLA_MAX_QUEUES 256 #define QLA_MAX_QUEUES 256
#define ISP_QUE_REG(ha, id) \ #define ISP_QUE_REG(ha, id) \
((ha->mqenable) ? \ ((ha->mqenable || IS_QLA83XX(ha)) ? \
((void *)(ha->mqiobase) +\ ((void *)(ha->mqiobase) +\
(QLA_QUE_PAGE * id)) :\ (QLA_QUE_PAGE * id)) :\
((void *)(ha->iobase))) ((void *)(ha->iobase)))
...@@ -2461,6 +2463,7 @@ struct qla_hw_data { ...@@ -2461,6 +2463,7 @@ struct qla_hw_data {
#define MIN_IOBASE_LEN 0x100 #define MIN_IOBASE_LEN 0x100
/* Multi queue data structs */ /* Multi queue data structs */
device_reg_t __iomem *mqiobase; device_reg_t __iomem *mqiobase;
device_reg_t __iomem *msixbase;
uint16_t msix_count; uint16_t msix_count;
uint8_t mqenable; uint8_t mqenable;
struct req_que **req_q_map; struct req_que **req_q_map;
...@@ -2494,6 +2497,7 @@ struct qla_hw_data { ...@@ -2494,6 +2497,7 @@ struct qla_hw_data {
#define PORT_SPEED_2GB 0x01 #define PORT_SPEED_2GB 0x01
#define PORT_SPEED_4GB 0x03 #define PORT_SPEED_4GB 0x03
#define PORT_SPEED_8GB 0x04 #define PORT_SPEED_8GB 0x04
#define PORT_SPEED_16GB 0x05
#define PORT_SPEED_10GB 0x13 #define PORT_SPEED_10GB 0x13
uint16_t link_data_rate; /* F/W operating speed */ uint16_t link_data_rate; /* F/W operating speed */
...@@ -2515,6 +2519,8 @@ struct qla_hw_data { ...@@ -2515,6 +2519,8 @@ struct qla_hw_data {
#define PCI_DEVICE_ID_QLOGIC_ISP2532 0x2532 #define PCI_DEVICE_ID_QLOGIC_ISP2532 0x2532
#define PCI_DEVICE_ID_QLOGIC_ISP8432 0x8432 #define PCI_DEVICE_ID_QLOGIC_ISP8432 0x8432
#define PCI_DEVICE_ID_QLOGIC_ISP8001 0x8001 #define PCI_DEVICE_ID_QLOGIC_ISP8001 0x8001
#define PCI_DEVICE_ID_QLOGIC_ISP8031 0x8031
#define PCI_DEVICE_ID_QLOGIC_ISP2031 0x2031
uint32_t device_type; uint32_t device_type;
#define DT_ISP2100 BIT_0 #define DT_ISP2100 BIT_0
#define DT_ISP2200 BIT_1 #define DT_ISP2200 BIT_1
...@@ -2531,7 +2537,9 @@ struct qla_hw_data { ...@@ -2531,7 +2537,9 @@ struct qla_hw_data {
#define DT_ISP8432 BIT_12 #define DT_ISP8432 BIT_12
#define DT_ISP8001 BIT_13 #define DT_ISP8001 BIT_13
#define DT_ISP8021 BIT_14 #define DT_ISP8021 BIT_14
#define DT_ISP_LAST (DT_ISP8021 << 1) #define DT_ISP2031 BIT_15
#define DT_ISP8031 BIT_16
#define DT_ISP_LAST (DT_ISP8031 << 1)
#define DT_T10_PI BIT_25 #define DT_T10_PI BIT_25
#define DT_IIDMA BIT_26 #define DT_IIDMA BIT_26
...@@ -2555,26 +2563,30 @@ struct qla_hw_data { ...@@ -2555,26 +2563,30 @@ struct qla_hw_data {
#define IS_QLA2532(ha) (DT_MASK(ha) & DT_ISP2532) #define IS_QLA2532(ha) (DT_MASK(ha) & DT_ISP2532)
#define IS_QLA8432(ha) (DT_MASK(ha) & DT_ISP8432) #define IS_QLA8432(ha) (DT_MASK(ha) & DT_ISP8432)
#define IS_QLA8001(ha) (DT_MASK(ha) & DT_ISP8001) #define IS_QLA8001(ha) (DT_MASK(ha) & DT_ISP8001)
#define IS_QLA81XX(ha) (IS_QLA8001(ha))
#define IS_QLA82XX(ha) (DT_MASK(ha) & DT_ISP8021) #define IS_QLA82XX(ha) (DT_MASK(ha) & DT_ISP8021)
#define IS_QLA2031(ha) (DT_MASK(ha) & DT_ISP2031)
#define IS_QLA8031(ha) (DT_MASK(ha) & DT_ISP8031)
#define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \ #define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \
IS_QLA6312(ha) || IS_QLA6322(ha)) IS_QLA6312(ha) || IS_QLA6322(ha))
#define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha)) #define IS_QLA24XX(ha) (IS_QLA2422(ha) || IS_QLA2432(ha))
#define IS_QLA54XX(ha) (IS_QLA5422(ha) || IS_QLA5432(ha)) #define IS_QLA54XX(ha) (IS_QLA5422(ha) || IS_QLA5432(ha))
#define IS_QLA25XX(ha) (IS_QLA2532(ha)) #define IS_QLA25XX(ha) (IS_QLA2532(ha))
#define IS_QLA83XX(ha) (IS_QLA2031(ha) || IS_QLA8031(ha))
#define IS_QLA84XX(ha) (IS_QLA8432(ha)) #define IS_QLA84XX(ha) (IS_QLA8432(ha))
#define IS_QLA24XX_TYPE(ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \ #define IS_QLA24XX_TYPE(ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \
IS_QLA84XX(ha)) IS_QLA84XX(ha))
#define IS_QLA81XX(ha) (IS_QLA8001(ha)) #define IS_CNA_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA82XX(ha) || \
#define IS_QLA8XXX_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA82XX(ha)) IS_QLA8031(ha))
#define IS_QLA2XXX_MIDTYPE(ha) (IS_QLA24XX(ha) || IS_QLA84XX(ha) || \ #define IS_QLA2XXX_MIDTYPE(ha) (IS_QLA24XX(ha) || IS_QLA84XX(ha) || \
IS_QLA25XX(ha) || IS_QLA81XX(ha) || \ IS_QLA25XX(ha) || IS_QLA81XX(ha) || \
IS_QLA82XX(ha)) IS_QLA82XX(ha) || IS_QLA83XX(ha))
#define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha)) #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha))
#define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \ #define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha) || \
(ha)->flags.msix_enabled) IS_QLA83XX(ha)) && (ha)->flags.msix_enabled)
#define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha)) #define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha))
#define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha)) #define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA83XX(ha))
#define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha)) #define IS_ALOGIO_CAPABLE(ha) (IS_QLA23XX(ha) || IS_FWI2_CAPABLE(ha))
#define IS_T10_PI_CAPABLE(ha) ((ha)->device_type & DT_T10_PI) #define IS_T10_PI_CAPABLE(ha) ((ha)->device_type & DT_T10_PI)
...@@ -2583,6 +2595,8 @@ struct qla_hw_data { ...@@ -2583,6 +2595,8 @@ struct qla_hw_data {
#define IS_ZIO_SUPPORTED(ha) ((ha)->device_type & DT_ZIO_SUPPORTED) #define IS_ZIO_SUPPORTED(ha) ((ha)->device_type & DT_ZIO_SUPPORTED)
#define IS_OEM_001(ha) ((ha)->device_type & DT_OEM_001) #define IS_OEM_001(ha) ((ha)->device_type & DT_OEM_001)
#define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS) #define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS)
#define IS_CT6_SUPPORTED(ha) ((ha)->device_type & DT_CT6_SUPPORTED)
#define IS_MQUE_CAPABLE(ha) ((ha)->mqenable || IS_QLA83XX(ha))
/* HBA serial number */ /* HBA serial number */
uint8_t serial0; uint8_t serial0;
...@@ -2674,6 +2688,8 @@ struct qla_hw_data { ...@@ -2674,6 +2688,8 @@ struct qla_hw_data {
uint16_t fw_minor_version; uint16_t fw_minor_version;
uint16_t fw_subminor_version; uint16_t fw_subminor_version;
uint16_t fw_attributes; uint16_t fw_attributes;
uint16_t fw_attributes_h;
uint16_t fw_attributes_ext[2];
uint32_t fw_memory_size; uint32_t fw_memory_size;
uint32_t fw_transfer_size; uint32_t fw_transfer_size;
uint32_t fw_srisc_address; uint32_t fw_srisc_address;
...@@ -3021,6 +3037,7 @@ typedef struct scsi_qla_host { ...@@ -3021,6 +3037,7 @@ typedef struct scsi_qla_host {
#define OPTROM_SIZE_25XX 0x200000 #define OPTROM_SIZE_25XX 0x200000
#define OPTROM_SIZE_81XX 0x400000 #define OPTROM_SIZE_81XX 0x400000
#define OPTROM_SIZE_82XX 0x800000 #define OPTROM_SIZE_82XX 0x800000
#define OPTROM_SIZE_83XX 0x1000000
#define OPTROM_BURST_SIZE 0x1000 #define OPTROM_BURST_SIZE 0x1000
#define OPTROM_BURST_DWORDS (OPTROM_BURST_SIZE / 4) #define OPTROM_BURST_DWORDS (OPTROM_BURST_SIZE / 4)
......
...@@ -114,7 +114,7 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha) ...@@ -114,7 +114,7 @@ qla2x00_dfs_setup(scsi_qla_host_t *vha)
{ {
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha)) if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha))
goto out; goto out;
if (!ha->fce) if (!ha->fce)
goto out; goto out;
......
...@@ -1327,6 +1327,11 @@ struct qla_flt_header { ...@@ -1327,6 +1327,11 @@ struct qla_flt_header {
#define FLT_REG_GOLD_FW 0x2f #define FLT_REG_GOLD_FW 0x2f
#define FLT_REG_FCP_PRIO_0 0x87 #define FLT_REG_FCP_PRIO_0 0x87
#define FLT_REG_FCP_PRIO_1 0x88 #define FLT_REG_FCP_PRIO_1 0x88
#define FLT_REG_FCOE_FW 0xA4
#define FLT_REG_FCOE_VPD_0 0xA9
#define FLT_REG_FCOE_NVRAM_0 0xAA
#define FLT_REG_FCOE_VPD_1 0xAB
#define FLT_REG_FCOE_NVRAM_1 0xAC
struct qla_flt_region { struct qla_flt_region {
uint32_t code; uint32_t code;
...@@ -1494,6 +1499,11 @@ struct access_chip_rsp_84xx { ...@@ -1494,6 +1499,11 @@ struct access_chip_rsp_84xx {
#define MBC_GET_XGMAC_STATS 0x7a #define MBC_GET_XGMAC_STATS 0x7a
#define MBC_GET_DCBX_PARAMS 0x51 #define MBC_GET_DCBX_PARAMS 0x51
/*
* ISP83xx mailbox commands
*/
#define MBC_WRITE_REMOTE_REG 0x0001 /* Write remote register */
/* Flash access control option field bit definitions */ /* Flash access control option field bit definitions */
#define FAC_OPT_FORCE_SEMAPHORE BIT_15 #define FAC_OPT_FORCE_SEMAPHORE BIT_15
#define FAC_OPT_REQUESTOR_ID BIT_14 #define FAC_OPT_REQUESTOR_ID BIT_14
...@@ -1875,4 +1885,7 @@ struct qla_fcp_prio_cfg { ...@@ -1875,4 +1885,7 @@ struct qla_fcp_prio_cfg {
#define FA_NPIV_CONF0_ADDR_81 0xD1000 #define FA_NPIV_CONF0_ADDR_81 0xD1000
#define FA_NPIV_CONF1_ADDR_81 0xD2000 #define FA_NPIV_CONF1_ADDR_81 0xD2000
/* 83XX Flash locations -- occupies second 8MB region. */
#define FA_FLASH_LAYOUT_ADDR_83 0xFC400
#endif #endif
...@@ -205,8 +205,7 @@ extern int ...@@ -205,8 +205,7 @@ extern int
qla2x00_execute_fw(scsi_qla_host_t *, uint32_t); qla2x00_execute_fw(scsi_qla_host_t *, uint32_t);
extern int extern int
qla2x00_get_fw_version(scsi_qla_host_t *, uint16_t *, uint16_t *, uint16_t *, qla2x00_get_fw_version(scsi_qla_host_t *);
uint16_t *, uint32_t *, uint8_t *, uint32_t *, uint8_t *);
extern int extern int
qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *); qla2x00_get_fw_options(scsi_qla_host_t *, uint16_t *);
...@@ -409,8 +408,10 @@ extern void qla2x00_beacon_blink(struct scsi_qla_host *); ...@@ -409,8 +408,10 @@ extern void qla2x00_beacon_blink(struct scsi_qla_host *);
extern int qla24xx_beacon_on(struct scsi_qla_host *); extern int qla24xx_beacon_on(struct scsi_qla_host *);
extern int qla24xx_beacon_off(struct scsi_qla_host *); extern int qla24xx_beacon_off(struct scsi_qla_host *);
extern void qla24xx_beacon_blink(struct scsi_qla_host *); extern void qla24xx_beacon_blink(struct scsi_qla_host *);
extern void qla83xx_beacon_blink(struct scsi_qla_host *);
extern int qla82xx_beacon_on(struct scsi_qla_host *); extern int qla82xx_beacon_on(struct scsi_qla_host *);
extern int qla82xx_beacon_off(struct scsi_qla_host *); extern int qla82xx_beacon_off(struct scsi_qla_host *);
extern int qla83xx_write_remote_reg(struct scsi_qla_host *, uint32_t, uint32_t);
extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *, extern uint8_t *qla2x00_read_optrom_data(struct scsi_qla_host *, uint8_t *,
uint32_t, uint32_t); uint32_t, uint32_t);
...@@ -576,6 +577,8 @@ extern void qla82xx_start_iocbs(scsi_qla_host_t *); ...@@ -576,6 +577,8 @@ extern void qla82xx_start_iocbs(scsi_qla_host_t *);
extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *); extern int qla82xx_fcoe_ctx_reset(scsi_qla_host_t *);
extern int qla82xx_check_md_needed(scsi_qla_host_t *); extern int qla82xx_check_md_needed(scsi_qla_host_t *);
extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *); extern void qla82xx_chip_reset_cleanup(scsi_qla_host_t *);
extern int qla81xx_set_led_config(scsi_qla_host_t *, uint16_t *);
extern int qla81xx_get_led_config(scsi_qla_host_t *, uint16_t *);
extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int); extern int qla82xx_mbx_beacon_ctl(scsi_qla_host_t *, int);
extern char *qdev_state(uint32_t); extern char *qdev_state(uint32_t);
extern void qla82xx_clear_pending_mbx(scsi_qla_host_t *); extern void qla82xx_clear_pending_mbx(scsi_qla_host_t *);
...@@ -589,6 +592,9 @@ extern int qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *, ...@@ -589,6 +592,9 @@ extern int qla2x00_issue_iocb_timeout(scsi_qla_host_t *, void *,
extern int qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t, extern int qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t,
uint16_t *, uint16_t *); uint16_t *, uint16_t *);
/* 83xx related functions */
extern void qla83xx_fw_dump(scsi_qla_host_t *, int);
/* Minidump related functions */ /* Minidump related functions */
extern int qla82xx_md_get_template_size(scsi_qla_host_t *); extern int qla82xx_md_get_template_size(scsi_qla_host_t *);
extern int qla82xx_md_get_template(scsi_qla_host_t *); extern int qla82xx_md_get_template(scsi_qla_host_t *);
......
...@@ -1547,7 +1547,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha) ...@@ -1547,7 +1547,7 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
eiter = (struct ct_fdmi_port_attr *) (entries + size); eiter = (struct ct_fdmi_port_attr *) (entries + size);
eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED); eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED);
eiter->len = __constant_cpu_to_be16(4 + 4); eiter->len = __constant_cpu_to_be16(4 + 4);
if (IS_QLA8XXX_TYPE(ha)) if (IS_CNA_CAPABLE(ha))
eiter->a.sup_speed = __constant_cpu_to_be32( eiter->a.sup_speed = __constant_cpu_to_be32(
FDMI_PORT_SPEED_10GB); FDMI_PORT_SPEED_10GB);
else if (IS_QLA25XX(ha)) else if (IS_QLA25XX(ha))
...@@ -1594,6 +1594,10 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha) ...@@ -1594,6 +1594,10 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
eiter->a.cur_speed = eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_10GB); __constant_cpu_to_be32(FDMI_PORT_SPEED_10GB);
break; break;
case PORT_SPEED_16GB:
eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_16GB);
break;
default: default:
eiter->a.cur_speed = eiter->a.cur_speed =
__constant_cpu_to_be32(FDMI_PORT_SPEED_UNKNOWN); __constant_cpu_to_be32(FDMI_PORT_SPEED_UNKNOWN);
......
...@@ -969,6 +969,9 @@ qla81xx_reset_mpi(scsi_qla_host_t *vha) ...@@ -969,6 +969,9 @@ qla81xx_reset_mpi(scsi_qla_host_t *vha)
{ {
uint16_t mb[4] = {0x1010, 0, 1, 0}; uint16_t mb[4] = {0x1010, 0, 1, 0};
if (!IS_QLA81XX(vha->hw))
return QLA_SUCCESS;
return qla81xx_write_mpi_register(vha, mb); return qla81xx_write_mpi_register(vha, mb);
} }
...@@ -1262,7 +1265,9 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ...@@ -1262,7 +1265,9 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
mem_size = (ha->fw_memory_size - 0x11000 + 1) * mem_size = (ha->fw_memory_size - 0x11000 + 1) *
sizeof(uint16_t); sizeof(uint16_t);
} else if (IS_FWI2_CAPABLE(ha)) { } else if (IS_FWI2_CAPABLE(ha)) {
if (IS_QLA81XX(ha)) if (IS_QLA83XX(ha))
fixed_size = offsetof(struct qla83xx_fw_dump, ext_mem);
else if (IS_QLA81XX(ha))
fixed_size = offsetof(struct qla81xx_fw_dump, ext_mem); fixed_size = offsetof(struct qla81xx_fw_dump, ext_mem);
else if (IS_QLA25XX(ha)) else if (IS_QLA25XX(ha))
fixed_size = offsetof(struct qla25xx_fw_dump, ext_mem); fixed_size = offsetof(struct qla25xx_fw_dump, ext_mem);
...@@ -1271,7 +1276,8 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ...@@ -1271,7 +1276,8 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
mem_size = (ha->fw_memory_size - 0x100000 + 1) * mem_size = (ha->fw_memory_size - 0x100000 + 1) *
sizeof(uint32_t); sizeof(uint32_t);
if (ha->mqenable) { if (ha->mqenable) {
mq_size = sizeof(struct qla2xxx_mq_chain); if (!IS_QLA83XX(ha))
mq_size = sizeof(struct qla2xxx_mq_chain);
/* /*
* Allocate maximum buffer size for all queues. * Allocate maximum buffer size for all queues.
* Resizing must be done at end-of-dump processing. * Resizing must be done at end-of-dump processing.
...@@ -1282,7 +1288,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha) ...@@ -1282,7 +1288,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *vha)
(rsp->length * sizeof(response_t)); (rsp->length * sizeof(response_t));
} }
/* Allocate memory for Fibre Channel Event Buffer. */ /* Allocate memory for Fibre Channel Event Buffer. */
if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha)) if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha))
goto try_eft; goto try_eft;
tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma, tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma,
...@@ -1493,17 +1499,8 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) ...@@ -1493,17 +1499,8 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
fw_major_version = ha->fw_major_version; fw_major_version = ha->fw_major_version;
if (IS_QLA82XX(ha)) if (IS_QLA82XX(ha))
qla82xx_check_md_needed(vha); qla82xx_check_md_needed(vha);
else { else
rval = qla2x00_get_fw_version(vha, rval = qla2x00_get_fw_version(vha);
&ha->fw_major_version,
&ha->fw_minor_version,
&ha->fw_subminor_version,
&ha->fw_attributes,
&ha->fw_memory_size,
ha->mpi_version,
&ha->mpi_capabilities,
ha->phy_version);
}
if (rval != QLA_SUCCESS) if (rval != QLA_SUCCESS)
goto failed; goto failed;
ha->flags.npiv_supported = 0; ha->flags.npiv_supported = 0;
...@@ -1544,6 +1541,9 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) ...@@ -1544,6 +1541,9 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
spin_unlock_irqrestore(&ha->hardware_lock, flags); spin_unlock_irqrestore(&ha->hardware_lock, flags);
} }
if (IS_QLA83XX(ha))
goto skip_fac_check;
if (rval == QLA_SUCCESS && IS_FAC_REQUIRED(ha)) { if (rval == QLA_SUCCESS && IS_FAC_REQUIRED(ha)) {
uint32_t size; uint32_t size;
...@@ -1556,6 +1556,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha) ...@@ -1556,6 +1556,11 @@ qla2x00_setup_chip(scsi_qla_host_t *vha)
"Unsupported FAC firmware (%d.%02d.%02d).\n", "Unsupported FAC firmware (%d.%02d.%02d).\n",
ha->fw_major_version, ha->fw_minor_version, ha->fw_major_version, ha->fw_minor_version,
ha->fw_subminor_version); ha->fw_subminor_version);
skip_fac_check:
if (IS_QLA83XX(ha)) {
ha->flags.fac_supported = 0;
rval = QLA_SUCCESS;
}
} }
} }
failed: failed:
...@@ -1734,7 +1739,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha) ...@@ -1734,7 +1739,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
struct req_que *req = ha->req_q_map[0]; struct req_que *req = ha->req_q_map[0];
struct rsp_que *rsp = ha->rsp_q_map[0]; struct rsp_que *rsp = ha->rsp_q_map[0];
/* Setup ring parameters in initialization control block. */ /* Setup ring parameters in initialization control block. */
icb = (struct init_cb_24xx *)ha->init_cb; icb = (struct init_cb_24xx *)ha->init_cb;
icb->request_q_outpointer = __constant_cpu_to_le16(0); icb->request_q_outpointer = __constant_cpu_to_le16(0);
icb->response_q_inpointer = __constant_cpu_to_le16(0); icb->response_q_inpointer = __constant_cpu_to_le16(0);
...@@ -1745,7 +1750,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha) ...@@ -1745,7 +1750,7 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
icb->response_q_address[0] = cpu_to_le32(LSD(rsp->dma)); icb->response_q_address[0] = cpu_to_le32(LSD(rsp->dma));
icb->response_q_address[1] = cpu_to_le32(MSD(rsp->dma)); icb->response_q_address[1] = cpu_to_le32(MSD(rsp->dma));
if (ha->mqenable) { if (ha->mqenable || IS_QLA83XX(ha)) {
icb->qos = __constant_cpu_to_le16(QLA_DEFAULT_QUE_QOS); icb->qos = __constant_cpu_to_le16(QLA_DEFAULT_QUE_QOS);
icb->rid = __constant_cpu_to_le16(rid); icb->rid = __constant_cpu_to_le16(rid);
if (ha->flags.msix_enabled) { if (ha->flags.msix_enabled) {
...@@ -1765,7 +1770,8 @@ qla24xx_config_rings(struct scsi_qla_host *vha) ...@@ -1765,7 +1770,8 @@ qla24xx_config_rings(struct scsi_qla_host *vha)
__constant_cpu_to_le32(BIT_18); __constant_cpu_to_le32(BIT_18);
/* Use Disable MSIX Handshake mode for capable adapters */ /* Use Disable MSIX Handshake mode for capable adapters */
if (IS_MSIX_NACK_CAPABLE(ha)) { if ((ha->fw_attributes & BIT_6) && (IS_MSIX_NACK_CAPABLE(ha)) &&
(ha->flags.msix_enabled)) {
icb->firmware_options_2 &= icb->firmware_options_2 &=
__constant_cpu_to_le32(~BIT_22); __constant_cpu_to_le32(~BIT_22);
ha->flags.disable_msix_handshake = 1; ha->flags.disable_msix_handshake = 1;
...@@ -2037,7 +2043,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha) ...@@ -2037,7 +2043,7 @@ qla2x00_configure_hba(scsi_qla_host_t *vha)
&loop_id, &al_pa, &area, &domain, &topo, &sw_cap); &loop_id, &al_pa, &area, &domain, &topo, &sw_cap);
if (rval != QLA_SUCCESS) { if (rval != QLA_SUCCESS) {
if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) || if (LOOP_TRANSITION(vha) || atomic_read(&ha->loop_down_timer) ||
IS_QLA8XXX_TYPE(ha) || IS_CNA_CAPABLE(ha) ||
(rval == QLA_COMMAND_ERROR && loop_id == 0x7)) { (rval == QLA_COMMAND_ERROR && loop_id == 0x7)) {
ql_dbg(ql_dbg_disc, vha, 0x2008, ql_dbg(ql_dbg_disc, vha, 0x2008,
"Loop is in a transition state.\n"); "Loop is in a transition state.\n");
...@@ -2129,7 +2135,7 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len, ...@@ -2129,7 +2135,7 @@ qla2x00_set_model_info(scsi_qla_host_t *vha, uint8_t *model, size_t len,
uint16_t index; uint16_t index;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
int use_tbl = !IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha) && int use_tbl = !IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha) &&
!IS_QLA8XXX_TYPE(ha); !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha);
if (memcmp(model, BINZERO, len) != 0) { if (memcmp(model, BINZERO, len) != 0) {
strncpy(ha->model_number, model, len); strncpy(ha->model_number, model, len);
...@@ -4109,15 +4115,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha) ...@@ -4109,15 +4115,8 @@ qla2x00_abort_isp(scsi_qla_host_t *vha)
ha->isp_abort_cnt = 0; ha->isp_abort_cnt = 0;
clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags); clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
if (IS_QLA81XX(ha)) if (IS_QLA81XX(ha) || IS_QLA8031(ha))
qla2x00_get_fw_version(vha, qla2x00_get_fw_version(vha);
&ha->fw_major_version,
&ha->fw_minor_version,
&ha->fw_subminor_version,
&ha->fw_attributes, &ha->fw_memory_size,
ha->mpi_version, &ha->mpi_capabilities,
ha->phy_version);
if (ha->fce) { if (ha->fce) {
ha->flags.fce_enabled = 1; ha->flags.fce_enabled = 1;
memset(ha->fce, 0, memset(ha->fce, 0,
...@@ -4983,7 +4982,6 @@ qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) ...@@ -4983,7 +4982,6 @@ qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
ql_log(ql_log_info, vha, 0x009a, "Update operational firmware.\n"); ql_log(ql_log_info, vha, 0x009a, "Update operational firmware.\n");
ha->flags.running_gold_fw = 1; ha->flags.running_gold_fw = 1;
return rval; return rval;
} }
...@@ -5223,10 +5221,10 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) ...@@ -5223,10 +5221,10 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
nv->reset_delay = 5; nv->reset_delay = 5;
nv->max_luns_per_target = __constant_cpu_to_le16(128); nv->max_luns_per_target = __constant_cpu_to_le16(128);
nv->port_down_retry_count = __constant_cpu_to_le16(30); nv->port_down_retry_count = __constant_cpu_to_le16(30);
nv->link_down_timeout = __constant_cpu_to_le16(30); nv->link_down_timeout = __constant_cpu_to_le16(180);
nv->enode_mac[0] = 0x00; nv->enode_mac[0] = 0x00;
nv->enode_mac[1] = 0x02; nv->enode_mac[1] = 0xC0;
nv->enode_mac[2] = 0x03; nv->enode_mac[2] = 0xDD;
nv->enode_mac[3] = 0x04; nv->enode_mac[3] = 0x04;
nv->enode_mac[4] = 0x05; nv->enode_mac[4] = 0x05;
nv->enode_mac[5] = 0x06 + ha->port_no; nv->enode_mac[5] = 0x06 + ha->port_no;
...@@ -5362,6 +5360,10 @@ qla81xx_nvram_config(scsi_qla_host_t *vha) ...@@ -5362,6 +5360,10 @@ qla81xx_nvram_config(scsi_qla_host_t *vha)
if (ql2xloginretrycount) if (ql2xloginretrycount)
ha->login_retry_count = ql2xloginretrycount; ha->login_retry_count = ql2xloginretrycount;
/* if not running MSI-X we need handshaking on interrupts */
if (!vha->hw->flags.msix_enabled && IS_QLA83XX(ha))
icb->firmware_options_2 |= __constant_cpu_to_le32(BIT_22);
/* Enable ZIO. */ /* Enable ZIO. */
if (!vha->flags.init_done) { if (!vha->flags.init_done) {
ha->zio_mode = le32_to_cpu(icb->firmware_options_2) & ha->zio_mode = le32_to_cpu(icb->firmware_options_2) &
......
...@@ -473,7 +473,6 @@ qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) ...@@ -473,7 +473,6 @@ qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req)
{ {
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
device_reg_t __iomem *reg = ISP_QUE_REG(ha, req->id); device_reg_t __iomem *reg = ISP_QUE_REG(ha, req->id);
struct device_reg_2xxx __iomem *ioreg = &ha->iobase->isp;
if (IS_QLA82XX(ha)) { if (IS_QLA82XX(ha)) {
qla82xx_start_iocbs(vha); qla82xx_start_iocbs(vha);
...@@ -487,9 +486,9 @@ qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req) ...@@ -487,9 +486,9 @@ qla2x00_start_iocbs(struct scsi_qla_host *vha, struct req_que *req)
req->ring_ptr++; req->ring_ptr++;
/* Set chip new ring index. */ /* Set chip new ring index. */
if (ha->mqenable) { if (ha->mqenable || IS_QLA83XX(ha)) {
WRT_REG_DWORD(&reg->isp25mq.req_q_in, req->ring_index); WRT_REG_DWORD(req->req_q_in, req->ring_index);
RD_REG_DWORD(&ioreg->hccr); RD_REG_DWORD_RELAXED(&reg->isp24.req_q_in);
} else if (IS_FWI2_CAPABLE(ha)) { } else if (IS_FWI2_CAPABLE(ha)) {
WRT_REG_DWORD(&reg->isp24.req_q_in, req->ring_index); WRT_REG_DWORD(&reg->isp24.req_q_in, req->ring_index);
RD_REG_DWORD_RELAXED(&reg->isp24.req_q_in); RD_REG_DWORD_RELAXED(&reg->isp24.req_q_in);
...@@ -1856,7 +1855,7 @@ qla2x00_alloc_iocbs(scsi_qla_host_t *vha, srb_t *sp) ...@@ -1856,7 +1855,7 @@ qla2x00_alloc_iocbs(scsi_qla_host_t *vha, srb_t *sp)
skip_cmd_array: skip_cmd_array:
/* Check for room on request queue. */ /* Check for room on request queue. */
if (req->cnt < req_cnt) { if (req->cnt < req_cnt) {
if (ha->mqenable) if (ha->mqenable || IS_QLA83XX(ha))
cnt = RD_REG_DWORD(&reg->isp25mq.req_q_out); cnt = RD_REG_DWORD(&reg->isp25mq.req_q_out);
else if (IS_QLA82XX(ha)) else if (IS_QLA82XX(ha))
cnt = RD_REG_DWORD(&reg->isp82.req_q_out); cnt = RD_REG_DWORD(&reg->isp82.req_q_out);
......
...@@ -289,7 +289,7 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr) ...@@ -289,7 +289,7 @@ qla81xx_idc_event(scsi_qla_host_t *vha, uint16_t aen, uint16_t descr)
mb[cnt] = RD_REG_WORD(wptr); mb[cnt] = RD_REG_WORD(wptr);
ql_dbg(ql_dbg_async, vha, 0x5021, ql_dbg(ql_dbg_async, vha, 0x5021,
"Inter-Driver Commucation %s -- " "Inter-Driver Communication %s -- "
"%04x %04x %04x %04x %04x %04x %04x.\n", "%04x %04x %04x %04x %04x %04x %04x.\n",
event[aen & 0xff], mb[0], mb[1], mb[2], mb[3], event[aen & 0xff], mb[0], mb[1], mb[2], mb[3],
mb[4], mb[5], mb[6]); mb[4], mb[5], mb[6]);
...@@ -318,7 +318,7 @@ void ...@@ -318,7 +318,7 @@ void
qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
{ {
#define LS_UNKNOWN 2 #define LS_UNKNOWN 2
static char *link_speeds[] = { "1", "2", "?", "4", "8", "10" }; static char *link_speeds[] = { "1", "2", "?", "4", "8", "16", "10" };
char *link_speed; char *link_speed;
uint16_t handle_cnt; uint16_t handle_cnt;
uint16_t cnt, mbx; uint16_t cnt, mbx;
...@@ -333,7 +333,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -333,7 +333,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
/* Setup to process RIO completion. */ /* Setup to process RIO completion. */
handle_cnt = 0; handle_cnt = 0;
if (IS_QLA8XXX_TYPE(ha)) if (IS_CNA_CAPABLE(ha))
goto skip_rio; goto skip_rio;
switch (mb[0]) { switch (mb[0]) {
case MBA_SCSI_COMPLETION: case MBA_SCSI_COMPLETION:
...@@ -405,7 +405,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -405,7 +405,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
break; break;
case MBA_SYSTEM_ERR: /* System Error */ case MBA_SYSTEM_ERR: /* System Error */
mbx = IS_QLA81XX(ha) ? RD_REG_WORD(&reg24->mailbox7) : 0; mbx = (IS_QLA81XX(ha) || IS_QLA83XX(ha)) ?
RD_REG_WORD(&reg24->mailbox7) : 0;
ql_log(ql_log_warn, vha, 0x5003, ql_log(ql_log_warn, vha, 0x5003,
"ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh " "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh "
"mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx); "mbx7=%xh.\n", mb[1], mb[2], mb[3], mbx);
...@@ -418,6 +419,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -418,6 +419,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
"Unrecoverable Hardware Error: adapter " "Unrecoverable Hardware Error: adapter "
"marked OFFLINE!\n"); "marked OFFLINE!\n");
vha->flags.online = 0; vha->flags.online = 0;
vha->device_flags |= DFLG_DEV_FAILED;
} else { } else {
/* Check to see if MPI timeout occurred */ /* Check to see if MPI timeout occurred */
if ((mbx & MBX_3) && (ha->flags.port0)) if ((mbx & MBX_3) && (ha->flags.port0))
...@@ -431,6 +433,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -431,6 +433,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
"Unrecoverable Hardware Error: adapter marked " "Unrecoverable Hardware Error: adapter marked "
"OFFLINE!\n"); "OFFLINE!\n");
vha->flags.online = 0; vha->flags.online = 0;
vha->device_flags |= DFLG_DEV_FAILED;
} else } else
set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
break; break;
...@@ -482,10 +485,10 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -482,10 +485,10 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
ha->link_data_rate = PORT_SPEED_1GB; ha->link_data_rate = PORT_SPEED_1GB;
} else { } else {
link_speed = link_speeds[LS_UNKNOWN]; link_speed = link_speeds[LS_UNKNOWN];
if (mb[1] < 5) if (mb[1] < 6)
link_speed = link_speeds[mb[1]]; link_speed = link_speeds[mb[1]];
else if (mb[1] == 0x13) else if (mb[1] == 0x13)
link_speed = link_speeds[5]; link_speed = link_speeds[6];
ha->link_data_rate = mb[1]; ha->link_data_rate = mb[1];
} }
...@@ -497,7 +500,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -497,7 +500,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
break; break;
case MBA_LOOP_DOWN: /* Loop Down Event */ case MBA_LOOP_DOWN: /* Loop Down Event */
mbx = IS_QLA81XX(ha) ? RD_REG_WORD(&reg24->mailbox4) : 0; mbx = (IS_QLA81XX(ha) || IS_QLA8031(ha))
? RD_REG_WORD(&reg24->mailbox4) : 0;
mbx = IS_QLA82XX(ha) ? RD_REG_WORD(&reg82->mailbox_out[4]) : mbx; mbx = IS_QLA82XX(ha) ? RD_REG_WORD(&reg82->mailbox_out[4]) : mbx;
ql_dbg(ql_dbg_async, vha, 0x500b, ql_dbg(ql_dbg_async, vha, 0x500b,
"LOOP DOWN detected (%x %x %x %x).\n", "LOOP DOWN detected (%x %x %x %x).\n",
...@@ -547,7 +551,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -547,7 +551,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
if (IS_QLA2100(ha)) if (IS_QLA2100(ha))
break; break;
if (IS_QLA8XXX_TYPE(ha)) { if (IS_QLA81XX(ha) || IS_QLA82XX(ha) || IS_QLA8031(ha)) {
ql_dbg(ql_dbg_async, vha, 0x500d, ql_dbg(ql_dbg_async, vha, 0x500d,
"DCBX Completed -- %04x %04x %04x.\n", "DCBX Completed -- %04x %04x %04x.\n",
mb[1], mb[2], mb[3]); mb[1], mb[2], mb[3]);
...@@ -809,6 +813,10 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb) ...@@ -809,6 +813,10 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
case MBA_IDC_TIME_EXT: case MBA_IDC_TIME_EXT:
qla81xx_idc_event(vha, mb[0], mb[1]); qla81xx_idc_event(vha, mb[0], mb[1]);
break; break;
default:
ql_dbg(ql_dbg_async, vha, 0x5057,
"Unknown AEN:%04x %04x %04x %04x\n",
mb[0], mb[1], mb[2], mb[3]);
} }
if (!vha->vp_idx && ha->num_vhosts) if (!vha->vp_idx && ha->num_vhosts)
...@@ -2127,7 +2135,7 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha) ...@@ -2127,7 +2135,7 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha)
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24; struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha)) if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha) && !IS_QLA83XX(ha))
return; return;
rval = QLA_SUCCESS; rval = QLA_SUCCESS;
...@@ -2168,7 +2176,7 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha) ...@@ -2168,7 +2176,7 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha)
} }
/** /**
* qla24xx_intr_handler() - Process interrupts for the ISP23xx and ISP63xx. * qla24xx_intr_handler() - Process interrupts for the ISP23xx and ISP24xx.
* @irq: * @irq:
* @dev_id: SCSI driver HA context * @dev_id: SCSI driver HA context
* *
...@@ -2530,8 +2538,14 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp) ...@@ -2530,8 +2538,14 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
} }
/* Enable MSI-X vector for response queue update for queue 0 */ /* Enable MSI-X vector for response queue update for queue 0 */
if (ha->mqiobase && (ha->max_rsp_queues > 1 || ha->max_req_queues > 1)) if (IS_QLA83XX(ha)) {
ha->mqenable = 1; if (ha->msixbase && ha->mqiobase &&
(ha->max_rsp_queues > 1 || ha->max_req_queues > 1))
ha->mqenable = 1;
} else
if (ha->mqiobase
&& (ha->max_rsp_queues > 1 || ha->max_req_queues > 1))
ha->mqenable = 1;
ql_dbg(ql_dbg_multiq, vha, 0xc005, ql_dbg(ql_dbg_multiq, vha, 0xc005,
"mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n", "mqiobase=%p, max_rsp_queues=%d, max_req_queues=%d.\n",
ha->mqiobase, ha->max_rsp_queues, ha->max_req_queues); ha->mqiobase, ha->max_rsp_queues, ha->max_req_queues);
...@@ -2552,8 +2566,8 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp) ...@@ -2552,8 +2566,8 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev); scsi_qla_host_t *vha = pci_get_drvdata(ha->pdev);
/* If possible, enable MSI-X. */ /* If possible, enable MSI-X. */
if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
!IS_QLA8432(ha) && !IS_QLA8XXX_TYPE(ha)) !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha))
goto skip_msi; goto skip_msi;
if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP && if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_HP &&
...@@ -2615,7 +2629,7 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp) ...@@ -2615,7 +2629,7 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
* FIXME: Noted that 8014s were being dropped during NK testing. * FIXME: Noted that 8014s were being dropped during NK testing.
* Timing deltas during MSI-X/INTa transitions? * Timing deltas during MSI-X/INTa transitions?
*/ */
if (IS_QLA81XX(ha) || IS_QLA82XX(ha)) if (IS_QLA81XX(ha) || IS_QLA82XX(ha) || IS_QLA83XX(ha))
goto fail; goto fail;
spin_lock_irq(&ha->hardware_lock); spin_lock_irq(&ha->hardware_lock);
if (IS_FWI2_CAPABLE(ha)) { if (IS_FWI2_CAPABLE(ha)) {
......
This diff is collapsed.
...@@ -3136,12 +3136,7 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha) ...@@ -3136,12 +3136,7 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha)
fw_minor_version = ha->fw_minor_version; fw_minor_version = ha->fw_minor_version;
fw_subminor_version = ha->fw_subminor_version; fw_subminor_version = ha->fw_subminor_version;
rval = qla2x00_get_fw_version(vha, &ha->fw_major_version, rval = qla2x00_get_fw_version(vha);
&ha->fw_minor_version, &ha->fw_subminor_version,
&ha->fw_attributes, &ha->fw_memory_size,
ha->mpi_version, &ha->mpi_capabilities,
ha->phy_version);
if (rval != QLA_SUCCESS) if (rval != QLA_SUCCESS)
return rval; return rval;
...@@ -3150,7 +3145,6 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha) ...@@ -3150,7 +3145,6 @@ qla82xx_check_md_needed(scsi_qla_host_t *vha)
if (fw_major_version != ha->fw_major_version || if (fw_major_version != ha->fw_major_version ||
fw_minor_version != ha->fw_minor_version || fw_minor_version != ha->fw_minor_version ||
fw_subminor_version != ha->fw_subminor_version) { fw_subminor_version != ha->fw_subminor_version) {
ql_log(ql_log_info, vha, 0xb02d, ql_log(ql_log_info, vha, 0xb02d,
"Firmware version differs " "Firmware version differs "
"Previous version: %d:%d:%d - " "Previous version: %d:%d:%d - "
......
...@@ -888,7 +888,8 @@ struct ct6_dsd { ...@@ -888,7 +888,8 @@ struct ct6_dsd {
}; };
#define MBC_TOGGLE_INTERRUPT 0x10 #define MBC_TOGGLE_INTERRUPT 0x10
#define MBC_SET_LED_CONFIG 0x125 #define MBC_SET_LED_CONFIG 0x125 /* FCoE specific LED control */
#define MBC_GET_LED_CONFIG 0x126 /* FCoE specific LED control */
/* Flash offset */ /* Flash offset */
#define FLT_REG_BOOTLOAD_82XX 0x72 #define FLT_REG_BOOTLOAD_82XX 0x72
......
This diff is collapsed.
...@@ -568,6 +568,9 @@ qla2xxx_find_flt_start(scsi_qla_host_t *vha, uint32_t *start) ...@@ -568,6 +568,9 @@ qla2xxx_find_flt_start(scsi_qla_host_t *vha, uint32_t *start)
else if (IS_QLA82XX(ha)) { else if (IS_QLA82XX(ha)) {
*start = FA_FLASH_LAYOUT_ADDR_82; *start = FA_FLASH_LAYOUT_ADDR_82;
goto end; goto end;
} else if (IS_QLA83XX(ha)) {
*start = FA_FLASH_LAYOUT_ADDR_83;
goto end;
} }
/* Begin with first PCI expansion ROM header. */ /* Begin with first PCI expansion ROM header. */
buf = (uint8_t *)req->ring; buf = (uint8_t *)req->ring;
...@@ -721,13 +724,22 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) ...@@ -721,13 +724,22 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
le32_to_cpu(region->size)); le32_to_cpu(region->size));
switch (le32_to_cpu(region->code) & 0xff) { switch (le32_to_cpu(region->code) & 0xff) {
case FLT_REG_FCOE_FW:
if (!IS_QLA8031(ha))
break;
ha->flt_region_fw = start;
break;
case FLT_REG_FW: case FLT_REG_FW:
if (IS_QLA8031(ha))
break;
ha->flt_region_fw = start; ha->flt_region_fw = start;
break; break;
case FLT_REG_BOOT_CODE: case FLT_REG_BOOT_CODE:
ha->flt_region_boot = start; ha->flt_region_boot = start;
break; break;
case FLT_REG_VPD_0: case FLT_REG_VPD_0:
if (IS_QLA8031(ha))
break;
ha->flt_region_vpd_nvram = start; ha->flt_region_vpd_nvram = start;
if (IS_QLA82XX(ha)) if (IS_QLA82XX(ha))
break; break;
...@@ -735,16 +747,20 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) ...@@ -735,16 +747,20 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
ha->flt_region_vpd = start; ha->flt_region_vpd = start;
break; break;
case FLT_REG_VPD_1: case FLT_REG_VPD_1:
if (IS_QLA82XX(ha)) if (IS_QLA82XX(ha) || IS_QLA8031(ha))
break; break;
if (!ha->flags.port0) if (!ha->flags.port0)
ha->flt_region_vpd = start; ha->flt_region_vpd = start;
break; break;
case FLT_REG_NVRAM_0: case FLT_REG_NVRAM_0:
if (IS_QLA8031(ha))
break;
if (ha->flags.port0) if (ha->flags.port0)
ha->flt_region_nvram = start; ha->flt_region_nvram = start;
break; break;
case FLT_REG_NVRAM_1: case FLT_REG_NVRAM_1:
if (IS_QLA8031(ha))
break;
if (!ha->flags.port0) if (!ha->flags.port0)
ha->flt_region_nvram = start; ha->flt_region_nvram = start;
break; break;
...@@ -785,6 +801,31 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) ...@@ -785,6 +801,31 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
case FLT_REG_VPD_82XX: case FLT_REG_VPD_82XX:
ha->flt_region_vpd = start; ha->flt_region_vpd = start;
break; break;
case FLT_REG_FCOE_VPD_0:
if (!IS_QLA8031(ha))
break;
ha->flt_region_vpd_nvram = start;
if (ha->flags.port0)
ha->flt_region_vpd = start;
break;
case FLT_REG_FCOE_VPD_1:
if (!IS_QLA8031(ha))
break;
if (!ha->flags.port0)
ha->flt_region_vpd = start;
break;
case FLT_REG_FCOE_NVRAM_0:
if (!IS_QLA8031(ha))
break;
if (ha->flags.port0)
ha->flt_region_nvram = start;
break;
case FLT_REG_FCOE_NVRAM_1:
if (!IS_QLA8031(ha))
break;
if (!ha->flags.port0)
ha->flt_region_nvram = start;
break;
} }
} }
goto done; goto done;
...@@ -804,15 +845,12 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr) ...@@ -804,15 +845,12 @@ qla2xxx_get_flt_info(scsi_qla_host_t *vha, uint32_t flt_addr)
def_npiv_conf0[def] : def_npiv_conf1[def]; def_npiv_conf0[def] : def_npiv_conf1[def];
done: done:
ql_dbg(ql_dbg_init, vha, 0x004a, ql_dbg(ql_dbg_init, vha, 0x004a,
"FLT[%s]: boot=0x%x fw=0x%x vpd_nvram=0x%x vpd=0x%x.\n", "FLT[%s]: boot=0x%x fw=0x%x vpd_nvram=0x%x vpd=0x%x nvram=0x%x "
loc, ha->flt_region_boot, "fdt=0x%x flt=0x%x npiv=0x%x fcp_prif_cfg=0x%x.\n",
ha->flt_region_fw, ha->flt_region_vpd_nvram, loc, ha->flt_region_boot, ha->flt_region_fw,
ha->flt_region_vpd); ha->flt_region_vpd_nvram, ha->flt_region_vpd, ha->flt_region_nvram,
ql_dbg(ql_dbg_init, vha, 0x004b, ha->flt_region_fdt, ha->flt_region_flt, ha->flt_region_npiv_conf,
"nvram=0x%x fdt=0x%x flt=0x%x npiv=0x%x fcp_prif_cfg=0x%x.\n", ha->flt_region_fcp_prio);
ha->flt_region_nvram,
ha->flt_region_fdt, ha->flt_region_flt,
ha->flt_region_npiv_conf, ha->flt_region_fcp_prio);
} }
static void static void
...@@ -948,7 +986,8 @@ qla2xxx_get_flash_info(scsi_qla_host_t *vha) ...@@ -948,7 +986,8 @@ qla2xxx_get_flash_info(scsi_qla_host_t *vha)
uint32_t flt_addr; uint32_t flt_addr;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha) && !IS_QLA8XXX_TYPE(ha)) if (!IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha) &&
!IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha))
return QLA_SUCCESS; return QLA_SUCCESS;
ret = qla2xxx_find_flt_start(vha, &flt_addr); ret = qla2xxx_find_flt_start(vha, &flt_addr);
...@@ -974,7 +1013,8 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) ...@@ -974,7 +1013,8 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha)
struct qla_npiv_entry *entry; struct qla_npiv_entry *entry;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
if (!IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha) && !IS_QLA8XXX_TYPE(ha)) if (!IS_QLA24XX_TYPE(ha) && !IS_QLA25XX(ha) &&
!IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha))
return; return;
ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr,
...@@ -1144,8 +1184,8 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr, ...@@ -1144,8 +1184,8 @@ qla24xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
/* Prepare burst-capable write on supported ISPs. */ /* Prepare burst-capable write on supported ISPs. */
if ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && !(faddr & 0xfff) && if ((IS_QLA25XX(ha) || IS_QLA81XX(ha) || IS_QLA83XX(ha)) &&
dwords > OPTROM_BURST_DWORDS) { !(faddr & 0xfff) && dwords > OPTROM_BURST_DWORDS) {
optrom = dma_alloc_coherent(&ha->pdev->dev, OPTROM_BURST_SIZE, optrom = dma_alloc_coherent(&ha->pdev->dev, OPTROM_BURST_SIZE,
&optrom_dma, GFP_KERNEL); &optrom_dma, GFP_KERNEL);
if (!optrom) { if (!optrom) {
...@@ -1619,6 +1659,71 @@ qla24xx_beacon_blink(struct scsi_qla_host *vha) ...@@ -1619,6 +1659,71 @@ qla24xx_beacon_blink(struct scsi_qla_host *vha)
spin_unlock_irqrestore(&ha->hardware_lock, flags); spin_unlock_irqrestore(&ha->hardware_lock, flags);
} }
void
qla83xx_beacon_blink(struct scsi_qla_host *vha)
{
uint32_t led_select_value;
struct qla_hw_data *ha = vha->hw;
uint16_t led_cfg[6];
uint16_t orig_led_cfg[6];
if (!IS_QLA83XX(ha) && !IS_QLA81XX(ha))
return;
if (IS_QLA2031(ha) && ha->beacon_blink_led) {
if (ha->flags.port0)
led_select_value = 0x00201320;
else
led_select_value = 0x00201328;
qla83xx_write_remote_reg(vha, led_select_value, 0x40002000);
qla83xx_write_remote_reg(vha, led_select_value + 4, 0x40002000);
msleep(1000);
qla83xx_write_remote_reg(vha, led_select_value, 0x40004000);
qla83xx_write_remote_reg(vha, led_select_value + 4, 0x40004000);
} else if ((IS_QLA8031(ha) || IS_QLA81XX(ha)) && ha->beacon_blink_led) {
int rval;
/* Save Current */
rval = qla81xx_get_led_config(vha, orig_led_cfg);
/* Do the blink */
if (rval == QLA_SUCCESS) {
if (IS_QLA81XX(ha)) {
led_cfg[0] = 0x4000;
led_cfg[1] = 0x2000;
led_cfg[2] = 0;
led_cfg[3] = 0;
led_cfg[4] = 0;
led_cfg[5] = 0;
} else {
led_cfg[0] = 0x4000;
led_cfg[1] = 0x4000;
led_cfg[2] = 0x4000;
led_cfg[3] = 0x2000;
led_cfg[4] = 0;
led_cfg[5] = 0x2000;
}
rval = qla81xx_set_led_config(vha, led_cfg);
msleep(1000);
if (IS_QLA81XX(ha)) {
led_cfg[0] = 0x4000;
led_cfg[1] = 0x2000;
led_cfg[2] = 0;
} else {
led_cfg[0] = 0x4000;
led_cfg[1] = 0x2000;
led_cfg[2] = 0x4000;
led_cfg[3] = 0x4000;
led_cfg[4] = 0;
led_cfg[5] = 0x2000;
}
rval = qla81xx_set_led_config(vha, led_cfg);
}
/* On exit, restore original (presumes no status change) */
qla81xx_set_led_config(vha, orig_led_cfg);
}
}
int int
qla24xx_beacon_on(struct scsi_qla_host *vha) qla24xx_beacon_on(struct scsi_qla_host *vha)
{ {
...@@ -1630,6 +1735,9 @@ qla24xx_beacon_on(struct scsi_qla_host *vha) ...@@ -1630,6 +1735,9 @@ qla24xx_beacon_on(struct scsi_qla_host *vha)
if (IS_QLA82XX(ha)) if (IS_QLA82XX(ha))
return QLA_SUCCESS; return QLA_SUCCESS;
if (IS_QLA8031(ha) || IS_QLA81XX(ha))
goto skip_gpio; /* let blink handle it */
if (ha->beacon_blink_led == 0) { if (ha->beacon_blink_led == 0) {
/* Enable firmware for update */ /* Enable firmware for update */
ha->fw_options[1] |= ADD_FO1_DISABLE_GPIO_LED_CTRL; ha->fw_options[1] |= ADD_FO1_DISABLE_GPIO_LED_CTRL;
...@@ -1644,6 +1752,9 @@ qla24xx_beacon_on(struct scsi_qla_host *vha) ...@@ -1644,6 +1752,9 @@ qla24xx_beacon_on(struct scsi_qla_host *vha)
return QLA_FUNCTION_FAILED; return QLA_FUNCTION_FAILED;
} }
if (IS_QLA2031(ha))
goto skip_gpio;
spin_lock_irqsave(&ha->hardware_lock, flags); spin_lock_irqsave(&ha->hardware_lock, flags);
gpio_data = RD_REG_DWORD(&reg->gpiod); gpio_data = RD_REG_DWORD(&reg->gpiod);
...@@ -1658,6 +1769,7 @@ qla24xx_beacon_on(struct scsi_qla_host *vha) ...@@ -1658,6 +1769,7 @@ qla24xx_beacon_on(struct scsi_qla_host *vha)
/* So all colors blink together. */ /* So all colors blink together. */
ha->beacon_color_state = 0; ha->beacon_color_state = 0;
skip_gpio:
/* Let the per HBA timer kick off the blinking process. */ /* Let the per HBA timer kick off the blinking process. */
ha->beacon_blink_led = 1; ha->beacon_blink_led = 1;
...@@ -1676,6 +1788,13 @@ qla24xx_beacon_off(struct scsi_qla_host *vha) ...@@ -1676,6 +1788,13 @@ qla24xx_beacon_off(struct scsi_qla_host *vha)
return QLA_SUCCESS; return QLA_SUCCESS;
ha->beacon_blink_led = 0; ha->beacon_blink_led = 0;
if (IS_QLA2031(ha))
goto set_fw_options;
if (IS_QLA8031(ha) || IS_QLA81XX(ha))
return QLA_SUCCESS;
ha->beacon_color_state = QLA_LED_ALL_ON; ha->beacon_color_state = QLA_LED_ALL_ON;
ha->isp_ops->beacon_blink(vha); /* Will flip to all off. */ ha->isp_ops->beacon_blink(vha); /* Will flip to all off. */
...@@ -1690,6 +1809,7 @@ qla24xx_beacon_off(struct scsi_qla_host *vha) ...@@ -1690,6 +1809,7 @@ qla24xx_beacon_off(struct scsi_qla_host *vha)
RD_REG_DWORD(&reg->gpiod); RD_REG_DWORD(&reg->gpiod);
spin_unlock_irqrestore(&ha->hardware_lock, flags); spin_unlock_irqrestore(&ha->hardware_lock, flags);
set_fw_options:
ha->fw_options[1] &= ~ADD_FO1_DISABLE_GPIO_LED_CTRL; ha->fw_options[1] &= ~ADD_FO1_DISABLE_GPIO_LED_CTRL;
if (qla2x00_set_fw_options(vha, ha->fw_options) != QLA_SUCCESS) { if (qla2x00_set_fw_options(vha, ha->fw_options) != QLA_SUCCESS) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment