ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.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 = <25000000>;
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 compatible = "nvmem-cells";
109 label = "config";
110 reg = <0xfa0000 0x010000>;
111 #address-cells = <1>;
112 #size-cells = <1>;
113 read-only;
114
115 macaddr_config_8: macaddr@8 {
116 reg = <0x8 0x6>;
117 };
118 };
119
120 partition@fb0000 {
121 label = "tplink";
122 reg = <0xfb0000 0x040000>;
123 read-only;
124 };
125
126 radio: partition@ff0000 {
127 compatible = "nvmem-cells";
128 label = "radio";
129 reg = <0xff0000 0x010000>;
130 #address-cells = <1>;
131 #size-cells = <1>;
132 read-only;
133
134 eeprom_radio_0: eeprom@0 {
135 reg = <0x0 0xe00>;
136 };
137 };
138 };
139 };
140 };
141
142 &pcie {
143 status = "okay";
144 };
145
146 &pcie1 {
147 wifi@0,0 {
148 compatible = "mediatek,mt76";
149 reg = <0x0000 0 0 0 0>;
150 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>;
151 nvmem-cell-names = "eeprom", "mac-address";
152 mediatek,disable-radar-background;
153 };
154 };
155
156 &gmac0 {
157 nvmem-cells = <&macaddr_config_8>;
158 nvmem-cell-names = "mac-address";
159 };
160
161 &gmac1 {
162 status = "okay";
163 label = "wan";
164 phy-handle = <&ethphy4>;
165
166 nvmem-cells = <&macaddr_config_8>;
167 nvmem-cell-names = "mac-address";
168 mac-address-increment = <1>;
169 };
170
171 &mdio {
172 ethphy4: ethernet-phy@4 {
173 reg = <4>;
174 };
175 };
176
177 &switch0 {
178 ports {
179 port@0 {
180 status = "okay";
181 label = "lan1";
182 };
183
184 port@1 {
185 status = "okay";
186 label = "lan2";
187 };
188
189 port@2 {
190 status = "okay";
191 label = "lan3";
192 };
193
194 port@3 {
195 status = "okay";
196 label = "lan4";
197 };
198 };
199 };
200
201 &state_default {
202 gpio {
203 groups = "i2c", "uart3", "jtag", "wdt";
204 function = "gpio";
205 };
206 };