ramips: set usb led trigger via devicetree
[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                         trigger-sources = <&ohci_port1>, <&ehci_port1>;
63                         linux,default-trigger = "usbport";
64                 };
65         };
66
67
68         gpio_export {
69                 compatible = "gpio-export";
70                 #size-cells = <0>;
71                 usb-power {
72                         gpio-export,name="usb-power";
73                         gpio-export,output=<1>;
74                         gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>;
75                 };
76         };
77 };
78
79
80 &gpio2 {
81         status = "okay";
82 };
83
84 &spi0 {
85         status = "okay";
86
87         flash@0 {
88                 compatible = "jedec,spi-nor";
89                 reg = <0 0>;
90                 spi-max-frequency = <10000000>;
91
92                 partitions {
93                         compatible = "fixed-partitions";
94                         #address-cells = <1>;
95                         #size-cells = <1>;
96
97                         partition@0 {
98                                 label = "u-boot";
99                                 reg = <0x0 0x30000>;
100                                 read-only;
101                         };
102
103                         partition@30000 {
104                                 label = "u-boot-env";
105                                 reg = <0x30000 0x10000>;
106                                 read-only;
107                         };
108
109                         factory: partition@40000 {
110                                 label = "factory";
111                                 reg = <0x40000 0x10000>;
112                                 read-only;
113                         };
114
115                         partition@50000 {
116                                 label = "cimage";
117                                 reg = <0x50000 0x20000>;
118                                 read-only;
119                         };
120
121                         partition@70000 {
122                                 label = "firmware";
123                                 reg = <0x00070000 0x00790000>;
124                         };
125                 };
126         };
127 };
128
129 &pinctrl {
130         state_default: pinctrl0 {
131                 gpio {
132                         ralink,group = "i2c", "uartf", "nd_sd";
133                         ralink,function = "gpio";
134                 };
135         };
136 };
137
138 &ethernet {
139         status = "okay";
140         mtd-mac-address = <&factory 0x4>;
141         pinctrl-names = "default";
142         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
143         mediatek,portmap = "wllll";
144
145         port@5 {
146                 status = "okay";
147                 mediatek,fixed-link = <1000 1 1 1>;
148                 phy-mode = "rgmii";
149         };
150
151         mdio-bus {
152                 status = "okay";
153
154                 phy0: ethernet-phy@0 {
155                         reg = <0>;
156                         phy-mode = "rgmii";
157                 };
158
159                 phy1: ethernet-phy@1 {
160                         reg = <1>;
161                         phy-mode = "rgmii";
162                 };
163
164                 phy2: ethernet-phy@2 {
165                         reg = <2>;
166                         phy-mode = "rgmii";
167                 };
168
169                 phy3: ethernet-phy@3 {
170                         reg = <3>;
171                         phy-mode = "rgmii";
172                 };
173
174                 phy4: ethernet-phy@4 {
175                         reg = <4>;
176                         phy-mode = "rgmii";
177                 };
178
179                 phy1f: ethernet-phy@1f {
180                         reg = <0x1f>;
181                         phy-mode = "rgmii";
182                 };
183         };
184 };
185
186 &gsw {
187         mediatek,port4 = "gmac";
188 };
189
190 &wmac {
191         ralink,mtd-eeprom = <&factory 0>;
192 };
193
194 &pcie {
195         status = "okay";
196 };
197
198 &pcie0 {
199         wifi@0,0 {
200                 reg = <0x0000 0 0 0 0>;
201                 mediatek,mtd-eeprom = <&factory 0x8000>;
202                 mediatek,2ghz = <0>;
203         };
204 };
205
206 &ehci {
207         status = "okay";
208 };
209
210 &ohci {
211         status = "okay";
212 };