ramips: Add support for TP-Link TL-WPA8631P v3
[openwrt/staging/hauke.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 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
120 radio: partition@7f0000 {
121 label = "radio";
122 reg = <0x7f0000 0x10000>;
123 read-only;
124 };
125 };
126 };
127 };
128
129 &state_default {
130 gpio {
131 groups = "rgmii2", "wdt";
132 function = "gpio";
133 };
134 };
135
136 &pcie {
137 status = "okay";
138 };
139
140 &pcie0 {
141 wifi@0,0 {
142 compatible = "mediatek,mt76";
143 reg = <0x0000 0 0 0 0>;
144 mediatek,mtd-eeprom = <&radio 0x0>;
145 nvmem-cells = <&macaddr_config_2008>;
146 nvmem-cell-names = "mac-address";
147 ieee80211-freq-limit = <2400000 2500000>;
148 };
149 };
150
151 &pcie1 {
152 wifi@0,0 {
153 compatible = "mediatek,mt76";
154 reg = <0x0000 0 0 0 0>;
155 mediatek,mtd-eeprom = <&radio 0x8000>;
156 nvmem-cells = <&macaddr_config_2008>;
157 nvmem-cell-names = "mac-address";
158 mac-address-increment = <1>;
159 ieee80211-freq-limit = <5000000 6000000>;
160 };
161 };
162
163 &gmac0 {
164 nvmem-cells = <&macaddr_config_2008>;
165 nvmem-cell-names = "mac-address";
166 };
167
168 &switch0 {
169 ports {
170 port@0 {
171 status = "okay";
172 label = "plc0";
173 };
174
175 port@1 {
176 status = "okay";
177 label = "lan1";
178 };
179
180 port@2 {
181 status = "okay";
182 label = "lan2";
183 };
184
185 port@3 {
186 status = "okay";
187 label = "lan3";
188 };
189 };
190 };
191
192 &config {
193 compatible = "nvmem-cells";
194 #address-cells = <1>;
195 #size-cells = <1>;
196
197 macaddr_config_2008: macaddr@2008 {
198 reg = <0x2008 0x6>;
199 };
200 };