rockchip: add Radxa CM3 IO board support
[openwrt/staging/jow.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 color = <LED_COLOR_ID_GREEN>;
86 function = LED_FUNCTION_POWER;
87 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
88 };
89 };
90 };
91
92 &spi0 {
93 status = "okay";
94
95 flash@0 {
96 compatible = "jedec,spi-nor";
97 reg = <0>;
98 spi-max-frequency = <25000000>;
99
100 partitions {
101 compatible = "fixed-partitions";
102 #address-cells = <1>;
103 #size-cells = <1>;
104
105 partition@0 {
106 label = "boot";
107 reg = <0x00 0x30000>;
108 read-only;
109 };
110
111 partition@30000 {
112 label = "boot-env";
113 reg = <0x30000 0x10000>;
114 read-only;
115 };
116
117 partition@40000 {
118 label = "factory";
119 reg = <0x40000 0x10000>;
120 read-only;
121 };
122
123 partition@50000 {
124 label = "config";
125 reg = <0x50000 0x10000>;
126 read-only;
127 };
128
129 partition@60000 {
130 label = "isp_config";
131 reg = <0x60000 0x10000>;
132 read-only;
133 };
134
135 partition@70000 {
136 label = "rom_file";
137 reg = <0x70000 0x10000>;
138 read-only;
139
140 nvmem-layout {
141 compatible = "fixed-layout";
142 #address-cells = <1>;
143 #size-cells = <1>;
144
145 macaddr_rom_file_f100: macaddr@f100 {
146 compatible = "mac-base";
147 reg = <0xf100 0x6>;
148 #nvmem-cell-cells = <1>;
149 };
150 };
151 };
152
153 partition@80000 {
154 label = "cloud";
155 reg = <0x80000 0x10000>;
156 read-only;
157 };
158
159 radio: partition@90000 {
160 label = "radio";
161 reg = <0x90000 0x20000>;
162 read-only;
163
164 nvmem-layout {
165 compatible = "fixed-layout";
166 #address-cells = <1>;
167 #size-cells = <1>;
168
169 eeprom_radio_0: eeprom@0 {
170 reg = <0x0 0xe00>;
171 };
172
173 precal_radio_e10: precal@e10 {
174 reg = <0xe10 0x19c10>;
175 };
176 };
177 };
178
179 partition@b0000 {
180 label = "config_bak";
181 reg = <0xb0000 0x10000>;
182 read-only;
183 };
184
185 partition@c0000 {
186 compatible = "denx,fit";
187 label = "firmware";
188 reg = <0xc0000 0xf30000>;
189 };
190 };
191 };
192 };
193
194 &pcie {
195 status = "okay";
196 };
197
198 &pcie1 {
199 wifi@0,0 {
200 compatible = "mediatek,mt76";
201 reg = <0x0000 0 0 0 0>;
202 nvmem-cells = <&eeprom_radio_0>, <&precal_radio_e10>, <&macaddr_rom_file_f100 0>;
203 nvmem-cell-names = "eeprom", "precal", "mac-address";
204 mediatek,disable-radar-background;
205 };
206 };
207
208 &gmac0 {
209 nvmem-cells = <&macaddr_rom_file_f100 0>;
210 nvmem-cell-names = "mac-address";
211 };
212
213 &gmac1 {
214 status = "okay";
215 label = "wan";
216 phy-handle = <&ethphy4>;
217
218 nvmem-cells = <&macaddr_rom_file_f100 1>;
219 nvmem-cell-names = "mac-address";
220 };
221
222 &mdio {
223 ethphy4: ethernet-phy@4 {
224 reg = <4>;
225 };
226 };
227
228 &switch0 {
229 ports {
230 port@0 {
231 status = "okay";
232 label = "lan1";
233 };
234
235 port@1 {
236 status = "okay";
237 label = "lan2";
238 };
239
240 port@2 {
241 status = "okay";
242 label = "lan3";
243 };
244
245 port@3 {
246 status = "okay";
247 label = "lan4";
248 };
249 };
250 };
251
252 &state_default {
253 gpio {
254 groups = "i2c", "uart3", "jtag", "wdt";
255 function = "gpio";
256 };
257 };