ramips: mt7621: convert to nvmem-layout
[openwrt/staging/wigyori.git] / target / linux / ramips / dts / mt7621_tplink_tl-wpa8631p-v3.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
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,tl-wpa8631p-v3", "mediatek,mt7621-soc";
10 model = "TP-Link TL-WPA8631P v3";
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 keys {
21 compatible = "gpio-keys";
22
23 reset {
24 label = "reset";
25 linux,code = <KEY_RESTART>;
26 gpios = <&gpio 31 GPIO_ACTIVE_LOW>;
27 debounce-interval = <60>;
28 };
29
30 led {
31 label = "led";
32 linux,code = <KEY_LIGHTS_TOGGLE>;
33 gpios = <&gpio 30 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 };
36
37 pair {
38 label = "pair";
39 linux,code = <BTN_1>;
40 gpios = <&gpio 32 GPIO_ACTIVE_LOW>;
41 debounce-interval = <60>;
42 };
43
44 wifi {
45 label = "wifi";
46 linux,code = <KEY_RFKILL>;
47 gpios = <&gpio 33 GPIO_ACTIVE_LOW>;
48 debounce-interval = <60>;
49 };
50 };
51
52 leds {
53 compatible = "gpio-leds";
54
55 led_power: power {
56 label = "green:power";
57 gpios = <&gpio 22 GPIO_ACTIVE_LOW>;
58 };
59
60 lan {
61 label = "green:lan";
62 gpios = <&gpio 29 GPIO_ACTIVE_LOW>;
63 };
64
65 wifi2g {
66 label = "green:wifi2g";
67 gpios = <&gpio 23 GPIO_ACTIVE_LOW>;
68 linux,default-trigger = "phy0tpt";
69 };
70
71 wifi5g {
72 label = "green:wifi5g";
73 gpios = <&gpio 24 GPIO_ACTIVE_LOW>;
74 linux,default-trigger = "phy1tpt";
75 };
76 };
77
78 gpio-export {
79 compatible = "gpio-export";
80
81 led_control {
82 gpio-export,name = "tp-link:led:control";
83 gpio-export,output = <0>;
84 gpios = <&gpio 25 GPIO_ACTIVE_LOW>;
85 };
86 };
87 };
88
89 &spi0 {
90 status = "okay";
91
92 flash@0 {
93 compatible = "jedec,spi-nor";
94 reg = <0>;
95 spi-max-frequency = <25000000>;
96
97 partitions {
98 compatible = "fixed-partitions";
99 #address-cells = <1>;
100 #size-cells = <1>;
101
102 partition@0 {
103 label = "u-boot";
104 reg = <0x0 0x20000>;
105 read-only;
106 };
107
108 partition@20000 {
109 compatible = "tplink,firmware";
110 label = "firmware";
111 reg = <0x20000 0x710000>;
112 };
113
114 config: partition@730000 {
115 label = "config";
116 reg = <0x730000 0xc0000>;
117 read-only;
118
119 nvmem-layout {
120 compatible = "fixed-layout";
121 #address-cells = <1>;
122 #size-cells = <1>;
123
124 macaddr_config_2008: macaddr@2008 {
125 reg = <0x2008 0x6>;
126 };
127 };
128 };
129
130 radio: partition@7f0000 {
131 label = "radio";
132 reg = <0x7f0000 0x10000>;
133 read-only;
134
135 nvmem-layout {
136 compatible = "fixed-layout";
137 #address-cells = <1>;
138 #size-cells = <1>;
139
140 eeprom_radio_0: eeprom@0 {
141 reg = <0x0 0x400>;
142 };
143
144 eeprom_radio_8000: eeprom@8000 {
145 reg = <0x8000 0x4da8>;
146 };
147 };
148 };
149 };
150 };
151 };
152
153 &state_default {
154 gpio {
155 groups = "rgmii2", "wdt";
156 function = "gpio";
157 };
158 };
159
160 &pcie {
161 status = "okay";
162 };
163
164 &pcie0 {
165 wifi@0,0 {
166 compatible = "mediatek,mt76";
167 reg = <0x0000 0 0 0 0>;
168 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_2008>;
169 nvmem-cell-names = "eeprom", "mac-address";
170 ieee80211-freq-limit = <2400000 2500000>;
171 };
172 };
173
174 &pcie1 {
175 wifi@0,0 {
176 compatible = "mediatek,mt76";
177 reg = <0x0000 0 0 0 0>;
178 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_2008>;
179 nvmem-cell-names = "eeprom", "mac-address";
180 mac-address-increment = <1>;
181 ieee80211-freq-limit = <5000000 6000000>;
182 };
183 };
184
185 &ethernet {
186 pinctrl-0 = <&mdio_pins>, <&rgmii1_pins>;
187 };
188
189 &gmac0 {
190 nvmem-cells = <&macaddr_config_2008>;
191 nvmem-cell-names = "mac-address";
192 };
193
194 &switch0 {
195 ports {
196 port@0 {
197 status = "okay";
198 label = "plc0";
199 };
200
201 port@1 {
202 status = "okay";
203 label = "lan1";
204 };
205
206 port@2 {
207 status = "okay";
208 label = "lan2";
209 };
210
211 port@3 {
212 status = "okay";
213 label = "lan3";
214 };
215 };
216 };