ramips: Use dts alias based status led
[oweals/openwrt.git] / target / linux / ramips / dts / ArcherC2-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,c2-v1", "ralink,mt7620a-soc";
10         model = "TP-Link Archer C2 v1";
11
12         aliases {
13                 led-status = &led_wps;
14         };
15
16         chosen {
17                 bootargs = "console=ttyS0,115200";
18         };
19
20         pinctrl {
21                 state_default: pinctrl0 {
22                         gpio {
23                                 ralink,group = "i2c", "uartf", "wled", "ephy", "spi refclk";
24                                 ralink,function = "gpio";
25                         };
26                 };
27         };
28
29         gpio-leds {
30                 compatible = "gpio-leds";
31
32                 lan {
33                         label = "c2-v1:green:lan";
34                         gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
35                 };
36
37                 usb {
38                         label = "c2-v1:green:usb";
39                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
40                 };
41
42                 led_wps: wps {
43                         label = "c2-v1:green:wps";
44                         gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
45                 };
46
47                 wan {
48                         label = "c2-v1:green:wan";
49                         gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
50                 };
51
52                 wlan {
53                         label = "c2-v1:green:wlan";
54                         gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
55                 };
56         };
57
58         gpio-keys {
59                 compatible = "gpio-keys";
60
61                 reset_wps {
62                         label = "reset_wps";
63                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
64                         linux,code = <KEY_RESTART>;
65                 };
66
67                 rfkill {
68                         label = "rfkill";
69                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
70                         linux,code = <KEY_RFKILL>;
71                 };
72         };
73
74         rtl8367rb {
75                 compatible = "realtek,rtl8367b", "rtl8367b";
76                 cpu_port = <6>;
77                 realtek,extif1 = <1 0 1 1 1 1 1 1 2>;
78                 mii-bus = <&mdio0>;
79         };
80 };
81
82 &spi0 {
83         status = "okay";
84
85         m25p80@0 {
86                 #address-cells = <1>;
87                 #size-cells = <1>;
88                 compatible = "jedec,spi-nor";
89                 reg = <0>;
90                 spi-max-frequency = <10000000>;
91
92                 partition@0 {
93                         label = "u-boot";
94                         reg = <0x0 0x20000>;
95                         read-only;
96                 };
97
98                 partition@20000 {
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 &ethernet {
130         status = "okay";
131         mtd-mac-address = <&rom 0xf100>;
132         pinctrl-names = "default";
133         pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
134
135         port@5 {
136                 status = "okay";
137                 mediatek,fixed-link = <1000 1 1 1>;
138                 phy-mode = "rgmii";
139         };
140
141         mdio0: mdio-bus {
142                 status = "okay";
143         };
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 &wmac {
160         ralink,mtd-eeprom = <&radio 0>;
161         mtd-mac-address = <&rom 0xf100>;
162 };
163
164 &ehci {
165         status = "okay";
166 };
167
168 &ohci {
169         status = "okay";
170 };
171
172 &pcie {
173         status = "okay";
174
175         pcie-bridge {
176                 mt76@0,0 {
177                         reg = <0x0000 0 0 0 0>;
178                         device_type = "pci";
179                         mediatek,mtd-eeprom = <&radio 0x8000>;
180                 };
181         };
182 };