ramips: convert rt2x00 EEPROM to NVMEM format
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_tplink_archer-c6u-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-c6u-v1", "mediatek,mt7621-soc";
10 model = "TP-Link Archer C6U 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 = "wps";
35 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
36 linux,code = <KEY_WPS_BUTTON>;
37 };
38 };
39
40 leds {
41 compatible = "gpio-leds";
42
43 led_power: power {
44 label = "green:power";
45 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
46 };
47
48 usb {
49 label = "green:usb";
50 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
51 trigger-sources = <&ehci_port2>;
52 linux,default-trigger = "usbport";
53 };
54
55 wan-orange {
56 label = "orange:wan";
57 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
58 };
59
60 lan {
61 label = "green:lan";
62 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
63 };
64
65 wifi5g {
66 label = "green:wifi5g";
67 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
68 linux,default-trigger = "phy1tpt";
69 };
70
71 wifi2g {
72 label = "green:wifi2g";
73 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
74 linux,default-trigger = "phy0tpt";
75 };
76
77 wan-green {
78 label = "green:wan";
79 gpios = <&gpio 45 GPIO_ACTIVE_LOW>;
80 };
81 };
82
83 reg_usb_vbus: regulator {
84 compatible = "regulator-fixed";
85 regulator-name = "usb_vbus";
86 regulator-min-microvolt = <5000000>;
87 regulator-max-microvolt = <5000000>;
88 gpio = <&gpio 3 GPIO_ACTIVE_HIGH>;
89 enable-active-high;
90 };
91 };
92
93 &spi0 {
94 status = "okay";
95
96 flash@0 {
97 compatible = "jedec,spi-nor";
98 reg = <0>;
99 spi-max-frequency = <80000000>;
100
101 partitions {
102 compatible = "fixed-partitions";
103 #address-cells = <1>;
104 #size-cells = <1>;
105
106 partition@0 {
107 label = "u-boot";
108 reg = <0x000000 0x040000>;
109 read-only;
110 };
111
112 partition@40000 {
113 compatible = "denx,uimage";
114 label = "firmware";
115 reg = <0x040000 0xf60000>;
116 };
117
118 config: partition@fa0000 {
119 compatible = "nvmem-cells";
120 label = "config";
121 reg = <0xfa0000 0x010000>;
122 #address-cells = <1>;
123 #size-cells = <1>;
124 read-only;
125
126 macaddr_config_8: macaddr@8 {
127 reg = <0x8 0x6>;
128 };
129 };
130
131 partition@fb0000 {
132 label = "tplink";
133 reg = <0xfb0000 0x040000>;
134 read-only;
135 };
136
137 radio: partition@ff0000 {
138 compatible = "nvmem-cells";
139 label = "radio";
140 reg = <0xff0000 0x010000>;
141 #address-cells = <1>;
142 #size-cells = <1>;
143 read-only;
144
145 eeprom_radio_0: eeprom@0 {
146 reg = <0x0 0x400>;
147 };
148
149 eeprom_radio_8000: eeprom@8000 {
150 reg = <0x8000 0x4da8>;
151 };
152 };
153 };
154 };
155 };
156
157 &pcie {
158 status = "okay";
159 };
160
161 &pcie0 {
162 mt76@0,0 {
163 compatible = "mediatek,mt76";
164 reg = <0x0000 0 0 0 0>;
165 nvmem-cells = <&eeprom_radio_0>, <&macaddr_config_8>;
166 nvmem-cell-names = "eeprom", "mac-address";
167 ieee80211-freq-limit = <2400000 2500000>;
168 };
169 };
170
171 &pcie1 {
172 mt76@0,0 {
173 compatible = "mediatek,mt76";
174 reg = <0x0000 0 0 0 0>;
175 nvmem-cells = <&eeprom_radio_8000>, <&macaddr_config_8>;
176 nvmem-cell-names = "eeprom", "mac-address";
177 mac-address-increment = <(-1)>;
178 ieee80211-freq-limit = <5000000 6000000>;
179 };
180 };
181
182 &gmac0 {
183 nvmem-cells = <&macaddr_config_8>;
184 nvmem-cell-names = "mac-address";
185 };
186
187 &gmac1 {
188 status = "okay";
189 label = "wan";
190 phy-handle = <&ethphy0>;
191
192 nvmem-cells = <&macaddr_config_8>;
193 nvmem-cell-names = "mac-address";
194 mac-address-increment = <1>;
195 };
196
197 &mdio {
198 ethphy0: ethernet-phy@0 {
199 reg = <0>;
200 };
201 };
202
203 &switch0 {
204 ports {
205 port@1 {
206 status = "okay";
207 label = "lan1";
208 };
209
210 port@2 {
211 status = "okay";
212 label = "lan2";
213 };
214
215 port@3 {
216 status = "okay";
217 label = "lan3";
218 };
219
220 port@4 {
221 status = "okay";
222 label = "lan4";
223 };
224 };
225 };
226
227 &state_default {
228 gpio {
229 groups = "i2c", "uart2", "uart3", "jtag", "wdt", "sdhci";
230 function = "gpio";
231 };
232 };
233
234 &xhci {
235 vbus-supply = <&reg_usb_vbus>;
236 };