From patchwork Tue Jan 8 16:29:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 154997 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5072533jaa; Tue, 8 Jan 2019 08:32:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN7uUUYK25lUMxZzg7dIXAPUle5HlNUlVnO8nIZuCPLQMACT+WlLBMSYT03vxLcggPFv1xQT X-Received: by 2002:a17:902:6bc7:: with SMTP id m7mr2482166plt.106.1546965148762; Tue, 08 Jan 2019 08:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546965148; cv=none; d=google.com; s=arc-20160816; b=rqFBjUr2YHwelq430+3XtjakMRCq+fh1c665zbJvZBjSglLG2Mh/2clgEmjqJMnUY5 46AUvBta5CIApOVZMPy7a9weAemgyndAdCvAahDfOE4Jn4M4RQRNel85qtIoFGlW3oke cMdeubKq1pgxF2H7O6S3ihX2A5qQFQ33qgOkHA7MDWL8m9TbqC2RuV8RLKmPTInLPMW7 t42DJzK8JolC3SgcWwkquGaq2DBm6cm32ontzC6dhzPu0RVVJq7QIsFecvAEifxgeYuR vpuG1DtKlWZ8vEmihLFDj30EVVNgH5PjDztn2CKBldRGP/0lqZDthHZcmcGE0+YYWFnS 1VNQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=LNZDavaBXGUQlw1gkMEoy4YxiocS3rMfzV3qYIDmOq4=; b=uybiRk8WkS9LApbBAKMWwES/Luy2ylcwXpah8td6hUtFZEiAZfXrPdUEtTKvQSVel1 qfT9BHa8Emk6wvroCURjFVFqqupGsFpbyZj9vu/1aOjnhk+oGF+yWTSoOQtZV0URnLyd O1v8EowNVR2xQGnJ8gnK0iVzGIjCTT5hJnBuuCAeFTNISKWIndTXnMTrZjmMItb60R6d 0wnQzh0jdSen2pwOnJms4zPVW9NhnUIINhVj0rYh5MtLZ4h9LIfprnk69dnEuqB5MMVK 7eTDuwhvryg7WTN1thPAuPmmgXawjOtR3JUeO0BtsNCL9mdGG93BR8paMWOXR4S58Mxq pMGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zq3n12/8"; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 d13si11388024pgu.40.2019.01.08.08.32.28; Tue, 08 Jan 2019 08:32:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of netdev-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="zq3n12/8"; spf=pass (google.com: best guess record for domain of netdev-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=netdev-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 S1729688AbfAHQc1 (ORCPT + 10 others); Tue, 8 Jan 2019 11:32:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:39986 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729683AbfAHQc0 (ORCPT ); Tue, 8 Jan 2019 11:32:26 -0500 Received: from localhost.localdomain (unknown [171.76.109.220]) (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 820952070B; Tue, 8 Jan 2019 16:32:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1546965145; bh=UBzv+pVZVAcd+YnO9biBE/inf5ufB9ku/as0pscDaV8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zq3n12/844Vo7OTizbRW8A+FyYiC1w4uvRtiQduXmi2/0LuQ+g42RizGpq73CV6N8 T6imvxlZ6320yNLW+k/DR17oIxagXM2y6udbHFEFurme6IRwdwnMAFYns/EYsHydQE KL1oQxkXBn7m1tsethWN8kMdEhi9HeO30BEfXieA= From: Vinod Koul To: David S Miller Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, Niklas Cassel , Bjorn Andersson , Vinod Koul , Andrew Lunn , Florian Fainelli Subject: [PATCH v2 4/5] net: phy: at803x: Disable phy delay for RGMII mode Date: Tue, 8 Jan 2019 21:59:25 +0530 Message-Id: <20190108162926.17806-5-vkoul@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190108162926.17806-1-vkoul@kernel.org> References: <20190108162926.17806-1-vkoul@kernel.org> MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org For RGMII mode, phy delay should be disabled. Add this case along with disable delay routines. Signed-off-by: Vinod Koul --- drivers/net/phy/at803x.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) -- 2.20.1 diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index f9432d053a22..e7cf1d5b0514 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c @@ -122,6 +122,18 @@ static inline int at803x_enable_tx_delay(struct phy_device *phydev) AT803X_DEBUG_TX_CLK_DLY_EN); } +static inline int at803x_disable_rx_delay(struct phy_device *phydev) +{ + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, + AT803X_DEBUG_RX_CLK_DLY_EN, 0); +} + +static inline int at803x_disable_tx_delay(struct phy_device *phydev) +{ + return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, + AT803X_DEBUG_TX_CLK_DLY_EN, 0); +} + /* save relevant PHY registers to private copy */ static void at803x_context_save(struct phy_device *phydev, struct at803x_context *context) @@ -269,6 +281,15 @@ static int at803x_config_init(struct phy_device *phydev) return ret; } + if (phydev->interface == PHY_INTERFACE_MODE_RGMII) { + ret = at803x_disable_rx_delay(phydev); + if (ret < 0) + return ret; + ret = at803x_disable_tx_delay(phydev); + if (ret < 0) + return ret; + } + return 0; }