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