net/ice/base: do not wait for PE unit to load
[dpdk.git] / drivers / net / ice / base / ice_common.c
index 11e902e..319b00f 100644 (file)
@@ -11,7 +11,6 @@
 
 #define ICE_PF_RESET_WAIT_COUNT        200
 
-
 /**
  * ice_set_mac_type - Sets MAC type
  * @hw: pointer to the HW structure
@@ -41,7 +40,6 @@ static enum ice_status ice_set_mac_type(struct ice_hw *hw)
        return status;
 }
 
-
 /**
  * ice_clear_pf_cfg - Clear PF configuration
  * @hw: pointer to the hardware structure
@@ -113,7 +111,6 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size,
                                   ETH_ALEN, ICE_DMA_TO_NONDMA);
                        break;
                }
-
        return ICE_SUCCESS;
 }
 
@@ -179,9 +176,6 @@ ice_aq_get_link_topo_handle(struct ice_port_info *pi, u8 node_type,
 
        cmd = &desc.params.get_link_topo;
 
-       if (!cmd)
-               return ICE_ERR_PARAM;
-
        ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_get_link_topo);
 
        cmd->addr.node_type_ctx = (ICE_AQC_LINK_TOPO_NODE_CTX_PORT <<
@@ -533,7 +527,6 @@ static void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw)
        ice_free(hw, sw);
 }
 
-
 /**
  * ice_get_itr_intrl_gran
  * @hw: pointer to the HW struct
@@ -598,7 +591,6 @@ void ice_print_rollback_msg(struct ice_hw *hw)
                            &ver_lo);
        SNPRINTF(nvm_str, sizeof(nvm_str), "%x.%02x 0x%x %d.%d.%d", ver_hi,
                 ver_lo, hw->nvm.eetrack, oem_ver, oem_build, oem_patch);
-
        ice_warn(hw,
                 "Firmware rollback mode detected. Current version is NVM: %s, FW: %d.%d. Device may exhibit limited functionality. Refer to the Intel(R) Ethernet Adapters and Devices User Guide for details on firmware rollback mode",
                 nvm_str, hw->fw_maj_ver, hw->fw_min_ver);
@@ -617,7 +609,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
 
        ice_debug(hw, ICE_DBG_TRACE, "%s\n", __func__);
 
-
        /* Set MAC type based on DeviceID */
        status = ice_set_mac_type(hw);
        if (status)
@@ -627,14 +618,12 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
                         PF_FUNC_RID_FUNCTION_NUMBER_M) >>
                PF_FUNC_RID_FUNCTION_NUMBER_S;
 
-
        status = ice_reset(hw, ICE_RESET_PFR);
        if (status)
                return status;
 
        ice_get_itr_intrl_gran(hw);
 
-
        status = ice_create_all_ctrlq(hw);
        if (status)
                goto err_unroll_cqinit;
@@ -656,7 +645,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
 
        ice_clear_pxe_mode(hw);
 
-
        status = ice_get_caps(hw);
        if (status)
                goto err_unroll_cqinit;
@@ -677,7 +665,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
                goto err_unroll_alloc;
 
        hw->evb_veb = true;
-
        /* Query the allocated resources for Tx scheduler */
        status = ice_sched_query_res_alloc(hw);
        if (status) {
@@ -686,7 +673,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
                goto err_unroll_alloc;
        }
 
-
        /* Initialize port_info struct with scheduler data */
        status = ice_sched_init_port(hw->port_info);
        if (status)
@@ -725,7 +711,6 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
        if (status)
                goto err_unroll_sched;
 
-
        /* Get MAC information */
        /* A single port can report up to two (LAN and WoL) addresses */
        mac_buf = ice_calloc(hw, 2,
@@ -798,7 +783,7 @@ void ice_deinit_hw(struct ice_hw *hw)
  */
 enum ice_status ice_check_reset(struct ice_hw *hw)
 {
-       u32 cnt, reg = 0, grst_delay;
+       u32 cnt, reg = 0, grst_delay, uld_mask;
 
        /* Poll for Device Active state in case a recent CORER, GLOBR,
         * or EMPR has occurred. The grst delay value is in 100ms units.
@@ -820,13 +805,20 @@ enum ice_status ice_check_reset(struct ice_hw *hw)
                return ICE_ERR_RESET_FAILED;
        }
 
-#define ICE_RESET_DONE_MASK    (GLNVM_ULD_CORER_DONE_M | \
-                                GLNVM_ULD_GLOBR_DONE_M)
+#define ICE_RESET_DONE_MASK    (GLNVM_ULD_PCIER_DONE_M |\
+                                GLNVM_ULD_PCIER_DONE_1_M |\
+                                GLNVM_ULD_CORER_DONE_M |\
+                                GLNVM_ULD_GLOBR_DONE_M |\
+                                GLNVM_ULD_POR_DONE_M |\
+                                GLNVM_ULD_POR_DONE_1_M |\
+                                GLNVM_ULD_PCIER_DONE_2_M)
+
+       uld_mask = ICE_RESET_DONE_MASK;
 
        /* Device is Active; check Global Reset processes are done */
        for (cnt = 0; cnt < ICE_PF_RESET_WAIT_COUNT; cnt++) {
-               reg = rd32(hw, GLNVM_ULD) & ICE_RESET_DONE_MASK;
-               if (reg == ICE_RESET_DONE_MASK) {
+               reg = rd32(hw, GLNVM_ULD) & uld_mask;
+               if (reg == uld_mask) {
                        ice_debug(hw, ICE_DBG_INIT,
                                  "Global reset processes done. %d\n", cnt);
                        break;
@@ -926,7 +918,6 @@ enum ice_status ice_reset(struct ice_hw *hw, enum ice_reset_req req)
        wr32(hw, GLGEN_RTRIG, val);
        ice_flush(hw);
 
-
        /* wait for the FW to be ready */
        return ice_check_reset(hw);
 }
@@ -997,8 +988,6 @@ ice_get_pfa_module_tlv(struct ice_hw *hw, u16 *module_tlv, u16 *module_tlv_len,
        return ICE_ERR_DOES_NOT_EXIST;
 }
 
-
-
 /**
  * ice_copy_rxq_ctx_to_hw
  * @hw: pointer to the hardware structure
@@ -1081,7 +1070,6 @@ ice_write_rxq_ctx(struct ice_hw *hw, struct ice_rlan_ctx *rlan_ctx,
        return ice_copy_rxq_ctx_to_hw(hw, ctx_buf, rxq_index);
 }
 
-#if !defined(NO_UNUSED_CTX_CODE) || defined(AE_DRIVER)
 /**
  * ice_clear_rxq_ctx
  * @hw: pointer to the hardware structure
@@ -1102,7 +1090,6 @@ enum ice_status ice_clear_rxq_ctx(struct ice_hw *hw, u32 rxq_index)
 
        return ICE_SUCCESS;
 }
-#endif /* !NO_UNUSED_CTX_CODE || AE_DRIVER */
 
 /* LAN Tx Queue Context */
 const struct ice_ctx_ele ice_tlan_ctx_info[] = {
@@ -1138,7 +1125,6 @@ const struct ice_ctx_ele ice_tlan_ctx_info[] = {
        { 0 }
 };
 
-#if !defined(NO_UNUSED_CTX_CODE) || defined(AE_DRIVER)
 /**
  * ice_copy_tx_cmpltnq_ctx_to_hw
  * @hw: pointer to the hardware structure
@@ -1319,8 +1305,6 @@ ice_clear_tx_drbell_q_ctx(struct ice_hw *hw, u32 tx_drbell_q_index)
 
        return ICE_SUCCESS;
 }
-#endif /* !NO_UNUSED_CTX_CODE || AE_DRIVER */
-
 
 /* FW Admin Queue command wrappers */
 
@@ -2142,7 +2126,6 @@ ice_aq_manage_mac_write(struct ice_hw *hw, const u8 *mac_addr, u8 flags,
 
        cmd->flags = flags;
 
-
        /* Prep values for flags, sah, sal */
        cmd->sah = HTONS(*((const u16 *)mac_addr));
        cmd->sal = HTONL(*((const u32 *)(mac_addr + 2)));
@@ -2179,7 +2162,6 @@ void ice_clear_pxe_mode(struct ice_hw *hw)
                ice_aq_clear_pxe_mode(hw);
 }
 
-
 /**
  * ice_get_link_speed_based_on_phy_type - returns link speed
  * @phy_type_low: lower part of phy_type
@@ -2848,7 +2830,6 @@ ice_aq_set_mac_loopback(struct ice_hw *hw, bool ena_lpbk, struct ice_sq_cd *cd)
        return ice_aq_send_cmd(hw, &desc, NULL, 0, cd);
 }
 
-
 /**
  * ice_aq_set_port_id_led
  * @pi: pointer to the port information
@@ -2869,7 +2850,6 @@ ice_aq_set_port_id_led(struct ice_port_info *pi, bool is_orig_mode,
 
        ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_set_port_id_led);
 
-
        if (is_orig_mode)
                cmd->ident_mode = ICE_AQC_PORT_IDENT_LED_ORIG;
        else
@@ -3357,7 +3337,6 @@ ice_aq_move_recfg_lan_txq(struct ice_hw *hw, u8 num_qs, bool is_move,
        return status;
 }
 
-
 /* End of FW Admin Queue command wrappers */
 
 /**
@@ -3581,9 +3560,6 @@ ice_set_ctx(u8 *src_ctx, u8 *dest_ctx, const struct ice_ctx_ele *ce_info)
        return ICE_SUCCESS;
 }
 
-
-
-
 /**
  * ice_read_byte - read context byte into struct
  * @src_ctx:  the context structure to read from
@@ -4047,8 +4023,6 @@ ice_cfg_vsi_lan(struct ice_port_info *pi, u16 vsi_handle, u8 tc_bitmap,
                              ICE_SCHED_NODE_OWNER_LAN);
 }
 
-
-
 /**
  * ice_replay_pre_init - replay pre initialization
  * @hw: pointer to the HW struct
@@ -4246,7 +4220,6 @@ ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool prev_stat_loaded,
        cur_stats->rx_errors += error_cnt;
 }
 
-
 /**
  * ice_sched_query_elem - query element information from HW
  * @hw: pointer to the HW struct