diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2007-07-19 23:37:34 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-07-20 10:25:29 -0400 |
commit | c3a2f0dfe1cecac76950f340f540c1a887dd2500 (patch) | |
tree | be6cce05e0fba81e9bf91351aebab23918ae5115 /drivers/scsi/qla2xxx/qla_os.c | |
parent | af6177d88d76834b4d05499482d471d64559a6af (diff) |
[SCSI] qla2xxx: Add ISP25XX support.
Large code-reuse from ISP24xx, consolidate RISC memory
extraction routines during firmware-dump.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 70 |
1 files changed, 68 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index e870e7cf62fe..8bdc5a2c8eee 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -265,6 +265,8 @@ qla24xx_pci_info_str(struct scsi_qla_host *ha, char *str) | |||
265 | strcpy(str, "PCIe ("); | 265 | strcpy(str, "PCIe ("); |
266 | if (lspeed == 1) | 266 | if (lspeed == 1) |
267 | strcat(str, "2.5Gb/s "); | 267 | strcat(str, "2.5Gb/s "); |
268 | else if (lspeed == 2) | ||
269 | strcat(str, "5.0Gb/s "); | ||
268 | else | 270 | else |
269 | strcat(str, "<unknown> "); | 271 | strcat(str, "<unknown> "); |
270 | snprintf(lwstr, sizeof(lwstr), "x%d)", lwidth); | 272 | snprintf(lwstr, sizeof(lwstr), "x%d)", lwidth); |
@@ -343,6 +345,12 @@ qla24xx_fw_version_str(struct scsi_qla_host *ha, char *str) | |||
343 | strcat(str, "[IP] "); | 345 | strcat(str, "[IP] "); |
344 | if (ha->fw_attributes & BIT_2) | 346 | if (ha->fw_attributes & BIT_2) |
345 | strcat(str, "[Multi-ID] "); | 347 | strcat(str, "[Multi-ID] "); |
348 | if (ha->fw_attributes & BIT_3) | ||
349 | strcat(str, "[SB-2] "); | ||
350 | if (ha->fw_attributes & BIT_4) | ||
351 | strcat(str, "[T10 CRC] "); | ||
352 | if (ha->fw_attributes & BIT_5) | ||
353 | strcat(str, "[VI] "); | ||
346 | if (ha->fw_attributes & BIT_13) | 354 | if (ha->fw_attributes & BIT_13) |
347 | strcat(str, "[Experimental]"); | 355 | strcat(str, "[Experimental]"); |
348 | return str; | 356 | return str; |
@@ -1348,6 +1356,39 @@ static struct isp_operations qla24xx_isp_ops = { | |||
1348 | .get_flash_version = qla24xx_get_flash_version, | 1356 | .get_flash_version = qla24xx_get_flash_version, |
1349 | }; | 1357 | }; |
1350 | 1358 | ||
1359 | static struct isp_operations qla25xx_isp_ops = { | ||
1360 | .pci_config = qla25xx_pci_config, | ||
1361 | .reset_chip = qla24xx_reset_chip, | ||
1362 | .chip_diag = qla24xx_chip_diag, | ||
1363 | .config_rings = qla24xx_config_rings, | ||
1364 | .reset_adapter = qla24xx_reset_adapter, | ||
1365 | .nvram_config = qla24xx_nvram_config, | ||
1366 | .update_fw_options = qla24xx_update_fw_options, | ||
1367 | .load_risc = qla24xx_load_risc, | ||
1368 | .pci_info_str = qla24xx_pci_info_str, | ||
1369 | .fw_version_str = qla24xx_fw_version_str, | ||
1370 | .intr_handler = qla24xx_intr_handler, | ||
1371 | .enable_intrs = qla24xx_enable_intrs, | ||
1372 | .disable_intrs = qla24xx_disable_intrs, | ||
1373 | .abort_command = qla24xx_abort_command, | ||
1374 | .abort_target = qla24xx_abort_target, | ||
1375 | .fabric_login = qla24xx_login_fabric, | ||
1376 | .fabric_logout = qla24xx_fabric_logout, | ||
1377 | .calc_req_entries = NULL, | ||
1378 | .build_iocbs = NULL, | ||
1379 | .prep_ms_iocb = qla24xx_prep_ms_iocb, | ||
1380 | .prep_ms_fdmi_iocb = qla24xx_prep_ms_fdmi_iocb, | ||
1381 | .read_nvram = qla25xx_read_nvram_data, | ||
1382 | .write_nvram = qla25xx_write_nvram_data, | ||
1383 | .fw_dump = qla25xx_fw_dump, | ||
1384 | .beacon_on = qla24xx_beacon_on, | ||
1385 | .beacon_off = qla24xx_beacon_off, | ||
1386 | .beacon_blink = qla24xx_beacon_blink, | ||
1387 | .read_optrom = qla24xx_read_optrom_data, | ||
1388 | .write_optrom = qla24xx_write_optrom_data, | ||
1389 | .get_flash_version = qla24xx_get_flash_version, | ||
1390 | }; | ||
1391 | |||
1351 | static inline void | 1392 | static inline void |
1352 | qla2x00_set_isp_flags(scsi_qla_host_t *ha) | 1393 | qla2x00_set_isp_flags(scsi_qla_host_t *ha) |
1353 | { | 1394 | { |
@@ -1413,6 +1454,13 @@ qla2x00_set_isp_flags(scsi_qla_host_t *ha) | |||
1413 | ha->device_type |= DT_FWI2; | 1454 | ha->device_type |= DT_FWI2; |
1414 | ha->fw_srisc_address = RISC_START_ADDRESS_2400; | 1455 | ha->fw_srisc_address = RISC_START_ADDRESS_2400; |
1415 | break; | 1456 | break; |
1457 | case PCI_DEVICE_ID_QLOGIC_ISP2532: | ||
1458 | ha->device_type |= DT_ISP2532; | ||
1459 | ha->device_type |= DT_ZIO_SUPPORTED; | ||
1460 | ha->device_type |= DT_FWI2; | ||
1461 | ha->device_type |= DT_IIDMA; | ||
1462 | ha->fw_srisc_address = RISC_START_ADDRESS_2400; | ||
1463 | break; | ||
1416 | } | 1464 | } |
1417 | } | 1465 | } |
1418 | 1466 | ||
@@ -1527,7 +1575,8 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1527 | if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || | 1575 | if (pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2422 || |
1528 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432 || | 1576 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2432 || |
1529 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5422 || | 1577 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5422 || |
1530 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5432) | 1578 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP5432 || |
1579 | pdev->device == PCI_DEVICE_ID_QLOGIC_ISP2532) | ||
1531 | sht = &qla24xx_driver_template; | 1580 | sht = &qla24xx_driver_template; |
1532 | host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); | 1581 | host = scsi_host_alloc(sht, sizeof(scsi_qla_host_t)); |
1533 | if (host == NULL) { | 1582 | if (host == NULL) { |
@@ -1609,6 +1658,17 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
1609 | ha->gid_list_info_size = 8; | 1658 | ha->gid_list_info_size = 8; |
1610 | ha->optrom_size = OPTROM_SIZE_24XX; | 1659 | ha->optrom_size = OPTROM_SIZE_24XX; |
1611 | ha->isp_ops = &qla24xx_isp_ops; | 1660 | ha->isp_ops = &qla24xx_isp_ops; |
1661 | } else if (IS_QLA25XX(ha)) { | ||
1662 | host->max_id = MAX_TARGETS_2200; | ||
1663 | ha->mbx_count = MAILBOX_REGISTER_COUNT; | ||
1664 | ha->request_q_length = REQUEST_ENTRY_CNT_24XX; | ||
1665 | ha->response_q_length = RESPONSE_ENTRY_CNT_2300; | ||
1666 | ha->last_loop_id = SNS_LAST_LOOP_ID_2300; | ||
1667 | ha->init_cb_size = sizeof(struct mid_init_cb_24xx); | ||
1668 | ha->mgmt_svr_loop_id = 10 + ha->vp_idx; | ||
1669 | ha->gid_list_info_size = 8; | ||
1670 | ha->optrom_size = OPTROM_SIZE_25XX; | ||
1671 | ha->isp_ops = &qla25xx_isp_ops; | ||
1612 | } | 1672 | } |
1613 | host->can_queue = ha->request_q_length + 128; | 1673 | host->can_queue = ha->request_q_length + 128; |
1614 | 1674 | ||
@@ -2665,18 +2725,20 @@ qla2x00_down_timeout(struct semaphore *sema, unsigned long timeout) | |||
2665 | 2725 | ||
2666 | /* Firmware interface routines. */ | 2726 | /* Firmware interface routines. */ |
2667 | 2727 | ||
2668 | #define FW_BLOBS 5 | 2728 | #define FW_BLOBS 6 |
2669 | #define FW_ISP21XX 0 | 2729 | #define FW_ISP21XX 0 |
2670 | #define FW_ISP22XX 1 | 2730 | #define FW_ISP22XX 1 |
2671 | #define FW_ISP2300 2 | 2731 | #define FW_ISP2300 2 |
2672 | #define FW_ISP2322 3 | 2732 | #define FW_ISP2322 3 |
2673 | #define FW_ISP24XX 4 | 2733 | #define FW_ISP24XX 4 |
2734 | #define FW_ISP25XX 5 | ||
2674 | 2735 | ||
2675 | #define FW_FILE_ISP21XX "ql2100_fw.bin" | 2736 | #define FW_FILE_ISP21XX "ql2100_fw.bin" |
2676 | #define FW_FILE_ISP22XX "ql2200_fw.bin" | 2737 | #define FW_FILE_ISP22XX "ql2200_fw.bin" |
2677 | #define FW_FILE_ISP2300 "ql2300_fw.bin" | 2738 | #define FW_FILE_ISP2300 "ql2300_fw.bin" |
2678 | #define FW_FILE_ISP2322 "ql2322_fw.bin" | 2739 | #define FW_FILE_ISP2322 "ql2322_fw.bin" |
2679 | #define FW_FILE_ISP24XX "ql2400_fw.bin" | 2740 | #define FW_FILE_ISP24XX "ql2400_fw.bin" |
2741 | #define FW_FILE_ISP25XX "ql2500_fw.bin" | ||
2680 | 2742 | ||
2681 | static DECLARE_MUTEX(qla_fw_lock); | 2743 | static DECLARE_MUTEX(qla_fw_lock); |
2682 | 2744 | ||
@@ -2686,6 +2748,7 @@ static struct fw_blob qla_fw_blobs[FW_BLOBS] = { | |||
2686 | { .name = FW_FILE_ISP2300, .segs = { 0x800, 0 }, }, | 2748 | { .name = FW_FILE_ISP2300, .segs = { 0x800, 0 }, }, |
2687 | { .name = FW_FILE_ISP2322, .segs = { 0x800, 0x1c000, 0x1e000, 0 }, }, | 2749 | { .name = FW_FILE_ISP2322, .segs = { 0x800, 0x1c000, 0x1e000, 0 }, }, |
2688 | { .name = FW_FILE_ISP24XX, }, | 2750 | { .name = FW_FILE_ISP24XX, }, |
2751 | { .name = FW_FILE_ISP25XX, }, | ||
2689 | }; | 2752 | }; |
2690 | 2753 | ||
2691 | struct fw_blob * | 2754 | struct fw_blob * |
@@ -2704,6 +2767,8 @@ qla2x00_request_firmware(scsi_qla_host_t *ha) | |||
2704 | blob = &qla_fw_blobs[FW_ISP2322]; | 2767 | blob = &qla_fw_blobs[FW_ISP2322]; |
2705 | } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { | 2768 | } else if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) { |
2706 | blob = &qla_fw_blobs[FW_ISP24XX]; | 2769 | blob = &qla_fw_blobs[FW_ISP24XX]; |
2770 | } else if (IS_QLA25XX(ha)) { | ||
2771 | blob = &qla_fw_blobs[FW_ISP25XX]; | ||
2707 | } | 2772 | } |
2708 | 2773 | ||
2709 | down(&qla_fw_lock); | 2774 | down(&qla_fw_lock); |
@@ -2747,6 +2812,7 @@ static struct pci_device_id qla2xxx_pci_tbl[] = { | |||
2747 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) }, | 2812 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2432) }, |
2748 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) }, | 2813 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5422) }, |
2749 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) }, | 2814 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP5432) }, |
2815 | { PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, PCI_DEVICE_ID_QLOGIC_ISP2532) }, | ||
2750 | { 0 }, | 2816 | { 0 }, |
2751 | }; | 2817 | }; |
2752 | MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); | 2818 | MODULE_DEVICE_TABLE(pci, qla2xxx_pci_tbl); |