ramips: Add support for Cudy WR1300 v3
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_wavlink_wl-wn579x3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "wavlink,wl-wn579x3", "ralink,mt7620a-soc";
10 model = "Wavlink WL-WN579X3";
11
12 aliases {
13 led-boot = &led_wps;
14 led-failsafe = &led_wps;
15 led-running = &led_wps;
16 led-upgrade = &led_wps;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 reset {
23 label = "reset";
24 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RESTART>;
26 };
27
28 wps {
29 label = "wps";
30 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_WPS_BUTTON>;
32 };
33
34 switch_aps {
35 label = "mode_aps";
36 gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
37 linux,code = <BTN_1>;
38 linux,input-type = <EV_SW>;
39 };
40
41 switch_repeater {
42 label = "mode_repeater";
43 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
44 linux,code = <BTN_0>;
45 linux,input-type = <EV_SW>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 led_wps: wps {
53 label = "blue:wps";
54 gpios = <&gpio2 2 GPIO_ACTIVE_LOW>;
55 };
56
57 lan {
58 label = "blue:lan";
59 gpios = <&gpio2 4 GPIO_ACTIVE_LOW>;
60 };
61
62 wan {
63 label = "blue:wan";
64 gpios = <&gpio2 1 GPIO_ACTIVE_LOW>;
65 };
66
67 wifi {
68 label = "blue:wifi";
69 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
70 };
71
72 /* These three form the signal wifi strength segments */
73 wifi_high {
74 label = "blue:wifi_high";
75 gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
76 };
77
78 wifi_medium {
79 label = "blue:wifi_medium";
80 gpios = <&gpio0 12 GPIO_ACTIVE_LOW>;
81 };
82
83 wifi_low {
84 label = "blue:wifi_low";
85 gpios = <&gpio2 3 GPIO_ACTIVE_LOW>;
86 };
87 };
88 };
89
90 &gpio2 {
91 status = "okay";
92 };
93
94 &gpio3 {
95 status = "okay";
96 };
97
98 &spi0 {
99 status = "okay";
100
101 flash@0 {
102 compatible = "jedec,spi-nor";
103 reg = <0>;
104 spi-max-frequency = <50000000>;
105
106 partitions {
107 compatible = "fixed-partitions";
108 #address-cells = <1>;
109 #size-cells = <1>;
110
111 partition@0 {
112 label = "u-boot";
113 reg = <0x0 0x30000>;
114 read-only;
115 };
116
117 partition@30000 {
118 label = "config";
119 reg = <0x30000 0x10000>;
120 read-only;
121 };
122
123 factory: partition@40000 {
124 compatible = "nvmem-cells";
125 label = "factory";
126 reg = <0x40000 0x10000>;
127 #address-cells = <1>;
128 #size-cells = <1>;
129 read-only;
130
131 eeprom_factory_0: eeprom@0 {
132 reg = <0x0 0x200>;
133 };
134
135 eeprom_factory_8000: eeprom@8000 {
136 reg = <0x8000 0x200>;
137 };
138
139 macaddr_factory_28: macaddr@28 {
140 reg = <0x28 0x6>;
141 };
142 };
143
144 partition@50000 {
145 compatible = "denx,uimage";
146 label = "firmware";
147 reg = <0x50000 0x790000>;
148 };
149
150 partition@7e0000 {
151 label = "board_data";
152 reg = <0x7e0000 0x10000>;
153 read-only;
154 };
155
156 partition@7f0000 {
157 label = "nvram";
158 reg = <0x7f0000 0x10000>;
159 read-only;
160 };
161 };
162 };
163 };
164
165 &pcie {
166 status = "okay";
167 };
168
169 &pcie0 {
170 wifi@0,0 {
171 reg = <0x0000 0 0 0 0>;
172 nvmem-cells = <&eeprom_factory_8000>;
173 nvmem-cell-names = "eeprom";
174 ieee80211-freq-limit = <5000000 6000000>;
175 };
176 };
177
178 &ethernet {
179 pinctrl-names = "default";
180 pinctrl-0 = <&rgmii1_pins &rgmii2_pins &mdio_pins>;
181
182 nvmem-cells = <&macaddr_factory_28>;
183 nvmem-cell-names = "mac-address";
184
185 mediatek,portmap = "llllw";
186
187 port@4 {
188 status = "okay";
189 phy-handle = <&phy4>;
190 phy-mode = "rgmii";
191 };
192
193 port@5 {
194 status = "okay";
195 phy-handle = <&phy5>;
196 phy-mode = "rgmii";
197 };
198
199 mdio-bus {
200 status = "okay";
201
202 phy4: ethernet-phy@4 {
203 reg = <4>;
204 phy-mode = "rgmii";
205 };
206
207 phy5: ethernet-phy@5 {
208 reg = <5>;
209 phy-mode = "rgmii";
210 };
211 };
212 };
213
214 &gsw {
215 mediatek,port4-gmac;
216 mediatek,ephy-base = /bits/ 8 <8>;
217 };
218
219 &wmac {
220 nvmem-cells = <&eeprom_factory_0>;
221 nvmem-cell-names = "eeprom";
222 };
223
224 &state_default {
225 gpio {
226 groups = "ephy", "i2c", "wled", "uartf";
227 function = "gpio";
228 };
229 };