fe670cf99e52e686ff811a3e73df210385c13b82
[openwrt/svn-archive/archive.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 @@ -54,6 +61,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 @@ -92,6 +118,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 @@ -166,5 +193,66 @@
54 pinctrl-0 = <&pcie2_pins>;
55 pinctrl-names = "default";
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 @@ -4,6 +4,7 @@
123 #include <dt-bindings/clock/qcom,gcc-ipq806x.h>
124 #include <dt-bindings/soc/qcom,gsbi.h>
125 #include <dt-bindings/reset/qcom,gcc-ipq806x.h>
126 +#include <dt-bindings/interrupt-controller/arm-gic.h>
127
128 / {
129 model = "Qualcomm IPQ8064";
130 @@ -513,5 +514,42 @@
131 dr_mode = "host";
132 };
133 };
134 +
135 + nss-gmac-common {
136 + reg = <0x03000000 0x0000FFFF 0x1bb00000 0x0000FFFF 0x00900000 0x00004000>;
137 + reg-names = "nss_reg_base" , "qsgmii_reg_base", "clk_ctl_base";
138 + };
139 +
140 + gmac0: ethernet@37000000 {
141 + device_type = "network";
142 + compatible = "qcom,nss-gmac";
143 + reg = <0x37000000 0x200000>;
144 + interrupts = <GIC_SPI 220 IRQ_TYPE_LEVEL_HIGH>;
145 + status = "disabled";
146 + };
147 +
148 + gmac1: ethernet@37200000 {
149 + device_type = "network";
150 + compatible = "qcom,nss-gmac";
151 + reg = <0x37200000 0x200000>;
152 + interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
153 + status = "disabled";
154 + };
155 +
156 + gmac2: ethernet@37400000 {
157 + device_type = "network";
158 + compatible = "qcom,nss-gmac";
159 + reg = <0x37400000 0x200000>;
160 + interrupts = <GIC_SPI 226 IRQ_TYPE_LEVEL_HIGH>;
161 + status = "disabled";
162 + };
163 +
164 + gmac3: ethernet@37600000 {
165 + device_type = "network";
166 + compatible = "qcom,nss-gmac";
167 + reg = <0x37600000 0x200000>;
168 + interrupts = <GIC_SPI 229 IRQ_TYPE_LEVEL_HIGH>;
169 + status = "disabled";
170 + };
171 };
172 };