ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/staging/jow.git] / target / linux / ramips / dts / mt7621_iodata_wn-xx-xr.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 led-boot = &led_power;
11 led-failsafe = &led_power;
12 led-running = &led_power;
13 led-upgrade = &led_power;
14 label-mac-device = &gmac1;
15 };
16
17 leds {
18 compatible = "gpio-leds";
19
20 wps {
21 label = "green:wps";
22 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
23 };
24
25 led_power: power {
26 label = "green:power";
27 gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
28 };
29 };
30
31 keys {
32 compatible = "gpio-keys";
33
34 reset {
35 label = "reset";
36 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
37 linux,code = <KEY_RESTART>;
38 };
39
40 repeater {
41 label = "repeater";
42 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
43 linux,code = <BTN_0>;
44 linux,input-type = <EV_SW>;
45 };
46
47 wps {
48 label = "wps";
49 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
50 linux,code = <KEY_WPS_BUTTON>;
51 };
52 };
53 };
54
55 &nand {
56 status = "okay";
57
58 partitions: partitions {
59 compatible = "fixed-partitions";
60 #address-cells = <1>;
61 #size-cells = <1>;
62
63 partition@0 {
64 label = "u-boot";
65 reg = <0x0 0x0100000>;
66 read-only;
67 };
68
69 partition@100000 {
70 label = "u-boot-env";
71 reg = <0x0100000 0x0100000>;
72 read-only;
73 };
74
75 factory: partition@200000 {
76 label = "factory";
77 reg = <0x0200000 0x0100000>;
78 };
79
80 partition@300000 {
81 label = "SecondBoot";
82 reg = <0x0300000 0x0100000>;
83 read-only;
84 };
85
86 partition@400000 {
87 label = "kernel";
88 reg = <0x0400000 0x0400000>;
89 };
90
91 partition@800000 {
92 label = "ubi";
93 reg = <0x0800000 0x2e00000>;
94 };
95
96 partition@3600000 {
97 label = "Config";
98 reg = <0x3600000 0x0100000>;
99 read-only;
100 };
101
102 partition@3700000 {
103 label = "firmware_2";
104 reg = <0x3700000 0x3200000>;
105 };
106
107 partition@6900000 {
108 label = "Config_2";
109 reg = <0x6900000 0x0100000>;
110 read-only;
111 };
112
113 partition@6a00000 {
114 label = "persist";
115 reg = <0x6a00000 0x0100000>;
116 };
117 };
118 };
119
120 &gmac0 {
121 nvmem-cells = <&macaddr_factory_e000>;
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_e006>;
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 &pcie {
165 status = "okay";
166 };
167
168 &state_default {
169 gpio {
170 groups = "uart2", "uart3", "wdt";
171 function = "gpio";
172 };
173 };
174
175 &xhci {
176 status = "disabled";
177 };
178
179 &factory {
180 compatible = "nvmem-cells";
181 #address-cells = <1>;
182 #size-cells = <1>;
183
184 macaddr_factory_e000: macaddr@e000 {
185 reg = <0xe000 0x6>;
186 };
187
188 macaddr_factory_e006: macaddr@e006 {
189 reg = <0xe006 0x6>;
190 };
191 };