From patchwork Tue Feb 19 06:59:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 158682 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp3336821jaa; Mon, 18 Feb 2019 23:00:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IZwy/fE/d7D8eFXt1bBwSu2ioK8CzI+Uy6OqI69QgR+oF5iWxm+hy9Q5KCyNNHJZo8xtAcl X-Received: by 2002:a62:964d:: with SMTP id c74mr27893449pfe.213.1550559627485; Mon, 18 Feb 2019 23:00:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550559627; cv=none; d=google.com; s=arc-20160816; b=n0ZgtL0bI1ERPhUQ0xxtE/XM74dh0JuU2R4UFDu0kfrrouMV0ayZ24oWF6sU5Ozfjh xzYOPF7O4XRvih03BGecBP5/vrHAOiXU/3JDEJN6VPTAg/Xrz7qnVXyrtbeIZjMDrEqe RB+nGBjy0JWHNrIJDsmev2mSamvjVscAGOM7h0EOOeSOxek9M3ogE0lpGlRkWAJC2LyW JxEHwdHID1r9xrCf1wGRjO6rKuIHORPpl8JdooudV7rLNCrvioTfa/fXaCw1JBMdGAQa Vd2qrrrSuSf5BBewcNIMhXnAG9YkUzmvXgA/s34IQLIhEr6VTj0N6BO3yvbfNBfkW8K/ oJVw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=9b2b3gLLQTsfCWutPqO8NEaPcXgx7GVY0sJMXjOuApM=; b=Zd0fV0kfSzNXA3HgnNIMN4RCBqdFg+w8fg3ho9udfmTnsdG+HYHdyjScuBaupKAf7c 2EVUTBZZSGps+EFBr8Gh6aTeG06rGhyhCpkCIgt1MUuhgHiGIkzh950m3H13Y4yhPOlu 5QxK/NHMw/bYSwnZ5NukNVjQp7cIpPKoz4g63OygfYWy6KyhMtJeHjIlbF9S77r87EjT wmN+pcfLrcesruv/VZXRVE9Hac2ZTafd0fi7z4ZCnJJ908jbGfgP+jdkNbfkIZqdahvO TrUD+SqDcsbX7XXEMzuQEq5TvmRxZTyuHElfRFoOROpNO4vi3m32EqBVDtBoSlakzZM3 wbug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=w+g2q9at; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 d13si14971964pgh.196.2019.02.18.23.00.27; Mon, 18 Feb 2019 23:00:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-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=w+g2q9at; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-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 S1725765AbfBSHA0 (ORCPT + 15 others); Tue, 19 Feb 2019 02:00:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:43310 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfBSHA0 (ORCPT ); Tue, 19 Feb 2019 02:00:26 -0500 Received: from localhost.localdomain (unknown [106.200.226.2]) (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 F04DF21848; Tue, 19 Feb 2019 07:00:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550559625; bh=p9tmK1mygTPJB6IHBsWjx3N5M+GXB3P5FxkY77CQKQ8=; h=From:To:Cc:Subject:Date:From; b=w+g2q9ateU3ZDd3SIW+Im6TXus/aasG4KPnKKtkd+Ft+NgIbT9tXcYswzpn3XYc8P 7arfbvxyMGS0yUmNN/4xlT35oCwpQZeuxyESZlIDPO6zSMq3enapkJOHFEW0ItpXt6 NMDP9MVpOyJp4J5NsBb3S8bgvg0yb27ql/13POfc= From: Vinod Koul To: David S Miller Cc: linux-arm-msm@vger.kernel.org, Bjorn Andersson , Vinod Koul , netdev@vger.kernel.org, Niklas Cassel , Andrew Lunn , Florian Fainelli , =?utf-8?q?Michal_Vok=C3=A1?= =?utf-8?b?xI0=?= Subject: [PATCH net-next v2] net: dsa: qca8k: Enable delay for RGMII_ID mode Date: Tue, 19 Feb 2019 12:29:43 +0530 Message-Id: <20190219065943.22765-1-vkoul@kernel.org> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 --- drivers/net/dsa/qca8k.c | 12 ++++++++++++ drivers/net/dsa/qca8k.h | 1 + 2 files changed, 13 insertions(+) -- 2.20.1 Reviewed-by: Andrew Lunn diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index a4b6cda38016..195a8a87b984 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -443,6 +443,18 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode) val = QCA8K_PORT_PAD_RGMII_EN; qca8k_write(priv, reg, val); 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 613fe5c50236..d146e54c8a6c 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