ramips: fix Ubiquiti EdgeRouter X's MAC address for gmac1
[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 label = "factory";
89 reg = <0x40000 0x10000>;
90 read-only;
91 };
92
93 partition@50000 {
94 compatible = "denx,uimage";
95 label = "firmware";
96 reg = <0x50000 0xf80000>;
97 };
98
99 partition@fd0000 {
100 label = "debug";
101 reg = <0xfd0000 0x10000>;
102 read-only;
103 };
104
105 partition@fe0000 {
106 label = "backup";
107 reg = <0xfe0000 0x10000>;
108 read-only;
109 };
110
111 bdinfo: partition@ff0000 {
112 label = "bdinfo";
113 reg = <0xff0000 0x10000>;
114 read-only;
115 };
116 };
117 };
118 };
119
120 &pcie {
121 status = "okay";
122 };
123
124 &pcie0 {
125 wifi@0,0 {
126 compatible = "pci14c3,7603";
127 reg = <0x0000 0 0 0 0>;
128 mediatek,mtd-eeprom = <&factory 0x0000>;
129 nvmem-cells = <&macaddr_bdinfo_de00>;
130 nvmem-cell-names = "mac-address";
131 ieee80211-freq-limit = <2400000 2500000>;
132
133 led {
134 led-active-low;
135 };
136 };
137 };
138
139 &pcie1 {
140 wifi@0,0 {
141 compatible = "pci14c3,7662";
142 reg = <0x0000 0 0 0 0>;
143 mediatek,mtd-eeprom = <&factory 0x8000>;
144 nvmem-cells = <&macaddr_bdinfo_de00>;
145 nvmem-cell-names = "mac-address";
146 mac-address-increment = <2>;
147 ieee80211-freq-limit = <5000000 6000000>;
148
149 led {
150 led-sources = <2>;
151 led-active-low;
152 };
153 };
154 };
155
156 &gmac0 {
157 nvmem-cells = <&macaddr_bdinfo_de00>;
158 nvmem-cell-names = "mac-address";
159 };
160
161 &gmac1 {
162 status = "okay";
163 label = "wan";
164 phy-handle = <&ethphy4>;
165
166 nvmem-cells = <&macaddr_bdinfo_de00>;
167 nvmem-cell-names = "mac-address";
168 mac-address-increment = <1>;
169 };
170
171 &mdio {
172 ethphy4: ethernet-phy@4 {
173 reg = <4>;
174 };
175 };
176
177 &switch0 {
178 ports {
179 port@0 {
180 status = "okay";
181 label = "lan4";
182 };
183
184 port@1 {
185 status = "okay";
186 label = "lan3";
187 };
188
189 port@2 {
190 status = "okay";
191 label = "lan2";
192 };
193
194 port@3 {
195 status = "okay";
196 label = "lan1";
197 };
198 };
199 };
200
201 &state_default {
202 gpio {
203 groups = "wdt", "i2c", "jtag";
204 function = "gpio";
205 };
206 };
207
208 &bdinfo {
209 compatible = "nvmem-cells";
210 #address-cells = <1>;
211 #size-cells = <1>;
212
213 macaddr_bdinfo_de00: macaddr@de00 {
214 reg = <0xde00 0x6>;
215 };
216 };