747d1de18a0649c594b17a134a3abb34775d9c12
[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 nvmem-layout {
113 compatible = "fixed-layout";
114 #address-cells = <1>;
115 #size-cells = <1>;
116
117 eeprom_factory_0: eeprom@0 {
118 reg = <0x0 0x4da8>;
119 };
120
121 macaddr_factory_4: macaddr@4 {
122 reg = <0x4 0x6>;
123 };
124
125 macaddr_factory_e000: macaddr@e000 {
126 reg = <0xe000 0x6>;
127 };
128
129 macaddr_factory_e006: macaddr@e006 {
130 reg = <0xe006 0x6>;
131 };
132 };
133 };
134
135 partition@140000 {
136 label = "config2";
137 reg = <0x140000 0x40000>;
138 read-only;
139 };
140
141 partition@180000 {
142 label = "firmware";
143 compatible = "openwrt,uimage", "denx,uimage";
144 openwrt,padding = <96>;
145 reg = <0x180000 0x2800000>;
146 };
147
148 partition@2980000 {
149 label = "private";
150 reg = <0x2980000 0x2000000>;
151 read-only;
152 };
153
154 partition@4980000 {
155 label = "firmware2";
156 reg = <0x4980000 0x2800000>;
157 };
158
159 partition@7180000 {
160 label = "mydlink";
161 reg = <0x7180000 0x600000>;
162 read-only;
163 };
164
165 partition@7780000 {
166 label = "reserved";
167 reg = <0x7780000 0x880000>;
168 read-only;
169 };
170 };
171 };
172
173 &pcie {
174 status = "okay";
175 };
176
177 &pcie0 {
178 wifi@0,0 {
179 compatible = "mediatek,mt76";
180 reg = <0x0000 0 0 0 0>;
181 /* 5 GHz (phy1) does not take the address from calibration data,
182 but setting it manually here works */
183 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4>;
184 nvmem-cell-names = "eeprom", "mac-address";
185 };
186 };
187
188 &gmac0 {
189 nvmem-cells = <&macaddr_factory_e000>;
190 nvmem-cell-names = "mac-address";
191 };
192
193 &gmac1 {
194 status = "okay";
195 label = "wan";
196 phy-handle = <&ethphy4>;
197
198 nvmem-cells = <&macaddr_factory_e006>;
199 nvmem-cell-names = "mac-address";
200 };
201
202 &mdio {
203 ethphy4: ethernet-phy@4 {
204 reg = <4>;
205 };
206 };
207
208 &switch0 {
209 ports {
210 port@0 {
211 status = "okay";
212 label = "lan4";
213 };
214
215 port@1 {
216 status = "okay";
217 label = "lan3";
218 };
219
220 port@2 {
221 status = "okay";
222 label = "lan2";
223 };
224
225 port@3 {
226 status = "okay";
227 label = "lan1";
228 };
229 };
230 };
231
232 &state_default {
233 gpio {
234 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
235 function = "gpio";
236 };
237 };