264c908c45b61bdeb8861d1222e2eb06ab08de5c
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_keenetic_kn-3010.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 #include "mt7621.dtsi"
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 / {
8 compatible = "keenetic,kn-3010", "mediatek,mt7621-soc";
9 model = "Keenetic KN-3010";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 label-mac-device = &gmac0;
17 };
18
19 chosen {
20 bootargs = "console=ttyS0,115200";
21 };
22
23 leds {
24 compatible = "gpio-leds";
25
26 led_power: power {
27 label = "green:power";
28 gpios = <&gpio 45 GPIO_ACTIVE_HIGH>;
29 };
30
31 internet {
32 label = "green:internet";
33 gpios = <&gpio 46 GPIO_ACTIVE_LOW>;
34 };
35
36 wifi2 {
37 label = "green:wifi2";
38 gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
39 linux,default-trigger = "phy0tpt";
40 };
41
42 wifi5 {
43 label = "green:wifi5";
44 gpios = <&gpio 48 GPIO_ACTIVE_LOW>;
45 linux,default-trigger = "phy1tpt";
46 };
47 };
48
49 keys {
50 compatible = "gpio-keys";
51
52 fn {
53 label = "fn";
54 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
55 linux,code = <BTN_0>;
56 };
57
58 reset {
59 label = "reset";
60 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
61 linux,code = <KEY_RESTART>;
62 };
63
64 wps {
65 label = "wps";
66 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
67 linux,code = <KEY_WPS_BUTTON>;
68 };
69 };
70
71 virtual_flash {
72 compatible = "mtd-concat";
73 devices = <&firmware1 &firmware2>;
74
75 partitions {
76 compatible = "fixed-partitions";
77 #address-cells = <1>;
78 #size-cells = <1>;
79
80 partition@0 {
81 compatible = "denx,uimage";
82 label = "firmware";
83 reg = <0x0 0x1ec0000>;
84 };
85 };
86 };
87 };
88
89 &state_default {
90 gpio {
91 groups = "uart3", "sdhci";
92 function = "gpio";
93 };
94 };
95
96 &xhci {
97 status = "disabled";
98 };
99
100 &spi0 {
101 status = "okay";
102
103 flash@0 {
104 compatible = "jedec,spi-nor";
105 reg = <0>;
106 spi-max-frequency = <31000000>;
107
108 partitions: partitions {
109 compatible = "fixed-partitions";
110 #address-cells = <1>;
111 #size-cells = <1>;
112
113 partition@0 {
114 label = "u-boot";
115 reg = <0x0 0x30000>;
116 read-only;
117 };
118
119 partition@30000 {
120 label = "u-config";
121 reg = <0x30000 0x10000>;
122 read-only;
123 };
124
125 factory: partition@40000 {
126 label = "rf-eeprom";
127 reg = <0x40000 0x10000>;
128 read-only;
129
130 nvmem-layout {
131 compatible = "fixed-layout";
132 #address-cells = <1>;
133 #size-cells = <1>;
134
135 eeprom_factory_0: eeprom@0 {
136 reg = <0x0 0x400>;
137 };
138
139 eeprom_factory_400: eeprom@400 {
140 reg = <0x400 0x4da8>;
141 };
142
143 macaddr_factory_4: macaddr@4 {
144 reg = <0x4 0x6>;
145 };
146
147 macaddr_factory_28: macaddr@28 {
148 reg = <0x28 0x6>;
149 };
150 };
151 };
152
153 firmware1: partition@50000 {
154 label = "firmware_1";
155 reg = <0x50000 0xf60000>;
156 };
157
158 partition@fb0000 {
159 label = "config_1";
160 reg = <0xfb0000 0x40000>;
161 read-only;
162 };
163
164 partition@ff0000 {
165 label = "dump";
166 reg = <0xff0000 0x10000>;
167 read-only;
168 };
169
170 partition@1000000 {
171 label = "u-state";
172 reg = <0x1000000 0x30000>;
173 read-only;
174 };
175
176 partition@1030000 {
177 label = "u-config_res";
178 reg = <0x1030000 0x10000>;
179 read-only;
180 };
181
182 partition@1040000 {
183 label = "rf-eeprom_res";
184 reg = <0x1040000 0x10000>;
185 read-only;
186 };
187
188 firmware2: partition@1050000 {
189 label = "firmware_2";
190 reg = <0x1050000 0xf60000>;
191 };
192
193 partition@1fb0000 {
194 label = "config_2";
195 reg = <0x1fb0000 0x40000>;
196 read-only;
197 };
198 };
199 };
200 };
201
202 &mdio {
203 ethphy0: ethernet-phy@0 {
204 reg = <0>;
205 };
206 };
207
208 &gmac0 {
209 nvmem-cells = <&macaddr_factory_4>;
210 nvmem-cell-names = "mac-address";
211 };
212
213 &gmac1 {
214 status = "okay";
215 label = "wan";
216 phy-handle = <&ethphy0>;
217
218 nvmem-cells = <&macaddr_factory_28>;
219 nvmem-cell-names = "mac-address";
220 };
221
222 &switch0 {
223 ports {
224 port@1 {
225 status = "okay";
226 label = "lan1";
227 };
228
229 port@2 {
230 status = "okay";
231 label = "lan2";
232 };
233
234 port@3 {
235 status = "okay";
236 label = "lan3";
237 };
238
239 port@4 {
240 status = "okay";
241 label = "lan4";
242 };
243 };
244 };
245
246 &pcie {
247 status = "okay";
248 };
249
250 &pcie0 {
251 wifi@0,0 {
252 compatible = "mediatek,mt76";
253 reg = <0x0000 0 0 0 0>;
254 nvmem-cells = <&eeprom_factory_0>;
255 nvmem-cell-names = "eeprom";
256 ieee80211-freq-limit = <2400000 2500000>;
257 };
258 };
259
260 &pcie1 {
261 wifi@0,0 {
262 compatible = "mediatek,mt76";
263 reg = <0x0000 0 0 0 0>;
264 nvmem-cells = <&eeprom_factory_400>;
265 nvmem-cell-names = "eeprom";
266 ieee80211-freq-limit = <5000000 6000000>;
267 };
268 };