Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1970147ima; Thu, 25 Oct 2018 07:44:41 -0700 (PDT) X-Google-Smtp-Source: AJdET5dznbDshxGQU8Wf9egDQNybvesk1J7vzq97v0/ul0rjbLo38NyEf1SGBOi8X0PGeq8zJ6at X-Received: by 2002:a63:7a5b:: with SMTP id j27mr1774501pgn.112.1540478681509; Thu, 25 Oct 2018 07:44:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540478681; cv=none; d=google.com; s=arc-20160816; b=Uexu5Av2+zbD9VHlZcwxEhD7uQ22VLJfEPENddMaRqVE47DFMeKp9wXDuEPGGE0bKf 0rSvGuLJhqo7VYdRc36HHyYUG4OIGFzVsXo3cFIKCPRoNLfg1jtlXUKC/bHZL4okzp1B K6YXJJmyMO9gYbA4ePMVT1VlxsCQx7isHoG+vURiJEuXv1WrSbb7kr6+orOcXEKfzB5X UmREK2TOw4ZYhNdDFZqZlq8d5GbfhyWTr85ww72FjZMJnySUp26Z6H5fY1hyvu8JSaGL vwKTKuc9OI9jH2L6l9fJzRL653yjunGIwvphisfPBg6J5dMNVqcAfG6c84rfGju2Q384 aDSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=1PIpk8bMCXzmNiSXNpTvmNS6LEo/KMrjQauWJ95szNc=; b=aK9r5KO+lC+b/94z5K6r/awdkkjGoMFiCYPHuNvZmlbzB4lmdJDldavofmbNoSF/Fr GESDGvsCitFQPRvVIFeqk2faYK0zVMR1T7L7FpQK5nF+GchwmhDDkyyvwKwk3uducd9F 8In9+ZF8mWd0ODybP2RPtEHZq/+ObNmP76MdjEe9f9zUxNhCrVWEsmCS+od5pAzQOqGE P3bm9QmZB0jBy8eGdi/uagm+YgJhi4mOSOLOq9aCchGuNfmb2Mo/9exIH7MqdCQ8zZbs GOseQy657DGV3oDfbKA5RGcGGztOaL4AI+Qb04ZdgDALD9ZBvA0Kz+aRt8NGxvpeq0hL 4TJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IsCa88nD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 65-v6si5724474pfl.220.2018.10.25.07.44.23; Thu, 25 Oct 2018 07:44:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IsCa88nD; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728878AbeJYWsM (ORCPT + 99 others); Thu, 25 Oct 2018 18:48:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:56700 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728864AbeJYWsL (ORCPT ); Thu, 25 Oct 2018 18:48:11 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4340920854; Thu, 25 Oct 2018 14:15:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476915; bh=1VhKplTVMsDTZv/pRu1nJzjBJTvFkRc7ec/9cGqTmv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IsCa88nD9iCITSsGuI8OBZa+1q63yoFCYov0r/PHu46vDP3eICJEkNNKN7qtmvU3k IjFironEiDCwZ14ojcQK7si014N/gOKsRpRz6sCZKa1/rBPGzG2JNNvCbEEPK84SfP 3E82AZy2GdbBDeIWf0/HurNnQiHuNzt6LX3Eb+hA= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Thor Thayer , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.9 34/98] net: ethernet: stmmac: Fix altr_tse_pcs SGMII Initialization Date: Thu, 25 Oct 2018 10:13:19 -0400 Message-Id: <20181025141423.213774-34-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141423.213774-1-sashal@kernel.org> References: <20181025141423.213774-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thor Thayer [ Upstream commit 77032732d0e89b83c3bca75b857a1f63e9efb44b ] Fix NETDEV WATCHDOG timeout on startup by adding missing register writes that properly setup SGMII. Signed-off-by: Thor Thayer Acked-by: Giuseppe Cavallaro Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c index 489ef146201e..6a9c954492f2 100644 --- a/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c +++ b/drivers/net/ethernet/stmicro/stmmac/altr_tse_pcs.c @@ -37,6 +37,7 @@ #define TSE_PCS_CONTROL_AN_EN_MASK BIT(12) #define TSE_PCS_CONTROL_REG 0x00 #define TSE_PCS_CONTROL_RESTART_AN_MASK BIT(9) +#define TSE_PCS_CTRL_AUTONEG_SGMII 0x1140 #define TSE_PCS_IF_MODE_REG 0x28 #define TSE_PCS_LINK_TIMER_0_REG 0x24 #define TSE_PCS_LINK_TIMER_1_REG 0x26 @@ -65,6 +66,7 @@ #define TSE_PCS_SW_RESET_TIMEOUT 100 #define TSE_PCS_USE_SGMII_AN_MASK BIT(1) #define TSE_PCS_USE_SGMII_ENA BIT(0) +#define TSE_PCS_IF_USE_SGMII 0x03 #define SGMII_ADAPTER_CTRL_REG 0x00 #define SGMII_ADAPTER_DISABLE 0x0001 @@ -101,7 +103,9 @@ int tse_pcs_init(void __iomem *base, struct tse_pcs *pcs) { int ret = 0; - writew(TSE_PCS_USE_SGMII_ENA, base + TSE_PCS_IF_MODE_REG); + writew(TSE_PCS_IF_USE_SGMII, base + TSE_PCS_IF_MODE_REG); + + writew(TSE_PCS_CTRL_AUTONEG_SGMII, base + TSE_PCS_CONTROL_REG); writew(TSE_PCS_SGMII_LINK_TIMER_0, base + TSE_PCS_LINK_TIMER_0_REG); writew(TSE_PCS_SGMII_LINK_TIMER_1, base + TSE_PCS_LINK_TIMER_1_REG); -- 2.17.1