Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp5997845ybc; Wed, 27 Nov 2019 13:08:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwmLokO31Poul/+cJp/ABmroaPDu3PM+O8pF9K4KQlxtJbgPyxfru/zrX1tYVoVvBjoaZNJ X-Received: by 2002:a05:6402:886:: with SMTP id e6mr14755526edy.46.1574888903642; Wed, 27 Nov 2019 13:08:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574888903; cv=none; d=google.com; s=arc-20160816; b=Lhef/PP2TrHu0NTErOdoEKEZb8ABgWPO7Vb6/8q71RA21tpGNLzhfRiBHD97XBhXBB n8gLbDSITAA1bq9dhHd6LEcb9+n2fjLxmlf1RIWEh4H6IC2JZN6n2gdPy8kZImfwA+40 pqDt5A5TDwRCpSuvLJv/y3dyCxA807iyl5bsOT5AwZSeNEn1VciwHg5iDWD4LGea+kX2 89VtVc/kj1RNFFgZ5f52iCupCMdXAL4lXg4CCWgO4QZLMaB4S9V6r7gzK5ICUsDn2g72 egsFhwwAQmBj8NYie9rXAPwqvTRs/uo8CABvQArdWmJveXBRLHgaK+rGX2x2vYWuMu0q XCFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qla2o4jwq6iDf5np43NojiRlcW2jNhP6qfL+5dPMXMs=; b=WHVmvuk5lVzBbcZxGfBvtW5fOp6Tmiyo0PQthyxZj4uZ3PGCaqKeWPW6v6zfEjQN++ ehq3fkI4l+bPxuvXJSK3FuyrfZVo39PNz15wtJo5iHAFWzxQGe4cnDm2HavpG04kU4yj 2u/hRb0A654esPzXC4QtWs8j2ASiKObItW/ekUNfj+SWFjE3gymZxFu9MeK0UcsQ8oVU Aao5RUF9o4Ks5zfdtmCzBNIQDOJx44sX0cXiLcqx7FWG1Qyk9ZO3zlQmwCD3Fh7vzrNp lvjD7f4b0ODIxq6274jqecqdhpzeiTq3CCBKVmVk+tCNx54+/X0/wf7sxYq8ISkNDTCC MB+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZHeyFRKO; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c26si11917636edc.416.2019.11.27.13.07.59; Wed, 27 Nov 2019 13:08:23 -0800 (PST) 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=ZHeyFRKO; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732384AbfK0VGN (ORCPT + 99 others); Wed, 27 Nov 2019 16:06:13 -0500 Received: from mail.kernel.org ([198.145.29.99]:60170 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbfK0VGK (ORCPT ); Wed, 27 Nov 2019 16:06:10 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2F58621770; Wed, 27 Nov 2019 21:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1574888769; bh=UdTQy0sebNhzvQQBQPvL4tB24mTeh/mRDWo6wJ5MdCI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZHeyFRKOVc545hTi6kBE4HS/XHa3yS++XSU8PxHin683BQvI2PrGj3x4lpRc6rNcY MjMRdx7Ud5XAqTtT2IMoxoQfNt3MNkIg+8dW6Tb9ylySa4xk9LC0Dh0EK++JHd7LRG c0LeBMzOlsrKVSiOS5VmUhv9laAyj9qw5bQKIZsw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Uvarov , Heiner Kallweit , Florian Fainelli , "David S. Miller" , Adrian Bunk Subject: [PATCH 4.19 262/306] net: phy: dp83867: fix speed 10 in sgmii mode Date: Wed, 27 Nov 2019 21:31:52 +0100 Message-Id: <20191127203133.982768147@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191127203114.766709977@linuxfoundation.org> References: <20191127203114.766709977@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Uvarov commit 333061b924539c0de081339643f45514f5f1c1e6 upstream. For supporting 10Mps speed in SGMII mode DP83867_10M_SGMII_RATE_ADAPT bit of DP83867_10M_SGMII_CFG register has to be cleared by software. That does not affect speeds 100 and 1000 so can be done on init. Signed-off-by: Max Uvarov Cc: Heiner Kallweit Reviewed-by: Florian Fainelli Signed-off-by: David S. Miller [ adapted for kernels without phy_modify_mmd ] Signed-off-by: Adrian Bunk Signed-off-by: Greg Kroah-Hartman --- drivers/net/phy/dp83867.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -37,6 +37,8 @@ #define DP83867_STRAP_STS1 0x006E #define DP83867_RGMIIDCTL 0x0086 #define DP83867_IO_MUX_CFG 0x0170 +#define DP83867_10M_SGMII_CFG 0x016F +#define DP83867_10M_SGMII_RATE_ADAPT_MASK BIT(7) #define DP83867_SW_RESET BIT(15) #define DP83867_SW_RESTART BIT(14) @@ -294,6 +296,23 @@ static int dp83867_config_init(struct ph } } + if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { + /* For support SPEED_10 in SGMII mode + * DP83867_10M_SGMII_RATE_ADAPT bit + * has to be cleared by software. That + * does not affect SPEED_100 and + * SPEED_1000. + */ + val = phy_read_mmd(phydev, DP83867_DEVADDR, + DP83867_10M_SGMII_CFG); + val &= ~DP83867_10M_SGMII_RATE_ADAPT_MASK; + ret = phy_write_mmd(phydev, DP83867_DEVADDR, + DP83867_10M_SGMII_CFG, val); + + if (ret) + return ret; + } + /* Enable Interrupt output INT_OE in CFG3 register */ if (phy_interrupt_is_valid(phydev)) { val = phy_read(phydev, DP83867_CFG3);