ramips: add support for D-Link DIR-853 A3
[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 led-boot = &led_power_orange;
15 led-failsafe = &led_power_blue;
16 led-running = &led_power_blue;
17 led-upgrade = &led_net_orange;
18 };
19
20 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
26 linux,code = <KEY_RESTART>;
27 };
28
29 wps {
30 label = "wps";
31 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
32 linux,code = <KEY_WPS_BUTTON>;
33 };
34
35 wifi {
36 label = "wifi";
37 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
38 linux,code = <KEY_RFKILL>;
39 };
40 };
41
42 leds {
43 compatible = "gpio-leds";
44
45 led_power_orange: power_orange {
46 label = "orange:power";
47 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
48 };
49
50 led_power_blue: power_blue {
51 label = "blue:power";
52 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
53 };
54
55 led_net_orange: net_orange {
56 label = "orange:net";
57 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
58 };
59
60 net_blue {
61 label = "blue:net";
62 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
63 };
64
65 usb_blue {
66 label = "blue:usb";
67 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
68 trigger-sources = <&xhci_ehci_port1>;
69 linux,default-trigger = "usbport";
70 };
71
72 wlan2g {
73 label = "blue:wlan2g";
74 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
75 linux,default-trigger = "phy0radio";
76 };
77
78 wlan5g {
79 label = "blue:wlan5g";
80 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
81 linux,default-trigger = "phy1radio";
82 };
83 };
84 };
85
86 &nand {
87 status = "okay";
88
89 partitions {
90 compatible = "fixed-partitions";
91 #address-cells = <1>;
92 #size-cells = <1>;
93
94 partition@0 {
95 label = "u-boot";
96 reg = <0x0 0x80000>;
97 read-only;
98 };
99
100 partition@80000 {
101 label = "config";
102 reg = <0x80000 0x80000>;
103 read-only;
104 };
105
106 factory: partition@100000 {
107 label = "factory";
108 reg = <0x100000 0x40000>;
109 read-only;
110 };
111
112 partition@140000 {
113 label = "config2";
114 reg = <0x140000 0x40000>;
115 read-only;
116 };
117
118 partition@180000 {
119 label = "firmware";
120 compatible = "openwrt,uimage", "denx,uimage";
121 openwrt,padding = <96>;
122 reg = <0x180000 0x2800000>;
123 };
124
125 partition@2980000 {
126 label = "private";
127 reg = <0x2980000 0x2000000>;
128 read-only;
129 };
130
131 partition@4980000 {
132 label = "firmware2";
133 reg = <0x4980000 0x2800000>;
134 };
135
136 partition@7180000 {
137 label = "mydlink";
138 reg = <0x7180000 0x600000>;
139 read-only;
140 };
141
142 partition@7780000 {
143 label = "reserved";
144 reg = <0x7780000 0x880000>;
145 read-only;
146 };
147 };
148 };
149
150 &pcie {
151 status = "okay";
152 };
153
154 &pcie0 {
155 wifi@0,0 {
156 compatible = "mediatek,mt76";
157 reg = <0x0000 0 0 0 0>;
158 mediatek,mtd-eeprom = <&factory 0x0>;
159 /* 5 GHz (phy1) does not take the address from calibration data,
160 but setting it manually here works */
161 mtd-mac-address = <&factory 0x4>;
162 };
163 };
164
165 &gmac0 {
166 mtd-mac-address = <&factory 0xe000>;
167 };
168
169 &switch0 {
170 ports {
171 port@0 {
172 status = "okay";
173 label = "lan4";
174 };
175
176 port@1 {
177 status = "okay";
178 label = "lan3";
179 };
180
181 port@2 {
182 status = "okay";
183 label = "lan2";
184 };
185
186 port@3 {
187 status = "okay";
188 label = "lan1";
189 };
190
191 port@4 {
192 status = "okay";
193 label = "wan";
194 mtd-mac-address = <&factory 0xe006>;
195 };
196 };
197 };
198
199 &state_default {
200 gpio {
201 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
202 function = "gpio";
203 };
204 };