diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 13e2aaf56769..dadc91bd0ea9 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -3550,6 +3550,67 @@ qla2x00_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) | |||
3550 | } | 3550 | } |
3551 | 3551 | ||
3552 | int | 3552 | int |
3553 | qla24xx_load_risc(scsi_qla_host_t *ha, uint32_t *srisc_addr) | ||
3554 | { | ||
3555 | int rval, num, i; | ||
3556 | uint32_t cnt; | ||
3557 | uint32_t *risc_code; | ||
3558 | uint32_t risc_addr, risc_size; | ||
3559 | uint32_t *req_ring; | ||
3560 | struct qla_fw_info *fw_iter; | ||
3561 | |||
3562 | rval = QLA_SUCCESS; | ||
3563 | |||
3564 | /* Load firmware sequences */ | ||
3565 | fw_iter = ha->brd_info->fw_info; | ||
3566 | *srisc_addr = *((uint32_t *)fw_iter->lfwstart); | ||
3567 | while (fw_iter->addressing != FW_INFO_ADDR_NOMORE) { | ||
3568 | risc_code = (uint32_t *)fw_iter->fwcode; | ||
3569 | risc_size = *((uint32_t *)fw_iter->fwlen); | ||
3570 | risc_addr = *((uint32_t *)fw_iter->lfwstart); | ||
3571 | |||
3572 | num = 0; | ||
3573 | rval = 0; | ||
3574 | while (risc_size > 0 && !rval) { | ||
3575 | cnt = (uint32_t)(ha->fw_transfer_size >> 2); | ||
3576 | if (cnt > risc_size) | ||
3577 | cnt = risc_size; | ||
3578 | |||
3579 | DEBUG7(printk("scsi(%ld): Loading risc segment@ " | ||
3580 | "addr %p, number of bytes 0x%x, offset 0x%lx.\n", | ||
3581 | ha->host_no, risc_code, cnt, risc_addr)); | ||
3582 | |||
3583 | req_ring = (uint32_t *)ha->request_ring; | ||
3584 | for (i = 0; i < cnt; i++) | ||
3585 | req_ring[i] = cpu_to_le32(risc_code[i]); | ||
3586 | |||
3587 | rval = qla2x00_load_ram(ha, ha->request_dma, risc_addr, | ||
3588 | cnt); | ||
3589 | if (rval) { | ||
3590 | DEBUG(printk("scsi(%ld): [ERROR] Failed to " | ||
3591 | "load segment %d of firmware\n", | ||
3592 | ha->host_no, num)); | ||
3593 | qla_printk(KERN_WARNING, ha, | ||
3594 | "[ERROR] Failed to load segment %d of " | ||
3595 | "firmware\n", num); | ||
3596 | |||
3597 | qla2x00_dump_regs(ha); | ||
3598 | break; | ||
3599 | } | ||
3600 | |||
3601 | risc_code += cnt; | ||
3602 | risc_addr += cnt; | ||
3603 | risc_size -= cnt; | ||
3604 | num++; | ||
3605 | } | ||
3606 | |||
3607 | /* Next firmware sequence */ | ||
3608 | fw_iter++; | ||
3609 | } | ||
3610 | return rval; | ||
3611 | } | ||
3612 | |||
3613 | int | ||
3553 | qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr) | 3614 | qla24xx_load_risc_flash(scsi_qla_host_t *ha, uint32_t *srisc_addr) |
3554 | { | 3615 | { |
3555 | int rval; | 3616 | int rval; |