3cc738530cc48ac57f444fccba022048250f25e7
[openwrt/staging/dedeckeh.git] / target / linux / ramips / dts / mt7621_tplink_archer-x6-v3.dtsi
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 aliases {
10 label-mac-device = &gmac0;
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200n8";
19 };
20
21 keys {
22 compatible = "gpio-keys";
23
24 wps {
25 label = "wps";
26 gpios = <&gpio 28 GPIO_ACTIVE_LOW>;
27 debounce-interval = <60>;
28 linux,code = <KEY_WPS_BUTTON>;
29 };
30
31 reset {
32 label = "reset";
33 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
34 debounce-interval = <60>;
35 linux,code = <KEY_RESTART>;
36 };
37 };
38
39 leds {
40 compatible = "gpio-leds";
41
42 led_power: power {
43 label = "green:power";
44 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
45 };
46
47 wan_orange {
48 label = "orange:wan";
49 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
50 };
51
52 lan {
53 label = "green:lan";
54 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
55 };
56
57 wifi5g {
58 label = "green:wifi5g";
59 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
60 linux,default-trigger = "phy1tpt";
61 };
62
63 wifi2g {
64 label = "green:wifi2g";
65 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
66 linux,default-trigger = "phy0tpt";
67 };
68
69 wan_green {
70 label = "green:wan";
71 gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
72 };
73 };
74 };
75
76 &spi0 {
77 status = "okay";
78
79 flash@0 {
80 compatible = "jedec,spi-nor";
81 reg = <0>;
82 spi-max-frequency = <40000000>;
83
84 partitions {
85 compatible = "fixed-partitions";
86 #address-cells = <1>;
87 #size-cells = <1>;
88
89 partition@0 {
90 label = "u-boot";
91 reg = <0x0 0x40000>;
92 read-only;
93 };
94
95 partition@40000 {
96 label = "firmware";
97 compatible = "denx,uimage";
98 reg = <0x40000 0xf60000>;
99 };
100
101 config: partition@fa0000 {
102 label = "config";
103 reg = <0xfa0000 0x50000>;
104 read-only;
105 };
106
107 radio: partition@ff0000 {
108 label = "radio";
109 reg = <0xff0000 0x10000>;
110 read-only;
111 };
112 };
113 };
114 };
115
116 &state_default {
117 gpio {
118 groups = "i2c", "uart2", "uart3", "jtag", "wdt";
119 function = "gpio";
120 };
121 };
122
123 &ethernet {
124 pinctrl-names = "default";
125 pinctrl-0 = <&rgmii1_pins &mdio_pins>;
126 };
127
128 &pcie {
129 status = "okay";
130 };
131
132 &pcie0 {
133 wifi@0,0 {
134 compatible = "mediatek,mt76";
135 reg = <0x0000 0 0 0 0>;
136 mediatek,mtd-eeprom = <&radio 0x0>;
137 nvmem-cells = <&macaddr_config_8>;
138 nvmem-cell-names = "mac-address";
139 mac-address-increment = <1>;
140 ieee80211-freq-limit = <2400000 2500000>;
141 };
142 };
143
144 &pcie1 {
145 wifi@0,0 {
146 compatible = "mediatek,mt76";
147 reg = <0x0000 0 0 0 0>;
148 mediatek,mtd-eeprom = <&radio 0x8000>;
149 nvmem-cells = <&macaddr_config_8>;
150 nvmem-cell-names = "mac-address";
151 mac-address-increment = <2>;
152 ieee80211-freq-limit = <5000000 6000000>;
153 };
154 };
155
156 &gmac0 {
157 nvmem-cells = <&macaddr_config_8>;
158 nvmem-cell-names = "mac-address";
159 };
160
161 &switch0 {
162 ports {
163 port@0 {
164 status = "okay";
165 label = "wan";
166 };
167
168 port@1 {
169 status = "okay";
170 label = "lan1";
171 };
172
173 port@2 {
174 status = "okay";
175 label = "lan2";
176 };
177
178 port@3 {
179 status = "okay";
180 label = "lan3";
181 };
182
183 port@4 {
184 status = "okay";
185 label = "lan4";
186 };
187 };
188 };
189
190 &config {
191 compatible = "nvmem-cells";
192 #address-cells = <1>;
193 #size-cells = <1>;
194
195 macaddr_config_8: macaddr@8 {
196 reg = <0x8 0x6>;
197 };
198 };