ramips: add support for TP-Link EX220 v1
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_tplink_ex220-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "tplink,ex220-v1", "mediatek,mt7621-soc";
11 model = "TP-Link EX220 v1";
12
13 aliases {
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200";
23 };
24
25 keys {
26 compatible = "gpio-keys";
27
28 button-wps {
29 label = "rfkill";
30 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RFKILL>;
32 };
33
34 button-reset {
35 label = "reset";
36 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led-wps {
45 color = <LED_COLOR_ID_GREEN>;
46 function = LED_FUNCTION_WPS;
47 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
48 };
49
50 led-lan {
51 color = <LED_COLOR_ID_GREEN>;
52 function = LED_FUNCTION_LAN;
53 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
54 };
55
56 led-wan-orange {
57 color = <LED_COLOR_ID_AMBER>;
58 function = LED_FUNCTION_WAN;
59 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
60 };
61
62 led-wan-green {
63 color = <LED_COLOR_ID_GREEN>;
64 function = LED_FUNCTION_WAN;
65 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
66 };
67
68 led-wifi5g {
69 color = <LED_COLOR_ID_GREEN>;
70 function = LED_FUNCTION_WLAN;
71 function-enumerator = <5>;
72 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
73 linux,default-trigger = "phy1tpt";
74 };
75
76 led-wifi2g {
77 color = <LED_COLOR_ID_GREEN>;
78 function = LED_FUNCTION_WLAN;
79 function-enumerator = <2>;
80 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
81 linux,default-trigger = "phy0tpt";
82 };
83
84 led_power: led-power {
85 label = "green:power"; // to be removed once #13837 is merged
86 color = <LED_COLOR_ID_GREEN>;
87 function = LED_FUNCTION_POWER;
88 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
89 };
90 };
91 };
92
93 &spi0 {
94 status = "okay";
95
96 flash@0 {
97 compatible = "jedec,spi-nor";
98 reg = <0>;
99 spi-max-frequency = <25000000>;
100
101 partitions {
102 compatible = "fixed-partitions";
103 #address-cells = <1>;
104 #size-cells = <1>;
105
106 partition@0 {
107 label = "boot";
108 reg = <0x00 0x30000>;
109 read-only;
110 };
111
112 partition@30000 {
113 label = "boot-env";
114 reg = <0x30000 0x10000>;
115 read-only;
116 };
117
118 partition@40000 {
119 label = "factory";
120 reg = <0x40000 0x10000>;
121 read-only;
122 };
123
124 partition@50000 {
125 label = "config";
126 reg = <0x50000 0x10000>;
127 read-only;
128 };
129
130 partition@60000 {
131 label = "isp_config";
132 reg = <0x60000 0x10000>;
133 read-only;
134 };
135
136 partition@70000 {
137 label = "rom_file";
138 reg = <0x70000 0x10000>;
139 read-only;
140
141 nvmem-layout {
142 compatible = "fixed-layout";
143 #address-cells = <1>;
144 #size-cells = <1>;
145
146 macaddr_rom_file_f100: macaddr@f100 {
147 compatible = "mac-base";
148 reg = <0xf100 0x6>;
149 #nvmem-cell-cells = <1>;
150 };
151 };
152 };
153
154 partition@80000 {
155 label = "cloud";
156 reg = <0x80000 0x10000>;
157 read-only;
158 };
159
160 radio: partition@90000 {
161 label = "radio";
162 reg = <0x90000 0x20000>;
163 read-only;
164 };
165
166 partition@b0000 {
167 label = "config_bak";
168 reg = <0xb0000 0x10000>;
169 read-only;
170 };
171
172 partition@c0000 {
173 compatible = "denx,fit";
174 label = "firmware";
175 reg = <0xc0000 0xf30000>;
176 };
177 };
178 };
179 };
180
181 &pcie {
182 status = "okay";
183 };
184
185 &pcie1 {
186 wifi@0,0 {
187 compatible = "mediatek,mt76";
188 reg = <0x0000 0 0 0 0>;
189 mediatek,mtd-eeprom = <&radio 0x0>;
190 nvmem-cells = <&macaddr_rom_file_f100 0>;
191 nvmem-cell-names = "mac-address";
192 mediatek,disable-radar-background;
193 };
194 };
195
196 &gmac0 {
197 nvmem-cells = <&macaddr_rom_file_f100 0>;
198 nvmem-cell-names = "mac-address";
199 };
200
201 &gmac1 {
202 status = "okay";
203 label = "wan";
204 phy-handle = <&ethphy4>;
205
206 nvmem-cells = <&macaddr_rom_file_f100 1>;
207 nvmem-cell-names = "mac-address";
208 };
209
210 &mdio {
211 ethphy4: ethernet-phy@4 {
212 reg = <4>;
213 };
214 };
215
216 &switch0 {
217 ports {
218 port@0 {
219 status = "okay";
220 label = "lan1";
221 };
222
223 port@1 {
224 status = "okay";
225 label = "lan2";
226 };
227
228 port@2 {
229 status = "okay";
230 label = "lan3";
231 };
232
233 port@3 {
234 status = "okay";
235 label = "lan4";
236 };
237 };
238 };
239
240 &state_default {
241 gpio {
242 groups = "i2c", "uart3", "jtag", "wdt";
243 function = "gpio";
244 };
245 };