diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 134 |
1 files changed, 1 insertions, 133 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 7b48c655b766..748be95c51a7 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -383,9 +383,7 @@ qla2x00_isp_firmware(scsi_qla_host_t *ha) | |||
383 | qla_printk(KERN_INFO, ha, "RISC CODE NOT loaded\n"); | 383 | qla_printk(KERN_INFO, ha, "RISC CODE NOT loaded\n"); |
384 | 384 | ||
385 | /* Verify checksum of loaded RISC code. */ | 385 | /* Verify checksum of loaded RISC code. */ |
386 | rval = qla2x00_verify_checksum(ha, | 386 | rval = qla2x00_verify_checksum(ha, ha->fw_srisc_address); |
387 | IS_QLA24XX(ha) || IS_QLA54XX(ha) ? RISC_SADDRESS : | ||
388 | *ha->brd_info->fw_info[0].fwstart); | ||
389 | } | 387 | } |
390 | 388 | ||
391 | if (rval) { | 389 | if (rval) { |
@@ -3545,135 +3543,6 @@ qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr) | |||
3545 | return rval; | 3543 | return rval; |
3546 | } | 3544 | } |
3547 | 3545 | ||
3548 | #if defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) | ||
3549 | |||
3550 | int | ||
3551 | qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) | ||
3552 | { | ||
3553 | int rval, num, i; | ||
3554 | uint32_t cnt; | ||
3555 | uint16_t *risc_code; | ||
3556 | uint32_t risc_addr, risc_size; | ||
3557 | uint16_t *req_ring; | ||
3558 | struct qla_fw_info *fw_iter; | ||
3559 | |||
3560 | rval = QLA_SUCCESS; | ||
3561 | |||
3562 | /* Load firmware sequences */ | ||
3563 | fw_iter = ha->brd_info->fw_info; | ||
3564 | *srisc_addr = *ha->brd_info->fw_info->fwstart; | ||
3565 | while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) { | ||
3566 | risc_code = fw_iter->fwcode; | ||
3567 | risc_size = *fw_iter->fwlen; | ||
3568 | if (fw_iter->addressing == FW_INFO_ADDR_NORMAL) | ||
3569 | risc_addr = *fw_iter->fwstart; | ||
3570 | else | ||
3571 | risc_addr = *fw_iter->lfwstart; | ||
3572 | |||
3573 | num = 0; | ||
3574 | rval = 0; | ||
3575 | while (risc_size > 0 && !rval) { | ||
3576 | cnt = (uint16_t)(ha->fw_transfer_size >> 1); | ||
3577 | if (cnt > risc_size) | ||
3578 | cnt = risc_size; | ||
3579 | |||
3580 | DEBUG7(printk("scsi(%ld): Loading risc segment@ " | ||
3581 | "addr %p, number of bytes 0x%x, offset 0x%lx.\n", | ||
3582 | ha->host_no, risc_code, cnt, risc_addr)); | ||
3583 | |||
3584 | req_ring = (uint16_t *)ha->request_ring; | ||
3585 | for (i = 0; i < cnt; i++) | ||
3586 | req_ring[i] = cpu_to_le16(risc_code[i]); | ||
3587 | |||
3588 | rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, | ||
3589 | cnt); | ||
3590 | if (rval) { | ||
3591 | DEBUG(printk("scsi(%ld): [ERROR] Failed to " | ||
3592 | "load segment %d of firmware\n", | ||
3593 | ha->host_no, num)); | ||
3594 | qla_printk(KERN_WARNING, ha, | ||
3595 | "[ERROR] Failed to load segment %d of " | ||
3596 | "firmware\n", num); | ||
3597 | |||
3598 | qla2x00_dump_regs(ha); | ||
3599 | break; | ||
3600 | } | ||
3601 | |||
3602 | risc_code += cnt; | ||
3603 | risc_addr += cnt; | ||
3604 | risc_size -= cnt; | ||
3605 | num++; | ||
3606 | } | ||
3607 | |||
3608 | /* Next firmware sequence */ | ||
3609 | fw_iter++; | ||
3610 | } | ||
3611 | return rval; | ||
3612 | } | ||
3613 | |||
3614 | int | ||
3615 | qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) | ||
3616 | { | ||
3617 | int rval, num, i; | ||
3618 | uint32_t cnt; | ||
3619 | uint32_t *risc_code; | ||
3620 | uint32_t risc_addr, risc_size; | ||
3621 | uint32_t *req_ring; | ||
3622 | struct qla_fw_info *fw_iter; | ||
3623 | |||
3624 | rval = QLA_SUCCESS; | ||
3625 | |||
3626 | /* Load firmware sequences */ | ||
3627 | fw_iter = ha->brd_info->fw_info; | ||
3628 | *srisc_addr = *((uint32_t *)fw_iter->lfwstart); | ||
3629 | while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) { | ||
3630 | risc_code = (uint32_t *)fw_iter->fwcode; | ||
3631 | risc_size = *((uint32_t *)fw_iter->fwlen); | ||
3632 | risc_addr = *((uint32_t *)fw_iter->lfwstart); | ||
3633 | |||
3634 | num = 0; | ||
3635 | rval = 0; | ||
3636 | while (risc_size > 0 && !rval) { | ||
3637 | cnt = (uint32_t)(ha->fw_transfer_size >> 2); | ||
3638 | if (cnt > risc_size) | ||
3639 | cnt = risc_size; | ||
3640 | |||
3641 | DEBUG7(printk("scsi(%ld): Loading risc segment@ " | ||
3642 | "addr %p, number of bytes 0x%x, offset 0x%lx.\n", | ||
3643 | ha->host_no, risc_code, cnt, risc_addr)); | ||
3644 | |||
3645 | req_ring = (uint32_t *)ha->request_ring; | ||
3646 | for (i = 0; i < cnt; i++) | ||
3647 | req_ring[i] = cpu_to_le32(risc_code[i]); | ||
3648 | |||
3649 | rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, | ||
3650 | cnt); | ||
3651 | if (rval) { | ||
3652 | DEBUG(printk("scsi(%ld): [ERROR] Failed to " | ||
3653 | "load segment %d of firmware\n", | ||
3654 | ha->host_no, num)); | ||
3655 | qla_printk(KERN_WARNING, ha, | ||
3656 | "[ERROR] Failed to load segment %d of " | ||
3657 | "firmware\n", num); | ||
3658 | |||
3659 | qla2x00_dump_regs(ha); | ||
3660 | break; | ||
3661 | } | ||
3662 | |||
3663 | risc_code += cnt; | ||
3664 | risc_addr += cnt; | ||
3665 | risc_size -= cnt; | ||
3666 | num++; | ||
3667 | } | ||
3668 | |||
3669 | /* Next firmware sequence */ | ||
3670 | fw_iter++; | ||
3671 | } | ||
3672 | return rval; | ||
3673 | } | ||
3674 | |||
3675 | #else /* !defined(CONFIG_SCSI_QLA2XXX_EMBEDDED_FIRMWARE) */ | ||
3676 | |||
3677 | #define QLA_FW_URL "ftp://ftp.qlogic.com/outgoing/linux/firmware/" | 3546 | #define QLA_FW_URL "ftp://ftp.qlogic.com/outgoing/linux/firmware/" |
3678 | 3547 | ||
3679 | int | 3548 | int |
@@ -3884,4 +3753,3 @@ qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) | |||
3884 | fail_fw_integrity: | 3753 | fail_fw_integrity: |
3885 | return QLA_FUNCTION_FAILED; | 3754 | return QLA_FUNCTION_FAILED; |
3886 | } | 3755 | } |
3887 | #endif | ||