Skip to content

Commit a72afb6

Browse files
idoschdavem330
authored andcommitted
mlxsw: Enforce firmware version for Spectrum-2
In a similar fashion to Spectrum-1, enforce a specific firmware version for Spectrum-2 so that the driver and firmware are always in sync with regards to new features. Signed-off-by: Ido Schimmel <idosch@mellanox.com> Reviewed-by: Petr Machata <petrm@mellanox.com> Acked-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5fd2ef4 commit a72afb6

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

‎drivers/net/ethernet/mellanox/mlxsw/spectrum.c‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,21 @@ static const struct mlxsw_fw_rev mlxsw_sp1_fw_rev = {
6363
"." __stringify(MLXSW_SP1_FWREV_MINOR) \
6464
"." __stringify(MLXSW_SP1_FWREV_SUBMINOR) ".mfa2"
6565

66+
#define MLXSW_SP2_FWREV_MAJOR 29
67+
#define MLXSW_SP2_FWREV_MINOR 2000
68+
#define MLXSW_SP2_FWREV_SUBMINOR 2308
69+
70+
static const struct mlxsw_fw_rev mlxsw_sp2_fw_rev = {
71+
.major = MLXSW_SP2_FWREV_MAJOR,
72+
.minor = MLXSW_SP2_FWREV_MINOR,
73+
.subminor = MLXSW_SP2_FWREV_SUBMINOR,
74+
};
75+
76+
#define MLXSW_SP2_FW_FILENAME \
77+
"mellanox/mlxsw_spectrum2-" __stringify(MLXSW_SP2_FWREV_MAJOR) \
78+
"." __stringify(MLXSW_SP2_FWREV_MINOR) \
79+
"." __stringify(MLXSW_SP2_FWREV_SUBMINOR) ".mfa2"
80+
6681
static const char mlxsw_sp1_driver_name[] = "mlxsw_spectrum";
6782
static const char mlxsw_sp2_driver_name[] = "mlxsw_spectrum2";
6883
static const char mlxsw_sp3_driver_name[] = "mlxsw_spectrum3";
@@ -4988,6 +5003,8 @@ static int mlxsw_sp2_init(struct mlxsw_core *mlxsw_core,
49885003
{
49895004
struct mlxsw_sp *mlxsw_sp = mlxsw_core_driver_priv(mlxsw_core);
49905005

5006+
mlxsw_sp->req_rev = &mlxsw_sp2_fw_rev;
5007+
mlxsw_sp->fw_filename = MLXSW_SP2_FW_FILENAME;
49915008
mlxsw_sp->kvdl_ops = &mlxsw_sp2_kvdl_ops;
49925009
mlxsw_sp->afa_ops = &mlxsw_sp2_act_afa_ops;
49935010
mlxsw_sp->afk_ops = &mlxsw_sp2_afk_ops;
@@ -6649,3 +6666,4 @@ MODULE_DEVICE_TABLE(pci, mlxsw_sp1_pci_id_table);
66496666
MODULE_DEVICE_TABLE(pci, mlxsw_sp2_pci_id_table);
66506667
MODULE_DEVICE_TABLE(pci, mlxsw_sp3_pci_id_table);
66516668
MODULE_FIRMWARE(MLXSW_SP1_FW_FILENAME);
6669+
MODULE_FIRMWARE(MLXSW_SP2_FW_FILENAME);

0 commit comments

Comments
 (0)