ramips: convert MT7613 and MT7615 EEPROM to NVMEM format for MT7621
[openwrt/staging/jow.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 compatible = "nvmem-cells";
151 label = "radio";
152 reg = <0xff0000 0x10000>;
153 #address-cells = <1>;
154 #size-cells = <1>;
155 read-only;
156
157 eeprom_radio_0: eeprom@0 {
158 reg = <0x0 0x400>;
159 };
160
161 eeprom_radio_8000: eeprom@8000 {
162 reg = <0x8000 0x4da8>;
163 };
164 };
165 };
166 };
167 };
168
169 &ethernet {
170 pinctrl-names = "default";
171 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
172 };
173
174 &gmac0 {
175 nvmem-cells = <&macaddr_config_8>;
176 nvmem-cell-names = "mac-address";
177 label = "dsa";
178 };
179
180 &switch0 {
181 ports {
182 port@0 {
183 status = "okay";
184 label = "eth0";
185 };
186
187 port@1 {
188 status = "okay";
189 label = "eth1";
190 };
191 };
192 };
193
194 &pcie {
195 status = "okay";
196 };
197
198 &pcie0 {
199 wifi@0,0 {
200 compatible = "mediatek,mt76";
201 reg = <0x0000 0 0 0 0>;
202 nvmem-cells = <&eeprom_radio_0>;
203 nvmem-cell-names = "eeprom";
204 ieee80211-freq-limit = <2400000 2500000>;
205 };
206 };
207
208 &pcie1 {
209 wifi@0,0 {
210 compatible = "mediatek,mt76";
211 reg = <0x0000 0 0 0 0>;
212 nvmem-cells = <&eeprom_radio_8000>;
213 nvmem-cell-names = "eeprom";
214 ieee80211-freq-limit = <5000000 6000000>;
215 };
216 };