Skip to content

Commit 4904337

Browse files
montjoiemripard
authored andcommitted
ARM: dts: sunxi: Restore EMAC changes (boards)
The original dwmac-sun8i DT bindings have some issue on how to handle integrated PHY and was reverted in last RC of 4.13. But now we have a solution so we need to get back that was reverted. This patch restore all boards DT about dwmac-sun8i This reverts partially commit fe45174 ("arm: dts: sunxi: Revert EMAC changes") Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com> Acked-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
1 parent 776245a commit 4904337

10 files changed

+131
-0
lines changed

arch/arm/boot/dts/sun8i-h2-plus-orangepi-zero.dts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@
5656

5757
aliases {
5858
serial0 = &uart0;
59+
/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
60+
ethernet0 = &emac;
5961
ethernet1 = &xr819;
6062
};
6163

@@ -102,6 +104,13 @@
102104
status = "okay";
103105
};
104106

107+
&emac {
108+
phy-handle = <&int_mii_phy>;
109+
phy-mode = "mii";
110+
allwinner,leds-active-low;
111+
status = "okay";
112+
};
113+
105114
&mmc0 {
106115
pinctrl-names = "default";
107116
pinctrl-0 = <&mmc0_pins_a>;

arch/arm/boot/dts/sun8i-h3-bananapi-m2-plus.dts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
compatible = "sinovoip,bpi-m2-plus", "allwinner,sun8i-h3";
5353

5454
aliases {
55+
ethernet0 = &emac;
5556
serial0 = &uart0;
5657
serial1 = &uart1;
5758
};
@@ -111,6 +112,24 @@
111112
status = "okay";
112113
};
113114

115+
&emac {
116+
pinctrl-names = "default";
117+
pinctrl-0 = <&emac_rgmii_pins>;
118+
phy-supply = <&reg_gmac_3v3>;
119+
phy-handle = <&ext_rgmii_phy>;
120+
phy-mode = "rgmii";
121+
122+
allwinner,leds-active-low;
123+
status = "okay";
124+
};
125+
126+
&external_mdio {
127+
ext_rgmii_phy: ethernet-phy@1 {
128+
compatible = "ethernet-phy-ieee802.3-c22";
129+
reg = <0>;
130+
};
131+
};
132+
114133
&ir {
115134
pinctrl-names = "default";
116135
pinctrl-0 = <&ir_pins_a>;

arch/arm/boot/dts/sun8i-h3-nanopi-m1-plus.dts

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@
5151
ethernet1 = &sdio_wifi;
5252
};
5353

54+
reg_gmac_3v3: gmac-3v3 {
55+
compatible = "regulator-fixed";
56+
regulator-name = "gmac-3v3";
57+
regulator-min-microvolt = <3300000>;
58+
regulator-max-microvolt = <3300000>;
59+
startup-delay-us = <100000>;
60+
enable-active-high;
61+
gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>;
62+
};
63+
5464
wifi_pwrseq: wifi_pwrseq {
5565
compatible = "mmc-pwrseq-simple";
5666
pinctrl-names = "default";
@@ -66,6 +76,25 @@
6676
status = "okay";
6777
};
6878

79+
&emac {
80+
pinctrl-names = "default";
81+
pinctrl-0 = <&emac_rgmii_pins>;
82+
phy-supply = <&reg_gmac_3v3>;
83+
phy-handle = <&ext_rgmii_phy>;
84+
phy-mode = "rgmii";
85+
86+
allwinner,leds-active-low;
87+
88+
status = "okay";
89+
};
90+
91+
&external_mdio {
92+
ext_rgmii_phy: ethernet-phy@1 {
93+
compatible = "ethernet-phy-ieee802.3-c22";
94+
reg = <7>;
95+
};
96+
};
97+
6998
&ir {
7099
pinctrl-names = "default";
71100
pinctrl-0 = <&ir_pins_a>;

arch/arm/boot/dts/sun8i-h3-nanopi-neo.dts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,10 @@
4646
model = "FriendlyARM NanoPi NEO";
4747
compatible = "friendlyarm,nanopi-neo", "allwinner,sun8i-h3";
4848
};
49+
50+
&emac {
51+
phy-handle = <&int_mii_phy>;
52+
phy-mode = "mii";
53+
allwinner,leds-active-low;
54+
status = "okay";
55+
};

arch/arm/boot/dts/sun8i-h3-orangepi-2.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
aliases {
5555
serial0 = &uart0;
5656
/* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
57+
ethernet0 = &emac;
5758
ethernet1 = &rtl8189;
5859
};
5960

@@ -117,6 +118,13 @@
117118
status = "okay";
118119
};
119120

121+
&emac {
122+
phy-handle = <&int_mii_phy>;
123+
phy-mode = "mii";
124+
allwinner,leds-active-low;
125+
status = "okay";
126+
};
127+
120128
&ir {
121129
pinctrl-names = "default";
122130
pinctrl-0 = <&ir_pins_a>;

arch/arm/boot/dts/sun8i-h3-orangepi-one.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
compatible = "xunlong,orangepi-one", "allwinner,sun8i-h3";
5353

5454
aliases {
55+
ethernet0 = &emac;
5556
serial0 = &uart0;
5657
};
5758

@@ -97,6 +98,13 @@
9798
status = "okay";
9899
};
99100

101+
&emac {
102+
phy-handle = <&int_mii_phy>;
103+
phy-mode = "mii";
104+
allwinner,leds-active-low;
105+
status = "okay";
106+
};
107+
100108
&mmc0 {
101109
pinctrl-names = "default";
102110
pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;

arch/arm/boot/dts/sun8i-h3-orangepi-pc-plus.dts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,11 @@
5353
};
5454
};
5555

56+
&emac {
57+
/* LEDs changed to active high on the plus */
58+
/delete-property/ allwinner,leds-active-low;
59+
};
60+
5661
&mmc1 {
5762
pinctrl-names = "default";
5863
pinctrl-0 = <&mmc1_pins_a>;

arch/arm/boot/dts/sun8i-h3-orangepi-pc.dts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
compatible = "xunlong,orangepi-pc", "allwinner,sun8i-h3";
5353

5454
aliases {
55+
ethernet0 = &emac;
5556
serial0 = &uart0;
5657
};
5758

@@ -113,6 +114,13 @@
113114
status = "okay";
114115
};
115116

117+
&emac {
118+
phy-handle = <&int_mii_phy>;
119+
phy-mode = "mii";
120+
allwinner,leds-active-low;
121+
status = "okay";
122+
};
123+
116124
&ir {
117125
pinctrl-names = "default";
118126
pinctrl-0 = <&ir_pins_a>;

arch/arm/boot/dts/sun8i-h3-orangepi-plus.dts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@
4747
model = "Xunlong Orange Pi Plus / Plus 2";
4848
compatible = "xunlong,orangepi-plus", "allwinner,sun8i-h3";
4949

50+
aliases {
51+
ethernet0 = &emac;
52+
};
53+
5054
reg_gmac_3v3: gmac-3v3 {
5155
compatible = "regulator-fixed";
5256
regulator-name = "gmac-3v3";
@@ -74,6 +78,24 @@
7478
status = "okay";
7579
};
7680

81+
&emac {
82+
pinctrl-names = "default";
83+
pinctrl-0 = <&emac_rgmii_pins>;
84+
phy-supply = <&reg_gmac_3v3>;
85+
phy-handle = <&ext_rgmii_phy>;
86+
phy-mode = "rgmii";
87+
88+
allwinner,leds-active-low;
89+
status = "okay";
90+
};
91+
92+
&external_mdio {
93+
ext_rgmii_phy: ethernet-phy@1 {
94+
compatible = "ethernet-phy-ieee802.3-c22";
95+
reg = <0>;
96+
};
97+
};
98+
7799
&mmc2 {
78100
pinctrl-names = "default";
79101
pinctrl-0 = <&mmc2_8bit_pins>;

arch/arm/boot/dts/sun8i-h3-orangepi-plus2e.dts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,19 @@
6161
gpio = <&pio 3 6 GPIO_ACTIVE_HIGH>; /* PD6 */
6262
};
6363
};
64+
65+
&emac {
66+
pinctrl-names = "default";
67+
pinctrl-0 = <&emac_rgmii_pins>;
68+
phy-supply = <&reg_gmac_3v3>;
69+
phy-handle = <&ext_rgmii_phy>;
70+
phy-mode = "rgmii";
71+
status = "okay";
72+
};
73+
74+
&external_mdio {
75+
ext_rgmii_phy: ethernet-phy@1 {
76+
compatible = "ethernet-phy-ieee802.3-c22";
77+
reg = <1>;
78+
};
79+
};

0 commit comments

Comments
 (0)