net/ice/base: add package segment ID
authorQi Zhang <qi.z.zhang@intel.com>
Thu, 16 Sep 2021 09:52:59 +0000 (17:52 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Tue, 21 Sep 2021 12:33:34 +0000 (14:33 +0200)
DDP package format is shared with different devices, for E810 device
we only support SEGMENT_TYPE_ICE_810.

Signed-off-by: Dan Nowlin <dan.nowlin@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
drivers/net/ice/base/ice_flex_pipe.c
drivers/net/ice/base/ice_flex_type.h
drivers/net/ice/base/ice_type.h

index 8a6fc8a..3631ddb 100644 (file)
@@ -1263,8 +1263,13 @@ ice_init_pkg_info(struct ice_hw *hw, struct ice_pkg_hdr *pkg_hdr)
        if (!pkg_hdr)
                return ICE_ERR_PARAM;
 
+       hw->pkg_seg_id = SEGMENT_TYPE_ICE_E810;
+
+       ice_debug(hw, ICE_DBG_INIT, "Pkg using segment id: 0x%08X\n",
+                 hw->pkg_seg_id);
+
        seg_hdr = (struct ice_generic_seg_hdr *)
-               ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE, pkg_hdr);
+               ice_find_seg_in_pkg(hw, hw->pkg_seg_id, pkg_hdr);
        if (seg_hdr) {
                struct ice_meta_sect *meta;
                struct ice_pkg_enum state;
@@ -1496,7 +1501,7 @@ ice_chk_pkg_compat(struct ice_hw *hw, struct ice_pkg_hdr *ospkg,
        }
 
        /* find ICE segment in given package */
-       *seg = (struct ice_seg *)ice_find_seg_in_pkg(hw, SEGMENT_TYPE_ICE,
+       *seg = (struct ice_seg *)ice_find_seg_in_pkg(hw, hw->pkg_seg_id,
                                                     ospkg);
        if (!*seg) {
                ice_debug(hw, ICE_DBG_INIT, "no ice segment in package.\n");
index 247b85a..3f2038c 100644 (file)
@@ -33,7 +33,7 @@ struct ice_pkg_hdr {
 /* generic segment */
 struct ice_generic_seg_hdr {
 #define SEGMENT_TYPE_METADATA  0x00000001
-#define SEGMENT_TYPE_ICE       0x00000010
+#define SEGMENT_TYPE_ICE_E810  0x00000010
        __le32 seg_type;
        struct ice_pkg_ver seg_format_ver;
        __le32 seg_size;
index b1e03b1..b2b3291 100644 (file)
@@ -1208,6 +1208,7 @@ struct ice_hw {
 
        /* Active package version (currently active) */
        struct ice_pkg_ver active_pkg_ver;
+       u32 pkg_seg_id;
        u32 active_track_id;
        u8 active_pkg_name[ICE_PKG_NAME_SIZE];
        u8 active_pkg_in_nvm;