Commit be1d2a1b authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge branch 'sfc-support-devlink-flash'

Edward Cree says:

====================
sfc: support devlink flash

Allow upgrading device firmware on Solarflare NICs through standard tools.
====================

Link: https://patch.msgid.link/cover.1739186252.git.ecree.xilinx@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents f4b87edb 5ea73bf3
Loading
Loading
Loading
Loading
+15 −1
Original line number Diff line number Diff line
@@ -5,7 +5,7 @@ sfc devlink support
===================

This document describes the devlink features implemented by the ``sfc``
device driver for the ef100 device.
device driver for the ef10 and ef100 devices.

Info versions
=============
@@ -18,6 +18,10 @@ The ``sfc`` driver reports the following versions
   * - Name
     - Type
     - Description
   * - ``fw.bundle_id``
     - stored
     - Version of the firmware "bundle" image that was last used to update
       multiple components.
   * - ``fw.mgmt.suc``
     - running
     - For boards where the management function is split between multiple
@@ -55,3 +59,13 @@ The ``sfc`` driver reports the following versions
   * - ``fw.uefi``
     - running
     - UEFI driver version (No UNDI support).

Flash Update
============

The ``sfc`` driver implements support for flash update using the
``devlink-flash`` interface. It supports updating the device flash using a
combined flash image ("bundle") that contains multiple components (on ef10,
typically ``fw.mgmt``, ``fw.app``, ``fw.exprom`` and ``fw.uefi``).

The driver does not support any overwrite mask flags.
+3 −2
Original line number Diff line number Diff line
@@ -38,8 +38,9 @@ config SFC_MTD
	default y
	help
	  This exposes the on-board flash and/or EEPROM as MTD devices
	  (e.g. /dev/mtd1).  This is required to update the firmware or
	  the boot configuration under Linux.
	  (e.g. /dev/mtd1).  This is required to update the boot
	  configuration under Linux, or use some older userland tools to
	  update the firmware.
config SFC_MCDI_MON
	bool "Solarflare SFC9100-family hwmon support"
	depends on SFC && HWMON && !(SFC=y && HWMON=m)
+1 −1
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ sfc-y += efx.o efx_common.o efx_channels.o nic.o \
			   mcdi_functions.o mcdi_filters.o mcdi_mon.o \
			   ef100.o ef100_nic.o ef100_netdev.o \
			   ef100_ethtool.o ef100_rx.o ef100_tx.o \
			   efx_devlink.o
			   efx_devlink.o efx_reflash.o
sfc-$(CONFIG_SFC_MTD)	+= mtd.o
sfc-$(CONFIG_SFC_SRIOV)	+= sriov.o ef10_sriov.o ef100_sriov.o ef100_rep.o \
                           mae.o tc.o tc_bindings.o tc_counters.o \
+5 −2
Original line number Diff line number Diff line
@@ -3501,7 +3501,7 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
	MCDI_DECLARE_BUF(inbuf, MC_CMD_NVRAM_METADATA_IN_LEN);
	MCDI_DECLARE_BUF(outbuf, MC_CMD_NVRAM_METADATA_OUT_LENMAX);
	const struct efx_ef10_nvram_type_info *info;
	size_t size, erase_size, outlen;
	size_t size, erase_size, write_size, outlen;
	int type_idx = 0;
	bool protected;
	int rc;
@@ -3516,7 +3516,8 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
	if (info->port != efx_port_num(efx))
		return -ENODEV;

	rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &protected);
	rc = efx_mcdi_nvram_info(efx, type, &size, &erase_size, &write_size,
				 &protected);
	if (rc)
		return rc;
	if (protected &&
@@ -3561,6 +3562,8 @@ static int efx_ef10_mtd_probe_partition(struct efx_nic *efx,
	if (!erase_size)
		part->common.mtd.flags |= MTD_NO_ERASE;

	part->common.mtd.writesize = write_size;

	return 0;
}

+1 −0
Original line number Diff line number Diff line
@@ -1003,6 +1003,7 @@ int efx_init_struct(struct efx_nic *efx, struct pci_dev *pci_dev)
	INIT_LIST_HEAD(&efx->vf_reps);
	INIT_WORK(&efx->mac_work, efx_mac_work);
	init_waitqueue_head(&efx->flush_wq);
	mutex_init(&efx->reflash_mutex);

	efx->tx_queues_per_channel = 1;
	efx->rxq_entries = EFX_DEFAULT_DMAQ_SIZE;
Loading