Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp460140ybl; Tue, 28 Jan 2020 06:19:13 -0800 (PST) X-Google-Smtp-Source: APXvYqxJrz3vNDvVVQm6Aj/WwebDLatHZTk+6fauoIJccsNNrrLU+yOKGlQIWCzuY2DFWiafWncT X-Received: by 2002:a05:6808:251:: with SMTP id m17mr2973617oie.15.1580221153531; Tue, 28 Jan 2020 06:19:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580221153; cv=none; d=google.com; s=arc-20160816; b=p6+ArzQyBS7pwo05mvCV/4EtV9+xXWRiYffJpIcN2DW4AcTsjoBsgng/gE/UMmmE6j jAJuL/iyJJ8qw4dzl0QpKcl+IE/sfzh0kjhHmery3WTOHmn2v80gHVI2EH6u6sMgiNU9 w2z0eDLocMJCxdxrhFbdb7Q3i6f6wEtS5DoR/0xil4RR8asNo//GPws67tY+vrL6Uggw vkYASwItL54hkDV1ESsaVJ4fuGbkE90p+DjJB5w/h2StVbcwJO/SoQktfTNuPHvzHKYP C/9hT0E+Knsx+4g5yR0TjjftjjaIYW3bsg6x5Q1BU12FPKaD+wWNs6SRfxH3zkm4IayB pYwQ== 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=W2RANeCrsccx18mq+Oi4ErNgshiRmVdFEI+0E0Xpw2o=; b=y9Xsu5LzZnNOvurv7RXEqEqnVMZPpdKx3jKgkJAhQIcT8jt7TBgO5oActkTzCYDh/b 1Oi+T+3Oc+e+PimtDNbSsDFAw2L+2bX9o17c0hX1aXw1IDfFJeNTaq/bxLWgKVZYnWUj E8iNcUvNVULz1xBuPug+hPrsPXrmNXQVqLfyeoQ9/zL1BUPQBsuzbbMnN3CtxT/8Sn2M 0zDWwDFZysQXTWnGCN6vZ62UHNg8QY75SC/20oeCwgQG3n8cQpAFLh+Lf+6p9aPT+X7P r2oYZKPryY1f14KtnHX61xWtdEhWdDWvB9sIPFANhKkMX09MYTlqsuhy3YKLv28eqMFj YU6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fSx2t2WH; 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 24si5075955oip.248.2020.01.28.06.19.01; Tue, 28 Jan 2020 06:19:13 -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=fSx2t2WH; 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 S1730620AbgA1OSE (ORCPT + 99 others); Tue, 28 Jan 2020 09:18:04 -0500 Received: from mail.kernel.org ([198.145.29.99]:41878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730602AbgA1OR7 (ORCPT ); Tue, 28 Jan 2020 09:17:59 -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 100062071E; Tue, 28 Jan 2020 14:17:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580221079; bh=znnOsdGetlEllZIX25wHMUIdX9foOB5SC+8CsdfWSUA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fSx2t2WHgYSguPKR2vmee6BZf7dB+sAzuoLpOAJ0Q7wfQrmDlHukfhNs21reLTDEe cx/rs8JshmSlHCAu+hP/1Zdly4R9Pzs936R2WZDVkrOpw/6GyNNeCJ02vPgu3Zvh88 Ag8vYolHsgnsj57TKulNGjOgMt/1gyGjeYJ39tds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= , Vinod Koul , Andrew Lunn , "David S. Miller" , Sasha Levin Subject: [PATCH 4.9 081/271] net: dsa: qca8k: Enable delay for RGMII_ID mode Date: Tue, 28 Jan 2020 15:03:50 +0100 Message-Id: <20200128135858.584187520@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135852.449088278@linuxfoundation.org> References: <20200128135852.449088278@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: Vinod Koul [ Upstream commit a968b5e9d5879f9535d6099505f9e14abcafb623 ] RGMII_ID specifies that we should have internal delay, so resurrect the delay addition routine but under the RGMII_ID mode. Fixes: 40269aa9f40a ("net: dsa: qca8k: disable delay for RGMII mode") Tested-by: Michal Vokáč Signed-off-by: Vinod Koul Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/dsa/qca8k.c | 12 ++++++++++++ drivers/net/dsa/qca8k.h | 1 + 2 files changed, 13 insertions(+) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index ebfbaf8597f40..3bbe85aae49bb 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -460,6 +460,18 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode) qca8k_write(priv, QCA8K_REG_PORT5_PAD_CTRL, QCA8K_PORT_PAD_RGMII_RX_DELAY_EN); break; + case PHY_INTERFACE_MODE_RGMII_ID: + /* RGMII_ID needs internal delay. This is enabled through + * PORT5_PAD_CTRL for all ports, rather than individual port + * registers + */ + qca8k_write(priv, reg, + QCA8K_PORT_PAD_RGMII_EN | + QCA8K_PORT_PAD_RGMII_TX_DELAY(QCA8K_MAX_DELAY) | + QCA8K_PORT_PAD_RGMII_RX_DELAY(QCA8K_MAX_DELAY)); + qca8k_write(priv, QCA8K_REG_PORT5_PAD_CTRL, + QCA8K_PORT_PAD_RGMII_RX_DELAY_EN); + break; case PHY_INTERFACE_MODE_SGMII: qca8k_write(priv, reg, QCA8K_PORT_PAD_SGMII_EN); break; diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h index 9c22bc3210cdf..db95168ca111d 100644 --- a/drivers/net/dsa/qca8k.h +++ b/drivers/net/dsa/qca8k.h @@ -40,6 +40,7 @@ ((0x8 + (x & 0x3)) << 22) #define QCA8K_PORT_PAD_RGMII_RX_DELAY(x) \ ((0x10 + (x & 0x3)) << 20) +#define QCA8K_MAX_DELAY 3 #define QCA8K_PORT_PAD_RGMII_RX_DELAY_EN BIT(24) #define QCA8K_PORT_PAD_SGMII_EN BIT(7) #define QCA8K_REG_MODULE_EN 0x030 -- 2.20.1