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