aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/netronome/nfp/nfpcore
diff options
context:
space:
mode:
authorDirk van der Merwe <dirk.vandermerwe@netronome.com>2019-09-09 00:54:22 +0100
committerDavid S. Miller <davem@davemloft.net>2019-09-10 17:29:27 +0100
commitf8921d73301f526219ee3fa85d325cc4e676f58e (patch)
treee2713098247e7e06af963990632e1498bfb5f805 /drivers/net/ethernet/netronome/nfp/nfpcore
parentnfp: nsp: add support for hwinfo set operation (diff)
downloadlinux-dev-f8921d73301f526219ee3fa85d325cc4e676f58e.tar.xz
linux-dev-f8921d73301f526219ee3fa85d325cc4e676f58e.zip
nfp: honor FW reset and loading policies
The firmware reset and loading policies can be controlled with the combination of three hwinfo keys, 'abi_drv_reset', 'abi_drv_load_ifc' and 'app_fw_from_flash'. 'app_fw_from_flash' defines which firmware should take precedence, 'Disk', 'Flash' or the 'Preferred' firmware. When 'Preferred' is selected, the management firmware makes the decision on which firmware will be loaded by comparing versions of the flash firmware and the host supplied firmware. 'abi_drv_reset' defines when the driver should reset the firmware when the driver is probed, either 'Disk' if firmware was found on disk, 'Always' reset or 'Never' reset. Note that the device is always reset on driver unload if firmware was loaded when the driver was probed. 'abi_drv_load_ifc' defines a list of PF devices allowed to load FW on the device. Furthermore, we limit the cases to where the driver will unload firmware again when the driver is removed to only when firmware was loaded by the driver and only if this particular device was the only one that could have loaded firmware. This is needed to avoid firmware being removed while in use on multi-host platforms. Signed-off-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com> Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: Simon Horman <simon.horman@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/netronome/nfp/nfpcore')
-rw-r--r--drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h
index 055fda05880d..1531c1870020 100644
--- a/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h
+++ b/drivers/net/ethernet/netronome/nfp/nfpcore/nfp_nsp.h
@@ -102,6 +102,21 @@ enum nfp_eth_fec {
#define NFP_FEC_REED_SOLOMON BIT(NFP_FEC_REED_SOLOMON_BIT)
#define NFP_FEC_DISABLED BIT(NFP_FEC_DISABLED_BIT)
+/* Defines the valid values of the 'abi_drv_reset' hwinfo key */
+#define NFP_NSP_DRV_RESET_DISK 0
+#define NFP_NSP_DRV_RESET_ALWAYS 1
+#define NFP_NSP_DRV_RESET_NEVER 2
+#define NFP_NSP_DRV_RESET_DEFAULT "0"
+
+/* Defines the valid values of the 'app_fw_from_flash' hwinfo key */
+#define NFP_NSP_APP_FW_LOAD_DISK 0
+#define NFP_NSP_APP_FW_LOAD_FLASH 1
+#define NFP_NSP_APP_FW_LOAD_PREF 2
+#define NFP_NSP_APP_FW_LOAD_DEFAULT "2"
+
+/* Define the default value for the 'abi_drv_load_ifc' key */
+#define NFP_NSP_DRV_LOAD_IFC_DEFAULT "0x10ff"
+
/**
* struct nfp_eth_table - ETH table information
* @count: number of table entries