Add various changes to the base driver that are not specifically
about any features but are present in the shared code snapshot, to
better align base code with DPDK.

Also, update documentation to reflect new base code snapshot version,
as well as document new hardware support.

Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
---

Notes:
    This fix seems to be kernel-specific, so Cc:stable was intentionally 
omitted.

 doc/guides/rel_notes/release_24_07.rst   |   4 +
 drivers/net/ixgbe/base/README            |   6 +-
 drivers/net/ixgbe/base/ixgbe_api.c       |   2 -
 drivers/net/ixgbe/base/ixgbe_type.h      |   1 +
 drivers/net/ixgbe/base/ixgbe_type_e610.h | 207 +++++++++++++++++++++++
 5 files changed, 216 insertions(+), 4 deletions(-)

diff --git a/doc/guides/rel_notes/release_24_07.rst 
b/doc/guides/rel_notes/release_24_07.rst
index a69f24cf99..9499352c46 100644
--- a/doc/guides/rel_notes/release_24_07.rst
+++ b/doc/guides/rel_notes/release_24_07.rst
@@ -55,6 +55,10 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Updated IXGBE base code.**
+
+  * Updated shared code to more recent version.
+  * Added support for E610 device family.
 
 Removed Items
 -------------
diff --git a/drivers/net/ixgbe/base/README b/drivers/net/ixgbe/base/README
index 2c74693924..98353ba26f 100644
--- a/drivers/net/ixgbe/base/README
+++ b/drivers/net/ixgbe/base/README
@@ -1,12 +1,12 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2010-2020 Intel Corporation
+ * Copyright(c) 2010-2024 Intel Corporation
  */
 
 Intel® IXGBE driver
 ===================
 
 This directory contains source code of FreeBSD ixgbe driver of version
-not-released-cid-ixgbe.2020.06.09.tar.gz released by the team which develop
+not-released-cid-ixgbe.2024.04.24.tar.gz released by the team which develop
 basic drivers for any ixgbe NIC. The sub-directory of base/
 contains the original source package.
 This driver is valid for the product(s) listed below
@@ -24,6 +24,7 @@ This driver is valid for the product(s) listed below
 * Intel® Ethernet Server Adapter X520 Series
 * Intel® Ethernet Server Adapter X520-T2
 * Intel® Ethernet Controller X550 Series
+* Intel® Ethernet Controller E610 Series
 
 Updating the driver
 ===================
@@ -32,3 +33,4 @@ NOTE: The source code in this directory should not be 
modified apart from
 the following file(s):
 
     ixgbe_osdep.h
+    ixgbe_osdep.c
diff --git a/drivers/net/ixgbe/base/ixgbe_api.c 
b/drivers/net/ixgbe/base/ixgbe_api.c
index f2371b1510..c8f9a6d9f1 100644
--- a/drivers/net/ixgbe/base/ixgbe_api.c
+++ b/drivers/net/ixgbe/base/ixgbe_api.c
@@ -227,8 +227,6 @@ s32 ixgbe_set_mac_type(struct ixgbe_hw *hw)
                break;
        }
 
-       DEBUGOUT2("ixgbe_set_mac_type found mac: %d, returns: %d\n",
-                 hw->mac.type, ret_val);
        return ret_val;
 }
 
diff --git a/drivers/net/ixgbe/base/ixgbe_type.h 
b/drivers/net/ixgbe/base/ixgbe_type.h
index e03ed63914..d86049426e 100644
--- a/drivers/net/ixgbe/base/ixgbe_type.h
+++ b/drivers/net/ixgbe/base/ixgbe_type.h
@@ -3396,6 +3396,7 @@ struct ixgbe_adv_tx_context_desc {
 #define IXGBE_ADVTXD_POPTS_RSV         0x00002000 /* POPTS Reserved */
 #define IXGBE_ADVTXD_PAYLEN_SHIFT      14 /* Adv desc PAYLEN shift */
 #define IXGBE_ADVTXD_MACLEN_SHIFT      9  /* Adv ctxt desc mac len shift */
+#define IXGBE_ADVTXD_MACLEN_MASK       (0x7F << IXGBE_ADVTXD_MACLEN_SHIFT) /* 
Adv ctxt desc mac len mask */
 #define IXGBE_ADVTXD_VLAN_SHIFT                16  /* Adv ctxt vlan tag shift 
*/
 #define IXGBE_ADVTXD_TUCMD_IPV4                0x00000400 /* IP Packet Type: 
1=IPv4 */
 #define IXGBE_ADVTXD_TUCMD_IPV6                0x00000000 /* IP Packet Type: 
0=IPv6 */
diff --git a/drivers/net/ixgbe/base/ixgbe_type_e610.h 
b/drivers/net/ixgbe/base/ixgbe_type_e610.h
index 646256365d..9e72053e2a 100644
--- a/drivers/net/ixgbe/base/ixgbe_type_e610.h
+++ b/drivers/net/ixgbe/base/ixgbe_type_e610.h
@@ -604,6 +604,8 @@ IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_get_exp_err);
 
 /* FW update timeout definitions are in milliseconds */
 #define IXGBE_NVM_TIMEOUT              180000
+#define IXGBE_CHANGE_LOCK_TIMEOUT      1000
+#define IXGBE_GLOBAL_CFG_LOCK_TIMEOUT  3000
 
 enum ixgbe_aci_res_access_type {
        IXGBE_RES_READ = 1,
@@ -1491,6 +1493,211 @@ struct ixgbe_aci_cmd_clear_port_alt_write {
 
 IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_clear_port_alt_write);
 
+/* Get CGU abilities command response data structure (indirect 0x0C61) */
+struct ixgbe_aci_cmd_get_cgu_abilities {
+       u8 num_inputs;
+       u8 num_outputs;
+       u8 pps_dpll_idx;
+       u8 synce_dpll_idx;
+       __le32 max_in_freq;
+       __le32 max_in_phase_adj;
+       __le32 max_out_freq;
+       __le32 max_out_phase_adj;
+       u8 cgu_part_num;
+       u8 rsvd[3];
+};
+
+IXGBE_CHECK_STRUCT_LEN(24, ixgbe_aci_cmd_get_cgu_abilities);
+
+#define IXGBE_ACI_NODE_HANDLE_VALID    BIT(10)
+#define IXGBE_ACI_NODE_HANDLE          MAKEMASK(0x3FF, 0)
+#define IXGBE_ACI_DRIVING_CLK_NUM_SHIFT        10
+#define IXGBE_ACI_DRIVING_CLK_NUM      MAKEMASK(0x3F, 
IXGBE_ACI_DRIVING_CLK_NUM_SHIFT)
+
+/* Set CGU input config (direct 0x0C62) */
+struct ixgbe_aci_cmd_set_cgu_input_config {
+       u8 input_idx;
+       u8 flags1;
+#define IXGBE_ACI_SET_CGU_IN_CFG_FLG1_UPDATE_FREQ      BIT(6)
+#define IXGBE_ACI_SET_CGU_IN_CFG_FLG1_UPDATE_DELAY     BIT(7)
+       u8 flags2;
+#define IXGBE_ACI_SET_CGU_IN_CFG_FLG2_INPUT_EN         BIT(5)
+#define IXGBE_ACI_SET_CGU_IN_CFG_FLG2_ESYNC_EN         BIT(6)
+       u8 rsvd;
+       __le32 freq;
+       __le32 phase_delay;
+       u8 rsvd2[2];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_set_cgu_input_config);
+
+/* Get CGU input config response descriptor structure (direct 0x0C63) */
+struct ixgbe_aci_cmd_get_cgu_input_config {
+       u8 input_idx;
+       u8 status;
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_LOS            BIT(0)
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_SCM_FAIL       BIT(1)
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_CFM_FAIL       BIT(2)
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_GST_FAIL       BIT(3)
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_PFM_FAIL       BIT(4)
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_ESYNC_FAIL     BIT(6)
+#define IXGBE_ACI_GET_CGU_IN_CFG_STATUS_ESYNC_CAP      BIT(7)
+       u8 type;
+#define IXGBE_ACI_GET_CGU_IN_CFG_TYPE_READ_ONLY                BIT(0)
+#define IXGBE_ACI_GET_CGU_IN_CFG_TYPE_GPS              BIT(4)
+#define IXGBE_ACI_GET_CGU_IN_CFG_TYPE_EXTERNAL         BIT(5)
+#define IXGBE_ACI_GET_CGU_IN_CFG_TYPE_PHY              BIT(6)
+       u8 flags1;
+#define IXGBE_ACI_GET_CGU_IN_CFG_FLG1_PHASE_DELAY_SUPP BIT(0)
+#define IXGBE_ACI_GET_CGU_IN_CFG_FLG1_1PPS_SUPP                BIT(2)
+#define IXGBE_ACI_GET_CGU_IN_CFG_FLG1_10MHZ_SUPP       BIT(3)
+#define IXGBE_ACI_GET_CGU_IN_CFG_FLG1_ANYFREQ          BIT(7)
+       __le32 freq;
+       __le32 phase_delay;
+       u8 flags2;
+#define IXGBE_ACI_GET_CGU_IN_CFG_FLG2_INPUT_EN         BIT(5)
+#define IXGBE_ACI_GET_CGU_IN_CFG_FLG2_ESYNC_EN         BIT(6)
+       u8 rsvd[1];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_get_cgu_input_config);
+
+/* Set CGU output config (direct 0x0C64) */
+struct ixgbe_aci_cmd_set_cgu_output_config {
+       u8 output_idx;
+       u8 flags;
+#define IXGBE_ACI_SET_CGU_OUT_CFG_OUT_EN               BIT(0)
+#define IXGBE_ACI_SET_CGU_OUT_CFG_ESYNC_EN             BIT(1)
+#define IXGBE_ACI_SET_CGU_OUT_CFG_UPDATE_FREQ          BIT(2)
+#define IXGBE_ACI_SET_CGU_OUT_CFG_UPDATE_PHASE         BIT(3)
+#define IXGBE_ACI_SET_CGU_OUT_CFG_UPDATE_SRC_SEL       BIT(4)
+       u8 src_sel;
+#define IXGBE_ACI_SET_CGU_OUT_CFG_DPLL_SRC_SEL         MAKEMASK(0x1F, 0)
+       u8 rsvd;
+       __le32 freq;
+       __le32 phase_delay;
+       u8 rsvd2[2];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_set_cgu_output_config);
+
+/* Get CGU output config (direct 0x0C65) */
+struct ixgbe_aci_cmd_get_cgu_output_config {
+       u8 output_idx;
+       u8 flags;
+#define IXGBE_ACI_GET_CGU_OUT_CFG_OUT_EN               BIT(0)
+#define IXGBE_ACI_GET_CGU_OUT_CFG_ESYNC_EN             BIT(1)
+#define IXGBE_ACI_GET_CGU_OUT_CFG_ESYNC_ABILITY                BIT(2)
+       u8 src_sel;
+#define IXGBE_ACI_GET_CGU_OUT_CFG_DPLL_SRC_SEL_SHIFT   0
+#define IXGBE_ACI_GET_CGU_OUT_CFG_DPLL_SRC_SEL \
+       MAKEMASK(0x1F, IXGBE_ACI_GET_CGU_OUT_CFG_DPLL_SRC_SEL_SHIFT)
+#define IXGBE_ACI_GET_CGU_OUT_CFG_DPLL_MODE_SHIFT      5
+#define IXGBE_ACI_GET_CGU_OUT_CFG_DPLL_MODE \
+       MAKEMASK(0x7, IXGBE_ACI_GET_CGU_OUT_CFG_DPLL_MODE_SHIFT)
+       u8 rsvd;
+       __le32 freq;
+       __le32 src_freq;
+       u8 rsvd2[2];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_get_cgu_output_config);
+
+/* Get CGU DPLL status (direct 0x0C66) */
+struct ixgbe_aci_cmd_get_cgu_dpll_status {
+       u8 dpll_num;
+       u8 ref_state;
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_REF_SW_LOS               BIT(0)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_REF_SW_SCM               BIT(1)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_REF_SW_CFM               BIT(2)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_REF_SW_GST               BIT(3)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_REF_SW_PFM               BIT(4)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_FAST_LOCK_EN             BIT(5)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_REF_SW_ESYNC             BIT(6)
+       __le16 dpll_state;
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_LOCK               BIT(0)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_HO                 BIT(1)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_HO_READY           BIT(2)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_FLHIT              BIT(5)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_PSLHIT             BIT(7)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_CLK_REF_SHIFT      8
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_CLK_REF_SEL                \
+       MAKEMASK(0x1F, IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_CLK_REF_SHIFT)
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_MODE_SHIFT         13
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_MODE               \
+       MAKEMASK(0x7, IXGBE_ACI_GET_CGU_DPLL_STATUS_STATE_MODE_SHIFT)
+       __le32 phase_offset_h;
+       __le32 phase_offset_l;
+       u8 eec_mode;
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_EEC_MODE_1               0xA
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_EEC_MODE_2               0xB
+#define IXGBE_ACI_GET_CGU_DPLL_STATUS_EEC_MODE_UNKNOWN         0xF
+       u8 rsvd[1];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_get_cgu_dpll_status);
+
+/* Set CGU DPLL config (direct 0x0C67) */
+struct ixgbe_aci_cmd_set_cgu_dpll_config {
+       u8 dpll_num;
+       u8 ref_state;
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_SW_LOS       BIT(0)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_SW_SCM       BIT(1)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_SW_CFM       BIT(2)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_SW_GST       BIT(3)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_SW_PFM       BIT(4)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_FLOCK_EN     BIT(5)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_REF_SW_ESYNC     BIT(6)
+       u8 rsvd;
+       u8 config;
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_CLK_REF_SEL      MAKEMASK(0x1F, 0)
+#define IXGBE_ACI_SET_CGU_DPLL_CONFIG_MODE             MAKEMASK(0x7, 5)
+       u8 rsvd2[8];
+       u8 eec_mode;
+       u8 rsvd3[1];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_set_cgu_dpll_config);
+
+/* Set CGU reference priority (direct 0x0C68) */
+struct ixgbe_aci_cmd_set_cgu_ref_prio {
+       u8 dpll_num;
+       u8 ref_idx;
+       u8 ref_priority;
+       u8 rsvd[11];
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_set_cgu_ref_prio);
+
+/* Get CGU reference priority (direct 0x0C69) */
+struct ixgbe_aci_cmd_get_cgu_ref_prio {
+       u8 dpll_num;
+       u8 ref_idx;
+       u8 ref_priority; /* Valid only in response */
+       u8 rsvd[13];
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_get_cgu_ref_prio);
+
+/* Get CGU info (direct 0x0C6A) */
+struct ixgbe_aci_cmd_get_cgu_info {
+       __le32 cgu_id;
+       __le32 cgu_cfg_ver;
+       __le32 cgu_fw_ver;
+       u8 node_part_num;
+       u8 dev_rev;
+       __le16 node_handle;
+};
+
+IXGBE_CHECK_PARAM_LEN(ixgbe_aci_cmd_get_cgu_info);
+
 /* Debug Dump Internal Data (indirect 0xFF08) */
 struct ixgbe_aci_cmd_debug_dump_internals {
        __le16 cluster_id; /* Expresses next cluster ID in response */
-- 
2.43.0

Reply via email to