From patchwork Mon Feb 18 13:03:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10817959 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BD0F717E9 for ; Mon, 18 Feb 2019 13:04:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC2BF29790 for ; Mon, 18 Feb 2019 13:04:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9FAC12AA0D; Mon, 18 Feb 2019 13:04:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54FAD29790 for ; Mon, 18 Feb 2019 13:04:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730734AbfBRNEe (ORCPT ); Mon, 18 Feb 2019 08:04:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:49760 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728873AbfBRNEd (ORCPT ); Mon, 18 Feb 2019 08:04:33 -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 CCDD620645; Mon, 18 Feb 2019 13:04:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1550495072; bh=FgJjZhbSXntmgUqdZ3d8Xb/9/CiTtobyMY5pBL8WP0A=; h=From:To:Cc:Subject:Date:From; b=1B4zoIUEoHM+T8+taTtfRyrvWJWfuFMRoamefaLZkx4vp/Zq4Yka1oD73IhamUH45 HlupnnblridcTT17sDM8sl6DtJox8AJcyKWshhyDERWF4E8WkR3oITU6Bf76wUozVI jJj8LPQORguou9dSoqHZVYHOtLVuGzfLtPHEMjCc= 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?b?TWljaGFsIFZva8OhxI0=?= Subject: [PATCH] net: dsa: qca8k: Enable delay for RGMII_ID mode Date: Mon, 18 Feb 2019 18:33:51 +0530 Message-Id: <20190218130352.9373-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 X-Virus-Scanned: ClamAV using ClamSMTP 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") Signed-off-by: Vinod Koul Tested-by: Michal Vokáč --- drivers/net/dsa/qca8k.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index a4b6cda38016..aa1f7f1b20d3 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(3) | + QCA8K_PORT_PAD_RGMII_RX_DELAY(3)); + 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;