cc56213fdbffe00ac3d17ddbe0f5badef2857dc7
[oweals/openwrt.git] / target / linux / ipq806x / files / arch / arm / boot / dts / qcom-ipq8065-nbg6817.dts
1 #include "qcom-ipq8065-v1.0.dtsi"
2
3 #include <dt-bindings/input/input.h>
4
5 / {
6         model = "ZyXEL NBG6817";
7         compatible = "zyxel,nbg6817", "qcom,ipq8065";
8
9         memory@0 {
10                 reg = <0x42000000 0x1e000000>;
11                 device_type = "memory";
12         };
13
14         reserved-memory {
15                 #address-cells = <1>;
16                 #size-cells = <1>;
17                 ranges;
18                 rsvd@41200000 {
19                         reg = <0x41200000 0x300000>;
20                         no-map;
21                 };
22         };
23
24         aliases {
25                 serial0 = &uart4;
26                 mdio-gpio0 = &mdio0;
27                 sdcc1 = &sdcc1;
28         };
29
30         chosen {
31                 bootargs = "root=/dev/mmcblk0p5 rootfstype=squashfs,ext4 rootwait noinitrd";
32                 linux,stdout-path = "serial0:115200n8";
33         };
34
35         soc {
36                 pinmux@800000 {
37                         pinctrl-0 = <&mdio0_pins &rgmii2_pins>;
38                         pinctrl-names = "default";
39
40                         i2c4_pins: i2c4_pinmux {
41                                 mux {
42                                         pins = "gpio12", "gpio13";
43                                         function = "gsbi4";
44                                         drive-strength = <12>;
45                                         bias-disable;
46                                 };
47                         };
48
49                         mdio0_pins: mdio0_pins {
50                                 mux {
51                                         pins = "gpio0", "gpio1";
52                                         function = "gpio";
53                                         drive-strength = <8>;
54                                         bias-disable;
55                                 };
56
57                                 clk {
58                                         pins = "gpio1";
59                                         input-disable;
60                                 };
61                         };
62
63                         rgmii2_pins: rgmii2_pins {
64                                 mux {
65                                         pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32",
66                                                "gpio51", "gpio52", "gpio59", "gpio60", "gpio61", "gpio62" ;
67                                         function = "rgmii2";
68                                         drive-strength = <8>;
69                                         bias-disable;
70                                 };
71
72                                 tx {
73                                         pins = "gpio27", "gpio28", "gpio29", "gpio30", "gpio31", "gpio32" ;
74                                         input-disable;
75                                 };
76                         };
77
78                         spi_pins: spi_pins {
79                                 mux {
80                                         pins = "gpio18", "gpio19", "gpio21";
81                                         function = "gsbi5";
82                                         drive-strength = <10>;
83                                         bias-none;
84                                 };
85
86                                 cs {
87                                         pins = "gpio20";
88                                         drive-strength = <12>;
89                                 };
90                         };
91                 };
92
93                 gsbi@16300000 {
94                         qcom,mode = <GSBI_PROT_I2C_UART>;
95                         status = "ok";
96                         serial@16340000 {
97                                 status = "ok";
98                         };
99                         /*
100                          * The i2c device on gsbi4 should not be enabled.
101                          * On ipq806x designs gsbi4 i2c is meant for exclusive
102                          * RPM usage. Turning this on in kernel manifests as
103                          * i2c failure for the RPM.
104                          */
105                 };
106
107                 gsbi5: gsbi@1a200000 {
108                         qcom,mode = <GSBI_PROT_SPI>;
109                         status = "ok";
110
111                         spi4: spi@1a280000 {
112                                 status = "ok";
113                                 spi-max-frequency = <50000000>;
114                                 pinctrl-0 = <&spi_pins>;
115                                 pinctrl-names = "default";
116
117                                 cs-gpios = <&qcom_pinmux 20 GPIO_ACTIVE_HIGH>;
118
119                                 flash: m25p80@0 {
120                                         compatible = "s25fl512s";
121                                         #address-cells = <1>;
122                                         #size-cells = <1>;
123                                         spi-max-frequency = <51200000>;
124                                         reg = <0>;
125
126                                         linux,part-probe = "qcom-smem";
127                                 };
128                         };
129                 };
130
131                 phy@100f8800 {          /* USB3 port 1 HS phy */
132                         status = "ok";
133                 };
134
135                 phy@100f8830 {          /* USB3 port 1 SS phy */
136                         status = "ok";
137                 };
138
139                 phy@110f8800 {          /* USB3 port 0 HS phy */
140                         status = "ok";
141                 };
142
143                 phy@110f8830 {          /* USB3 port 0 SS phy */
144                         status = "ok";
145                 };
146
147                 usb30@0 {
148                         status = "ok";
149                 };
150
151                 usb30@1 {
152                         status = "ok";
153                 };
154
155                 pcie0: pci@1b500000 {
156                         status = "ok";
157                         reset-gpio = <&qcom_pinmux 3 GPIO_ACTIVE_LOW>;
158                         pinctrl-0 = <&pcie0_pins>;
159                         pinctrl-names = "default";
160                 };
161
162                 pcie1: pci@1b700000 {
163                         status = "ok";
164                         reset-gpio = <&qcom_pinmux 48 GPIO_ACTIVE_LOW>;
165                         pinctrl-0 = <&pcie1_pins>;
166                         pinctrl-names = "default";
167                 };
168
169                 mdio0: mdio {
170                         compatible = "virtual,mdio-gpio";
171                         #address-cells = <1>;
172                         #size-cells = <0>;
173                         gpios = <&qcom_pinmux 1 0 &qcom_pinmux 0 0>;
174
175                         phy0: ethernet-phy@0 {
176                                 device_type = "ethernet-phy";
177                                 reg = <0>;
178                                 qca,ar8327-initvals = <
179                                         0x00004 0x7600000   /* PAD0_MODE */
180                                         0x00008 0x1000000   /* PAD5_MODE */
181                                         0x0000c 0x80        /* PAD6_MODE */
182                                         0x000e4 0xaa545     /* MAC_POWER_SEL */
183                                         0x000e0 0xc74164de  /* SGMII_CTRL */
184                                         0x0007c 0x4e        /* PORT0_STATUS */
185                                         0x00094 0x4e        /* PORT6_STATUS */
186                                         0x00970 0x1e864443  /* QM_PORT0_CTRL0 */
187                                         0x00974 0x000001c6  /* QM_PORT0_CTRL1 */
188                                         0x00978 0x19008643  /* QM_PORT1_CTRL0 */
189                                         0x0097c 0x000001c6  /* QM_PORT1_CTRL1 */
190                                         0x00980 0x19008643  /* QM_PORT2_CTRL0 */
191                                         0x00984 0x000001c6  /* QM_PORT2_CTRL1 */
192                                         0x00988 0x19008643  /* QM_PORT3_CTRL0 */
193                                         0x0098c 0x000001c6  /* QM_PORT3_CTRL1 */
194                                         0x00990 0x19008643  /* QM_PORT4_CTRL0 */
195                                         0x00994 0x000001c6  /* QM_PORT4_CTRL1 */
196                                         0x00998 0x1e864443  /* QM_PORT5_CTRL0 */
197                                         0x0099c 0x000001c6  /* QM_PORT5_CTRL1 */
198                                         0x009a0 0x1e864443  /* QM_PORT6_CTRL0 */
199                                         0x009a4 0x000001c6  /* QM_PORT6_CTRL1 */
200                                         >;
201                         };
202
203                         phy4: ethernet-phy@4 {
204                                 device_type = "ethernet-phy";
205                                 reg = <4>;
206                                 qca,ar8327-initvals = <
207                                         0x000e4 0x6a545     /* MAC_POWER_SEL */
208                                         0x0000c 0x80        /* PAD6_MODE */
209                                         >;
210                         };
211                 };
212
213                 gmac1: ethernet@37200000 {
214                         status = "ok";
215                         phy-mode = "rgmii";
216                         qcom,id = <1>;
217                         qcom,phy_mdio_addr = <4>;
218                         qcom,poll_required = <0>;
219                         qcom,rgmii_delay = <1>;
220                         qcom,phy_mii_type = <0>;
221                         qcom,emulation = <0>;
222                         qcom,irq = <255>;
223                         mdiobus = <&mdio0>;
224
225                         fixed-link {
226                                 speed = <1000>;
227                                 full-duplex;
228                         };
229                 };
230
231                 gmac2: ethernet@37400000 {
232                         status = "ok";
233                         phy-mode = "sgmii";
234                         qcom,id = <2>;
235                         qcom,phy_mdio_addr = <0>;       /* none */
236                         qcom,poll_required = <0>;       /* no polling */
237                         qcom,rgmii_delay = <0>;
238                         qcom,phy_mii_type = <1>;
239                         qcom,emulation = <0>;
240                         qcom,irq = <258>;
241                         mdiobus = <&mdio0>;
242
243                         fixed-link {
244                                 speed = <1000>;
245                                 full-duplex;
246                         };
247                 };
248
249                 rpm@108000 {
250                         pinctrl-0 = <&i2c4_pins>;
251                         pinctrl-names = "default";
252                 };
253
254                 amba {
255                         sdcc1: sdcc@12400000 {
256                                 status          = "okay";
257                                 dmas = <&sdcc1bam 2>, <&sdcc1bam 1>;
258                                 dma-names = "tx", "rx";
259                         };
260                 };
261
262
263
264         };
265
266         gpio-keys {
267                 compatible = "gpio-keys";
268                 wifi {
269                         label = "wifi";
270                         gpios = <&qcom_pinmux 6 GPIO_ACTIVE_LOW>;
271                         linux,code = <KEY_RFKILL>;
272                 };
273
274                 reset {
275                         label = "reset";
276                         gpios = <&qcom_pinmux 54 GPIO_ACTIVE_LOW>;
277                         linux,code = <KEY_RESTART>;
278                 };
279
280                 wps {
281                         label = "wps";
282                         gpios = <&qcom_pinmux 65 GPIO_ACTIVE_LOW>;
283                         linux,code = <KEY_WPS_BUTTON>;
284                 };
285         };
286
287         gpio-leds {
288                 compatible = "gpio-leds";
289                 internet {
290                         label = "nbg6817:white:internet";
291                         gpios = <&qcom_pinmux 64 GPIO_ACTIVE_HIGH>;
292                 };
293
294                 power {
295                         label = "nbg6817:white:power";
296                         gpios = <&qcom_pinmux 9 GPIO_ACTIVE_HIGH>;
297                         default-state = "on";
298                 };
299
300                 wifi {
301                         label = "nbg6817:amber:wifi";
302                         gpios = <&qcom_pinmux 33 GPIO_ACTIVE_HIGH>;
303                 };
304
305                 wifi5g {
306                         label = "nbg6817:amber:wifi5g";
307                         gpios = <&qcom_pinmux 26 GPIO_ACTIVE_HIGH>;
308                 };
309         };
310
311         gpio_export {
312                 compatible = "gpio-export";
313                 #size-cells = <0>;
314
315                 usb0_status {
316                         gpio-export,name = "usb0";
317                         gpio-export,output = <1>;
318                         gpios = <&qcom_pinmux 15 GPIO_ACTIVE_HIGH>;
319                 };
320
321                 usb1_status {
322                         gpio-export,name = "usb1";
323                         gpio-export,output = <1>;
324                         gpios = <&qcom_pinmux 16 GPIO_ACTIVE_HIGH>;
325                 };
326                 usb1_power {
327                         gpio-export,name = "usb1_power";
328                         gpio-export,output = <1>;
329                         gpios = <&qcom_pinmux 14 GPIO_ACTIVE_HIGH>;
330                 };
331                 usb2_power {
332                         gpio-export,name = "usb2_power";
333                         gpio-export,output = <1>;
334                         gpios = <&qcom_pinmux 17 GPIO_ACTIVE_HIGH>;
335                 };
336         };
337 };
338
339 &adm_dma {
340         status = "ok";
341 };