forked from Minki/linux
scsi: qla2xxx: Added support for MPI and PEP regions for ISP28XX
This patch adds support for MPI/PEP region updates which is required with
secure flash updates for ISP28XX.
Fixes: 3f006ac342
("scsi: qla2xxx: Secure flash update support for ISP28XX")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20191203223657.22109-3-hmadhani@marvell.com
Signed-off-by: Michael Hernandez <mhernandez@marvell.com>
Signed-off-by: Himanshu Madhani <hmadhani@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
4e71dcae0c
commit
a530bf691f
@ -1523,6 +1523,10 @@ struct qla_flt_header {
|
||||
#define FLT_REG_NVRAM_SEC_28XX_1 0x10F
|
||||
#define FLT_REG_NVRAM_SEC_28XX_2 0x111
|
||||
#define FLT_REG_NVRAM_SEC_28XX_3 0x113
|
||||
#define FLT_REG_MPI_PRI_28XX 0xD3
|
||||
#define FLT_REG_MPI_SEC_28XX 0xF0
|
||||
#define FLT_REG_PEP_PRI_28XX 0xD1
|
||||
#define FLT_REG_PEP_SEC_28XX 0xF1
|
||||
|
||||
struct qla_flt_region {
|
||||
uint16_t code;
|
||||
|
@ -2725,8 +2725,11 @@ qla28xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
|
||||
ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff,
|
||||
"Region %x is secure\n", region.code);
|
||||
|
||||
if (region.code == FLT_REG_FW ||
|
||||
region.code == FLT_REG_FW_SEC_27XX) {
|
||||
switch (region.code) {
|
||||
case FLT_REG_FW:
|
||||
case FLT_REG_FW_SEC_27XX:
|
||||
case FLT_REG_MPI_PRI_28XX:
|
||||
case FLT_REG_MPI_SEC_28XX:
|
||||
fw_array = dwptr;
|
||||
|
||||
/* 1st fw array */
|
||||
@ -2757,9 +2760,23 @@ qla28xx_write_flash_data(scsi_qla_host_t *vha, uint32_t *dwptr, uint32_t faddr,
|
||||
buf_size_without_sfub += risc_size;
|
||||
fw_array += risc_size;
|
||||
}
|
||||
} else {
|
||||
ql_log(ql_log_warn + ql_dbg_verbose, vha, 0xffff,
|
||||
"Secure region %x not supported\n",
|
||||
break;
|
||||
|
||||
case FLT_REG_PEP_PRI_28XX:
|
||||
case FLT_REG_PEP_SEC_28XX:
|
||||
fw_array = dwptr;
|
||||
|
||||
/* 1st fw array */
|
||||
risc_size = be32_to_cpu(fw_array[3]);
|
||||
risc_attr = be32_to_cpu(fw_array[9]);
|
||||
|
||||
buf_size_without_sfub = risc_size;
|
||||
fw_array += risc_size;
|
||||
break;
|
||||
|
||||
default:
|
||||
ql_log(ql_log_warn + ql_dbg_verbose, vha,
|
||||
0xffff, "Secure region %x not supported\n",
|
||||
region.code);
|
||||
rval = QLA_COMMAND_ERROR;
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user