ramips: Add support for Cudy WR1300 v3
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_engenius_epg600.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "engenius,epg600", "ralink,mt7620a-soc";
10 model = "EnGenius EPG600";
11
12 aliases {
13 led-boot = &led_power;
14 led-failsafe = &led_power;
15 led-running = &led_power;
16 led-upgrade = &led_power;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 keys {
24 compatible = "gpio-keys";
25
26 reset {
27 linux,code = <KEY_RESTART>;
28 gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
29 debounce-interval = <60>;
30 };
31
32 wps {
33 linux,code = <KEY_WPS_BUTTON>;
34 gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
35 debounce-interval = <60>;
36 };
37
38 reg {
39 linux,code = <BTN_0>;
40 gpios = <&gpio2 7 GPIO_ACTIVE_LOW>;
41 debounce-interval = <60>;
42 };
43 };
44
45 leds {
46 compatible = "gpio-leds";
47
48 led_power: power {
49 label = "amber:power";
50 gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
51 default-state = "on";
52 };
53
54 wlan2g {
55 label = "blue:wlan2g";
56 gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
57 linux,default-trigger = "phy1tpt";
58 };
59
60 wlan5g {
61 label = "blue:wlan5g";
62 gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
63 };
64
65 wps2g {
66 label = "blue:wps2g";
67 gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
68 };
69
70 wps5g {
71 label = "amber:wps5g";
72 gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
73 };
74
75 line {
76 label = "blue:line";
77 gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
78 };
79 };
80 };
81
82 &gpio1 {
83 status = "okay";
84 };
85
86 &gpio2 {
87 status = "okay";
88 };
89
90 &gpio3 {
91 status = "okay";
92 };
93
94 &spi0 {
95 status = "okay";
96
97 flash@0 {
98 compatible = "jedec,spi-nor";
99 reg = <0>;
100 spi-max-frequency = <30000000>;
101
102 partitions {
103 compatible = "fixed-partitions";
104 #address-cells = <1>;
105 #size-cells = <1>;
106
107 partition@0 {
108 label = "u-boot";
109 reg = <0x0 0x30000>;
110 read-only;
111 };
112
113 partition@30000 {
114 label = "u-boot-env";
115 reg = <0x30000 0x10000>;
116 };
117
118 factory: partition@40000 {
119 compatible = "nvmem-cells";
120 label = "factory";
121 reg = <0x40000 0x10000>;
122 #address-cells = <1>;
123 #size-cells = <1>;
124 read-only;
125
126 eeprom_factory_0: eeprom@0 {
127 reg = <0x0 0x200>;
128 };
129 };
130
131 rf: partition@50000 {
132 compatible = "nvmem-cells";
133 label = "rf";
134 reg = <0x50000 0x10000>;
135 #address-cells = <1>;
136 #size-cells = <1>;
137 read-only;
138
139 eeprom_rf_0: eeprom@0 {
140 reg = <0x0 0x200>;
141 };
142
143 macaddr_rf_4: macaddr@4 {
144 reg = <0x4 0x6>;
145 };
146 };
147
148 partition@60000 {
149 label = "firmware";
150 reg = <0x60000 0xf40000>;
151 compatible = "denx,uimage";
152 };
153
154 partition@fa0000 {
155 label = "backup";
156 reg = <0xfa0000 0x10000>;
157 read-only;
158 };
159
160 partition@fb0000 {
161 label = "storage";
162 reg = <0xfb0000 0x50000>;
163 read-only;
164 };
165 };
166 };
167 };
168
169 &ethernet {
170 pinctrl-names = "default";
171 pinctrl-0 = <&mdio_pins &rgmii1_pins &rgmii2_pins>;
172
173 nvmem-cells = <&macaddr_rf_4>;
174 nvmem-cell-names = "mac-address";
175
176 port@5 {
177 status = "okay";
178
179 phy-mode = "rgmii-txid";
180
181 mediatek,fixed-link = <1000 1 1 1>;
182 };
183
184 mdio-bus {
185 status = "okay";
186
187 ethernet-phy@0 {
188 reg = <0>;
189 phy-mode = "rgmii";
190
191 qca,ar8327-initvals = <
192 0x04 0x07600000 /* PORT0 PAD MODE CTRL */
193 0x08 0x01000000 /* PORT5 PAD MODE CTRL */
194 0x0c 0x07600000 /* PORT6 PAD MODE CTRL */
195 0x10 0x40000000 /* POWER-ON STRAPPING */
196 0x7c 0x0000007e /* PORT0_STATUS */
197 0x94 0x0000007e /* PORT6_STATUS */
198 >;
199 };
200 };
201 };
202
203 &gsw {
204 mediatek,ephy-disable;
205 };
206
207 &pcie {
208 status = "okay";
209 };
210
211 &pcie0 {
212 wifi@0,1,0 {
213 compatible = "pci1814,3091";
214 reg = <0x0 1 0 0 0>;
215 nvmem-cells = <&eeprom_factory_0>;
216 nvmem-cell-names = "eeprom";
217 };
218 };
219
220 &wmac {
221 nvmem-cells = <&eeprom_rf_0>;
222 nvmem-cell-names = "eeprom";
223 };
224
225 &ehci {
226 status = "okay";
227 };
228
229 &ohci {
230 status = "okay";
231 };
232
233 &state_default {
234 default {
235 groups = "ephy", "wled", "spi refclk", "i2c", "uartf", "nd_sd";
236 function = "gpio";
237 };
238 };