ramips: mt7621: fix Xiaomi Router 3G/Pro LEDs
[openwrt/openwrt.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 label = "factory";
82 reg = <0x40000 0x10000>;
83 read-only;
84 };
85
86 partition@50000 {
87 compatible = "denx,uimage";
88 label = "firmware";
89 reg = <0x50000 0xf80000>;
90 };
91
92 partition@fd0000 {
93 label = "debug";
94 reg = <0xfd0000 0x10000>;
95 read-only;
96 };
97
98 partition@fe0000 {
99 label = "backup";
100 reg = <0xfe0000 0x10000>;
101 read-only;
102 };
103
104 bdinfo: partition@ff0000 {
105 label = "bdinfo";
106 reg = <0xff0000 0x10000>;
107 read-only;
108 };
109 };
110 };
111 };
112
113 &pcie {
114 status = "okay";
115 };
116
117 &pcie1 {
118 wifi@0,0 {
119 compatible = "mediatek,mt76";
120 reg = <0x0000 0 0 0 0>;
121 mediatek,mtd-eeprom = <&factory 0x0000>;
122 nvmem-cells = <&macaddr_bdinfo_de00>;
123 nvmem-cell-names = "mac-address";
124 };
125 };
126
127 &pcie0 {
128 wifi@0,0 {
129 compatible = "mediatek,mt76";
130 reg = <0x0000 0 0 0 0>;
131 mediatek,mtd-eeprom = <&factory 0x8000>;
132 nvmem-cells = <&macaddr_bdinfo_de00>;
133 nvmem-cell-names = "mac-address";
134 mac-address-increment = <2>;
135 };
136 };
137
138 &gmac0 {
139 nvmem-cells = <&macaddr_bdinfo_de00>;
140 nvmem-cell-names = "mac-address";
141 };
142
143 &gmac1 {
144 status = "okay";
145 label = "wan";
146 phy-handle = <&ethphy4>;
147
148 nvmem-cells = <&macaddr_bdinfo_de00>;
149 nvmem-cell-names = "mac-address";
150 mac-address-increment = <1>;
151 };
152
153 &mdio {
154 ethphy4: ethernet-phy@4 {
155 reg = <4>;
156 };
157 };
158
159 &switch0 {
160 ports {
161 port@0 {
162 status = "okay";
163 label = "lan4";
164 };
165
166 port@1 {
167 status = "okay";
168 label = "lan3";
169 };
170
171 port@2 {
172 status = "okay";
173 label = "lan2";
174 };
175
176 port@3 {
177 status = "okay";
178 label = "lan1";
179 };
180 };
181 };
182
183 &state_default {
184 gpio {
185 groups = "wdt", "i2c", "jtag";
186 function = "gpio";
187 };
188 };
189
190 &bdinfo {
191 compatible = "nvmem-cells";
192 #address-cells = <1>;
193 #size-cells = <1>;
194
195 macaddr_bdinfo_de00: macaddr@de00 {
196 reg = <0xde00 0x6>;
197 };
198 };