ramips: add support for D-Link DIR-853-R1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_dlink_dir-853-r1.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7621.dtsi"
4
5 #include "mt7621_dlink_flash-16m-r1.dtsi"
6
7 #include <dt-bindings/gpio/gpio.h>
8 #include <dt-bindings/input/input.h>
9
10 / {
11 compatible = "dlink,dir-853-r1", "mediatek,mt7621-soc";
12 model = "D-Link DIR-853 R1";
13
14 aliases {
15 label-mac-device = &wan;
16 led-boot = &led_power_orange;
17 led-failsafe = &led_power_blue;
18 led-running = &led_power_blue;
19 led-upgrade = &led_net_orange;
20 };
21
22 leds {
23 compatible = "gpio-leds";
24
25 led_power_orange: power_orange {
26 label = "orange:power";
27 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
28 };
29
30 led_power_blue: power_blue {
31 label = "blue:power";
32 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
33 };
34
35 led_net_orange: net_orange {
36 label = "orange:net";
37 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
38 };
39
40 net_blue {
41 label = "blue:net";
42 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
43 };
44
45 usb_blue {
46 label = "blue:usb";
47 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
48 trigger-sources = <&xhci_ehci_port1>;
49 linux,default-trigger = "usbport";
50 };
51
52 wlan2g {
53 label = "blue:wlan2g";
54 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
55 linux,default-trigger = "phy0radio";
56 };
57
58 wlan5g {
59 label = "blue:wlan5g";
60 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
61 linux,default-trigger = "phy1radio";
62 };
63 };
64
65 keys {
66 compatible = "gpio-keys";
67
68 reset {
69 label = "reset";
70 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
71 linux,code = <KEY_RESTART>;
72 };
73
74 wps {
75 label = "wps";
76 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
77 linux,code = <KEY_WPS_BUTTON>;
78 };
79
80 wifi {
81 label = "wifi";
82 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
83 linux,code = <KEY_RFKILL>;
84 };
85 };
86 };
87
88 &pcie {
89 status = "okay";
90 };
91
92 &pcie0 {
93 wifi@0,0 {
94 compatible = "mediatek,mt76";
95 reg = <0x0000 0 0 0 0>;
96 mediatek,mtd-eeprom = <&factory 0x0>;
97 /* 5 GHz (phy1) does not take the address from calibration data,
98 but setting it manually here works */
99 mtd-mac-address = <&factory 0x4>;
100 };
101 };
102
103 &gmac0 {
104 mtd-mac-address = <&factory 0x4>;
105 mtd-mac-address-increment = <(-1)>;
106 };
107
108 &switch0 {
109 ports {
110 port@0 {
111 status = "okay";
112 label = "lan4";
113 };
114
115 port@1 {
116 status = "okay";
117 label = "lan3";
118 };
119
120 port@2 {
121 status = "okay";
122 label = "lan2";
123 };
124
125 port@3 {
126 status = "okay";
127 label = "lan1";
128 };
129
130 wan: port@4 {
131 status = "okay";
132 label = "wan";
133 mtd-mac-address = <&factory 0x4>;
134 mtd-mac-address-increment = <(-2)>;
135 };
136 };
137 };
138
139 &state_default {
140 gpio {
141 groups = "i2c", "uart3", "uart2", "jtag", "wdt";
142 function = "gpio";
143 };
144 };