| Message ID | 20190503115928.27662-1-jagan@amarulasolutions.com |
|---|---|
| State | New |
| Headers |
Return-Path: <linux-amarula+bncBD7MFH7A7EEBBNG2WDTAKGQEYOTFEKA@amarulasolutions.com> X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 3D5B53F36B for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 3 May 2019 13:59:51 +0200 (CEST) Received: by mail-pf1-f198.google.com with SMTP id j1sf2955664pff.1 for <linux-amarula@patchwork.amarulasolutions.com>; Fri, 03 May 2019 04:59:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1556884789; cv=pass; d=google.com; s=arc-20160816; b=Tv8UvnnqpcQqW2wnc5mMrqXHyCeY6AaGaIDw7tfp9MeN0zw6D/tfwgqh+QdNt8UQZg QL1pMMhzodJPnPVin/0y3qCesJzrOBDYtNvp5gZUid5P6kRDVGGr1tyLdcfY5KdFCA3L On7qae7F6Zbj381xP8bmwx/BeKjm9pqi4eZZuUKtv9v/Fxm3MxEnoWYLCvQrXIFMLBqn LvcPYMjEvBQIBY1g9ADtv2SOLEeoHZZPXv4vODEHrIimVqospGrQ5RH1PdEFtSU7s0UX 3tpDKDQKTtV5PpUtAVSaVHCr4uG3c7p0NXpV5egkqksEOWt2uTzb5oC+m8CH/ZPJx8VK r5Lg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:mime-version:message-id:date:subject:cc:to :from:dkim-signature; bh=U69961W0tQJR0yEhi6Wwaz+T3Wpd5nrJ5yxj7y4KW28=; b=RG8Fy9NMZgPTGFnAWzqdhxz6e3NcHbcGQ1zM6bIC7qu3OUWVLt9j9YQNW0EzV6K4gN vW5k7Y0JDyJczV1BLpL4kFWq+GM8OqTDuty2r5hm2X6rMd+RmJQuYimk9C5REqHYykv/ Zabr6hESQD4H4ebP0cjA8cBw10wKtWsDLNKU68RLpcqKNvEwt2rQah75zP046DYVsa9o pRF9CZDITHrRMGvqNkm0T00rS1LYemVlwIE2ad6pAOVsBmvhJ2NI2riUavFBrFNKmnyz ZpCk5pduOOn/BcMZn1r2KICeNxPrUOMIuo8Fa9fv0c9u5H3iX5iER/+W0IdKW67wAViu ZqHA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I7fOhnOZ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=U69961W0tQJR0yEhi6Wwaz+T3Wpd5nrJ5yxj7y4KW28=; b=gFwZwnZKfM7t2C2eLM72uLn4ooOoy/FDU/RsxGUMc3TxksKvgJNlHt4FeFlvFhLjuA kUzrSTE08muz8CjdLGdZ1XNXERIr5TahV8smIsbu8noM4gITwEzZAoYRt+kKyW8aMrOy CQxfnOqEPzeS5CksBkBWtHDH0FU6jDf4Xrs6w= 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:date:message-id:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-unsubscribe; bh=U69961W0tQJR0yEhi6Wwaz+T3Wpd5nrJ5yxj7y4KW28=; b=kJp5u2oz+S2uLQo2f+qg3yRcaiWmzjYzXXacI2cH3Cjj5rl98SZWVXjp0XhMMatD+E Px6wpQxqh5IFNE40+ff+CFq2P3ypjYWT1B+typCZW+n/xj+E/6Yk758bjVvKLLqPa1Wq aLQ0r4fFahUqV5pWvRdV5bYRH/vVcekRCGuLyrzpHFluM0XZ81ycF8X1PKyybCzDwHms dewSV3W5vDQPvYZdtN3GaW2DAUtnFzZJ1QHvh6Uw69862jOusSbcKMq/qUN+hWT4n1ig NMlRabxlEXbxjkxKW+dTsWloKZBZkjX4V6LaCeXMh/cEgVqJ/mm5q1MIpsmqZP+KXlgE Hq+Q== X-Gm-Message-State: APjAAAU7jomS8BXbLfoFj8Wcp+vCGrdnNJE2zDIaPDrotfQxPYLixQUI 9oJyMIcraZYp7aNtvo6qltw1X4sL X-Google-Smtp-Source: APXvYqy2cyErcssaGVwOChnDO1KnIhsVFoMlVNRRPn+KEUg/whFqFXBMn89ANPEbDbJ9U27IM5vZGg== X-Received: by 2002:a63:ef53:: with SMTP id c19mr10009646pgk.120.1556884788851; Fri, 03 May 2019 04:59:48 -0700 (PDT) X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a63:6886:: with SMTP id d128ls1169794pgc.4.gmail; Fri, 03 May 2019 04:59:48 -0700 (PDT) X-Received: by 2002:a63:5041:: with SMTP id q1mr9802803pgl.386.1556884788453; Fri, 03 May 2019 04:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556884788; cv=none; d=google.com; s=arc-20160816; b=t/nNlM2bdbA04Ay4ZmsynhfVS8BdYxPrd4zcLtBJQRRfPYA/Q2gV4R9Oivkp4WpHTR xDgtO+wXZ2x94PedecDZhGZQccPfFTcLCVlILaPrANu/M7M783quS6C0NchihvgPNY6U Bqgm+SSKEJdBDqxLupAUllbQ19OGmUYiHyyGaCPQiFfBIbdArDwN59S/+qkNBzXQ5Sxa 2wSepJKw/wYvtFu0Y96n4+ajw2wGCSAV7ivfIDd1oW/inlzPhhPxvBFRkPLlpToHfco8 Gl6RXkxsOna8Y11Q78wrN4rnAvaphItqmwCktbJ//EfMe6pf1opVq22gANlf448JDILM jvOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=vJmfFw0q35lTjOMKi7JKfHPrHE1C5yCWa/soMCMhwUs=; b=Qf/5reU7FHZUTuxAOwJlmm4PBRceQPdKs35Om/IDRNOIQNCOp/ZP84zhC5RRd1g8rb hXFaltRXtaAylYPt6EQFIXFROQ9xnqCadBsyOAS+F8PE3qOtXgYa9jv+szdBc6qnMQIp ZA9qD5xXWX+SyGlQwHiItFXMoQ2StVzwyUV5sXLrlPbpmR2s8CqHqgGepOY7PyfjUsCA V/Tq+fZqZagR3UzbegP8pxcGBeQ/uw/FaLeK8dgFDelrxUSutX2IB0mtN5hEU660dqKx uRJhDvKVufptHAEaIZ75QcTDFh8rVUW0w8IAEIOv7KuoZIiSc6X2zq+bmgOgGy0h8Omy sfow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I7fOhnOZ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id g188sor1737400pgc.84.2019.05.03.04.59.48 for <linux-amarula@amarulasolutions.com> (Google Transport Security); Fri, 03 May 2019 04:59:48 -0700 (PDT) Received-SPF: pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; X-Received: by 2002:a63:1604:: with SMTP id w4mr9850811pgl.148.1556884787760; Fri, 03 May 2019 04:59:47 -0700 (PDT) Received: from localhost.localdomain ([49.206.203.165]) by smtp.gmail.com with ESMTPSA id f5sm2235940pgo.75.2019.05.03.04.59.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 May 2019 04:59:47 -0700 (PDT) From: Jagan Teki <jagan@amarulasolutions.com> To: Maxime Ripard <maxime.ripard@bootlin.com>, Chen-Yu Tsai <wens@csie.org>, Rob Herring <robh+dt@kernel.org>, Mark Rutland <mark.rutland@arm.com> Cc: Michael Trimarchi <michael@amarulasolutions.com>, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com, linux-sunxi@googlegroups.com, Jagan Teki <jagan@amarulasolutions.com> Subject: [PATCH v2] arm64: allwinner: h6: orangepi-one-plus: Add Ethernet support Date: Fri, 3 May 2019 17:29:28 +0530 Message-Id: <20190503115928.27662-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.18.0.321.gffc6fa0e3 MIME-Version: 1.0 X-Original-Sender: jagan@amarulasolutions.com X-Original-Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=I7fOhnOZ; spf=pass (google.com: domain of jagan@amarulasolutions.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=jagan@amarulasolutions.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: <linux-amarula.amarulasolutions.com> X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/post>, <mailto:linux-amarula@amarulasolutions.com> List-Help: <https://support.google.com/a/amarulasolutions.com/bin/topic.py?topic=25838>, <mailto:linux-amarula+help@amarulasolutions.com> List-Archive: <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/> List-Unsubscribe: <mailto:googlegroups-manage+476853432473+unsubscribe@googlegroups.com>, <https://groups.google.com/a/amarulasolutions.com/group/linux-amarula/subscribe> |
| Series |
[v2] arm64: allwinner: h6: orangepi-one-plus: Add Ethernet support
|
|
Commit Message
Jagan Teki
May 3, 2019, 11:59 a.m. UTC
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator with GMAC_EN pin via PD6
GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v2:
- emac changes on top of https://patchwork.kernel.org/cover/10899529/
series
.../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++
.../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++
2 files changed, 50 insertions(+)
Comments
On Fri, May 03, 2019 at 05:29:28PM +0530, Jagan Teki wrote: > Add Ethernet support for orangepi-one-plus board, > > - Ethernet port connected via RTL8211E PHY > - PHY suppiled with > GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 > GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 > - RGMII-RESET pin connected via PD14 > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> Your commit log should be improved. We can get those informations from the patch itself... > --- > Changes for v2: > - emac changes on top of https://patchwork.kernel.org/cover/10899529/ > series > > .../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++ > .../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++ > 2 files changed, 50 insertions(+) > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > index 12e17567ab56..9e8ed1053715 100644 > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > @@ -9,4 +9,12 @@ > / { > model = "OrangePi One Plus"; > compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; > + > + aliases { > + ethernet0 = &emac; > + }; > +}; > + > +&emac { > + status = "okay"; > }; > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > index 62e27948a3fa..c48e24acaf8a 100644 > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > @@ -45,6 +45,48 @@ > regulator-max-microvolt = <5000000>; > regulator-always-on; > }; > + > + /* > + * The board uses 2.5V RGMII signalling. Power sequence to enable > + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails > + * at the same time and to wait 100ms. > + */ > + reg_gmac_2v5: gmac-2v5 { > + compatible = "regulator-fixed"; > + regulator-name = "gmac-2v5"; > + regulator-min-microvolt = <2500000>; > + regulator-max-microvolt = <2500000>; > + startup-delay-us = <100000>; > + enable-active-high; > + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ > + > + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to > + * enable two regulators to power the phy. This is one way > + * to achieve that. > + */ > + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ > + }; > +}; > + > +&emac { > + pinctrl-names = "default"; > + pinctrl-0 = <&ext_rgmii_pins>; > + phy-mode = "rgmii"; > + phy-handle = <&ext_rgmii_phy>; > + phy-supply = <®_gmac_2v5>; > + allwinner,rx-delay-ps = <1500>; > + allwinner,tx-delay-ps = <700>; > +}; > + > +&mdio { > + ext_rgmii_phy: ethernet-phy@1 { > + compatible = "ethernet-phy-ieee802.3-c22"; > + reg = <1>; > + > + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ > + reset-assert-us = <15000>; > + reset-deassert-us = <40000>; > + }; > }; ... however, at no point in time you explain why you made that switch, and while most of the definition of the EMAC nodes is in the DTSI, you only enable it in one DTS. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Fri, May 3, 2019 at 8:16 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Fri, May 03, 2019 at 05:29:28PM +0530, Jagan Teki wrote: > > Add Ethernet support for orangepi-one-plus board, > > > > - Ethernet port connected via RTL8211E PHY > > - PHY suppiled with > > GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 > > GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 > > - RGMII-RESET pin connected via PD14 > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > Your commit log should be improved. We can get those informations from > the patch itself... Thought it was a clear commit log :) will update anyway. > > > --- > > Changes for v2: > > - emac changes on top of https://patchwork.kernel.org/cover/10899529/ > > series > > > > .../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++ > > .../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++ > > 2 files changed, 50 insertions(+) > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > index 12e17567ab56..9e8ed1053715 100644 > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > @@ -9,4 +9,12 @@ > > / { > > model = "OrangePi One Plus"; > > compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; > > + > > + aliases { > > + ethernet0 = &emac; > > + }; > > +}; > > + > > +&emac { > > + status = "okay"; > > }; > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > index 62e27948a3fa..c48e24acaf8a 100644 > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > @@ -45,6 +45,48 @@ > > regulator-max-microvolt = <5000000>; > > regulator-always-on; > > }; > > + > > + /* > > + * The board uses 2.5V RGMII signalling. Power sequence to enable > > + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails > > + * at the same time and to wait 100ms. > > + */ > > + reg_gmac_2v5: gmac-2v5 { > > + compatible = "regulator-fixed"; > > + regulator-name = "gmac-2v5"; > > + regulator-min-microvolt = <2500000>; > > + regulator-max-microvolt = <2500000>; > > + startup-delay-us = <100000>; > > + enable-active-high; > > + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ > > + > > + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to > > + * enable two regulators to power the phy. This is one way > > + * to achieve that. > > + */ > > + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ > > + }; > > +}; > > + > > +&emac { > > + pinctrl-names = "default"; > > + pinctrl-0 = <&ext_rgmii_pins>; > > + phy-mode = "rgmii"; > > + phy-handle = <&ext_rgmii_phy>; > > + phy-supply = <®_gmac_2v5>; > > + allwinner,rx-delay-ps = <1500>; > > + allwinner,tx-delay-ps = <700>; > > +}; > > + > > +&mdio { > > + ext_rgmii_phy: ethernet-phy@1 { > > + compatible = "ethernet-phy-ieee802.3-c22"; > > + reg = <1>; > > + > > + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ > > + reset-assert-us = <15000>; > > + reset-deassert-us = <40000>; > > + }; > > }; > > ... however, at no point in time you explain why you made that switch, > and while most of the definition of the EMAC nodes is in the DTSI, you > only enable it in one DTS. The dtsi is shared b/w 1+ and lite2 and 1+ has emac, so I enabled the status directly on dts and keeping the relevant nodes on dtsi just like SoC dtsi does. do I need to mention this in commit log?
On Mon, May 06, 2019 at 03:03:15PM +0530, Jagan Teki wrote: > On Fri, May 3, 2019 at 8:16 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > > > On Fri, May 03, 2019 at 05:29:28PM +0530, Jagan Teki wrote: > > > Add Ethernet support for orangepi-one-plus board, > > > > > > - Ethernet port connected via RTL8211E PHY > > > - PHY suppiled with > > > GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 > > > GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 > > > - RGMII-RESET pin connected via PD14 > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Your commit log should be improved. We can get those informations from > > the patch itself... > > Thought it was a clear commit log :) will update anyway. > > > > > > --- > > > Changes for v2: > > > - emac changes on top of https://patchwork.kernel.org/cover/10899529/ > > > series > > > > > > .../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++ > > > .../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++ > > > 2 files changed, 50 insertions(+) > > > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > index 12e17567ab56..9e8ed1053715 100644 > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > @@ -9,4 +9,12 @@ > > > / { > > > model = "OrangePi One Plus"; > > > compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; > > > + > > > + aliases { > > > + ethernet0 = &emac; > > > + }; > > > +}; > > > + > > > +&emac { > > > + status = "okay"; > > > }; > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > index 62e27948a3fa..c48e24acaf8a 100644 > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > @@ -45,6 +45,48 @@ > > > regulator-max-microvolt = <5000000>; > > > regulator-always-on; > > > }; > > > + > > > + /* > > > + * The board uses 2.5V RGMII signalling. Power sequence to enable > > > + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails > > > + * at the same time and to wait 100ms. > > > + */ > > > + reg_gmac_2v5: gmac-2v5 { > > > + compatible = "regulator-fixed"; > > > + regulator-name = "gmac-2v5"; > > > + regulator-min-microvolt = <2500000>; > > > + regulator-max-microvolt = <2500000>; > > > + startup-delay-us = <100000>; > > > + enable-active-high; > > > + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ > > > + > > > + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to > > > + * enable two regulators to power the phy. This is one way > > > + * to achieve that. > > > + */ > > > + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ > > > + }; > > > +}; > > > + > > > +&emac { > > > + pinctrl-names = "default"; > > > + pinctrl-0 = <&ext_rgmii_pins>; > > > + phy-mode = "rgmii"; > > > + phy-handle = <&ext_rgmii_phy>; > > > + phy-supply = <®_gmac_2v5>; > > > + allwinner,rx-delay-ps = <1500>; > > > + allwinner,tx-delay-ps = <700>; > > > +}; > > > + > > > +&mdio { > > > + ext_rgmii_phy: ethernet-phy@1 { > > > + compatible = "ethernet-phy-ieee802.3-c22"; > > > + reg = <1>; > > > + > > > + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ > > > + reset-assert-us = <15000>; > > > + reset-deassert-us = <40000>; > > > + }; > > > }; > > > > ... however, at no point in time you explain why you made that switch, > > and while most of the definition of the EMAC nodes is in the DTSI, you > > only enable it in one DTS. > > The dtsi is shared b/w 1+ and lite2 and 1+ has emac, so I enabled the > status directly on dts and keeping the relevant nodes on dtsi just > like SoC dtsi does. do I need to mention this in commit log? Lite 2 doesn't have reg_gmac_2v5 and it also doesn't have the external phy. But with this patch, reg_gmac_2v5 will also show up in the Lite 2's final DTB. Comapred to SoC dtsi, the SoC always has things that are in the dtsi, they are just not enabled/used by the board, but they are present on the chip. So this comes down to what the meaning of board-level dtsi should be. I doubt we want it to mean "a collection of stuff that may or may not be present on the boards that depend on it". regards, o. > -- > You received this message because you are subscribed to the Google Groups "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.
On Mon, May 06, 2019 at 03:03:15PM +0530, Jagan Teki wrote: > On Fri, May 3, 2019 at 8:16 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > > > On Fri, May 03, 2019 at 05:29:28PM +0530, Jagan Teki wrote: > > > Add Ethernet support for orangepi-one-plus board, > > > > > > - Ethernet port connected via RTL8211E PHY > > > - PHY suppiled with > > > GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 > > > GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 > > > - RGMII-RESET pin connected via PD14 > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > Your commit log should be improved. We can get those informations from > > the patch itself... > > Thought it was a clear commit log :) will update anyway. Well, yes and no. The commit log is clear indeed, but it doesn't provide what it's supposed to provide. You shouldn't put *what* is being done by the patch. That's pretty easy to figure out by reading the patch itself. You have to explain why and how you did it, which is lacking in that case. -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Mon, May 06, 2019 at 03:31:01PM +0200, Ondřej Jirman wrote: > > > > --- > > > > Changes for v2: > > > > - emac changes on top of https://patchwork.kernel.org/cover/10899529/ > > > > series > > > > > > > > .../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++ > > > > .../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++ > > > > 2 files changed, 50 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > > index 12e17567ab56..9e8ed1053715 100644 > > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > > @@ -9,4 +9,12 @@ > > > > / { > > > > model = "OrangePi One Plus"; > > > > compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; > > > > + > > > > + aliases { > > > > + ethernet0 = &emac; > > > > + }; > > > > +}; > > > > + > > > > +&emac { > > > > + status = "okay"; > > > > }; > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > > index 62e27948a3fa..c48e24acaf8a 100644 > > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > > @@ -45,6 +45,48 @@ > > > > regulator-max-microvolt = <5000000>; > > > > regulator-always-on; > > > > }; > > > > + > > > > + /* > > > > + * The board uses 2.5V RGMII signalling. Power sequence to enable > > > > + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails > > > > + * at the same time and to wait 100ms. > > > > + */ > > > > + reg_gmac_2v5: gmac-2v5 { > > > > + compatible = "regulator-fixed"; > > > > + regulator-name = "gmac-2v5"; > > > > + regulator-min-microvolt = <2500000>; > > > > + regulator-max-microvolt = <2500000>; > > > > + startup-delay-us = <100000>; > > > > + enable-active-high; > > > > + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ > > > > + > > > > + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to > > > > + * enable two regulators to power the phy. This is one way > > > > + * to achieve that. > > > > + */ > > > > + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ > > > > + }; > > > > +}; > > > > + > > > > +&emac { > > > > + pinctrl-names = "default"; > > > > + pinctrl-0 = <&ext_rgmii_pins>; > > > > + phy-mode = "rgmii"; > > > > + phy-handle = <&ext_rgmii_phy>; > > > > + phy-supply = <®_gmac_2v5>; > > > > + allwinner,rx-delay-ps = <1500>; > > > > + allwinner,tx-delay-ps = <700>; > > > > +}; > > > > + > > > > +&mdio { > > > > + ext_rgmii_phy: ethernet-phy@1 { > > > > + compatible = "ethernet-phy-ieee802.3-c22"; > > > > + reg = <1>; > > > > + > > > > + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ > > > > + reset-assert-us = <15000>; > > > > + reset-deassert-us = <40000>; > > > > + }; > > > > }; > > > > > > ... however, at no point in time you explain why you made that switch, > > > and while most of the definition of the EMAC nodes is in the DTSI, you > > > only enable it in one DTS. > > > > The dtsi is shared b/w 1+ and lite2 and 1+ has emac, so I enabled the > > status directly on dts and keeping the relevant nodes on dtsi just > > like SoC dtsi does. do I need to mention this in commit log? > > Lite 2 doesn't have reg_gmac_2v5 and it also doesn't have the external phy. > But with this patch, reg_gmac_2v5 will also show up in the Lite 2's final > DTB. > > Comapred to SoC dtsi, the SoC always has things that are in the dtsi, they > are just not enabled/used by the board, but they are present on the chip. > > So this comes down to what the meaning of board-level dtsi should be. I > doubt we want it to mean "a collection of stuff that may or may not be > present on the boards that depend on it". Agreed. Maxime -- Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
On Mon, May 6, 2019 at 7:01 PM Ondřej Jirman <megous@megous.com> wrote: > > On Mon, May 06, 2019 at 03:03:15PM +0530, Jagan Teki wrote: > > On Fri, May 3, 2019 at 8:16 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > > > > > On Fri, May 03, 2019 at 05:29:28PM +0530, Jagan Teki wrote: > > > > Add Ethernet support for orangepi-one-plus board, > > > > > > > > - Ethernet port connected via RTL8211E PHY > > > > - PHY suppiled with > > > > GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 > > > > GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 > > > > - RGMII-RESET pin connected via PD14 > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > Your commit log should be improved. We can get those informations from > > > the patch itself... > > > > Thought it was a clear commit log :) will update anyway. > > > > > > > > > --- > > > > Changes for v2: > > > > - emac changes on top of https://patchwork.kernel.org/cover/10899529/ > > > > series > > > > > > > > .../allwinner/sun50i-h6-orangepi-one-plus.dts | 8 ++++ > > > > .../dts/allwinner/sun50i-h6-orangepi.dtsi | 42 +++++++++++++++++++ > > > > 2 files changed, 50 insertions(+) > > > > > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > > index 12e17567ab56..9e8ed1053715 100644 > > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts > > > > @@ -9,4 +9,12 @@ > > > > / { > > > > model = "OrangePi One Plus"; > > > > compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; > > > > + > > > > + aliases { > > > > + ethernet0 = &emac; > > > > + }; > > > > +}; > > > > + > > > > +&emac { > > > > + status = "okay"; > > > > }; > > > > diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > > index 62e27948a3fa..c48e24acaf8a 100644 > > > > --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > > +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi > > > > @@ -45,6 +45,48 @@ > > > > regulator-max-microvolt = <5000000>; > > > > regulator-always-on; > > > > }; > > > > + > > > > + /* > > > > + * The board uses 2.5V RGMII signalling. Power sequence to enable > > > > + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails > > > > + * at the same time and to wait 100ms. > > > > + */ > > > > + reg_gmac_2v5: gmac-2v5 { > > > > + compatible = "regulator-fixed"; > > > > + regulator-name = "gmac-2v5"; > > > > + regulator-min-microvolt = <2500000>; > > > > + regulator-max-microvolt = <2500000>; > > > > + startup-delay-us = <100000>; > > > > + enable-active-high; > > > > + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ > > > > + > > > > + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to > > > > + * enable two regulators to power the phy. This is one way > > > > + * to achieve that. > > > > + */ > > > > + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ > > > > + }; > > > > +}; > > > > + > > > > +&emac { > > > > + pinctrl-names = "default"; > > > > + pinctrl-0 = <&ext_rgmii_pins>; > > > > + phy-mode = "rgmii"; > > > > + phy-handle = <&ext_rgmii_phy>; > > > > + phy-supply = <®_gmac_2v5>; > > > > + allwinner,rx-delay-ps = <1500>; > > > > + allwinner,tx-delay-ps = <700>; > > > > +}; > > > > + > > > > +&mdio { > > > > + ext_rgmii_phy: ethernet-phy@1 { > > > > + compatible = "ethernet-phy-ieee802.3-c22"; > > > > + reg = <1>; > > > > + > > > > + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ > > > > + reset-assert-us = <15000>; > > > > + reset-deassert-us = <40000>; > > > > + }; > > > > }; > > > > > > ... however, at no point in time you explain why you made that switch, > > > and while most of the definition of the EMAC nodes is in the DTSI, you > > > only enable it in one DTS. > > > > The dtsi is shared b/w 1+ and lite2 and 1+ has emac, so I enabled the > > status directly on dts and keeping the relevant nodes on dtsi just > > like SoC dtsi does. do I need to mention this in commit log? > > Lite 2 doesn't have reg_gmac_2v5 and it also doesn't have the external phy. > But with this patch, reg_gmac_2v5 will also show up in the Lite 2's final > DTB. > > Comapred to SoC dtsi, the SoC always has things that are in the dtsi, they > are just not enabled/used by the board, but they are present on the chip. > > So this comes down to what the meaning of board-level dtsi should be. I > doubt we want it to mean "a collection of stuff that may or may not be > present on the boards that depend on it". Was thinking in another direction, thanks for the info. agreed.
On Tue, May 7, 2019 at 12:36 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > On Mon, May 06, 2019 at 03:03:15PM +0530, Jagan Teki wrote: > > On Fri, May 3, 2019 at 8:16 PM Maxime Ripard <maxime.ripard@bootlin.com> wrote: > > > > > > On Fri, May 03, 2019 at 05:29:28PM +0530, Jagan Teki wrote: > > > > Add Ethernet support for orangepi-one-plus board, > > > > > > > > - Ethernet port connected via RTL8211E PHY > > > > - PHY suppiled with > > > > GMAC-2V5, fixed regulator with GMAC_EN pin via PD6 > > > > GMAC-3V, which is supplied by VCC3V3-MAC via aldo2 > > > > - RGMII-RESET pin connected via PD14 > > > > > > > > Signed-off-by: Jagan Teki <jagan@amarulasolutions.com> > > > > > > Your commit log should be improved. We can get those informations from > > > the patch itself... > > > > Thought it was a clear commit log :) will update anyway. > > Well, yes and no. The commit log is clear indeed, but it doesn't > provide what it's supposed to provide. > > You shouldn't put *what* is being done by the patch. That's pretty > easy to figure out by reading the patch itself. You have to explain > why and how you did it, which is lacking in that case. Make sense, will rework.
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts index 12e17567ab56..9e8ed1053715 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts @@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; }; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi index 62e27948a3fa..c48e24acaf8a 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi @@ -45,6 +45,48 @@ regulator-max-microvolt = <5000000>; regulator-always-on; }; + + /* + * The board uses 2.5V RGMII signalling. Power sequence to enable + * the phy is to enable GMAC-2V5 and GMAC-3V (aldo2) power rails + * at the same time and to wait 100ms. + */ + reg_gmac_2v5: gmac-2v5 { + compatible = "regulator-fixed"; + regulator-name = "gmac-2v5"; + regulator-min-microvolt = <2500000>; + regulator-max-microvolt = <2500000>; + startup-delay-us = <100000>; + enable-active-high; + gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* GMAC_EN: PD6 */ + + /* The real parent of gmac-2v5 is reg_vcc5v, but we need to + * enable two regulators to power the phy. This is one way + * to achieve that. + */ + vin-supply = <®_aldo2>; /* VCC3V3-MAC: GMAC-3V */ + }; +}; + +&emac { + pinctrl-names = "default"; + pinctrl-0 = <&ext_rgmii_pins>; + phy-mode = "rgmii"; + phy-handle = <&ext_rgmii_phy>; + phy-supply = <®_gmac_2v5>; + allwinner,rx-delay-ps = <1500>; + allwinner,tx-delay-ps = <700>; +}; + +&mdio { + ext_rgmii_phy: ethernet-phy@1 { + compatible = "ethernet-phy-ieee802.3-c22"; + reg = <1>; + + reset-gpios = <&pio 3 14 GPIO_ACTIVE_LOW>; /* RGMII-RESET: PD14 */ + reset-assert-us = <15000>; + reset-deassert-us = <40000>; + }; }; &ehci0 {