fcc16c31b518da3256a78a2fd098fa7429337d7e
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr1300-v1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/input/input.h>
6 #include <dt-bindings/gpio/gpio.h>
7
8 / {
9 compatible = "cudy,wr1300-v1", "mediatek,mt7621-soc";
10 model = "Cudy WR1300 v1";
11
12 aliases {
13 led-boot = &led_sys;
14 led-failsafe = &led_sys;
15 led-running = &led_sys;
16 led-upgrade = &led_sys;
17 label-mac-device = &gmac0;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 reset {
28 label = "reset";
29 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 wps {
34 label = "wps";
35 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_sys: sys {
44 label = "green:sys";
45 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
46 };
47
48 usb {
49 label = "green:usb";
50 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
51 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
52 linux,default-trigger = "usbport";
53 };
54
55 wps {
56 label = "green:wps";
57 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
58 };
59 };
60 };
61
62 &spi0 {
63 status = "okay";
64
65 flash@0 {
66 compatible = "jedec,spi-nor";
67 reg = <0>;
68 spi-max-frequency = <10000000>;
69
70 partitions {
71 compatible = "fixed-partitions";
72 #address-cells = <1>;
73 #size-cells = <1>;
74
75 partition@0 {
76 label = "u-boot";
77 reg = <0x0 0x30000>;
78 read-only;
79 };
80
81 partition@30000 {
82 label = "u-boot-env";
83 reg = <0x30000 0x10000>;
84 read-only;
85 };
86
87 factory: partition@40000 {
88 compatible = "nvmem-cells";
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 #address-cells = <1>;
92 #size-cells = <1>;
93 read-only;
94
95 eeprom_factory_0: eeprom@0 {
96 reg = <0x0 0x400>;
97 };
98
99 eeprom_factory_8000: eeprom@8000 {
100 reg = <0x8000 0x200>;
101 };
102 };
103
104 partition@50000 {
105 compatible = "denx,uimage";
106 label = "firmware";
107 reg = <0x50000 0xf80000>;
108 };
109
110 partition@fd0000 {
111 label = "debug";
112 reg = <0xfd0000 0x10000>;
113 read-only;
114 };
115
116 partition@fe0000 {
117 label = "backup";
118 reg = <0xfe0000 0x10000>;
119 read-only;
120 };
121
122 bdinfo: partition@ff0000 {
123 compatible = "nvmem-cells";
124 label = "bdinfo";
125 reg = <0xff0000 0x10000>;
126 #address-cells = <1>;
127 #size-cells = <1>;
128 read-only;
129
130 macaddr_bdinfo_de00: macaddr@de00 {
131 reg = <0xde00 0x6>;
132 };
133 };
134 };
135 };
136 };
137
138 &pcie {
139 status = "okay";
140 };
141
142 &pcie0 {
143 wifi@0,0 {
144 compatible = "pci14c3,7603";
145 reg = <0x0000 0 0 0 0>;
146 nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00>;
147 nvmem-cell-names = "eeprom", "mac-address";
148 ieee80211-freq-limit = <2400000 2500000>;
149
150 led {
151 led-active-low;
152 };
153 };
154 };
155
156 &pcie1 {
157 wifi@0,0 {
158 compatible = "pci14c3,7662";
159 reg = <0x0000 0 0 0 0>;
160 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00>;
161 nvmem-cell-names = "eeprom", "mac-address";
162 mac-address-increment = <2>;
163 ieee80211-freq-limit = <5000000 6000000>;
164
165 led {
166 led-sources = <2>;
167 led-active-low;
168 };
169 };
170 };
171
172 &gmac0 {
173 nvmem-cells = <&macaddr_bdinfo_de00>;
174 nvmem-cell-names = "mac-address";
175 };
176
177 &gmac1 {
178 status = "okay";
179 label = "wan";
180 phy-handle = <&ethphy4>;
181
182 nvmem-cells = <&macaddr_bdinfo_de00>;
183 nvmem-cell-names = "mac-address";
184 mac-address-increment = <1>;
185 };
186
187 &mdio {
188 ethphy4: ethernet-phy@4 {
189 reg = <4>;
190 };
191 };
192
193 &switch0 {
194 ports {
195 port@0 {
196 status = "okay";
197 label = "lan4";
198 };
199
200 port@1 {
201 status = "okay";
202 label = "lan3";
203 };
204
205 port@2 {
206 status = "okay";
207 label = "lan2";
208 };
209
210 port@3 {
211 status = "okay";
212 label = "lan1";
213 };
214 };
215 };
216
217 &state_default {
218 gpio {
219 groups = "wdt", "i2c", "jtag";
220 function = "gpio";
221 };
222 };