ramips: fix BR-6478ACv2 support
[oweals/openwrt.git] / target / linux / ramips / dts / BR-6478AC-V2.dts
1 /*
2  * Device Tree file for the Edimax BR-6478AC V2
3  * based on Linksys E1700
4  *
5  * Copyright (C) 2016 Rohan Murch <rohan.murch@gmail.com>
6  * Copyright (C) 2016 Hans Ulli Kroll <ulli.kroll@googlemail.com>
7  * Copyright (C) 2017 James McKenzie <openwrt@madingley.org>
8  *
9  * This file is licensed under the terms of the GNU General Public
10  * License version 2.  This program is licensed "as is" without any
11  * warranty of any kind, whether express or implied.
12  */
13
14 /dts-v1/;
15
16 #include "mt7620a.dtsi"
17
18 #include <dt-bindings/gpio/gpio.h>
19 #include <dt-bindings/input/input.h>
20
21 / {
22         compatible = "edimax,br-6478ac-v2", "ralink,mt7620a-soc";
23         model = "Edimax BR-6478AC v2";
24
25         aliases {
26                 led-status = &led_power;
27         };
28
29         chosen {
30                 bootargs = "console=ttyS0,57600";
31         };
32
33         gpio-keys-polled {
34                 compatible = "gpio-keys-polled";
35                 poll-interval = <20>;
36
37                 reset_wps {
38                         label = "reset_wps";
39                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
40                         linux,code = <KEY_RESTART>;
41                 };
42         };
43
44         gpio-leds {
45                 compatible = "gpio-leds";
46
47                 led_power: power {
48                         label = "br-6478ac-v2:white:power";
49                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
50                 };
51                 internet {
52                         label = "br-6478ac-v2:blue:internet";
53                         gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
54                 };
55                 wlan {
56                         label = "br-6478ac-v2:blue:wlan";
57                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
58                 };
59                 usb {
60                         label = "br-6478ac-v2:blue:usb";
61                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
62                 };
63         };
64
65
66         gpio_export {
67                 compatible = "gpio-export";
68                 #size-cells = <0>;
69                 usb-power {
70                         gpio-export,name="usb-power";
71                         gpio-export,output=<1>;
72                         gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
73                 };
74         };
75 };
76
77
78 &gpio2 {
79         status = "okay";
80 };
81
82 &spi0 {
83         status = "okay";
84
85         flash@0 {
86                 compatible = "jedec,spi-nor";
87                 reg = <0 0>;
88                 spi-max-frequency = <10000000>;
89
90                 partitions {
91                         compatible = "fixed-partitions";
92                         #address-cells = <1>;
93                         #size-cells = <1>;
94
95                         partition@0 {
96                                 label = "u-boot";
97                                 reg = <0x0 0x30000>;
98                                 read-only;
99                         };
100
101                         partition@30000 {
102                                 label = "u-boot-env";
103                                 reg = <0x30000 0x10000>;
104                                 read-only;
105                         };
106
107                         factory: partition@40000 {
108                                 label = "factory";
109                                 reg = <0x40000 0x10000>;
110                                 read-only;
111                         };
112
113                         partition@50000 {
114                                 label = "cimage";
115                                 reg = <0x50000 0x20000>;
116                                 read-only;
117                         };
118
119                         partition@70000 {
120                                 label = "firmware";
121                                 reg = <0x00070000 0x00790000>;
122                         };
123                 };
124         };
125 };
126
127 &pinctrl {
128         state_default: pinctrl0 {
129                 gpio {
130                         ralink,group = "i2c", "uartf", "nd_sd";
131                         ralink,function = "gpio";
132                 };
133         };
134 };
135
136 &ethernet {
137         status = "okay";
138         mtd-mac-address = <&factory 0x4>;
139         pinctrl-names = "default";
140         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
141         mediatek,portmap = "wllll";
142
143         port@5 {
144                 status = "okay";
145                 mediatek,fixed-link = <1000 1 1 1>;
146                 phy-mode = "rgmii";
147         };
148
149         mdio-bus {
150                 status = "okay";
151
152                 phy0: ethernet-phy@0 {
153                         reg = <0>;
154                         phy-mode = "rgmii";
155                 };
156
157                 phy1: ethernet-phy@1 {
158                         reg = <1>;
159                         phy-mode = "rgmii";
160                 };
161
162                 phy2: ethernet-phy@2 {
163                         reg = <2>;
164                         phy-mode = "rgmii";
165                 };
166
167                 phy3: ethernet-phy@3 {
168                         reg = <3>;
169                         phy-mode = "rgmii";
170                 };
171
172                 phy4: ethernet-phy@4 {
173                         reg = <4>;
174                         phy-mode = "rgmii";
175                 };
176
177                 phy1f: ethernet-phy@1f {
178                         reg = <0x1f>;
179                         phy-mode = "rgmii";
180                 };
181         };
182 };
183
184 &gsw {
185         mediatek,port4 = "gmac";
186 };
187
188 &wmac {
189         ralink,mtd-eeprom = <&factory 0>;
190 };
191
192 &pcie {
193         status = "okay";
194 };
195
196 &pcie0 {
197         wifi@0,0 {
198                 reg = <0x0000 0 0 0 0>;
199                 mediatek,mtd-eeprom = <&factory 0x8000>;
200                 mediatek,2ghz = <0>;
201         };
202 };
203
204 &ehci {
205         status = "okay";
206 };
207
208 &ohci {
209         status = "okay";
210 };