From patchwork Fri Jul 21 11:26:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marc Gonzalez X-Patchwork-Id: 9856751 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 6A864601C0 for ; Fri, 21 Jul 2017 11:54:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 51A6628736 for ; Fri, 21 Jul 2017 11:54:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4651128799; Fri, 21 Jul 2017 11:54:50 +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,RCVD_IN_DNSWL_NONE 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 D212028736 for ; Fri, 21 Jul 2017 11:54:49 +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=ocgglqV9R3EEKhitk34yMMhoQLo5zlKSPfvATKdsKI8=; b=SrxdhKhUtBi4sr M8O7cgQPvjW+e/+lMUtv/yHP9JJAH+oC9v7fG7Q5KWtoJDspiFDwGDfDMEweSZjjSAYz8je6ErDp4 wvU+xcpHRlXReBTaBfqnq2zq0+WGxYbFD/ce91/qc8+lLV8CvHwBcGu/Vb9Aq+KatmibRElNxi23b YXOGrnvrQZle6NuBU8bzx4o9UJ72a5Dl3wPLMEff8/GyYGLAhom0x7X9H8hEzh3DvU8HzfCCtvTm6 ZgQwElLbFdbQDzth7CJaqQGfsuqlBpNev6oiipN2CM+1BIeNmMBcCo1P4emKsU1BCOqJstKbucbVp Ie1sM5FplQLYtKZ72GeA==; 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 1dYWW5-0007OL-QP; Fri, 21 Jul 2017 11:54:45 +0000 Received: from us-smtp-delivery-107.mimecast.com ([216.205.24.107]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dYWUy-0006Tk-FL for linux-arm-kernel@lists.infradead.org; Fri, 21 Jul 2017 11:53:40 +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-191-NZarrL1tP52dpKQLcHHGYA-1; Fri, 21 Jul 2017 07:53: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; Fri, 21 Jul 2017 13:53:11 +0200 Subject: [PATCH v2 3/4] 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: <2617d673-ef81-5e7f-4730-ed3aa3f1c2c6@sigmadesigns.com> Message-ID: <5a68bec8-0b1d-bcfe-65fb-b10399ec75be@sigmadesigns.com> Date: Fri, 21 Jul 2017 13:26:30 +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: <2617d673-ef81-5e7f-4730-ed3aa3f1c2c6@sigmadesigns.com> X-Originating-IP: [172.27.0.114] X-MC-Unique: NZarrL1tP52dpKQLcHHGYA-1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170721_045337_218972_4BDA6AA8 X-CRM114-Status: UNSURE ( 8.37 ) X-CRM114-Notice: Please train this message. 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 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) Add TX delay in the MAC only for rgmii and rgmii-rxid. Signed-off-by: Marc Gonzalez --- drivers/net/ethernet/aurora/nb8800.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c index ded041dbafe7..f3ed320eb4ad 100644 --- a/drivers/net/ethernet/aurora/nb8800.c +++ b/drivers/net/ethernet/aurora/nb8800.c @@ -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: