ramips: fix Ubiquiti EdgeRouter X's MAC address for gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dlink_dir-853-a3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "dlink,dir-853-a3", "mediatek,mt7621-soc";
10 model = "D-Link DIR-853 A3";
11
12 aliases {
13 label-mac-device = &gmac0;
14
15 led-boot = &led_power_orange;
16 led-failsafe = &led_power_blue;
17 led-running = &led_power_blue;
18 led-upgrade = &led_net_orange;
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 reset {
25 label = "reset";
26 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
27 linux,code = <KEY_RESTART>;
28 };
29
30 wps {
31 label = "wps";
32 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
33 linux,code = <KEY_WPS_BUTTON>;
34 };
35
36 wifi {
37 label = "wifi";
38 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
39 linux,code = <KEY_RFKILL>;
40 };
41 };
42
43 leds {
44 compatible = "gpio-leds";
45
46 led_power_orange: power_orange {
47 label = "orange:power";
48 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
49 };
50
51 led_power_blue: power_blue {
52 label = "blue:power";
53 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
54 };
55
56 led_net_orange: net_orange {
57 label = "orange:net";
58 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
59 };
60
61 net_blue {
62 label = "blue:net";
63 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
64 };
65
66 usb_blue {
67 label = "blue:usb";
68 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
69 trigger-sources = <&xhci_ehci_port1>;
70 linux,default-trigger = "usbport";
71 };
72
73 wlan2g {
74 label = "blue:wlan2g";
75 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
76 linux,default-trigger = "phy0radio";
77 };
78
79 wlan5g {
80 label = "blue:wlan5g";
81 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
82 linux,default-trigger = "phy1radio";
83 };
84 };
85 };
86
87 &nand {
88 status = "okay";
89
90 partitions {
91 compatible = "fixed-partitions";
92 #address-cells = <1>;
93 #size-cells = <1>;
94
95 partition@0 {
96 label = "u-boot";
97 reg = <0x0 0x80000>;
98 read-only;
99 };
100
101 partition@80000 {
102 label = "config";
103 reg = <0x80000 0x80000>;
104 read-only;
105 };
106
107 factory: partition@100000 {
108 label = "factory";
109 reg = <0x100000 0x40000>;
110 read-only;
111 };
112
113 partition@140000 {
114 label = "config2";
115 reg = <0x140000 0x40000>;
116 read-only;
117 };
118
119 partition@180000 {
120 label = "firmware";
121 compatible = "openwrt,uimage", "denx,uimage";
122 openwrt,padding = <96>;
123 reg = <0x180000 0x2800000>;
124 };
125
126 partition@2980000 {
127 label = "private";
128 reg = <0x2980000 0x2000000>;
129 read-only;
130 };
131
132 partition@4980000 {
133 label = "firmware2";
134 reg = <0x4980000 0x2800000>;
135 };
136
137 partition@7180000 {
138 label = "mydlink";
139 reg = <0x7180000 0x600000>;
140 read-only;
141 };
142
143 partition@7780000 {
144 label = "reserved";
145 reg = <0x7780000 0x880000>;
146 read-only;
147 };
148 };
149 };
150
151 &pcie {
152 status = "okay";
153 };
154
155 &pcie0 {
156 wifi@0,0 {
157 compatible = "mediatek,mt76";
158 reg = <0x0000 0 0 0 0>;
159 mediatek,mtd-eeprom = <&factory 0x0>;
160 /* 5 GHz (phy1) does not take the address from calibration data,
161 but setting it manually here works */
162 nvmem-cells = <&macaddr_factory_4>;
163 nvmem-cell-names = "mac-address";
164 };
165 };
166
167 &gmac0 {
168 nvmem-cells = <&macaddr_factory_e000>;
169 nvmem-cell-names = "mac-address";
170 };
171
172 &gmac1 {
173 status = "okay";
174 label = "wan";
175 phy-handle = <&ethphy4>;
176
177 nvmem-cells = <&macaddr_factory_e006>;
178 nvmem-cell-names = "mac-address";
179 };
180
181 &mdio {
182 ethphy4: ethernet-phy@4 {
183 reg = <4>;
184 };
185 };
186
187 &switch0 {
188 ports {
189 port@0 {
190 status = "okay";
191 label = "lan4";
192 };
193
194 port@1 {
195 status = "okay";
196 label = "lan3";
197 };
198
199 port@2 {
200 status = "okay";
201 label = "lan2";
202 };
203
204 port@3 {
205 status = "okay";
206 label = "lan1";
207 };
208 };
209 };
210
211 &state_default {
212 gpio {
213 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
214 function = "gpio";
215 };
216 };
217
218 &factory {
219 compatible = "nvmem-cells";
220 #address-cells = <1>;
221 #size-cells = <1>;
222
223 macaddr_factory_4: macaddr@4 {
224 reg = <0x4 0x6>;
225 };
226
227 macaddr_factory_e000: macaddr@e000 {
228 reg = <0xe000 0x6>;
229 };
230
231 macaddr_factory_e006: macaddr@e006 {
232 reg = <0xe006 0x6>;
233 };
234 };