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