7cd4a92aa7dfce169267ec1809b81e5c1c516ca3
[openwrt/staging/hauke.git] / target / linux / ramips / dts / mt7621_dlink_dir-853-a1.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-a1", "mediatek,mt7621-soc";
10 model = "D-Link DIR-853 A1";
11
12 aliases {
13 led-boot = &led_power_orange;
14 led-failsafe = &led_power_blue;
15 led-running = &led_power_blue;
16 led-upgrade = &led_net_orange;
17 };
18
19 keys {
20 compatible = "gpio-keys";
21
22 wifi {
23 label = "wifi";
24 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
25 linux,code = <KEY_RFKILL>;
26 };
27
28 reset {
29 label = "reset";
30 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
31 linux,code = <KEY_RESTART>;
32 };
33
34 wps {
35 label = "wps";
36 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_WPS_BUTTON>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 wlan5g {
45 label = "blue:wlan5g";
46 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
47 linux,default-trigger = "phy1radio";
48 };
49
50 wlan2g {
51 label = "blue:wlan2g";
52 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
53 linux,default-trigger = "phy0radio";
54 };
55
56 usb_blue {
57 label = "blue:usb";
58 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
59 trigger-sources = <&xhci_ehci_port1>;
60 linux,default-trigger = "usbport";
61 };
62
63 led_power_orange: power_orange {
64 label = "orange:power";
65 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
66 };
67
68 led_power_blue: power_blue {
69 label = "blue:power";
70 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
71 };
72
73 led_net_orange: net_orange {
74 label = "orange:net";
75 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
76 };
77
78 net_blue {
79 label = "blue:net";
80 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
81 };
82 };
83 };
84
85 &spi0 {
86 status = "okay";
87
88 flash@0 {
89 compatible = "jedec,spi-nor";
90 reg = <0>;
91 spi-max-frequency = <50000000>;
92
93 partitions {
94 compatible = "fixed-partitions";
95 #address-cells = <1>;
96 #size-cells = <1>;
97
98 partition@0 {
99 label = "u-boot";
100 reg = <0x0 0x30000>;
101 read-only;
102 };
103
104 partition@30000 {
105 label = "u-boot-env";
106 reg = <0x30000 0x10000>;
107 read-only;
108 };
109
110 factory: partition@40000 {
111 compatible = "nvmem-cells";
112 label = "factory";
113 reg = <0x40000 0x10000>;
114 #address-cells = <1>;
115 #size-cells = <1>;
116 read-only;
117
118 eeprom_factory_0: eeprom@0 {
119 reg = <0x0 0x4da8>;
120 };
121
122 macaddr_factory_e000: macaddr@e000 {
123 reg = <0xe000 0x6>;
124 };
125
126 macaddr_factory_e006: macaddr@e006 {
127 reg = <0xe006 0x6>;
128 };
129 };
130
131 partition@50000 {
132 label = "config2_stock";
133 reg = <0x50000 0x10000>;
134 read-only;
135 };
136
137 partition@60000 {
138 compatible = "openwrt,uimage", "denx,uimage";
139 openwrt,padding = <96>;
140 label = "firmware";
141 reg = <0x60000 0xf50000>;
142 };
143
144 partition@fb0000 {
145 label = "private_stock";
146 reg = <0xfb0000 0x50000>;
147 read-only;
148 };
149 };
150 };
151 };
152
153
154 &pcie {
155 status = "okay";
156 };
157
158 &pcie0 {
159 wifi@0,0 {
160 compatible = "mediatek,mt76";
161 reg = <0x0000 0 0 0 0>;
162 nvmem-cells = <&eeprom_factory_0>;
163 nvmem-cell-names = "eeprom";
164
165 /* The correct Mac addresses are set in 10_fix_wifi_mac. */
166 };
167 };
168
169 &gmac0 {
170 nvmem-cells = <&macaddr_factory_e000>;
171 nvmem-cell-names = "mac-address";
172 };
173
174 &gmac1 {
175 status = "okay";
176 label = "wan";
177 phy-handle = <&ethphy4>;
178
179 nvmem-cells = <&macaddr_factory_e006>;
180 nvmem-cell-names = "mac-address";
181 };
182
183 &mdio {
184 ethphy4: ethernet-phy@4 {
185 reg = <4>;
186 };
187 };
188
189 &switch0 {
190 ports {
191 port@0 {
192 status = "okay";
193 label = "lan4";
194 };
195
196 port@1 {
197 status = "okay";
198 label = "lan3";
199 };
200
201 port@2 {
202 status = "okay";
203 label = "lan2";
204 };
205
206 port@3 {
207 status = "okay";
208 label = "lan1";
209 };
210 };
211 };
212
213 &state_default {
214 gpio {
215 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
216 function = "gpio";
217 };
218 };