Commit f67ef7ba authored by Padmanabh Ratnakar's avatar Padmanabh Ratnakar Committed by David S. Miller

be2net: Activate new FW after FW download for Lancer

After FW download, activate new FW by invoking FW reset.
Recreate rings once new FW is operational.
Signed-off-by: default avatarPadmanabh Ratnakar <padmanabh.ratnakar@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent bf99e50d
...@@ -389,6 +389,7 @@ struct be_adapter { ...@@ -389,6 +389,7 @@ struct be_adapter {
struct delayed_work work; struct delayed_work work;
u16 work_counter; u16 work_counter;
struct delayed_work func_recovery_work;
u32 flags; u32 flags;
/* Ethtool knobs and info */ /* Ethtool knobs and info */
char fw_ver[FW_VER_LEN]; char fw_ver[FW_VER_LEN];
...@@ -396,9 +397,10 @@ struct be_adapter { ...@@ -396,9 +397,10 @@ struct be_adapter {
u32 *pmac_id; /* MAC addr handle used by BE card */ u32 *pmac_id; /* MAC addr handle used by BE card */
u32 beacon_state; /* for set_phys_id */ u32 beacon_state; /* for set_phys_id */
bool eeh_err; bool eeh_error;
bool ue_detected;
bool fw_timeout; bool fw_timeout;
bool hw_error;
u32 port_num; u32 port_num;
bool promiscuous; bool promiscuous;
u32 function_mode; u32 function_mode;
...@@ -599,7 +601,19 @@ static inline bool be_multi_rxq(const struct be_adapter *adapter) ...@@ -599,7 +601,19 @@ static inline bool be_multi_rxq(const struct be_adapter *adapter)
static inline bool be_error(struct be_adapter *adapter) static inline bool be_error(struct be_adapter *adapter)
{ {
return adapter->eeh_err || adapter->ue_detected || adapter->fw_timeout; return adapter->eeh_error || adapter->hw_error || adapter->fw_timeout;
}
static inline bool be_crit_error(struct be_adapter *adapter)
{
return adapter->eeh_error || adapter->hw_error;
}
static inline void be_clear_all_error(struct be_adapter *adapter)
{
adapter->eeh_error = false;
adapter->hw_error = false;
adapter->fw_timeout = false;
} }
static inline bool be_is_wol_excluded(struct be_adapter *adapter) static inline bool be_is_wol_excluded(struct be_adapter *adapter)
......
...@@ -349,7 +349,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db) ...@@ -349,7 +349,7 @@ static int be_mbox_db_ready_wait(struct be_adapter *adapter, void __iomem *db)
if (msecs > 4000) { if (msecs > 4000) {
dev_err(&adapter->pdev->dev, "FW not responding\n"); dev_err(&adapter->pdev->dev, "FW not responding\n");
adapter->fw_timeout = true; adapter->fw_timeout = true;
be_detect_dump_ue(adapter); be_detect_error(adapter);
return -1; return -1;
} }
...@@ -1869,8 +1869,9 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state) ...@@ -1869,8 +1869,9 @@ int be_cmd_get_beacon_state(struct be_adapter *adapter, u8 port_num, u32 *state)
} }
int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd, int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
u32 data_size, u32 data_offset, const char *obj_name, u32 data_size, u32 data_offset,
u32 *data_written, u8 *addn_status) const char *obj_name, u32 *data_written,
u8 *change_status, u8 *addn_status)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct lancer_cmd_req_write_object *req; struct lancer_cmd_req_write_object *req;
...@@ -1926,10 +1927,12 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd, ...@@ -1926,10 +1927,12 @@ int lancer_cmd_write_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
status = adapter->flash_status; status = adapter->flash_status;
resp = embedded_payload(wrb); resp = embedded_payload(wrb);
if (!status) if (!status) {
*data_written = le32_to_cpu(resp->actual_write_len); *data_written = le32_to_cpu(resp->actual_write_len);
else *change_status = resp->change_status;
} else {
*addn_status = resp->additional_status; *addn_status = resp->additional_status;
}
return status; return status;
......
...@@ -1163,6 +1163,8 @@ struct lancer_cmd_req_write_object { ...@@ -1163,6 +1163,8 @@ struct lancer_cmd_req_write_object {
u32 addr_high; u32 addr_high;
}; };
#define LANCER_NO_RESET_NEEDED 0x00
#define LANCER_FW_RESET_NEEDED 0x02
struct lancer_cmd_resp_write_object { struct lancer_cmd_resp_write_object {
u8 opcode; u8 opcode;
u8 subsystem; u8 subsystem;
...@@ -1173,6 +1175,8 @@ struct lancer_cmd_resp_write_object { ...@@ -1173,6 +1175,8 @@ struct lancer_cmd_resp_write_object {
u32 resp_len; u32 resp_len;
u32 actual_resp_len; u32 actual_resp_len;
u32 actual_write_len; u32 actual_write_len;
u8 change_status;
u8 rsvd3[3];
}; };
/************************ Lancer Read FW info **************/ /************************ Lancer Read FW info **************/
...@@ -1718,10 +1722,11 @@ extern int be_cmd_write_flashrom(struct be_adapter *adapter, ...@@ -1718,10 +1722,11 @@ extern int be_cmd_write_flashrom(struct be_adapter *adapter,
struct be_dma_mem *cmd, u32 flash_oper, struct be_dma_mem *cmd, u32 flash_oper,
u32 flash_opcode, u32 buf_size); u32 flash_opcode, u32 buf_size);
extern int lancer_cmd_write_object(struct be_adapter *adapter, extern int lancer_cmd_write_object(struct be_adapter *adapter,
struct be_dma_mem *cmd, struct be_dma_mem *cmd,
u32 data_size, u32 data_offset, u32 data_size, u32 data_offset,
const char *obj_name, const char *obj_name,
u32 *data_written, u8 *addn_status); u32 *data_written, u8 *change_status,
u8 *addn_status);
int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd, int lancer_cmd_read_object(struct be_adapter *adapter, struct be_dma_mem *cmd,
u32 data_size, u32 data_offset, const char *obj_name, u32 data_size, u32 data_offset, const char *obj_name,
u32 *data_read, u32 *eof, u8 *addn_status); u32 *data_read, u32 *eof, u8 *addn_status);
...@@ -1744,7 +1749,7 @@ extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num, ...@@ -1744,7 +1749,7 @@ extern int be_cmd_set_loopback(struct be_adapter *adapter, u8 port_num,
u8 loopback_type, u8 enable); u8 loopback_type, u8 enable);
extern int be_cmd_get_phy_info(struct be_adapter *adapter); extern int be_cmd_get_phy_info(struct be_adapter *adapter);
extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain); extern int be_cmd_set_qos(struct be_adapter *adapter, u32 bps, u32 domain);
extern void be_detect_dump_ue(struct be_adapter *adapter); extern void be_detect_error(struct be_adapter *adapter);
extern int be_cmd_get_die_temperature(struct be_adapter *adapter); extern int be_cmd_get_die_temperature(struct be_adapter *adapter);
extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter); extern int be_cmd_get_cntl_attributes(struct be_adapter *adapter);
extern int be_cmd_req_native_mode(struct be_adapter *adapter); extern int be_cmd_req_native_mode(struct be_adapter *adapter);
......
...@@ -45,18 +45,19 @@ ...@@ -45,18 +45,19 @@
#define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */ #define POST_STAGE_ARMFW_RDY 0xc000 /* FW is done with POST */
/* Lancer SLIPORT_CONTROL SLIPORT_STATUS registers */ /* Lancer SLIPORT registers */
#define SLIPORT_STATUS_OFFSET 0x404 #define SLIPORT_STATUS_OFFSET 0x404
#define SLIPORT_CONTROL_OFFSET 0x408 #define SLIPORT_CONTROL_OFFSET 0x408
#define SLIPORT_ERROR1_OFFSET 0x40C #define SLIPORT_ERROR1_OFFSET 0x40C
#define SLIPORT_ERROR2_OFFSET 0x410 #define SLIPORT_ERROR2_OFFSET 0x410
#define PHYSDEV_CONTROL_OFFSET 0x414
#define SLIPORT_STATUS_ERR_MASK 0x80000000 #define SLIPORT_STATUS_ERR_MASK 0x80000000
#define SLIPORT_STATUS_RN_MASK 0x01000000 #define SLIPORT_STATUS_RN_MASK 0x01000000
#define SLIPORT_STATUS_RDY_MASK 0x00800000 #define SLIPORT_STATUS_RDY_MASK 0x00800000
#define SLI_PORT_CONTROL_IP_MASK 0x08000000 #define SLI_PORT_CONTROL_IP_MASK 0x08000000
#define PHYSDEV_CONTROL_FW_RESET_MASK 0x00000002
#define PHYSDEV_CONTROL_INP_MASK 0x40000000
/********* Memory BAR register ************/ /********* Memory BAR register ************/
#define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc #define PCICFG_MEMBAR_CTRL_INT_CTRL_OFFSET 0xfc
......
This diff is collapsed.
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