ramips: add support for D-Link Dir-853 A1
[openwrt/staging/noltari.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 label = "factory";
112 reg = <0x40000 0x10000>;
113 read-only;
114 };
115
116 partition@50000 {
117 label = "config2_stock";
118 reg = <0x50000 0x10000>;
119 read-only;
120 };
121
122 partition@60000 {
123 compatible = "openwrt,uimage", "denx,uimage";
124 openwrt,padding = <96>;
125 label = "firmware";
126 reg = <0x60000 0xf50000>;
127 };
128
129 partition@fb0000 {
130 label = "private_stock";
131 reg = <0xfb0000 0x50000>;
132 read-only;
133 };
134 };
135 };
136 };
137
138
139 &pcie {
140 status = "okay";
141 };
142
143 &pcie0 {
144 wifi@0,0 {
145 compatible = "mediatek,mt76";
146 reg = <0x0000 0 0 0 0>;
147 mediatek,mtd-eeprom = <&factory 0x0>;
148
149 /* The correct Mac addresses are set in 10_fix_wifi_mac. */
150 };
151 };
152
153 &gmac0 {
154 nvmem-cells = <&macaddr_factory_e000>;
155 nvmem-cell-names = "mac-address";
156 };
157
158 &gmac1 {
159 status = "okay";
160 label = "wan";
161 phy-handle = <&ethphy4>;
162
163 nvmem-cells = <&macaddr_factory_e006>;
164 nvmem-cell-names = "mac-address";
165 };
166
167 &mdio {
168 ethphy4: ethernet-phy@4 {
169 reg = <4>;
170 };
171 };
172
173 &switch0 {
174 ports {
175 port@0 {
176 status = "okay";
177 label = "lan4";
178 };
179
180 port@1 {
181 status = "okay";
182 label = "lan3";
183 };
184
185 port@2 {
186 status = "okay";
187 label = "lan2";
188 };
189
190 port@3 {
191 status = "okay";
192 label = "lan1";
193 };
194 };
195 };
196
197 &state_default {
198 gpio {
199 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
200 function = "gpio";
201 };
202 };
203
204 &factory {
205 compatible = "nvmem-cells";
206 #address-cells = <1>;
207 #size-cells = <1>;
208
209 macaddr_factory_e000: macaddr@e000 {
210 reg = <0xe000 0x6>;
211 };
212
213 macaddr_factory_e006: macaddr@e006 {
214 reg = <0xe006 0x6>;
215 };
216 };