Commit 14743ddd authored by Alejandro Lucero's avatar Alejandro Lucero Committed by Paolo Abeni

sfc: add devlink info support for ef100

Add devlink info support for ef100. The information reported is obtained
through the MCDI interface with the specific meaning defined in new
documentation file.
Signed-off-by: default avatarAlejandro Lucero <alejandro.lucero-palau@amd.com>
Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
Acked-by: default avatarMartin Habets <habetsm.xilinx@gmail.com>
Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parent fa34a514
...@@ -66,3 +66,4 @@ parameters, info versions, and other features it supports. ...@@ -66,3 +66,4 @@ parameters, info versions, and other features it supports.
prestera prestera
iosm iosm
octeontx2 octeontx2
sfc
.. SPDX-License-Identifier: GPL-2.0
===================
sfc devlink support
===================
This document describes the devlink features implemented by the ``sfc``
device driver for the ef100 device.
Info versions
=============
The ``sfc`` driver reports the following versions
.. list-table:: devlink info versions implemented
:widths: 5 5 90
* - Name
- Type
- Description
* - ``fw.mgmt.suc``
- running
- For boards where the management function is split between multiple
control units, this is the SUC control unit's firmware version.
* - ``fw.mgmt.cmc``
- running
- For boards where the management function is split between multiple
control units, this is the CMC control unit's firmware version.
* - ``fpga.rev``
- running
- FPGA design revision.
* - ``fpga.app``
- running
- Datapath programmable logic version.
* - ``fw.app``
- running
- Datapath software/microcode/firmware version.
* - ``coproc.boot``
- running
- SmartNIC application co-processor (APU) first stage boot loader version.
* - ``coproc.uboot``
- running
- SmartNIC application co-processor (APU) co-operating system loader version.
* - ``coproc.main``
- running
- SmartNIC application co-processor (APU) main operating system version.
* - ``coproc.recovery``
- running
- SmartNIC application co-processor (APU) recovery operating system version.
* - ``fw.exprom``
- running
- Expansion ROM version. For boards where the expansion ROM is split between
multiple images (e.g. PXE and UEFI), this is the specifically the PXE boot
ROM version.
* - ``fw.uefi``
- running
- UEFI driver version (No UNDI support).
...@@ -18937,6 +18937,7 @@ M: Edward Cree <ecree.xilinx@gmail.com> ...@@ -18937,6 +18937,7 @@ M: Edward Cree <ecree.xilinx@gmail.com>
M: Martin Habets <habetsm.xilinx@gmail.com> M: Martin Habets <habetsm.xilinx@gmail.com>
L: netdev@vger.kernel.org L: netdev@vger.kernel.org
S: Supported S: Supported
F: Documentation/networking/devlink/sfc.rst
F: drivers/net/ethernet/sfc/ F: drivers/net/ethernet/sfc/
SFF/SFP/SFP+ MODULE SUPPORT SFF/SFP/SFP+ MODULE SUPPORT
......
This diff is collapsed.
...@@ -14,6 +14,23 @@ ...@@ -14,6 +14,23 @@
#include "net_driver.h" #include "net_driver.h"
#include <net/devlink.h> #include <net/devlink.h>
/* Custom devlink-info version object names for details that do not map to the
* generic standardized names.
*/
#define EFX_DEVLINK_INFO_VERSION_FW_MGMT_SUC "fw.mgmt.suc"
#define EFX_DEVLINK_INFO_VERSION_FW_MGMT_CMC "fw.mgmt.cmc"
#define EFX_DEVLINK_INFO_VERSION_FPGA_REV "fpga.rev"
#define EFX_DEVLINK_INFO_VERSION_DATAPATH_HW "fpga.app"
#define EFX_DEVLINK_INFO_VERSION_DATAPATH_FW DEVLINK_INFO_VERSION_GENERIC_FW_APP
#define EFX_DEVLINK_INFO_VERSION_SOC_BOOT "coproc.boot"
#define EFX_DEVLINK_INFO_VERSION_SOC_UBOOT "coproc.uboot"
#define EFX_DEVLINK_INFO_VERSION_SOC_MAIN "coproc.main"
#define EFX_DEVLINK_INFO_VERSION_SOC_RECOVERY "coproc.recovery"
#define EFX_DEVLINK_INFO_VERSION_FW_EXPROM "fw.exprom"
#define EFX_DEVLINK_INFO_VERSION_FW_UEFI "fw.uefi"
#define EFX_MAX_VERSION_INFO_LEN 64
int efx_probe_devlink_and_lock(struct efx_nic *efx); int efx_probe_devlink_and_lock(struct efx_nic *efx);
void efx_probe_devlink_unlock(struct efx_nic *efx); void efx_probe_devlink_unlock(struct efx_nic *efx);
void efx_fini_devlink_lock(struct efx_nic *efx); void efx_fini_devlink_lock(struct efx_nic *efx);
......
...@@ -2175,6 +2175,78 @@ int efx_mcdi_get_privilege_mask(struct efx_nic *efx, u32 *mask) ...@@ -2175,6 +2175,78 @@ int efx_mcdi_get_privilege_mask(struct efx_nic *efx, u32 *mask)
return 0; return 0;
} }
int efx_mcdi_nvram_metadata(struct efx_nic *efx, unsigned int type,
u32 *subtype, u16 version[4], char *desc,
size_t descsize)
{
MCDI_DECLARE_BUF(inbuf, MC_CMD_NVRAM_METADATA_IN_LEN);
efx_dword_t *outbuf;
size_t outlen;
u32 flags;
int rc;
outbuf = kzalloc(MC_CMD_NVRAM_METADATA_OUT_LENMAX_MCDI2, GFP_KERNEL);
if (!outbuf)
return -ENOMEM;
MCDI_SET_DWORD(inbuf, NVRAM_METADATA_IN_TYPE, type);
rc = efx_mcdi_rpc_quiet(efx, MC_CMD_NVRAM_METADATA, inbuf,
sizeof(inbuf), outbuf,
MC_CMD_NVRAM_METADATA_OUT_LENMAX_MCDI2,
&outlen);
if (rc)
goto out_free;
if (outlen < MC_CMD_NVRAM_METADATA_OUT_LENMIN) {
rc = -EIO;
goto out_free;
}
flags = MCDI_DWORD(outbuf, NVRAM_METADATA_OUT_FLAGS);
if (desc && descsize > 0) {
if (flags & BIT(MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_VALID_LBN)) {
if (descsize <=
MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_NUM(outlen)) {
rc = -E2BIG;
goto out_free;
}
strncpy(desc,
MCDI_PTR(outbuf, NVRAM_METADATA_OUT_DESCRIPTION),
MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_NUM(outlen));
desc[MC_CMD_NVRAM_METADATA_OUT_DESCRIPTION_NUM(outlen)] = '\0';
} else {
desc[0] = '\0';
}
}
if (subtype) {
if (flags & BIT(MC_CMD_NVRAM_METADATA_OUT_SUBTYPE_VALID_LBN))
*subtype = MCDI_DWORD(outbuf, NVRAM_METADATA_OUT_SUBTYPE);
else
*subtype = 0;
}
if (version) {
if (flags & BIT(MC_CMD_NVRAM_METADATA_OUT_VERSION_VALID_LBN)) {
version[0] = MCDI_WORD(outbuf, NVRAM_METADATA_OUT_VERSION_W);
version[1] = MCDI_WORD(outbuf, NVRAM_METADATA_OUT_VERSION_X);
version[2] = MCDI_WORD(outbuf, NVRAM_METADATA_OUT_VERSION_Y);
version[3] = MCDI_WORD(outbuf, NVRAM_METADATA_OUT_VERSION_Z);
} else {
version[0] = 0;
version[1] = 0;
version[2] = 0;
version[3] = 0;
}
}
out_free:
kfree(outbuf);
return rc;
}
#ifdef CONFIG_SFC_MTD #ifdef CONFIG_SFC_MTD
#define EFX_MCDI_NVRAM_LEN_MAX 128 #define EFX_MCDI_NVRAM_LEN_MAX 128
......
...@@ -378,6 +378,9 @@ int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type, ...@@ -378,6 +378,9 @@ int efx_mcdi_nvram_info(struct efx_nic *efx, unsigned int type,
size_t *size_out, size_t *erase_size_out, size_t *size_out, size_t *erase_size_out,
bool *protected_out); bool *protected_out);
int efx_new_mcdi_nvram_test_all(struct efx_nic *efx); int efx_new_mcdi_nvram_test_all(struct efx_nic *efx);
int efx_mcdi_nvram_metadata(struct efx_nic *efx, unsigned int type,
u32 *subtype, u16 version[4], char *desc,
size_t descsize);
int efx_mcdi_nvram_test_all(struct efx_nic *efx); int efx_mcdi_nvram_test_all(struct efx_nic *efx);
int efx_mcdi_handle_assertion(struct efx_nic *efx); int efx_mcdi_handle_assertion(struct efx_nic *efx);
int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode); int efx_mcdi_set_id_led(struct efx_nic *efx, enum efx_led_mode mode);
......
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