264a0fa5c16b3fcc514eb031923d6cb07cecea7e
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7621_cudy_wr1300-v2.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-v2", "mediatek,mt7621-soc";
10 model = "Cudy WR1300 v2";
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 7 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_LOW>;
46 };
47
48 wps {
49 label = "green:wps";
50 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
51 };
52 };
53 };
54
55 &spi0 {
56 status = "okay";
57
58 flash@0 {
59 compatible = "jedec,spi-nor";
60 reg = <0>;
61 spi-max-frequency = <40000000>;
62
63 partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "u-boot";
70 reg = <0x0 0x30000>;
71 read-only;
72 };
73
74 partition@30000 {
75 label = "u-boot-env";
76 reg = <0x30000 0x10000>;
77 read-only;
78 };
79
80 factory: partition@40000 {
81 compatible = "nvmem-cells";
82 label = "factory";
83 reg = <0x40000 0x10000>;
84 #address-cells = <1>;
85 #size-cells = <1>;
86 read-only;
87
88 eeprom_factory_0: eeprom@0 {
89 reg = <0x0 0x400>;
90 };
91
92 eeprom_factory_8000: eeprom@8000 {
93 reg = <0x8000 0x200>;
94 };
95 };
96
97 partition@50000 {
98 compatible = "denx,uimage";
99 label = "firmware";
100 reg = <0x50000 0xf80000>;
101 };
102
103 partition@fd0000 {
104 label = "debug";
105 reg = <0xfd0000 0x10000>;
106 read-only;
107 };
108
109 partition@fe0000 {
110 label = "backup";
111 reg = <0xfe0000 0x10000>;
112 read-only;
113 };
114
115 bdinfo: partition@ff0000 {
116 compatible = "nvmem-cells";
117 label = "bdinfo";
118 reg = <0xff0000 0x10000>;
119 #address-cells = <1>;
120 #size-cells = <1>;
121 read-only;
122
123 macaddr_bdinfo_de00: macaddr@de00 {
124 reg = <0xde00 0x6>;
125 };
126 };
127 };
128 };
129 };
130
131 &pcie {
132 status = "okay";
133 };
134
135 &pcie1 {
136 wifi@0,0 {
137 compatible = "mediatek,mt76";
138 reg = <0x0000 0 0 0 0>;
139 nvmem-cells = <&eeprom_factory_0>, <&macaddr_bdinfo_de00>;
140 nvmem-cell-names = "eeprom", "mac-address";
141 };
142 };
143
144 &pcie0 {
145 wifi@0,0 {
146 compatible = "mediatek,mt76";
147 reg = <0x0000 0 0 0 0>;
148 nvmem-cells = <&eeprom_factory_8000>, <&macaddr_bdinfo_de00>;
149 nvmem-cell-names = "eeprom", "mac-address";
150 mac-address-increment = <2>;
151 };
152 };
153
154 &gmac0 {
155 nvmem-cells = <&macaddr_bdinfo_de00>;
156 nvmem-cell-names = "mac-address";
157 };
158
159 &gmac1 {
160 status = "okay";
161 label = "wan";
162 phy-handle = <&ethphy4>;
163
164 nvmem-cells = <&macaddr_bdinfo_de00>;
165 nvmem-cell-names = "mac-address";
166 mac-address-increment = <1>;
167 };
168
169 &mdio {
170 ethphy4: ethernet-phy@4 {
171 reg = <4>;
172 };
173 };
174
175 &switch0 {
176 ports {
177 port@0 {
178 status = "okay";
179 label = "lan4";
180 };
181
182 port@1 {
183 status = "okay";
184 label = "lan3";
185 };
186
187 port@2 {
188 status = "okay";
189 label = "lan2";
190 };
191
192 port@3 {
193 status = "okay";
194 label = "lan1";
195 };
196 };
197 };
198
199 &state_default {
200 gpio {
201 groups = "wdt", "i2c", "jtag";
202 function = "gpio";
203 };
204 };