ramips: add support for TP-Link Deco M4R v4
[openwrt/staging/stintel.git] / target / linux / ramips / dts / mt7621_tplink_deco-m4r-v4.dts
1 // SPDX-License-Identifier: GPL-2.0-only
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "tplink,deco-m4r-v4", "mediatek,mt7621-soc";
10 model = "TP-Link Deco M4R v4";
11
12 aliases {
13 label-mac-device = &gmac0;
14 led-boot = &led_power;
15 led-failsafe = &led_power;
16 led-running = &led_power;
17 led-upgrade = &led_power;
18 };
19
20 chosen {
21 bootargs = "console=ttyS0,115200n8";
22 };
23
24 keys {
25 compatible = "gpio-keys";
26
27 wps {
28 label = "wps";
29 gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
30 debounce-interval = <60>;
31 linux,code = <KEY_WPS_BUTTON>;
32 };
33
34 led {
35 label = "led";
36 gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
37 debounce_interval = <60>;
38 linux,code = <KEY_BRIGHTNESS_TOGGLE>;
39 };
40
41 reset {
42 label = "reset";
43 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
44 debounce-interval = <60>;
45 linux,code = <KEY_RESTART>;
46 };
47 };
48
49 leds {
50 compatible = "gpio-leds";
51
52 rssi {
53 label = "green:rssi";
54 gpios = <&gpio 5 GPIO_ACTIVE_LOW>;
55 };
56
57 lan {
58 label = "green:lan";
59 gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
60 };
61
62 sys {
63 label = "green:sys";
64 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
65 };
66
67 wifi2g {
68 label = "green:wifi2g";
69 gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
70 linux,default-trigger = "phy0tpt";
71 };
72
73 logo_red {
74 label = "red:logo";
75 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
76 /* match usage in v1 and v2 */
77 linux,default-trigger = "phy0tpt";
78 };
79
80 logo_blue {
81 label = "blue:logo";
82 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
83 /* match usage in v1 and v2 */
84 linux,default-trigger = "phy1tpt";
85
86 };
87
88 led_power: logo_green {
89 label = "green:logo";
90 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
91 /* match usage in v1 and v2 */
92 default_state = "on";
93 };
94 };
95 };
96
97 &state_default {
98 gpio {
99 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
100 function = "gpio";
101 };
102 };
103
104 &spi0 {
105 status = "okay";
106
107 flash@0 {
108 compatible = "jedec,spi-nor";
109 reg = <0>;
110 spi-max-frequency = <40000000>;
111
112 partitions {
113 compatible = "fixed-partitions";
114 #address-cells = <1>;
115 #size-cells = <1>;
116
117 partition@0 {
118 label = "u-boot";
119 reg = <0x0 0x40000>;
120 read-only;
121 };
122
123 partition@40000 {
124 label = "firmware";
125 compatible = "denx,uimage";
126 reg = <0x40000 0xf60000>;
127 };
128
129 config: partition@fa0000 {
130 label = "config";
131 reg = <0xfa0000 0x010000>;
132 read-only;
133
134 compatible = "nvmem-cells";
135 #address-cells = <1>;
136 #size-cells = <1>;
137
138 macaddr_config_8: macaddr@8 {
139 reg = <0x8 0x6>;
140 };
141 };
142
143 partition@fb0000 {
144 label = "tplink";
145 reg = <0xfb0000 0x040000>;
146 read-only;
147 };
148
149 radio: partition@ff0000 {
150 label = "radio";
151 reg = <0xff0000 0x10000>;
152 read-only;
153 };
154 };
155 };
156 };
157
158 &ethernet {
159 pinctrl-names = "default";
160 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
161 };
162
163 &gmac0 {
164 nvmem-cells = <&macaddr_config_8>;
165 nvmem-cell-names = "mac-address";
166 label = "dsa";
167 };
168
169 &switch0 {
170 ports {
171 port@0 {
172 status = "okay";
173 label = "eth0";
174 };
175
176 port@1 {
177 status = "okay";
178 label = "eth1";
179 };
180 };
181 };
182
183 &pcie {
184 status = "okay";
185 };
186
187 &pcie0 {
188 wifi@0,0 {
189 compatible = "mediatek,mt76";
190 reg = <0x0000 0 0 0 0>;
191 mediatek,mtd-eeprom = <&radio 0x0>;
192 ieee80211-freq-limit = <2400000 2500000>;
193 };
194 };
195
196 &pcie1 {
197 wifi@0,0 {
198 compatible = "mediatek,mt76";
199 reg = <0x0000 0 0 0 0>;
200 mediatek,mtd-eeprom = <&radio 0x8000>;
201 ieee80211-freq-limit = <5000000 6000000>;
202 };
203 };