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