From patchwork Thu Nov 24 14:34:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9445561 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 50999606DB for ; Thu, 24 Nov 2016 14:35:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 468F2205AB for ; Thu, 24 Nov 2016 14:35:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3B12227D7F; Thu, 24 Nov 2016 14:35:22 +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=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DD4E4276AE for ; Thu, 24 Nov 2016 14:35:19 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9v7H-0000Y3-IE; Thu, 24 Nov 2016 14:35:11 +0000 Received: from mail-wm0-x244.google.com ([2a00:1450:400c:c09::244]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c9v6y-0008J2-E0; Thu, 24 Nov 2016 14:34:53 +0000 Received: by mail-wm0-x244.google.com with SMTP id m203so5120828wma.3; Thu, 24 Nov 2016 06:34:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=qFK1DsTdY1t9FDAP4D0bxQC1qpzFxEqlBZmMCOBAut8=; b=Hbs1j7k3G1/y/pM8349XPhDWdiwHSnFTADH8lbd2J/6soEXcxYbgx9cLxaiefQ8Ocl dudDWdgy9sF58J1ieG7Z/VB6CmxntJn4Y4Dcaa5sphIvSi8p2I8ra6irfvOFETa62u7G 67+i7Id+S6B7cKim4AyzjK9JYcppIyosRvoCc99iltz+INmsd/CfSAQH3BsIgC54WcMw neNOJRZxF2qF92IrMJ5luWfh/LU6Ihp9pBYq01xbub6HAJbtrlmGpLScP+dLHLA1NblM k5PpF26zi/PgyNr6F+F6kgas9baV+WkF72poenM+hCCiKy820bNO/Eydv+rWgESz/qGl Tgwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=qFK1DsTdY1t9FDAP4D0bxQC1qpzFxEqlBZmMCOBAut8=; b=EiRv0G69PP/5gpaaLx/6i6jkI0JTABtDCq8Of/2cvWu4wkDZS+ejC67qll5sNME9Xh VD8ok4VrmeLgW0Z2pSXS2Kz+dp4vACTxQ+/8/Xt+U+B4R29ZqJBYpzTsV607/r1O+BSW WN4JROpIlyZoSBIZAMWHh8QjJ/3ZWN6Le5z274RSsrVkiBw9fKbMQcFe3A/3WpHcU6kv XVa4R3YQ19h+AhdjXwXBn7j0yB7x74QfDMvcVEdQbAzmNgIFTTNQJtdkzGg6ANac+ivb bLPB28CT5QMLYuXbZrRnr4U8U35NttRKF17Ms8GptLSFH/huvxYrjBNHkzrUloKLhdS/ EkZg== X-Gm-Message-State: AKaTC02glcw1XUiFcJb38FLKLcH4Xf5Sb5FoWLepMPcQydUlNG4J9RyU1SNSSuEd33sdCg== X-Received: by 10.28.60.5 with SMTP id j5mr2863609wma.119.1479998070571; Thu, 24 Nov 2016 06:34:30 -0800 (PST) Received: from blackbox.darklights.net (p200300DCD3D39204428D5CFFFEB99DB8.dip0.t-ipconnect.de. [2003:dc:d3d3:9204:428d:5cff:feb9:9db8]) by smtp.googlemail.com with ESMTPSA id d17sm42015245wjr.14.2016.11.24.06.34.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Nov 2016 06:34:29 -0800 (PST) From: Martin Blumenstingl To: linux-amlogic@lists.infradead.org, devicetree@vger.kernel.org, netdev@vger.kernel.org, davem@davemloft.net, khilman@baylibre.com, mark.rutland@arm.com, robh+dt@kernel.org Subject: [net-next PATCH v1 1/2] net: dt-bindings: add RGMII TX delay configuration to meson8b-dwmac Date: Thu, 24 Nov 2016 15:34:16 +0100 Message-Id: <20161124143417.10178-2-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161124143417.10178-1-martin.blumenstingl@googlemail.com> References: <20161124143417.10178-1-martin.blumenstingl@googlemail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161124_063452_729181_2D7DE83C X-CRM114-Status: GOOD ( 14.17 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexandre.torgue@st.com, Martin Blumenstingl , carlo@caione.org, peppe.cavallaro@st.com, linux-arm-kernel@lists.infradead.org, jbrunet@baylibre.com MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This allows configuring the RGMII TX clock delay. This clock is generated by the Meson 8b / GXBB DWMAC glue. The configuration depends on the actual hardware (no delay may be needed due to the design of the actual circuit, the PHY might add this delay, etc.). The configuration values are provided as preprocessor macros to make the devicetree files easier to read. Signed-off-by: Martin Blumenstingl --- Documentation/devicetree/bindings/net/meson-dwmac.txt | 11 +++++++++++ include/dt-bindings/net/dwmac-meson8b.h | 18 ++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 include/dt-bindings/net/dwmac-meson8b.h diff --git a/Documentation/devicetree/bindings/net/meson-dwmac.txt b/Documentation/devicetree/bindings/net/meson-dwmac.txt index 89e62dd..fe526d0 100644 --- a/Documentation/devicetree/bindings/net/meson-dwmac.txt +++ b/Documentation/devicetree/bindings/net/meson-dwmac.txt @@ -25,6 +25,17 @@ Required properties on Meson8b and newer: - "clkin0" - first parent clock of the internal mux - "clkin1" - second parent clock of the internal mux +Optional properties on Meson8b and newer: +- amlogic,tx-delay: The internal RGMII TX clock delay configuration. + Defaults to DWMAC_MESON8B_TXDLY_QUARTER_CYCLE + when not given. All possible values are defined + as preprocessor macro in + . + The delay is specified as divider for the + internal clock (RGMII typically uses a 125MHz + clock clock (= 8ns per cycle), so setting + DWMAC_MESON8B_TXDLY_QUARTER_CYCLE + results in a TX delay of 8ns/4 = 2ns. Example for Meson6: diff --git a/include/dt-bindings/net/dwmac-meson8b.h b/include/dt-bindings/net/dwmac-meson8b.h new file mode 100644 index 0000000..4fc149e --- /dev/null +++ b/include/dt-bindings/net/dwmac-meson8b.h @@ -0,0 +1,18 @@ +/* + * Devicetree constants for the Amlogic Meson8b and GXBB DWMAC glue layer + * + * Copyright (C) 2016 Martin Blumenstingl + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/* TX delay configuration */ +#define DWMAC_MESON8B_TXDLY_OFF 0x0 +#define DWMAC_MESON8B_TXDLY_QUARTER_CYCLE 0x1 +#define DWMAC_MESON8B_TXDLY_HALF_CYCLE 0x2 +#define DWMAC_MESON8B_TXDLY_THREE_QUARTER_CYCLE 0x3