ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_netgear_sercomm_chj.dtsi
1 // SPDX-License-Identifier: GPL-2.0-only
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "mediatek,mt7621-soc";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 label-mac-device = &gmac0;
17 };
18
19 leds {
20 compatible = "gpio-leds";
21
22 led_power: power {
23 label = "green:power";
24 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
25 };
26
27 usb {
28 label = "green:usb";
29 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
30 trigger-sources = <&xhci_ehci_port1>, <&ehci_port2>;
31 linux,default-trigger = "usbport";
32 };
33
34 internet {
35 label = "green:wan";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 };
38
39 wifi {
40 label = "green:wifi";
41 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
42 linux,default-trigger = "phy0tpt";
43 };
44 };
45
46 keys {
47 compatible = "gpio-keys";
48
49 wps {
50 label = "wps";
51 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
52 linux,code = <KEY_WPS_BUTTON>;
53 };
54
55 reset {
56 label = "reset";
57 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
58 linux,code = <KEY_RESTART>;
59 };
60 };
61
62 reg_usb_vbus: regulator {
63 compatible = "regulator-fixed";
64 regulator-name = "usb_vbus";
65 regulator-min-microvolt = <5000000>;
66 regulator-max-microvolt = <5000000>;
67 gpio = <&gpio 10 GPIO_ACTIVE_HIGH>;
68 enable-active-high;
69 };
70 };
71
72 &xhci {
73 vbus-supply = <&reg_usb_vbus>;
74 };
75
76 &pcie {
77 status = "okay";
78 };
79
80 &pcie0 {
81 wifi@0,0 {
82 compatible = "mediatek,mt76";
83 reg = <0x0 0 0 0 0>;
84 mediatek,mtd-eeprom = <&factory 0x8000>;
85 ieee80211-freq-limit = <5000000 6000000>;
86 };
87 };
88
89 &pcie1 {
90 wifi@0,0 {
91 compatible = "mediatek,mt76";
92 reg = <0x0 0 0 0 0>;
93 mediatek,mtd-eeprom = <&factory 0x0>;
94 ieee80211-freq-limit = <2400000 2500000>;
95 };
96 };
97
98 &gmac0 {
99 nvmem-cells = <&macaddr_factory_4>;
100 nvmem-cell-names = "mac-address";
101 };
102
103 &gmac1 {
104 status = "okay";
105 label = "wan";
106 phy-handle = <&ethphy4>;
107
108 nvmem-cells = <&macaddr_factory_4>;
109 nvmem-cell-names = "mac-address";
110 mac-address-increment = <2>;
111 };
112
113 &mdio {
114 ethphy4: ethernet-phy@4 {
115 reg = <4>;
116 };
117 };
118
119 &switch0 {
120 ports {
121 port@0 {
122 status = "okay";
123 label = "lan4";
124 };
125
126 port@1 {
127 status = "okay";
128 label = "lan3";
129 };
130
131 port@2 {
132 status = "okay";
133 label = "lan2";
134 };
135
136 port@3 {
137 status = "okay";
138 label = "lan1";
139 };
140 };
141 };
142
143 &state_default {
144 gpio {
145 groups = "uart3", "uart2", "jtag", "wdt";
146 function = "gpio";
147 };
148 };
149
150 &nand {
151 status = "okay";
152
153 partitions {
154 compatible = "fixed-partitions";
155 #address-cells = <1>;
156 #size-cells = <1>;
157
158 partition@0 {
159 label = "u-boot";
160 reg = <0x0 0x100000>;
161 read-only;
162 };
163
164 partition@100000 {
165 label = "SC PART_MAP";
166 reg = <0x100000 0x100000>;
167 read-only;
168 };
169
170 partition@200000 {
171 label = "kernel";
172 reg = <0x200000 0x400000>;
173 };
174
175 partition@600000 {
176 label = "ubi";
177 reg = <0x600000 0x2800000>;
178 };
179
180 partition@2e00000 {
181 label = "reserved0";
182 reg = <0x2e00000 0x1800000>;
183 read-only;
184 };
185
186 factory: partition@4600000 {
187 label = "factory";
188 reg = <0x4600000 0x200000>;
189 read-only;
190 };
191
192 partition@4800000 {
193 label = "reserved1";
194 reg = <0x4800000 0x3800000>;
195 read-only;
196 };
197 };
198 };
199
200 &factory {
201 compatible = "nvmem-cells";
202 #address-cells = <1>;
203 #size-cells = <1>;
204
205 macaddr_factory_4: macaddr@4 {
206 reg = <0x4 0x6>;
207 };
208 };