Commit b79cb787 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

mlxsw: Move fw flashing code into core.c

As the firmware flashing is not specific to Spectrum, move the code to
core.c and avoid one op call and 2 exported symbols. Also, this allows
to do flash before call of driver->init function and possibly do other
core calls in between.

Do some small renaming here and there on the way to be consistent with
the rest of core.c code.
Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
Signed-off-by: default avatarIdo Schimmel <idosch@nvidia.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent eab1924a
This diff is collapsed.
...@@ -280,6 +280,8 @@ struct mlxsw_driver { ...@@ -280,6 +280,8 @@ struct mlxsw_driver {
struct list_head list; struct list_head list;
const char *kind; const char *kind;
size_t priv_size; size_t priv_size;
const struct mlxsw_fw_rev *fw_req_rev;
const char *fw_filename;
int (*init)(struct mlxsw_core *mlxsw_core, int (*init)(struct mlxsw_core *mlxsw_core,
const struct mlxsw_bus_info *mlxsw_bus_info, const struct mlxsw_bus_info *mlxsw_bus_info,
struct netlink_ext_ack *extack); struct netlink_ext_ack *extack);
...@@ -324,9 +326,6 @@ struct mlxsw_driver { ...@@ -324,9 +326,6 @@ struct mlxsw_driver {
unsigned int sb_index, u16 tc_index, unsigned int sb_index, u16 tc_index,
enum devlink_sb_pool_type pool_type, enum devlink_sb_pool_type pool_type,
u32 *p_cur, u32 *p_max); u32 *p_cur, u32 *p_max);
int (*flash_update)(struct mlxsw_core *mlxsw_core,
const char *file_name, const char *component,
struct netlink_ext_ack *extack);
int (*trap_init)(struct mlxsw_core *mlxsw_core, int (*trap_init)(struct mlxsw_core *mlxsw_core,
const struct devlink_trap *trap, void *trap_ctx); const struct devlink_trap *trap, void *trap_ctx);
void (*trap_fini)(struct mlxsw_core *mlxsw_core, void (*trap_fini)(struct mlxsw_core *mlxsw_core,
...@@ -378,9 +377,6 @@ int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core, ...@@ -378,9 +377,6 @@ int mlxsw_core_kvd_sizes_get(struct mlxsw_core *mlxsw_core,
u64 *p_single_size, u64 *p_double_size, u64 *p_single_size, u64 *p_double_size,
u64 *p_linear_size); u64 *p_linear_size);
void mlxsw_core_fw_flash_start(struct mlxsw_core *mlxsw_core);
void mlxsw_core_fw_flash_end(struct mlxsw_core *mlxsw_core);
u32 mlxsw_core_read_frc_h(struct mlxsw_core *mlxsw_core); u32 mlxsw_core_read_frc_h(struct mlxsw_core *mlxsw_core);
u32 mlxsw_core_read_frc_l(struct mlxsw_core *mlxsw_core); u32 mlxsw_core_read_frc_l(struct mlxsw_core *mlxsw_core);
......
...@@ -162,8 +162,6 @@ struct mlxsw_sp { ...@@ -162,8 +162,6 @@ struct mlxsw_sp {
struct mlxsw_sp_counter_pool *counter_pool; struct mlxsw_sp_counter_pool *counter_pool;
struct mlxsw_sp_span *span; struct mlxsw_sp_span *span;
struct mlxsw_sp_trap *trap; struct mlxsw_sp_trap *trap;
const struct mlxsw_fw_rev *req_rev;
const char *fw_filename;
const struct mlxsw_sp_kvdl_ops *kvdl_ops; const struct mlxsw_sp_kvdl_ops *kvdl_ops;
const struct mlxsw_afa_ops *afa_ops; const struct mlxsw_afa_ops *afa_ops;
const struct mlxsw_afk_ops *afk_ops; const struct mlxsw_afk_ops *afk_ops;
......
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