a3753f37d4315aa9e7ed2b929a55f001ac34f068
[openwrt/staging/stintel.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 #include <dt-bindings/leds/common.h>
10
11 / {
12 compatible = "dlink,dir-853-r1", "mediatek,mt7621-soc";
13 model = "D-Link DIR-853 R1";
14
15 aliases {
16 label-mac-device = &gmac1;
17
18 led-boot = &led_power_orange;
19 led-failsafe = &led_power_blue;
20 led-running = &led_power_blue;
21 led-upgrade = &led_net_orange;
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led_power_orange: power_orange {
28 function = LED_FUNCTION_POWER;
29 color = <LED_COLOR_ID_ORANGE>;
30 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
31 };
32
33 led_power_blue: power_blue {
34 function = LED_FUNCTION_POWER;
35 color = <LED_COLOR_ID_BLUE>;
36 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
37 };
38
39 led_net_orange: net_orange {
40 label = "orange:net";
41 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
42 };
43
44 net_blue {
45 label = "blue:net";
46 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
47 };
48
49 usb_blue {
50 function = LED_FUNCTION_USB;
51 color = <LED_COLOR_ID_BLUE>;
52 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
53 trigger-sources = <&xhci_ehci_port1>;
54 linux,default-trigger = "usbport";
55 };
56
57 wlan2g {
58 label = "blue:wlan2g";
59 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
60 linux,default-trigger = "phy0radio";
61 };
62
63 wlan5g {
64 label = "blue:wlan5g";
65 gpios = <&gpio 3 GPIO_ACTIVE_LOW>;
66 linux,default-trigger = "phy1radio";
67 };
68 };
69
70 keys {
71 compatible = "gpio-keys";
72
73 reset {
74 label = "reset";
75 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
76 linux,code = <KEY_RESTART>;
77 };
78
79 wps {
80 label = "wps";
81 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
82 linux,code = <KEY_WPS_BUTTON>;
83 };
84
85 wifi {
86 label = "wifi";
87 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
88 linux,code = <KEY_RFKILL>;
89 };
90 };
91 };
92
93 &pcie {
94 status = "okay";
95 };
96
97 &pcie0 {
98 wifi@0,0 {
99 compatible = "mediatek,mt76";
100 reg = <0x0000 0 0 0 0>;
101
102 /* 5 GHz (phy1) does not take the address from calibration data,
103 but setting it manually here works */
104 nvmem-cells = <&eeprom_factory_0>, <&macaddr_factory_4 0>;
105 nvmem-cell-names = "eeprom", "mac-address";
106 };
107 };
108
109 &gmac0 {
110 nvmem-cells = <&macaddr_factory_4 (-1)>;
111 nvmem-cell-names = "mac-address";
112 };
113
114 &gmac1 {
115 status = "okay";
116 label = "wan";
117 phy-handle = <&ethphy4>;
118
119 nvmem-cells = <&macaddr_factory_4 (-2)>;
120 nvmem-cell-names = "mac-address";
121 };
122
123 &mdio {
124 ethphy4: ethernet-phy@4 {
125 reg = <4>;
126 };
127 };
128
129 &switch0 {
130 ports {
131 port@0 {
132 status = "okay";
133 label = "lan4";
134 };
135
136 port@1 {
137 status = "okay";
138 label = "lan3";
139 };
140
141 port@2 {
142 status = "okay";
143 label = "lan2";
144 };
145
146 port@3 {
147 status = "okay";
148 label = "lan1";
149 };
150 };
151 };
152
153 &state_default {
154 gpio {
155 groups = "i2c", "uart3", "uart2", "jtag", "wdt";
156 function = "gpio";
157 };
158 };