3fd67c967a234cc7f6bbd48b5a7b9e0f0d9d09a5
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_cudy_wr1300.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", "mediatek,mt7621-soc";
10 model = "Cudy WR1300";
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 = <80000000>;
69 m25p,fast-read;
70
71 partitions {
72 compatible = "fixed-partitions";
73 #address-cells = <1>;
74 #size-cells = <1>;
75
76 partition@0 {
77 label = "u-boot";
78 reg = <0x0 0x30000>;
79 read-only;
80 };
81
82 partition@30000 {
83 label = "u-boot-env";
84 reg = <0x30000 0x10000>;
85 read-only;
86 };
87
88 factory: partition@40000 {
89 label = "factory";
90 reg = <0x40000 0x10000>;
91 read-only;
92 };
93
94 partition@50000 {
95 compatible = "denx,uimage";
96 label = "firmware";
97 reg = <0x50000 0xf80000>;
98 };
99
100 partition@fd0000 {
101 label = "debug";
102 reg = <0xfd0000 0x10000>;
103 read-only;
104 };
105
106 partition@fe0000 {
107 label = "backup";
108 reg = <0xfe0000 0x10000>;
109 read-only;
110 };
111
112 bdinfo: partition@ff0000 {
113 label = "bdinfo";
114 reg = <0xff0000 0x10000>;
115 read-only;
116 };
117 };
118 };
119 };
120
121 &pcie {
122 status = "okay";
123 };
124
125 &pcie0 {
126 wifi@0,0 {
127 compatible = "pci14c3,7603";
128 reg = <0x0000 0 0 0 0>;
129 mediatek,mtd-eeprom = <&factory 0x0000>;
130 nvmem-cells = <&macaddr_bdinfo_de00>;
131 nvmem-cell-names = "mac-address";
132 ieee80211-freq-limit = <2400000 2500000>;
133
134 led {
135 led-active-low;
136 };
137 };
138 };
139
140 &pcie1 {
141 wifi@0,0 {
142 compatible = "pci14c3,7662";
143 reg = <0x0000 0 0 0 0>;
144 mediatek,mtd-eeprom = <&factory 0x8000>;
145 nvmem-cells = <&macaddr_bdinfo_de00>;
146 nvmem-cell-names = "mac-address";
147 mac-address-increment = <2>;
148 ieee80211-freq-limit = <5000000 6000000>;
149
150 led {
151 led-sources = <2>;
152 led-active-low;
153 };
154 };
155 };
156
157 &gmac0 {
158 nvmem-cells = <&macaddr_bdinfo_de00>;
159 nvmem-cell-names = "mac-address";
160 };
161
162 &switch0 {
163 ports {
164 port@0 {
165 status = "okay";
166 label = "lan4";
167 };
168
169 port@1 {
170 status = "okay";
171 label = "lan3";
172 };
173
174 port@2 {
175 status = "okay";
176 label = "lan2";
177 };
178
179 port@3 {
180 status = "okay";
181 label = "lan1";
182 };
183
184 port@4 {
185 status = "okay";
186 label = "wan";
187 nvmem-cells = <&macaddr_bdinfo_de00>;
188 nvmem-cell-names = "mac-address";
189 mac-address-increment = <1>;
190 };
191 };
192 };
193
194 &state_default {
195 gpio {
196 groups = "wdt", "i2c", "jtag";
197 function = "gpio";
198 };
199 };
200
201 &bdinfo {
202 compatible = "nvmem-cells";
203 #address-cells = <1>;
204 #size-cells = <1>;
205
206 macaddr_bdinfo_de00: macaddr@de00 {
207 reg = <0xde00 0x6>;
208 };
209 };