ramips: mt7621: convert Linksys devices EEPROM to NVMEM format
[openwrt/openwrt.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 nvmem-layout {
166 compatible = "fixed-layout";
167 #address-cells = <1>;
168 #size-cells = <1>;
169
170 eeprom_radio_0: eeprom@0 {
171 reg = <0x0 0xe00>;
172 };
173
174 precal_radio_e10: precal@e10 {
175 reg = <0xe10 0x19c10>;
176 };
177 };
178 };
179
180 partition@b0000 {
181 label = "config_bak";
182 reg = <0xb0000 0x10000>;
183 read-only;
184 };
185
186 partition@c0000 {
187 compatible = "denx,fit";
188 label = "firmware";
189 reg = <0xc0000 0xf30000>;
190 };
191 };
192 };
193 };
194
195 &pcie {
196 status = "okay";
197 };
198
199 &pcie1 {
200 wifi@0,0 {
201 compatible = "mediatek,mt76";
202 reg = <0x0000 0 0 0 0>;
203 nvmem-cells = <&eeprom_radio_0>, <&precal_radio_e10>, <&macaddr_rom_file_f100 0>;
204 nvmem-cell-names = "eeprom", "precal", "mac-address";
205 mediatek,disable-radar-background;
206 };
207 };
208
209 &gmac0 {
210 nvmem-cells = <&macaddr_rom_file_f100 0>;
211 nvmem-cell-names = "mac-address";
212 };
213
214 &gmac1 {
215 status = "okay";
216 label = "wan";
217 phy-handle = <&ethphy4>;
218
219 nvmem-cells = <&macaddr_rom_file_f100 1>;
220 nvmem-cell-names = "mac-address";
221 };
222
223 &mdio {
224 ethphy4: ethernet-phy@4 {
225 reg = <4>;
226 };
227 };
228
229 &switch0 {
230 ports {
231 port@0 {
232 status = "okay";
233 label = "lan1";
234 };
235
236 port@1 {
237 status = "okay";
238 label = "lan2";
239 };
240
241 port@2 {
242 status = "okay";
243 label = "lan3";
244 };
245
246 port@3 {
247 status = "okay";
248 label = "lan4";
249 };
250 };
251 };
252
253 &state_default {
254 gpio {
255 groups = "i2c", "uart3", "jtag", "wdt";
256 function = "gpio";
257 };
258 };