sunxi: backport stmmac network patches
[openwrt/openwrt.git] / target / linux / sunxi / patches-4.14 / 027-arm64-dts-allwinner-H5-Restore-EMAC-changes.patch
1 From 44a94c7ef989317de81e3e7f84385be2bf1b5fe2 Mon Sep 17 00:00:00 2001
2 From: Corentin Labbe <clabbe.montjoie@gmail.com>
3 Date: Tue, 31 Oct 2017 09:19:14 +0100
4 Subject: [PATCH] arm64: dts: allwinner: H5: Restore EMAC changes
5
6 The original dwmac-sun8i DT bindings have some issue on how to handle
7 integrated PHY and was reverted in last RC of 4.13.
8 But now we have a solution so we need to get back that was reverted.
9
10 This patch restore arm64 DT about dwmac-sun8i for H5
11 This reverts a part of commit 87e1f5e8bb4b ("arm64: dts: allwinner: Revert EMAC changes")
12
13 Signed-off-by: Corentin Labbe <clabbe.montjoie@gmail.com>
14 Acked-by: Florian Fainelli <f.fainelli@gmail.com>
15 Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
16 ---
17 arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts | 17 +++++++++++++++++
18 .../arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts | 17 +++++++++++++++++
19 .../boot/dts/allwinner/sun50i-h5-orangepi-prime.dts | 17 +++++++++++++++++
20 3 files changed, 51 insertions(+)
21
22 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts
23 +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo2.dts
24 @@ -50,6 +50,7 @@
25 compatible = "friendlyarm,nanopi-neo2", "allwinner,sun50i-h5";
26
27 aliases {
28 + ethernet0 = &emac;
29 serial0 = &uart0;
30 };
31
32 @@ -108,6 +109,22 @@
33 status = "okay";
34 };
35
36 +&emac {
37 + pinctrl-names = "default";
38 + pinctrl-0 = <&emac_rgmii_pins>;
39 + phy-supply = <&reg_gmac_3v3>;
40 + phy-handle = <&ext_rgmii_phy>;
41 + phy-mode = "rgmii";
42 + status = "okay";
43 +};
44 +
45 +&external_mdio {
46 + ext_rgmii_phy: ethernet-phy@7 {
47 + compatible = "ethernet-phy-ieee802.3-c22";
48 + reg = <7>;
49 + };
50 +};
51 +
52 &mmc0 {
53 pinctrl-names = "default";
54 pinctrl-0 = <&mmc0_pins_a>, <&mmc0_cd_pin>;
55 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
56 +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-pc2.dts
57 @@ -59,6 +59,7 @@
58 };
59
60 aliases {
61 + ethernet0 = &emac;
62 serial0 = &uart0;
63 };
64
65 @@ -136,6 +137,22 @@
66 status = "okay";
67 };
68
69 +&emac {
70 + pinctrl-names = "default";
71 + pinctrl-0 = <&emac_rgmii_pins>;
72 + phy-supply = <&reg_gmac_3v3>;
73 + phy-handle = <&ext_rgmii_phy>;
74 + phy-mode = "rgmii";
75 + status = "okay";
76 +};
77 +
78 +&external_mdio {
79 + ext_rgmii_phy: ethernet-phy@1 {
80 + compatible = "ethernet-phy-ieee802.3-c22";
81 + reg = <1>;
82 + };
83 +};
84 +
85 &ir {
86 pinctrl-names = "default";
87 pinctrl-0 = <&ir_pins_a>;
88 --- a/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
89 +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-orangepi-prime.dts
90 @@ -54,6 +54,7 @@
91 compatible = "xunlong,orangepi-prime", "allwinner,sun50i-h5";
92
93 aliases {
94 + ethernet0 = &emac;
95 serial0 = &uart0;
96 };
97
98 @@ -143,6 +144,22 @@
99 status = "okay";
100 };
101
102 +&emac {
103 + pinctrl-names = "default";
104 + pinctrl-0 = <&emac_rgmii_pins>;
105 + phy-supply = <&reg_gmac_3v3>;
106 + phy-handle = <&ext_rgmii_phy>;
107 + phy-mode = "rgmii";
108 + status = "okay";
109 +};
110 +
111 +&external_mdio {
112 + ext_rgmii_phy: ethernet-phy@1 {
113 + compatible = "ethernet-phy-ieee802.3-c22";
114 + reg = <1>;
115 + };
116 +};
117 +
118 &ir {
119 pinctrl-names = "default";
120 pinctrl-0 = <&ir_pins_a>;