ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_edimax_rx21s.dtsi
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 aliases {
10 label-mac-device = &gmac0;
11 led-boot = &led_power;
12 led-failsafe = &led_power;
13 led-running = &led_power;
14 led-upgrade = &led_power;
15 };
16
17 keys {
18 compatible = "gpio-keys";
19
20 reset {
21 label = "reset";
22 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
23 linux,code = <KEY_RESTART>;
24 };
25
26 wps {
27 label = "wps";
28 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
29 linux,code = <KEY_WPS_BUTTON>;
30 };
31 };
32
33 leds {
34 compatible = "gpio-leds";
35
36 led_power: led_1 {
37 label = "red:led1";
38 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
39 };
40
41 led_2 {
42 label = "red:led2";
43 gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
44 };
45
46 led_3 {
47 label = "red:led3";
48 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
49 };
50
51 led_4 {
52 label = "red:led4";
53 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
54 };
55 };
56 };
57
58 &spi0 {
59 status = "okay";
60
61 flash@0 {
62 compatible = "jedec,spi-nor";
63 reg = <0>;
64 spi-max-frequency = <40000000>;
65
66 partitions {
67 compatible = "fixed-partitions";
68 #address-cells = <1>;
69 #size-cells = <1>;
70
71 partition@0 {
72 label = "u-boot";
73 reg = <0x0 0x30000>;
74 read-only;
75 };
76
77 partition@30000 {
78 label = "u-boot-env";
79 reg = <0x30000 0x10000>;
80 read-only;
81 };
82
83 factory: partition@40000 {
84 label = "factory";
85 reg = <0x40000 0x10000>;
86 read-only;
87 };
88
89 partition@50000 {
90 compatible = "denx,uimage";
91 label = "firmware";
92 reg = <0x50000 0xfb0000>;
93 };
94 };
95 };
96 };
97
98 &pcie {
99 status = "okay";
100 };
101
102 &pcie0 {
103 wifi0: wifi@0,0 {
104 compatible = "mediatek,mt76";
105 reg = <0x0000 0 0 0 0>;
106 mediatek,mtd-eeprom = <&factory 0x0000>;
107 ieee80211-freq-limit = <2400000 2500000>;
108 };
109 };
110
111 &pcie1 {
112 wifi1: wifi@0,0 {
113 compatible = "mediatek,mt76";
114 reg = <0x0000 0 0 0 0>;
115 mediatek,mtd-eeprom = <&factory 0x8000>;
116 ieee80211-freq-limit = <5000000 6000000>;
117 };
118 };
119
120 &gmac0 {
121 nvmem-cells = <&macaddr_factory_4>;
122 nvmem-cell-names = "mac-address";
123 };
124
125 &gmac1 {
126 status = "okay";
127 label = "wan";
128 phy-handle = <&ethphy0>;
129
130 nvmem-cells = <&macaddr_factory_4>;
131 nvmem-cell-names = "mac-address";
132 };
133
134 &mdio {
135 ethphy0: ethernet-phy@0 {
136 reg = <0>;
137 };
138 };
139
140 &switch0 {
141 ports {
142 port@1 {
143 status = "okay";
144 label = "lan4";
145 };
146
147 port@2 {
148 status = "okay";
149 label = "lan3";
150 };
151
152 port@3 {
153 status = "okay";
154 label = "lan2";
155 };
156
157 port@4 {
158 status = "okay";
159 label = "lan1";
160 };
161 };
162 };
163
164 &state_default {
165 gpio {
166 groups = "uart3", "uart2", "jtag", "wdt";
167 function = "gpio";
168 };
169 };
170
171 &xhci {
172 status = "disabled";
173 };
174
175 &factory {
176 compatible = "nvmem-cells";
177 #address-cells = <1>;
178 #size-cells = <1>;
179
180 macaddr_factory_4: macaddr@4 {
181 reg = <0x4 0x6>;
182 };
183 };