Commit eaac30be authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[SCSI] qla2xxx: Modify firmware-load order precedence for ISP81XX parts.

Pre-ISP81XX parts (including ISP24xx and ISP25xx) could contain a
firmware image within a segment of flash, driver would fallback
to loading this firmware if the request-firmware interface failed
(userspace .bin file).  Moving forward, all ISP81XX parts will
ship with a suggested-to-be-used firmware image within flash
which all driver should first attempt to load.  If the flash
firmware load fails, the driver will then fallback to loading
firmware via the request-firmware interface (ql8100_fw.bin).
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
parent 8eca3f39
...@@ -34,6 +34,7 @@ extern void qla24xx_update_fw_options(scsi_qla_host_t *); ...@@ -34,6 +34,7 @@ extern void qla24xx_update_fw_options(scsi_qla_host_t *);
extern void qla81xx_update_fw_options(scsi_qla_host_t *); extern void qla81xx_update_fw_options(scsi_qla_host_t *);
extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *); extern int qla2x00_load_risc(struct scsi_qla_host *, uint32_t *);
extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *); extern int qla24xx_load_risc(scsi_qla_host_t *, uint32_t *);
extern int qla81xx_load_risc(scsi_qla_host_t *, uint32_t *);
extern int qla2x00_loop_resync(scsi_qla_host_t *); extern int qla2x00_loop_resync(scsi_qla_host_t *);
......
...@@ -3850,6 +3850,10 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr) ...@@ -3850,6 +3850,10 @@ qla24xx_load_risc_flash(scsi_qla_host_t *vha, uint32_t *srisc_addr)
uint32_t i; uint32_t i;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
struct req_que *req = ha->req_q_map[0]; struct req_que *req = ha->req_q_map[0];
qla_printk(KERN_INFO, ha,
"FW: Loading from flash (%x)...\n", ha->flt_region_fw);
rval = QLA_SUCCESS; rval = QLA_SUCCESS;
segments = FA_RISC_CODE_SEGMENTS; segments = FA_RISC_CODE_SEGMENTS;
...@@ -4025,8 +4029,8 @@ qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) ...@@ -4025,8 +4029,8 @@ qla2x00_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
return QLA_FUNCTION_FAILED; return QLA_FUNCTION_FAILED;
} }
int static int
qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) qla24xx_load_risc_blob(scsi_qla_host_t *vha, uint32_t *srisc_addr)
{ {
int rval; int rval;
int segments, fragment; int segments, fragment;
...@@ -4046,12 +4050,12 @@ qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) ...@@ -4046,12 +4050,12 @@ qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
qla_printk(KERN_ERR, ha, "Firmware images can be retrieved " qla_printk(KERN_ERR, ha, "Firmware images can be retrieved "
"from: " QLA_FW_URL ".\n"); "from: " QLA_FW_URL ".\n");
/* Try to load RISC code from flash. */ return QLA_FUNCTION_FAILED;
qla_printk(KERN_ERR, ha, "Attempting to load (potentially "
"outdated) firmware from flash.\n");
return qla24xx_load_risc_flash(vha, srisc_addr);
} }
qla_printk(KERN_INFO, ha,
"FW: Loading via request-firmware...\n");
rval = QLA_SUCCESS; rval = QLA_SUCCESS;
segments = FA_RISC_CODE_SEGMENTS; segments = FA_RISC_CODE_SEGMENTS;
...@@ -4136,6 +4140,40 @@ qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr) ...@@ -4136,6 +4140,40 @@ qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
return QLA_FUNCTION_FAILED; return QLA_FUNCTION_FAILED;
} }
int
qla24xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
{
int rval;
/*
* FW Load priority:
* 1) Firmware via request-firmware interface (.bin file).
* 2) Firmware residing in flash.
*/
rval = qla24xx_load_risc_blob(vha, srisc_addr);
if (rval == QLA_SUCCESS)
return rval;
return qla24xx_load_risc_flash(vha, srisc_addr);
}
int
qla81xx_load_risc(scsi_qla_host_t *vha, uint32_t *srisc_addr)
{
int rval;
/*
* FW Load priority:
* 1) Firmware residing in flash.
* 2) Firmware via request-firmware interface (.bin file).
*/
rval = qla24xx_load_risc_flash(vha, srisc_addr);
if (rval == QLA_SUCCESS)
return rval;
return qla24xx_load_risc_blob(vha, srisc_addr);
}
void void
qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha) qla2x00_try_to_stop_firmware(scsi_qla_host_t *vha)
{ {
......
...@@ -1480,7 +1480,7 @@ static struct isp_operations qla81xx_isp_ops = { ...@@ -1480,7 +1480,7 @@ static struct isp_operations qla81xx_isp_ops = {
.reset_adapter = qla24xx_reset_adapter, .reset_adapter = qla24xx_reset_adapter,
.nvram_config = qla81xx_nvram_config, .nvram_config = qla81xx_nvram_config,
.update_fw_options = qla81xx_update_fw_options, .update_fw_options = qla81xx_update_fw_options,
.load_risc = qla24xx_load_risc, .load_risc = qla81xx_load_risc,
.pci_info_str = qla24xx_pci_info_str, .pci_info_str = qla24xx_pci_info_str,
.fw_version_str = qla24xx_fw_version_str, .fw_version_str = qla24xx_fw_version_str,
.intr_handler = qla24xx_intr_handler, .intr_handler = qla24xx_intr_handler,
......
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