ar71xx: add support for compex wpj344
[openwrt.git] / target / linux / ipq806x / patches-3.18 / 700-add-gmac-dts-suport.patch
1 --- a/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
2 +++ b/arch/arm/boot/dts/qcom-ipq8064-ap148.dts
3 @@ -22,8 +22,15 @@
4                 linux,stdout-path = "serial0:115200n8";
5         };
6  
7 +       aliases {
8 +               mdio-gpio0 = &mdio0;
9 +       };
10 +
11         soc {
12                 pinmux@800000 {
13 +                       pinctrl-0 = <&mdio0_pins &rgmii2_pins>;
14 +                       pinctrl-names = "default";
15 +
16                         i2c4_pins: i2c4_pinmux {
17                                 pins = "gpio12", "gpio13";
18                                 function = "gsbi4";
19 @@ -38,6 +45,25 @@
20                                         bias-none;
21                                 };
22                         };
23 +
24 +                       mdio0_pins: mdio0_pins {
25 +                               mux {
26 +                                       pins = "gpio0", "gpio1";
27 +                                       function = "gpio";
28 +                                       drive-strength = <8>;
29 +                                       bias-disable;
30 +                               };
31 +                       };
32 +
33 +                       rgmii2_pins: rgmii2_pins {
34 +                               mux {
35 +                                       pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
36 +                                              "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
37 +                                       function = "rgmii2";
38 +                                       drive-strength = <8>;
39 +                                       bias-disable;
40 +                               };
41 +                       };
42                 };
43  
44                 gsbi@16300000 {
45 @@ -76,6 +102,7 @@
46                                         #size-cells = <1>;
47                                         spi-max-frequency = <50000000>;
48                                         reg = <0>;
49 +                                       m25p,fast-read;
50  
51                                         partition@0 {
52                                                 label = "lowlevel_init";
53 @@ -136,5 +163,66 @@
54                 usb30@1 {
55                         status = "ok";
56                 };
57 +
58 +               mdio0: mdio {
59 +                       compatible = "virtual,mdio-gpio";
60 +                       #address-cells = <1>;
61 +                       #size-cells = <0>;
62 +                       gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
63 +
64 +                       phy0: ethernet-phy@0 {
65 +                               device_type = "ethernet-phy";
66 +                               reg = <0>;
67 +                               qca,ar8327-initvals = <
68 +                                       0x00004 0x7600000   /* PAD0_MODE */
69 +                                       0x00008 0x1000000   /* PAD5_MODE */
70 +                                       0x0000c 0x80        /* PAD6_MODE */
71 +                                       0x000e4 0xaa545     /* MAC_POWER_SEL */
72 +                                       0x000e0 0xc74164de  /* SGMII_CTRL */
73 +                                       0x0007c 0x4e        /* PORT0_STATUS */
74 +                                       0x00094 0x4e        /* PORT6_STATUS */
75 +                               >;
76 +                       };
77 +
78 +                       phy4: ethernet-phy@4 {
79 +                               device_type = "ethernet-phy";
80 +                               reg = <4>;
81 +                       };
82 +               };
83 +
84 +               nss-gmac-common {
85 +                       reg = <0x03000000 0x0000FFFF 0x1bb00000 0x0000FFFF 0x00900000 0x00004000>;
86 +                       reg-names = "nss_reg_base" , "qsgmii_reg_base", "clk_ctl_base";
87 +               };
88 +
89 +               gmac1: ethernet@37200000 {
90 +                       status = "ok";
91 +                       phy-mode = "rgmii";
92 +                       qcom,id = <1>;
93 +                       qcom,phy_mdio_addr = <4>;
94 +                       qcom,poll_required = <1>;
95 +                       qcom,rgmii_delay = <0>;
96 +                       qcom,emulation = <0>;
97 +                       qcom,forced_speed = <1000>;
98 +                       qcom,forced_duplex = <1>;
99 +                       qcom,socver = <0>;
100 +                       local-mac-address = [000000000000];
101 +                       mdiobus = <&mdio0>;
102 +               };
103 +
104 +               gmac2: ethernet@37400000 {
105 +                       status = "ok";
106 +                       phy-mode = "sgmii";
107 +                       qcom,id = <2>;
108 +                       qcom,phy_mdio_addr = <0>;
109 +                       qcom,poll_required = <0>;
110 +                       qcom,rgmii_delay = <0>;
111 +                       qcom,emulation = <0>;
112 +                       qcom,forced_speed = <1000>;
113 +                       qcom,forced_duplex = <1>;
114 +                       qcom,socver = <0>;
115 +                       local-mac-address = [000000000000];
116 +                       mdiobus = <&mdio0>;
117 +               };
118         };
119  };
120 --- a/arch/arm/boot/dts/qcom-ipq8064.dtsi
121 +++ b/arch/arm/boot/dts/qcom-ipq8064.dtsi
122 @@ -3,6 +3,7 @@
123  #include "skeleton.dtsi"
124  #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
125  #include <dt-bindings/soc/qcom,gsbi.h>
126 +#include <dt-bindings/interrupt-controller/arm-gic.h>
127  
128  / {
129         model = "Qualcomm IPQ8064";
130 @@ -390,5 +391,41 @@
131                         };
132                 };
133  
134 +               nss-gmac-common {
135 +                       reg = <0x03000000 0x0000FFFF 0x1bb00000 0x0000FFFF 0x00900000 0x00004000>;
136 +                       reg-names = "nss_reg_base" , "qsgmii_reg_base", "clk_ctl_base";
137 +               };
138 +
139 +               gmac0: ethernet@37000000 {
140 +                       device_type = "network";
141 +                       compatible = "qcom,nss-gmac";
142 +                       reg = <0x37000000 0x200000>;
143 +                       interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
144 +                       status = "disabled";
145 +               };
146 +
147 +               gmac1: ethernet@37200000 {
148 +                       device_type = "network";
149 +                       compatible = "qcom,nss-gmac";
150 +                       reg = <0x37200000 0x200000>;
151 +                       interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
152 +                       status = "disabled";
153 +               };
154 +
155 +               gmac2: ethernet@37400000 {
156 +                       device_type = "network";
157 +                       compatible = "qcom,nss-gmac";
158 +                       reg = <0x37400000 0x200000>;
159 +                       interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
160 +                       status = "disabled";
161 +               };
162 +
163 +               gmac3: ethernet@37600000 {
164 +                       device_type = "network";
165 +                       compatible = "qcom,nss-gmac";
166 +                       reg = <0x37600000 0x200000>;
167 +                       interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
168 +                       status = "disabled";
169 +               };
170         };
171  };