Support for restoring settings and identifiers from factory settings
instead of using those found in the image.

Restoring data from factory settings requires restoring both settings
and identifiers simultaneously. Other combinations are not supported.

Signed-off-by: Konrad Knitter <[email protected]>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c | 6 ++++++
 drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h | 1 +
 2 files changed, 7 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c
index e5479fc07a07..6b46da369934 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fw_update.c
@@ -654,6 +654,12 @@ int ixgbe_flash_pldm_image(struct devlink *devlink,
                /* overwrite both settings and identifiers, preserve nothing */
                preservation = IXGBE_ACI_NVM_NO_PRESERVATION;
                break;
+       case (DEVLINK_FLASH_OVERWRITE_SETTINGS |
+            DEVLINK_FLASH_OVERWRITE_IDENTIFIERS |
+            DEVLINK_FLASH_OVERWRITE_FROM_FACTORY_SETTINGS):
+               /* overwrite both settings and identifiers, from factory 
settings */
+               preservation = IXGBE_ACI_NVM_FACTORY_DEFAULT;
+               break;
        default:
                NL_SET_ERR_MSG_MOD(extack,
                                   "Requested overwrite mask is not supported");
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h 
b/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
index d76334b8fbad..426bb2424620 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type_e610.h
@@ -691,6 +691,7 @@ struct ixgbe_aci_cmd_nvm {
 #define IXGBE_ACI_NVM_LAST_CMD         BIT(0)
 #define IXGBE_ACI_NVM_PCIR_REQ         BIT(0) /* Used by NVM Write reply */
 #define IXGBE_ACI_NVM_PRESERVE_ALL     BIT(1)
+#define IXGBE_ACI_NVM_FACTORY_DEFAULT  BIT(2)
 #define IXGBE_ACI_NVM_ACTIV_SEL_NVM    BIT(3) /* Write Activate/SR Dump only */
 #define IXGBE_ACI_NVM_ACTIV_SEL_OROM   BIT(4)
 #define IXGBE_ACI_NVM_ACTIV_SEL_NETLIST        BIT(5)
-- 
2.38.1

Reply via email to