ramips: fix switch setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7620a_tplink_archer-c2-v1.dts
1 /dts-v1/;
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "tplink,archer-c2-v1", "ralink,mt7620a-soc";
10         model = "TP-Link Archer C2 v1";
11
12         aliases {
13                 led-boot = &led_wps;
14                 led-failsafe = &led_wps;
15                 led-running = &led_wps;
16                 led-upgrade = &led_wps;
17         };
18
19         chosen {
20                 bootargs = "console=ttyS0,115200";
21         };
22
23         leds {
24                 compatible = "gpio-leds";
25
26                 lan {
27                         label = "archer-c2-v1:green:lan";
28                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
29                 };
30
31                 usb {
32                         label = "archer-c2-v1:green:usb";
33                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
34                         trigger-sources = <&ohci_port1>, <&ehci_port1>;
35                         linux,default-trigger = "usbport";
36                 };
37
38                 led_wps: wps {
39                         label = "archer-c2-v1:green:wps";
40                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
41                 };
42
43                 wan {
44                         label = "archer-c2-v1:green:wan";
45                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
46                 };
47
48                 wlan {
49                         label = "archer-c2-v1:green:wlan";
50                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
51                 };
52         };
53
54         keys {
55                 compatible = "gpio-keys";
56
57                 reset_wps {
58                         label = "reset_wps";
59                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
60                         linux,code = <KEY_RESTART>;
61                 };
62
63                 rfkill {
64                         label = "rfkill";
65                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
66                         linux,code = <KEY_RFKILL>;
67                 };
68         };
69
70         rtl8367rb {
71                 compatible = "realtek,rtl8367b", "rtl8367b";
72                 cpu_port = <6>;
73                 realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
74                 mii-bus = <&mdio0>;
75         };
76 };
77
78 &spi0 {
79         status = "okay";
80
81         m25p80@0 {
82                 compatible = "jedec,spi-nor";
83                 reg = <0>;
84                 spi-max-frequency = <10000000>;
85
86                 partitions {
87                         compatible = "fixed-partitions";
88                         #address-cells = <1>;
89                         #size-cells = <1>;
90
91                         partition@0 {
92                                 label = "u-boot";
93                                 reg = <0x0 0x20000>;
94                                 read-only;
95                         };
96
97                         partition@20000 {
98                                 compatible = "tplink,firmware";
99                                 label = "firmware";
100                                 reg = <0x20000 0x7a0000>;
101                         };
102
103                         partition@7c0000 {
104                                 label = "config";
105                                 reg = <0x7c0000 0x10000>;
106                                 read-only;
107                         };
108
109                         rom: partition@7d0000 {
110                                 label = "rom";
111                                 reg = <0x7d0000 0x10000>;
112                                 read-only;
113                         };
114
115                         partition@7e0000 {
116                                 label = "romfile";
117                                 reg = <0x7e0000 0x10000>;
118                                 read-only;
119                         };
120
121                         radio: partition@7f0000 {
122                                 label = "radio";
123                                 reg = <0x7f0000 0x10000>;
124                                 read-only;
125                         };
126                 };
127         };
128 };
129
130 &ethernet {
131         status = "okay";
132         mtd-mac-address = <&rom 0xf100>;
133         pinctrl-names = "default";
134         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
135
136         port@5 {
137                 status = "okay";
138                 mediatek,fixed-link = <1000 1 1 1>;
139                 phy-mode = "rgmii";
140         };
141
142         mdio0: mdio-bus {
143                 status = "okay";
144         };
145 };
146
147 &gpio1 {
148         status = "okay";
149 };
150
151 &gpio2 {
152         status = "okay";
153 };
154
155 &gpio3 {
156         status = "okay";
157 };
158
159 &state_default {
160         gpio {
161                 ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk";
162                 ralink,function = "gpio";
163         };
164 };
165
166 &wmac {
167         ralink,mtd-eeprom = <&radio 0>;
168         mtd-mac-address = <&rom 0xf100>;
169 };
170
171 &ehci {
172         status = "okay";
173 };
174
175 &ohci {
176         status = "okay";
177 };
178
179 &pcie {
180         status = "okay";
181 };
182
183 &pcie0 {
184         mt76@0,0 {
185                 reg = <0x0000 0 0 0 0>;
186                 mediatek,mtd-eeprom = <&radio 0x8000>;
187         };
188 };