mlxsw: spectrum: Load firmware version based on devlink parameter
authorShalom Toledo <shalomt@mellanox.com>
Mon, 3 Dec 2018 07:59:02 +0000 (07:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 3 Dec 2018 21:55:43 +0000 (13:55 -0800)
commit064501c5b6fd344cc2770194f23d620c65f2bd2c
treec7b77c81599e5cb33650ccbd389cd25f36c79732
parent03bffcad491fa824eba21b68e4ed710f9eca49d8
mlxsw: spectrum: Load firmware version based on devlink parameter

Load firmware version based on 'fw_load_policy' devlink parameter. The
driver supports these two options:
    * DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_DRIVER (0)
      Default, load firmware version preferred by the driver
    * DEVLINK_PARAM_FW_LOAD_POLICY_VALUE_FLASH (1)
      Load firmware currently stored in flash

The second option, 'flash', allow the device to run with different firmware
version than preferred by the driver for testing and/or debugging purposes.
For example, testing a firmware bug fix.

Signed-off-by: Shalom Toledo <shalomt@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core.c
drivers/net/ethernet/mellanox/mlxsw/core.h
drivers/net/ethernet/mellanox/mlxsw/spectrum.c