ramips: mt7621: convert to nvmem-layout
[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 nvmem-layout {
135 compatible = "fixed-layout";
136 #address-cells = <1>;
137 #size-cells = <1>;
138
139 macaddr_config_8: macaddr@8 {
140 reg = <0x8 0x6>;
141 };
142 };
143 };
144
145 partition@fb0000 {
146 label = "tplink";
147 reg = <0xfb0000 0x040000>;
148 read-only;
149 };
150
151 radio: partition@ff0000 {
152 label = "radio";
153 reg = <0xff0000 0x10000>;
154 read-only;
155
156 nvmem-layout {
157 compatible = "fixed-layout";
158 #address-cells = <1>;
159 #size-cells = <1>;
160
161 eeprom_radio_0: eeprom@0 {
162 reg = <0x0 0x400>;
163 };
164
165 eeprom_radio_8000: eeprom@8000 {
166 reg = <0x8000 0x4da8>;
167 };
168 };
169 };
170 };
171 };
172 };
173
174 &ethernet {
175 pinctrl-names = "default";
176 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
177 };
178
179 &gmac0 {
180 nvmem-cells = <&macaddr_config_8>;
181 nvmem-cell-names = "mac-address";
182 label = "dsa";
183 };
184
185 &switch0 {
186 ports {
187 port@0 {
188 status = "okay";
189 label = "eth0";
190 };
191
192 port@1 {
193 status = "okay";
194 label = "eth1";
195 };
196 };
197 };
198
199 &pcie {
200 status = "okay";
201 };
202
203 &pcie0 {
204 wifi@0,0 {
205 compatible = "mediatek,mt76";
206 reg = <0x0000 0 0 0 0>;
207 nvmem-cells = <&eeprom_radio_0>;
208 nvmem-cell-names = "eeprom";
209 ieee80211-freq-limit = <2400000 2500000>;
210 };
211 };
212
213 &pcie1 {
214 wifi@0,0 {
215 compatible = "mediatek,mt76";
216 reg = <0x0000 0 0 0 0>;
217 nvmem-cells = <&eeprom_radio_8000>;
218 nvmem-cell-names = "eeprom";
219 ieee80211-freq-limit = <5000000 6000000>;
220 };
221 };