aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorSarveshwar Bandi <sarveshwarb@serverengines.com>2010-03-02 17:37:28 -0500
committerDavid S. Miller <davem@davemloft.net>2010-03-03 04:04:38 -0500
commit9fe969345b10931319b3f1e7034fbdeb786de234 (patch)
treeb5a638a49c3992126b02b2e1c2406945ab58a7b8 /drivers/net/benet
parent48a29516e8b0b8cd59f5afec90a14f49dd9cf967 (diff)
be2net: download NCSI section during firmware update
Adding code to update NCSI section while updating firmware on the controller. Signed-off-by: Sarveshwar Bandi <sarveshwarb@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_hw.h5
-rw-r--r--drivers/net/benet/be_main.c14
2 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/benet/be_hw.h b/drivers/net/benet/be_hw.h
index 5ffb149181ad..2d4a4b827637 100644
--- a/drivers/net/benet/be_hw.h
+++ b/drivers/net/benet/be_hw.h
@@ -114,8 +114,7 @@
114#define IMG_TYPE_ISCSI_BACKUP 9 114#define IMG_TYPE_ISCSI_BACKUP 9
115#define IMG_TYPE_FCOE_FW_ACTIVE 10 115#define IMG_TYPE_FCOE_FW_ACTIVE 10
116#define IMG_TYPE_FCOE_FW_BACKUP 11 116#define IMG_TYPE_FCOE_FW_BACKUP 11
117#define IMG_TYPE_NCSI_BITFILE 13 117#define IMG_TYPE_NCSI_FW 13
118#define IMG_TYPE_NCSI_8051 14
119 118
120#define FLASHROM_OPER_FLASH 1 119#define FLASHROM_OPER_FLASH 1
121#define FLASHROM_OPER_SAVE 2 120#define FLASHROM_OPER_SAVE 2
@@ -127,6 +126,7 @@
127#define FLASH_IMAGE_MAX_SIZE_g3 (2097152) /* Max fw image size */ 126#define FLASH_IMAGE_MAX_SIZE_g3 (2097152) /* Max fw image size */
128#define FLASH_BIOS_IMAGE_MAX_SIZE_g3 (524288) /* Max OPTION ROM img sz */ 127#define FLASH_BIOS_IMAGE_MAX_SIZE_g3 (524288) /* Max OPTION ROM img sz */
129#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3 (1048576) /* Max Redboot image sz */ 128#define FLASH_REDBOOT_IMAGE_MAX_SIZE_g3 (1048576) /* Max Redboot image sz */
129#define FLASH_NCSI_IMAGE_MAX_SIZE_g3 (262144) /* Max NSCI image sz */
130 130
131#define FLASH_NCSI_MAGIC (0x16032009) 131#define FLASH_NCSI_MAGIC (0x16032009)
132#define FLASH_NCSI_DISABLED (0) 132#define FLASH_NCSI_DISABLED (0)
@@ -144,6 +144,7 @@
144#define FLASH_FCoE_BIOS_START_g2 (524288) 144#define FLASH_FCoE_BIOS_START_g2 (524288)
145#define FLASH_REDBOOT_START_g2 (0) 145#define FLASH_REDBOOT_START_g2 (0)
146 146
147#define FLASH_NCSI_START_g3 (15990784)
147#define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 (2097152) 148#define FLASH_iSCSI_PRIMARY_IMAGE_START_g3 (2097152)
148#define FLASH_iSCSI_BACKUP_IMAGE_START_g3 (4194304) 149#define FLASH_iSCSI_BACKUP_IMAGE_START_g3 (4194304)
149#define FLASH_FCoE_PRIMARY_IMAGE_START_g3 (6291456) 150#define FLASH_FCoE_PRIMARY_IMAGE_START_g3 (6291456)
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index a703ed8e24fe..22f787f2a30b 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -1880,8 +1880,9 @@ static int be_flash_data(struct be_adapter *adapter,
1880 const u8 *p = fw->data; 1880 const u8 *p = fw->data;
1881 struct be_cmd_write_flashrom *req = flash_cmd->va; 1881 struct be_cmd_write_flashrom *req = flash_cmd->va;
1882 struct flash_comp *pflashcomp; 1882 struct flash_comp *pflashcomp;
1883 int num_comp;
1883 1884
1884 struct flash_comp gen3_flash_types[8] = { 1885 struct flash_comp gen3_flash_types[9] = {
1885 { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE, 1886 { FLASH_iSCSI_PRIMARY_IMAGE_START_g3, IMG_TYPE_ISCSI_ACTIVE,
1886 FLASH_IMAGE_MAX_SIZE_g3}, 1887 FLASH_IMAGE_MAX_SIZE_g3},
1887 { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT, 1888 { FLASH_REDBOOT_START_g3, IMG_TYPE_REDBOOT,
@@ -1897,7 +1898,9 @@ static int be_flash_data(struct be_adapter *adapter,
1897 { FLASH_FCoE_PRIMARY_IMAGE_START_g3, IMG_TYPE_FCOE_FW_ACTIVE, 1898 { FLASH_FCoE_PRIMARY_IMAGE_START_g3, IMG_TYPE_FCOE_FW_ACTIVE,
1898 FLASH_IMAGE_MAX_SIZE_g3}, 1899 FLASH_IMAGE_MAX_SIZE_g3},
1899 { FLASH_FCoE_BACKUP_IMAGE_START_g3, IMG_TYPE_FCOE_FW_BACKUP, 1900 { FLASH_FCoE_BACKUP_IMAGE_START_g3, IMG_TYPE_FCOE_FW_BACKUP,
1900 FLASH_IMAGE_MAX_SIZE_g3} 1901 FLASH_IMAGE_MAX_SIZE_g3},
1902 { FLASH_NCSI_START_g3, IMG_TYPE_NCSI_FW,
1903 FLASH_NCSI_IMAGE_MAX_SIZE_g3}
1901 }; 1904 };
1902 struct flash_comp gen2_flash_types[8] = { 1905 struct flash_comp gen2_flash_types[8] = {
1903 { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE, 1906 { FLASH_iSCSI_PRIMARY_IMAGE_START_g2, IMG_TYPE_ISCSI_ACTIVE,
@@ -1921,11 +1924,16 @@ static int be_flash_data(struct be_adapter *adapter,
1921 if (adapter->generation == BE_GEN3) { 1924 if (adapter->generation == BE_GEN3) {
1922 pflashcomp = gen3_flash_types; 1925 pflashcomp = gen3_flash_types;
1923 filehdr_size = sizeof(struct flash_file_hdr_g3); 1926 filehdr_size = sizeof(struct flash_file_hdr_g3);
1927 num_comp = 9;
1924 } else { 1928 } else {
1925 pflashcomp = gen2_flash_types; 1929 pflashcomp = gen2_flash_types;
1926 filehdr_size = sizeof(struct flash_file_hdr_g2); 1930 filehdr_size = sizeof(struct flash_file_hdr_g2);
1931 num_comp = 8;
1927 } 1932 }
1928 for (i = 0; i < 8; i++) { 1933 for (i = 0; i < num_comp; i++) {
1934 if ((pflashcomp[i].optype == IMG_TYPE_NCSI_FW) &&
1935 memcmp(adapter->fw_ver, "3.102.148.0", 11) < 0)
1936 continue;
1929 if ((pflashcomp[i].optype == IMG_TYPE_REDBOOT) && 1937 if ((pflashcomp[i].optype == IMG_TYPE_REDBOOT) &&
1930 (!be_flash_redboot(adapter, fw->data, 1938 (!be_flash_redboot(adapter, fw->data,
1931 pflashcomp[i].offset, pflashcomp[i].size, 1939 pflashcomp[i].offset, pflashcomp[i].size,