From patchwork Wed Feb 1 19:19:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9550565 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 3387E60236 for ; Wed, 1 Feb 2017 19:21:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 25D7A2845F for ; Wed, 1 Feb 2017 19:21:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A92A28462; Wed, 1 Feb 2017 19:21:08 +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.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=no 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 AE8F12845F for ; Wed, 1 Feb 2017 19:21:07 +0000 (UTC) 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 1cZ0Sh-0003iE-Rq; Wed, 01 Feb 2017 19:20:59 +0000 Received: from mail-wj0-f193.google.com ([209.85.210.193]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cZ0Se-0003dJ-EX for linux-amlogic@lists.infradead.org; Wed, 01 Feb 2017 19:20:58 +0000 Received: by mail-wj0-f193.google.com with SMTP id le4so4733362wjb.0 for ; Wed, 01 Feb 2017 11:20:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=lXLVTUIyrt7M5mReuqsqdf/BjXAyW05iBao/zEiqQM0=; b=psYBiCAHv24dl/yDGqyDI6isUw1S4zqOWlDHQiLxRUKgBa7QcFiu56Wt9Azod7LZfg P22o8Wd6vGg3yTlzZvIau9gwiMoIFilXPXz3DVkmXcdUYuAK6vb529Q0yuQGMLOHUrvv gZuOT/eGrGN9Y0h3P63/Bt7n5lYZ3ATTLZXAJmuSSprYytOGMfAct71Wb+rKe1FcHRxp RN+cS8HXWStjzxCLbw0IZ7M+y/NTBSRA01gGM0Pu2Az0n6qNBx7HN651VvW3QEV6NPfQ wuz6r8no8X3pWDtFVjFQ0DWv0yLn1HJdqWwAfgcZIO0Q0R6YCV2XoDF1WYOUlZ1HoXxO N43Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=lXLVTUIyrt7M5mReuqsqdf/BjXAyW05iBao/zEiqQM0=; b=s9pqe49gE9CSsYji77WueX10wtK/pLQ/jQkoF5SCj9pdfF5MZr7N5j1ssEHdjUa5cu IIATwLGS0ZpcAHz1sS/Q4MoO1tjVePYYVkLiaC/+YcGx6t2zlAZpG4Ab2oeFZ6fKR69Y lCLWvk99BzZHqxM2f97fu/7PCNFAROnRQ6/RHQUl/7fZ8U6qv20AohfZMULfIRK08IiZ eKs71KxpwNEMFwzMW2eejc3E6robZzv7Fg+3wpijyndrKTRpkNwl3QwYGnVknQF8Fs0i zqXvMOSWbgoOk25F7jQHfD7c2RbFfi2G9grN1QUOST3m3ksdC87unXtUssS252RJEAjm I1Iw== X-Gm-Message-State: AIkVDXILTnCTcnt14xTAypzfwaOmhMyQWHQTkGnKeblhNZ6AAWqQDdyos32UhK6Kz8x3+g== X-Received: by 10.223.138.172 with SMTP id y41mr4058157wry.118.1485976774709; Wed, 01 Feb 2017 11:19:34 -0800 (PST) Received: from ?IPv6:2003:c6:ebc5:6c00:7c0d:c568:586a:c33c? (p200300C6EBC56C007C0DC568586AC33C.dip0.t-ipconnect.de. [2003:c6:ebc5:6c00:7c0d:c568:586a:c33c]) by smtp.googlemail.com with ESMTPSA id x39sm35664524wrb.3.2017.02.01.11.19.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Feb 2017 11:19:34 -0800 (PST) From: Heiner Kallweit To: David Miller Subject: [PATCH] net: stmmac: don't set tx delay in RGMII_ID and RGMII_TXID mode Message-ID: Date: Wed, 1 Feb 2017 20:19:25 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170201_112056_648286_64C66B00 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Martin Blumenstingl , "netdev@vger.kernel.org" , linux-amlogic@lists.infradead.org Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP As documented in Documentation/devicetree/bindings/net/ethernet.txt, in RGMII_ID and RGMII_TXID mode the MAC should not add a tx delay. Signed-off-by: Heiner Kallweit Acked-by: Martin Blumenstingl phy_mode) { case PHY_INTERFACE_MODE_RGMII: - case PHY_INTERFACE_MODE_RGMII_ID: case PHY_INTERFACE_MODE_RGMII_RXID: + /* TX clock delay in ns = "8ns / 4 * tx_dly_val" (where + * 8ns are exactly one cycle of the 125MHz RGMII TX clock): + * 0ns = 0x0, 2ns = 0x1, 4ns = 0x2, 6ns = 0x3 + */ + tx_dly_val = dwmac->tx_delay_ns >> 1; + /* fall through */ + + case PHY_INTERFACE_MODE_RGMII_ID: case PHY_INTERFACE_MODE_RGMII_TXID: /* Generate a 25MHz clock for the PHY */ clk_rate = 25 * 1000 * 1000; @@ -195,11 +202,6 @@ static int meson8b_init_prg_eth(struct meson8b_dwmac *dwmac) meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, PRG_ETH0_INVERTED_RMII_CLK, 0); - /* TX clock delay in ns = "8ns / 4 * tx_dly_val" (where - * 8ns are exactly one cycle of the 125MHz RGMII TX clock): - * 0ns = 0x0, 2ns = 0x1, 4ns = 0x2, 6ns = 0x3 - */ - tx_dly_val = dwmac->tx_delay_ns >> 1; meson8b_dwmac_mask_bits(dwmac, PRG_ETH0, PRG_ETH0_TXDLY_MASK, tx_dly_val << PRG_ETH0_TXDLY_SHIFT); break;