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