Commit f8d54811 authored by Sritej Velaga's avatar Sritej Velaga Committed by David S. Miller

qlcnic: Use flt method to determine flash fw region

Use flash layout table to get flash fw starting address and its size.
If that fails, use legacy method.
Signed-off-by: default avatarSritej Velaga <sritej.velaga@qlogic.com>
Signed-off-by: default avatarAnirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8816d009
...@@ -292,6 +292,7 @@ struct uni_data_desc{ ...@@ -292,6 +292,7 @@ struct uni_data_desc{
/* Flash Defines and Structures */ /* Flash Defines and Structures */
#define QLCNIC_FLT_LOCATION 0x3F1000 #define QLCNIC_FLT_LOCATION 0x3F1000
#define QLCNIC_FW_IMAGE_REGION 0x74 #define QLCNIC_FW_IMAGE_REGION 0x74
#define QLCNIC_BOOTLD_REGION 0X72
struct qlcnic_flt_header { struct qlcnic_flt_header {
u16 version; u16 version;
u16 len; u16 len;
...@@ -306,7 +307,7 @@ struct qlcnic_flt_entry { ...@@ -306,7 +307,7 @@ struct qlcnic_flt_entry {
u8 reserved1; u8 reserved1;
u32 size; u32 size;
u32 start_addr; u32 start_addr;
u32 end_add; u32 end_addr;
}; };
/* Magic number to let user know flash is programmed */ /* Magic number to let user know flash is programmed */
......
...@@ -1130,9 +1130,20 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter) ...@@ -1130,9 +1130,20 @@ qlcnic_load_firmware(struct qlcnic_adapter *adapter)
} else { } else {
u64 data; u64 data;
u32 hi, lo; u32 hi, lo;
int ret;
size = (QLCNIC_IMAGE_START - QLCNIC_BOOTLD_START) / 8; struct qlcnic_flt_entry bootld_entry;
flashaddr = QLCNIC_BOOTLD_START;
ret = qlcnic_get_flt_entry(adapter, QLCNIC_BOOTLD_REGION,
&bootld_entry);
if (!ret) {
size = bootld_entry.size / 8;
flashaddr = bootld_entry.start_addr;
} else {
size = (QLCNIC_IMAGE_START - QLCNIC_BOOTLD_START) / 8;
flashaddr = QLCNIC_BOOTLD_START;
dev_info(&pdev->dev,
"using legacy method to get flash fw region");
}
for (i = 0; i < size; i++) { for (i = 0; i < size; i++) {
if (qlcnic_rom_fast_read(adapter, if (qlcnic_rom_fast_read(adapter,
......
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