From patchwork Wed Jul 19 15:33:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 9852589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A515602C8 for ; Wed, 19 Jul 2017 15:44:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A9152861B for ; Wed, 19 Jul 2017 15:44:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F3A728632; Wed, 19 Jul 2017 15:44:52 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CC1CA2861B for ; Wed, 19 Jul 2017 15:44:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:References:To:From:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UOq1g7zwqkL//j0czcIUyHQ5yqnX8Y8KQLGcRq82iaw=; b=tt9TPjDDQL03KQ S9eNEyc4V8cQn35jlz8+jXsnWWe3W0TjXXKOyqdpF3XLr0nFgUHe7XxGcrIwjnFijeyXqztVBQiOH pRhSOJIzSwJyrbqbdSElXpjVlvn4eU9cRdJqRIgF2Au/nW2fpF5cZ4nlbhYBEJDfUtZ/SKkv0fr+q GZDmvJbrxMvovcu15uTI8VlTf4KZFuYTaGRovNVhWIGa6VQOEo1R6iywBetZbFJUPRtPUQPLX6p1M 12rf0DoPZGxz6RXF0QkHxG8qNDRZqyQPMkmdKBGgdLGrIpE36JqlMdkB1BQ/kG6c4Yzd6HeHTOVdo 63nEPa47KFYil1wT5Wuw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dXr9b-0003m7-SP; Wed, 19 Jul 2017 15:44:47 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXr9a-0003Va-N3 for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2017 15:44:46 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:References:CC:To:From:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=tt4/yjCU9BCbG0NqqbbgTt/quE10ci8fJpUMaIMFYB8=; b=e9pyCQPxq/aJPeG3cnvFsf/kXl k1a//DImk4dp4kPx+oyz3J2y0XovZixZdlpZvz/+2OimjxRKEKakTIunG9FfAXiQS6p0ItERCileH RUUhqHJKA25Vzv9hs8U+lw9CI0AJfiMs0gQ3GF5f5hjSIWnhOHiux62UOzpAxY5Nx0iSchzL0gRNl oWXGpdkcizt0iXXG30gvi0aW2TzkJ51wRH0dOelCKISJJXNYLm2imPtMzrzrXNHLedJIWxZvVU5QP F2S5TEHeGt2xSMHSTOlWNVE2cO0CSpKE+UWNr6RJOppo9zCSgW96i7J4ASBeKAXtNr23baEKgTsCo 44sOBZHQ==; Received: from us-smtp-delivery-107.mimecast.com ([216.205.24.107]) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dXqzq-00049L-2R for linux-arm-kernel@lists.infradead.org; Wed, 19 Jul 2017 15:34:43 +0000 Received: from CPH-EX1.SDESIGNS.COM (195-215-56-170-static.dk.customer.tdc.net [195.215.56.170]) (Using TLS) by us-smtp-1.mimecast.com with ESMTP id us-mta-131-NMyn6HjBO7W2-ZFmqdmoqA-1; Wed, 19 Jul 2017 11:34:14 -0400 Received: from [172.27.0.114] (172.27.0.114) by CPH-EX1.sdesigns.com (192.168.10.36) with Microsoft SMTP Server (TLS) id 14.3.294.0; Wed, 19 Jul 2017 17:34:10 +0200 Subject: [PATCH 2/2] net: ethernet: nb8800: Fix RGMII TX clock delay setup From: Marc Gonzalez To: Florian Fainelli , Andrew Lunn , Mans Rullgard , Martin Blumenstingl , Grygorii Strashko , Fabio Estevam , Zefir Kurtisi , Timur Tabi , Daniel Mack References: Message-ID: <61b71d12-4e3a-edbe-1d69-c66e7cf46d8e@sigmadesigns.com> Date: Wed, 19 Jul 2017 17:33:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Firefox/52.0 SeaMonkey/2.49.1 MIME-Version: 1.0 In-Reply-To: X-Originating-IP: [172.27.0.114] X-MC-Unique: NMyn6HjBO7W2-ZFmqdmoqA-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170719_163442_272217_3DE40F1E X-CRM114-Status: GOOD ( 11.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev , Thibaud Cornic , "David S. Miller" , Linux ARM , Mason Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP According to commit e5f3a4a56ce2a707b2fb8ce37e4414dcac89c672 ("Documentation: devicetree: clarify usage of the RGMII phy-modes") there are 4 RGMII phy-modes to handle: "rgmii" (RX and TX delays are added by the MAC when required) "rgmii-id" (RGMII with internal RX and TX delays provided by the PHY, the MAC should not add the RX or TX delays in this case) "rgmii-rxid" (RGMII with internal RX delay provided by the PHY, the MAC should not add an RX delay in this case) "rgmii-txid" (RGMII with internal TX delay provided by the PHY, the MAC should not add an TX delay in this case) Let the MAC handle TX clock delay for rgmii and rgmii-rxid. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index 041cfb7952f8..f3ed320eb4ad 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c @@ -609,7 +609,7 @@ static void nb8800_mac_config(struct net_device *dev) mac_mode |= HALF_DUPLEX; if (gigabit) { - if (priv->phy_mode == PHY_INTERFACE_MODE_RGMII) + if (phy_interface_is_rgmii(dev->phydev)) mac_mode |= RGMII_MODE; mac_mode |= GMAC_MODE; @@ -1268,11 +1268,13 @@ static int nb8800_tangox_init(struct net_device *dev) break; case PHY_INTERFACE_MODE_RGMII: - pad_mode = PAD_MODE_RGMII; + case PHY_INTERFACE_MODE_RGMII_RXID: + pad_mode = PAD_MODE_RGMII | PAD_MODE_GTX_CLK_DELAY; break; + case PHY_INTERFACE_MODE_RGMII_ID: case PHY_INTERFACE_MODE_RGMII_TXID: - pad_mode = PAD_MODE_RGMII | PAD_MODE_GTX_CLK_DELAY; + pad_mode = PAD_MODE_RGMII; break; default: