ramips: mt7621-dts: mux phy0/4 to gmac1
[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 label = "config";
120 reg = <0xfa0000 0x010000>;
121 read-only;
122 };
123
124 partition@fb0000 {
125 label = "tplink";
126 reg = <0xfb0000 0x040000>;
127 read-only;
128 };
129
130 radio: partition@ff0000 {
131 label = "radio";
132 reg = <0xff0000 0x010000>;
133 read-only;
134 };
135 };
136 };
137 };
138
139 &pcie {
140 status = "okay";
141 };
142
143 &pcie0 {
144 mt76@0,0 {
145 compatible = "mediatek,mt76";
146 reg = <0x0000 0 0 0 0>;
147 mediatek,mtd-eeprom = <&radio 0x0>;
148 nvmem-cells = <&macaddr_config_8>;
149 nvmem-cell-names = "mac-address";
150 ieee80211-freq-limit = <2400000 2500000>;
151 };
152 };
153
154 &pcie1 {
155 mt76@0,0 {
156 compatible = "mediatek,mt76";
157 reg = <0x0000 0 0 0 0>;
158 mediatek,mtd-eeprom = <&radio 0x8000>;
159 nvmem-cells = <&macaddr_config_8>;
160 nvmem-cell-names = "mac-address";
161 mac-address-increment = <(-1)>;
162 ieee80211-freq-limit = <5000000 6000000>;
163 };
164 };
165
166 &gmac0 {
167 nvmem-cells = <&macaddr_config_8>;
168 nvmem-cell-names = "mac-address";
169 };
170
171 &gmac1 {
172 status = "okay";
173 label = "wan";
174 phy-handle = <&ethphy0>;
175
176 nvmem-cells = <&macaddr_config_8>;
177 nvmem-cell-names = "mac-address";
178 mac-address-increment = <1>;
179 };
180
181 &mdio {
182 ethphy0: ethernet-phy@0 {
183 reg = <0>;
184 };
185 };
186
187 &switch0 {
188 ports {
189 port@1 {
190 status = "okay";
191 label = "lan1";
192 };
193
194 port@2 {
195 status = "okay";
196 label = "lan2";
197 };
198
199 port@3 {
200 status = "okay";
201 label = "lan3";
202 };
203
204 port@4 {
205 status = "okay";
206 label = "lan4";
207 };
208 };
209 };
210
211 &state_default {
212 gpio {
213 groups = "i2c", "uart2", "uart3", "jtag", "wdt", "sdhci";
214 function = "gpio";
215 };
216 };
217
218 &xhci {
219 vbus-supply = <&reg_usb_vbus>;
220 };
221
222 &config {
223 compatible = "nvmem-cells";
224 #address-cells = <1>;
225 #size-cells = <1>;
226
227 macaddr_config_8: macaddr@8 {
228 reg = <0x8 0x6>;
229 };
230 };