net/ixgbe/base: make a debug message simple
[dpdk.git] / drivers / net / ixgbe / base / ixgbe_x550.c
index 2f7f446..cf72bba 100644 (file)
@@ -1311,13 +1311,20 @@ s32 ixgbe_get_phy_token(struct ixgbe_hw *hw)
                                              sizeof(token_cmd),
                                              IXGBE_HI_COMMAND_TIMEOUT,
                                              true);
-       if (status)
+       if (status) {
+               DEBUGOUT1("Issuing host interface command failed with Status = %d\n",
+                         status);
                return status;
+       }
        if (token_cmd.hdr.cmd_or_resp.ret_status == FW_PHY_TOKEN_OK)
                return IXGBE_SUCCESS;
-       if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY)
+       if (token_cmd.hdr.cmd_or_resp.ret_status != FW_PHY_TOKEN_RETRY) {
+               DEBUGOUT1("Host interface command returned 0x%08x , returning IXGBE_ERR_FW_RESP_INVALID\n",
+                         token_cmd.hdr.cmd_or_resp.ret_status);
                return IXGBE_ERR_FW_RESP_INVALID;
+       }
 
+       DEBUGOUT("Returning  IXGBE_ERR_TOKEN_RETRY\n");
        return IXGBE_ERR_TOKEN_RETRY;
 }
 
@@ -1975,6 +1982,7 @@ s32 ixgbe_get_link_capabilities_X550em(struct ixgbe_hw *hw,
                        *speed = IXGBE_LINK_SPEED_10GB_FULL;
        } else {
                switch (hw->phy.type) {
+               case ixgbe_phy_ext_1g_t:
                case ixgbe_phy_sgmii:
                        *speed = IXGBE_LINK_SPEED_1GB_FULL;
                        break;
@@ -2372,6 +2380,10 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
                /* set up for CS4227 usage */
                hw->phy.phy_semaphore_mask = IXGBE_GSSR_SHARED_I2C_SM;
                break;
+       case IXGBE_DEV_ID_X550EM_X_1G_T:
+               phy->ops.read_reg_mdi = ixgbe_read_phy_reg_mdi_22;
+               phy->ops.write_reg_mdi = ixgbe_write_phy_reg_mdi_22;
+               break;
        default:
                break;
        }
@@ -2399,6 +2411,10 @@ s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
                phy->ops.read_reg = ixgbe_read_phy_reg_x550em;
                phy->ops.write_reg = ixgbe_write_phy_reg_x550em;
                break;
+       case ixgbe_phy_ext_1g_t:
+               /* link is managed by FW */
+               phy->ops.setup_link = NULL;
+               break;
        case ixgbe_phy_x550em_xfi:
                /* link is managed by HW */
                phy->ops.setup_link = NULL;
@@ -2486,9 +2502,10 @@ s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
 
        /* Call adapter stop to disable Tx/Rx and clear interrupts */
        status = hw->mac.ops.stop_adapter(hw);
-       if (status != IXGBE_SUCCESS)
+       if (status != IXGBE_SUCCESS) {
+               DEBUGOUT1("Failed to stop adapter, STATUS = %d\n", status);
                return status;
-
+       }
        /* flush pending Tx transactions */
        ixgbe_clear_tx_pending(hw);
 
@@ -2497,14 +2514,23 @@ s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
        /* PHY ops must be identified and initialized prior to reset */
        status = hw->phy.ops.init(hw);
 
-       if (status == IXGBE_ERR_SFP_NOT_SUPPORTED)
+       if (status)
+               DEBUGOUT1("Failed to initialize PHY ops, STATUS = %d\n",
+                         status);
+
+       if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) {
+               DEBUGOUT("Returning from reset HW due to PHY init failure\n");
                return status;
+       }
 
        /* start the external PHY */
        if (hw->phy.type == ixgbe_phy_x550em_ext_t) {
                status = ixgbe_init_ext_t_x550em(hw);
-               if (status)
+               if (status) {
+                       DEBUGOUT1("Failed to start the external PHY, STATUS = %d\n",
+                                 status);
                        return status;
+               }
        }
 
        /* Setup SFP module if there is one present. */
@@ -2578,6 +2604,9 @@ mac_reset_top:
        if (hw->device_id == IXGBE_DEV_ID_X550EM_X_SFP)
                ixgbe_setup_mux_ctl(hw);
 
+       if (status != IXGBE_SUCCESS)
+               DEBUGOUT1("Reset HW failed, STATUS = %d\n", status);
+
        return status;
 }
 
@@ -2627,12 +2656,11 @@ s32 ixgbe_init_ext_t_x550em(struct ixgbe_hw *hw)
 /**
  *  ixgbe_setup_kr_x550em - Configure the KR PHY.
  *  @hw: pointer to hardware structure
- *
- *  Configures the integrated KR PHY for X550EM_x.
  **/
 s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw)
 {
-       if (hw->mac.type != ixgbe_mac_X550EM_x)
+       /* leave link alone for 2.5G */
+       if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL)
                return IXGBE_SUCCESS;
 
        return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised);
@@ -3707,6 +3735,9 @@ u32 ixgbe_get_supported_physical_layer_X550em(struct ixgbe_hw *hw)
        case ixgbe_phy_sgmii:
                physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
                break;
+       case ixgbe_phy_ext_1g_t:
+               physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
+               break;
        default:
                break;
        }
@@ -4325,21 +4356,34 @@ STATIC s32 ixgbe_acquire_swfw_sync_X550a(struct ixgbe_hw *hw, u32 mask)
                status = IXGBE_SUCCESS;
                if (hmask)
                        status = ixgbe_acquire_swfw_sync_X540(hw, hmask);
-               if (status)
+               if (status) {
+                       DEBUGOUT1("Could not acquire SWFW semaphore, Status = %d\n",
+                                 status);
                        return status;
+               }
                if (!(mask & IXGBE_GSSR_TOKEN_SM))
                        return IXGBE_SUCCESS;
 
                status = ixgbe_get_phy_token(hw);
+               if (status == IXGBE_ERR_TOKEN_RETRY)
+                       DEBUGOUT1("Could not acquire PHY token, Status = %d\n",
+                                 status);
+
                if (status == IXGBE_SUCCESS)
                        return IXGBE_SUCCESS;
 
                if (hmask)
                        ixgbe_release_swfw_sync_X540(hw, hmask);
-               if (status != IXGBE_ERR_TOKEN_RETRY)
+
+               if (status != IXGBE_ERR_TOKEN_RETRY) {
+                       DEBUGOUT1("Unable to retry acquiring the PHY token, Status = %d\n",
+                                 status);
                        return status;
+               }
        }
 
+       DEBUGOUT1("Semaphore acquisition retries failed!: PHY ID = 0x%08X\n",
+                 hw->phy.id);
        return status;
 }