Commit a5a3b460 authored by Divy Le Ray's avatar Divy Le Ray Committed by David S. Miller

cxgb3 - Firmware update

Update firmware version.
Allow the driver to be up and running with older FW image
Signed-off-by: default avatarDivy Le Ray <divy@chelsio.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent 34c6417b
...@@ -690,7 +690,7 @@ int t3_read_flash(struct adapter *adapter, unsigned int addr, ...@@ -690,7 +690,7 @@ int t3_read_flash(struct adapter *adapter, unsigned int addr,
unsigned int nwords, u32 *data, int byte_oriented); unsigned int nwords, u32 *data, int byte_oriented);
int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size); int t3_load_fw(struct adapter *adapter, const u8 * fw_data, unsigned int size);
int t3_get_fw_version(struct adapter *adapter, u32 *vers); int t3_get_fw_version(struct adapter *adapter, u32 *vers);
int t3_check_fw_version(struct adapter *adapter); int t3_check_fw_version(struct adapter *adapter, int *must_load);
int t3_init_hw(struct adapter *adapter, u32 fw_params); int t3_init_hw(struct adapter *adapter, u32 fw_params);
void mac_prep(struct cmac *mac, struct adapter *adapter, int index); void mac_prep(struct cmac *mac, struct adapter *adapter, int index);
void early_hw_init(struct adapter *adapter, const struct adapter_info *ai); void early_hw_init(struct adapter *adapter, const struct adapter_info *ai);
......
...@@ -797,11 +797,12 @@ static int cxgb_up(struct adapter *adap) ...@@ -797,11 +797,12 @@ static int cxgb_up(struct adapter *adap)
int must_load; int must_load;
if (!(adap->flags & FULL_INIT_DONE)) { if (!(adap->flags & FULL_INIT_DONE)) {
err = t3_check_fw_version(adap); err = t3_check_fw_version(adap, &must_load);
if (err == -EINVAL) if (err == -EINVAL) {
err = upgrade_fw(adap); err = upgrade_fw(adap);
if (err) if (err && must_load)
goto out; goto out;
}
err = t3_check_tpsram_version(adap, &must_load); err = t3_check_tpsram_version(adap, &must_load);
if (err == -EINVAL) { if (err == -EINVAL) {
......
...@@ -960,16 +960,18 @@ int t3_get_fw_version(struct adapter *adapter, u32 *vers) ...@@ -960,16 +960,18 @@ int t3_get_fw_version(struct adapter *adapter, u32 *vers)
/** /**
* t3_check_fw_version - check if the FW is compatible with this driver * t3_check_fw_version - check if the FW is compatible with this driver
* @adapter: the adapter * @adapter: the adapter
* * @must_load: set to 1 if loading a new FW image is required
* Checks if an adapter's FW is compatible with the driver. Returns 0 * Checks if an adapter's FW is compatible with the driver. Returns 0
* if the versions are compatible, a negative error otherwise. * if the versions are compatible, a negative error otherwise.
*/ */
int t3_check_fw_version(struct adapter *adapter) int t3_check_fw_version(struct adapter *adapter, int *must_load)
{ {
int ret; int ret;
u32 vers; u32 vers;
unsigned int type, major, minor; unsigned int type, major, minor;
*must_load = 1;
ret = t3_get_fw_version(adapter, &vers); ret = t3_get_fw_version(adapter, &vers);
if (ret) if (ret)
return ret; return ret;
...@@ -982,9 +984,17 @@ int t3_check_fw_version(struct adapter *adapter) ...@@ -982,9 +984,17 @@ int t3_check_fw_version(struct adapter *adapter)
minor == FW_VERSION_MINOR) minor == FW_VERSION_MINOR)
return 0; return 0;
CH_ERR(adapter, "found wrong FW version(%u.%u), " if (major != FW_VERSION_MAJOR)
"driver needs version %u.%u\n", major, minor, CH_ERR(adapter, "found wrong FW version(%u.%u), "
FW_VERSION_MAJOR, FW_VERSION_MINOR); "driver needs version %u.%u\n", major, minor,
FW_VERSION_MAJOR, FW_VERSION_MINOR);
else {
*must_load = 0;
CH_WARN(adapter, "found wrong FW minor version(%u.%u), "
"driver compiled for version %u.%u\n", major, minor,
FW_VERSION_MAJOR, FW_VERSION_MINOR);
}
return -EINVAL; return -EINVAL;
} }
......
...@@ -39,6 +39,6 @@ ...@@ -39,6 +39,6 @@
/* Firmware version */ /* Firmware version */
#define FW_VERSION_MAJOR 4 #define FW_VERSION_MAJOR 4
#define FW_VERSION_MINOR 3 #define FW_VERSION_MINOR 6
#define FW_VERSION_MICRO 0 #define FW_VERSION_MICRO 0
#endif /* __CHELSIO_VERSION_H */ #endif /* __CHELSIO_VERSION_H */
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