summaryrefslogtreecommitdiff
path: root/target/linux/sunxi/patches-3.14/306-dt-sun7i-fix-gmac-on-bananapi.patch
blob: 19934eacbe074523160b818595f5ae6feadb4d3f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
+++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
@@ -86,6 +86,13 @@
 				allwinner,drive = <0>;
 				allwinner,pull = <1>;
 			};
+			
+			gmac_power_pin_bananapi: gmac_power_pin@0 {
+				allwinner,pins = "PH23";
+				allwinner,function = "gpio_out";
+				allwinner,drive = <0>;
+				allwinner,pull = <0>;
+			};
 		};
 
 		lradc: lradc@01c22800 {
@@ -134,9 +141,10 @@
 
 		gmac: ethernet@01c50000 {
 			pinctrl-names = "default";
-			pinctrl-0 = <&gmac_pins_mii_a>;
+			pinctrl-0 = <&gmac_pins_rgmii_a>;
 			phy = <&phy1>;
-			phy-mode = "mii";
+			phy-mode = "rgmii";
+			phy-supply = <&reg_gmac_3v3>;
 			status = "okay";
 
 			phy1: ethernet-phy@1 {
@@ -169,4 +177,16 @@
                 status = "okay";
         };
 
+	reg_gmac_3v3: gmac-3v3 {
+			compatible = "regulator-fixed";
+			pinctrl-names = "default";
+			pinctrl-0 = <&gmac_power_pin_bananapi>;
+			regulator-name = "gmac-3v3";
+			regulator-min-microvolt = <3300000>;
+			regulator-max-microvolt = <3300000>;
+			startup-delay-us = <50000>;
+			enable-active-high;
+			gpio = <&pio 7 23 0>;
+			status = "okay";
+	};
 };