arm64: allwinner: h6: orangepi-one-plus: Add Ethernet support
Subsystems (2)
PATCH v2 1/1 arm64: allwinner: h6: orangepi-one-plus: Add Ethernet support
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
---
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(+)
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +8 -0
@@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; };
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +42 -0
48 lines not on this page · raw message
Signature · 1 line
2.18.0.321.gffc6fa0e3
Quoted 9 lines · Jagan Teki
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator withGMAC_ENpin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14Signed-off-by Jagan Teki <[email protected]>
Your commit log should be improved. We can get those informations from the patch itself...
Quoted 67 lines
---
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(+)arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +8
-0@@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; };arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +33
-0@@ -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>; +}; +
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi line 90
Quoted 10 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +9
-0+&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
Quoted 10 lines · Maxime Ripard
Quoted 8 lines · Jagan Teki
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator withGMAC_ENpin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14
Quoted 4 lines
Quoted 1 line
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.
Quoted 74 lines
Quoted 74 lines
---
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(+)arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +8
-0@@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; };arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +39
-0@@ -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 */
Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi line 90
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +3
-0+ 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?
Quoted 101 lines · Jagan Teki
Quoted 10 lines · Maxime Ripard
Quoted 8 lines · Jagan Teki
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator withGMAC_ENpin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14Quoted 4 lines
Quoted 1 line
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.
Quoted 74 lines
Quoted 74 lines
---
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(+)arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +8
-0@@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; };arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +39
-0@@ -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 */Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi line 90
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +3
-0+ 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.
Quoted 3 lines
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.
Quoted 4 lines
Signature · 3 lines
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-/JYPxA39Uh5TLH3MbocFF+G/[email protected] For more options, visit https://groups.google.com/d/optout.
Quoted 90 lines · Ondřej Jirman
Quoted 82 lines
Quoted 73 lines
Quoted 73 lines
---
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(+)arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +8
-0@@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; };arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +39
-0@@ -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 */Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi line 90
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +3
-0+ 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.
Quoted 3 lines
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_2v5and it also doesn't have the external phy. But with this patch,reg_gmac_2v5will also show up in the Lite 2's final DTB.
Quoted 6 lines
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
Signature · 4 lines
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-/JYPxA39Uh5TLH3MbocFF+G/[email protected] To view this discussion on the web, visit https://groups.google.com/d/msgid/linux-sunxi/20190507070641.7whs4ckiqupaah35%40flea. For more options, visit https://groups.google.com/d/optout.
Quoted 111 lines · Ondřej Jirman
Quoted 101 lines · Jagan Teki
Quoted 10 lines · Maxime Ripard
Quoted 8 lines · Jagan Teki
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator withGMAC_ENpin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14Quoted 4 lines
Quoted 1 line
Signed-off-by Jagan Teki <[email protected]>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.
Quoted 74 lines
Quoted 74 lines
---
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(+)arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts +8
-0@@ -9,4 +9,12 @@ / { model = "OrangePi One Plus"; compatible = "xunlong,orangepi-one-plus", "allwinner,sun50i-h6"; + + aliases { + ethernet0 = &emac; + }; +}; + +&emac { + status = "okay"; };arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +39
-0@@ -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 */Quoted 8 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi line 90
Quoted 4 lines
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi +3
-0+ 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.
Quoted 3 lines
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_2v5and it also doesn't have the external phy. But with this patch,reg_gmac_2v5will also show up in the Lite 2's final DTB.
Quoted 6 lines
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.
Quoted 11 lines · Jagan Teki
Quoted 10 lines · Maxime Ripard
Quoted 8 lines · Jagan Teki
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator withGMAC_ENpin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14
Quoted 6 lines
Quoted 4 lines
Quoted 1 line
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
Quoted 18 lines · Maxime Ripard
Quoted 16 lines · Jagan Teki
Quoted 14 lines · Maxime Ripard
Quoted 9 lines · Jagan Teki
Add Ethernet support for orangepi-one-plus board,
- Ethernet port connected via RTL8211E PHY
- PHY suppiled with
GMAC-2V5, fixed regulator withGMAC_ENpin via PD6 GMAC-3V, which is supplied by VCC3V3-MAC via aldo2
- RGMII-RESET pin connected via PD14Signed-off-by Jagan Teki <[email protected]>Your commit log should be improved. We can get those informations from the patch itself...
Quoted 8 lines
Quoted 1 line
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.