Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2224711imu; Sun, 18 Nov 2018 19:00:59 -0800 (PST) X-Google-Smtp-Source: AJdET5fW9V8XCv9z/sjQhvmcJLvz0U+T7RBlwMuY5oeiCy8xZta/S+y2Y1kg9kGOxVbv1E7qT4Jl X-Received: by 2002:a63:2447:: with SMTP id k68-v6mr18037423pgk.156.1542596459839; Sun, 18 Nov 2018 19:00:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542596459; cv=none; d=google.com; s=arc-20160816; b=XZdDtwM5qxodCREtiD9zam0g548g6fcgI3zTAzjDBMA7+7VVj0AnMwd6RWcziQZWj9 t1aBbl8wwVw7unhWkm1teCqYTrij14zW87Y2hMl7qH0Yme8RDOTgF+mc0d/7Xe/gBXY8 mT+GwmBShIFltXg8Aqz8QQgZLwOtmnvrHo3MPVhZlPMD4SmRo5S7W2G1YjAgkAE6OcT5 3f8mrwOLsP/Xwiu6LjDGUQoG2np1QKfpmBcsh0J6MqU3jJIQgUq8ubCc7cKxrKcIZBlF zy8rUo7ZyhHAgWE81sPs5cRL7vs3PbKyu602eerCB5xnKbpy629PKLo35bA0qYzEbzPn oHgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :references:in-reply-to:date:cc:to:from:subject:message-id; bh=Qw6nN8TFMTWJODUjJWvwbOyD140Pz3Tqpxfm9ea0Jgk=; b=ItxiHHblHOlDnaA8CLdy01q9WuVFY+U+GtTKimYFYAVwAEO0lXftcFAE9bH6SwGY4E ZiZaTQ2l2D2ILddcGRZ/Qtvn+zblt3yVoxJ7EvCD02BRlXksZr8MycbMO5E0xNF5ZQz6 1Cq4sJmYSpelMLnssiXHB2vaEpRRpFowXtQuzNPfHzRU3E/Mgb+Dim2pDR5Mz+ltHdrH ygfZxAdvoe6FMhd8WJwHLgT12D/7J3ckq2uzxXKUTfHcKFAeYizIBHjzjeoqT5iPExbx jjh6c8SUHZak83562aCX/mHvF9T5l/mA7ij2bFrpSdjdnHVyIvIRJaTZK8winYn3ERHw i8bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si38150729pgn.551.2018.11.18.19.00.44; Sun, 18 Nov 2018 19:00:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727816AbeKSNNx (ORCPT + 99 others); Mon, 19 Nov 2018 08:13:53 -0500 Received: from mailgw02.mediatek.com ([1.203.163.81]:20533 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725888AbeKSNNx (ORCPT ); Mon, 19 Nov 2018 08:13:53 -0500 X-UUID: 745472719935414289b674bc8a7262d0-20181119 X-UUID: 745472719935414289b674bc8a7262d0-20181119 Received: from mtkcas35.mediatek.inc [(172.27.4.250)] by mailgw02.mediatek.com (envelope-from ) (mailgw01.mediatek.com ESMTP with TLS) with ESMTP id 662449553; Mon, 19 Nov 2018 10:51:38 +0800 Received: from MTKCAS36.mediatek.inc (172.27.4.186) by MTKMBS31DR.mediatek.inc (172.27.6.102) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 19 Nov 2018 10:51:36 +0800 Received: from [10.17.3.153] (10.17.3.153) by MTKCAS36.mediatek.inc (172.27.4.170) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 19 Nov 2018 10:51:35 +0800 Message-ID: <1542595895.24219.28.camel@mhfsdcap03> Subject: Re: [v3, PATCH 2/2] dt-binding: mediatek-dwmac: add binding document for MediaTek MT2712 DWMAC From: biao huang To: Rob Herring CC: "davem@davemloft.net" , Honghui Zhang =?UTF-8?Q?=28=E5=BC=A0=E6=B4=AA=E8=BE=89=29?= , YT Shen =?UTF-8?Q?=28=E6=B2=88=E5=B2=B3=E9=9C=86=29?= , Liguo Zhang =?UTF-8?Q?=28=E5=BC=A0=E7=AB=8B=E5=9B=BD=29?= , "mark.rutland@arm.com" , Nelson Chang =?UTF-8?Q?=28=3F=3F=E5=AE=B6=E7=A5=A5=29?= , "matthias.bgg@gmail.com" , "netdev@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "joabreu@synopsys.com" , "andrew@lunn.ch" Date: Mon, 19 Nov 2018 10:51:35 +0800 In-Reply-To: <20181117145611.GA26013@bogus> References: <1542359926-28800-1-git-send-email-biao.huang@mediatek.com> <1542359926-28800-2-git-send-email-biao.huang@mediatek.com> <20181117145611.GA26013@bogus> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit MIME-Version: 1.0 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Thanks for your comments. On Sat, 2018-11-17 at 22:56 +0800, Rob Herring wrote: > On Fri, Nov 16, 2018 at 05:18:46PM +0800, Biao Huang wrote: > > The commit adds the device tree binding documentation for the MediaTek DWMAC > > found on MediaTek MT2712. > > > > Change-Id: I3728666bf65927164bd82fa8dddb90df8270bd44 > > Signed-off-by: Biao Huang > > --- > > .../devicetree/bindings/net/mediatek-dwmac.txt | 77 ++++++++++++++++++++ > > 1 file changed, 77 insertions(+) > > create mode 100644 Documentation/devicetree/bindings/net/mediatek-dwmac.txt > > > > diff --git a/Documentation/devicetree/bindings/net/mediatek-dwmac.txt b/Documentation/devicetree/bindings/net/mediatek-dwmac.txt > > new file mode 100644 > > index 0000000..7fd56e0 > > --- /dev/null > > +++ b/Documentation/devicetree/bindings/net/mediatek-dwmac.txt > > @@ -0,0 +1,77 @@ > > +MediaTek DWMAC glue layer controller > > + > > +This file documents platform glue layer for stmmac. > > +Please see stmmac.txt for the other unchanged properties. > > + > > +The device node has following properties. > > + > > +Required properties: > > +- compatible: Should be "mediatek,mt2712-gmac" for MT2712 SoC > > +- reg: Address and length of the register set for the device > > +- interrupts: Should contain the MAC interrupts > > How many? > the common stmmac driver will parse interrupt-name "macirq", so even only one interrupt is used in mediatek dwmac design, the interrupt-names is still remained in device tree. > > +- interrupt-names: Should contain a list of interrupt names corresponding to > > + the interrupts in the interrupts property, if available. > > + Should be "macirq" for the main MAC IRQ > > +- clocks: Must contain a phandle for each entry in clock-names. > > +- clock-names: The name of the clock listed in the clocks property. These are > > + "axi", "apb", "mac_ext", "mac_parent", "ptp_ref", "ptp_parent", "ptp_top" > > + for MT2712 SoC > > Clocks should represent the physical clocks connected to a block. Parent > clocks are not in that category. > Got it. assigned-clocks/assigned-clocks-parents properties can handle it. > > +- mac-address: See ethernet.txt in the same directory > > +- phy-mode: See ethernet.txt in the same directory > > + > > +Optional properties: > > +- tx-delay: TX clock delay macro value. Range is 0~31. Default is 0. > > + It should be defined for rgmii/rgmii-rxid/mii interface. > > +- rx-delay: RX clock delay macro value. Range is 0~31. Default is 0. > > + It should be defined for rgmii/rgmii-txid/mii/rmii interface. > > +- fine-tune: This property will select coarse-tune delay or fine delay > > + for rgmii interface. > > + If fine-tune delay is enabled, tx-delay/rx-delay is 170+/-50ps > > + per stage. > > + Else coarse-tune delay is enabled, tx-delay/rx-delay is 0.55+/-0.2ns > > + per stage. > > + This property do not apply to non-rgmii PHYs. > > + Only coarse-tune delay is supported for mii/rmii PHYs. > > Perhaps the delays should be in ps and the driver can figure out > fine-tune or not based on the value. > the delay time in mediatek dwmac design is not so accurate, the current mt2712 and the following ICs will not use the same delay design, but will use stages to indicate different delay time. so, maybe "mediatek,tx-delay" represent the delay stage is a good choice. > > +- rmii-rxc: Reference clock of rmii is from external PHYs, > > + and it can be connected to TXC or RXC pin on MT2712 SoC. > > + If ref_clk <--> TXC, disable it. > > + Else ref_clk <--> RXC, enable it. > > +- txc-inverse: Inverse tx clock for mii/rgmii. > > + Inverse tx clock inside MAC relative to reference clock for rmii, > > + and it rarely happen. > > +- rxc-inverse: Inverse rx clock for mii/rgmii interfaces. > > + Inverse reference clock for rmii. > > These should all have vendor prefixes. 'snps' if these are all standard > GMAC controls or 'mediatek' if Mediatek specific. > Got it, will be modified in next version. > > + > > +Example: > > + eth: ethernet@1101c000 { > > + compatible = "mediatek,mt2712-gmac"; > > + reg = <0 0x1101c000 0 0x1300>; > > + interrupts = ; > > + interrupt-names = "macirq"; > > + phy-mode ="rgmii-id"; > > + mac-address = [00 55 7b b5 7d f7]; > > + clock-names = "axi", > > + "apb", > > + "mac_ext", > > + "mac_parent", > > + "ptp_ref", > > + "ptp_parent", > > + "ptp_top"; > > + clocks = <&pericfg CLK_PERI_GMAC>, > > + <&pericfg CLK_PERI_GMAC_PCLK>, > > + <&topckgen CLK_TOP_ETHER_125M_SEL>, > > + <&topckgen CLK_TOP_ETHERPLL_125M>, > > + <&topckgen CLK_TOP_ETHER_50M_SEL>, > > + <&topckgen CLK_TOP_APLL1_D3>, > > + <&topckgen CLK_TOP_APLL1>; > > + snps,txpbl = <32>; > > + snps,rxpbl = <32>; > > + snps,reset-gpio = <&pio 87 GPIO_ACTIVE_LOW>; > > + snps,reset-active-low; > > + tx-delay = <9>; > > + rx-delay = <9>; > > + fine-tune; > > + rmii-rxc; > > + txc-inverse; > > + rxc-inverse; > > + }; > > -- > > 1.7.9.5 > >