ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mi-router-cr660x.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_sys_yellow;
11 led-failsafe = &led_sys_yellow;
12 led-running = &led_sys_blue;
13 led-upgrade = &led_sys_yellow;
14 label-mac-device = &gmac0;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,115200n8";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_sys_yellow: sys_yellow {
25 label = "yellow:sys";
26 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
27 };
28
29 led_sys_blue: sys_blue {
30 label = "blue:sys";
31 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
32 };
33
34 net_yellow {
35 label = "yellow:net";
36 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
37 };
38
39 net_blue {
40 label = "blue:net";
41 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
42 };
43 };
44
45 keys {
46 compatible = "gpio-keys";
47
48 reset {
49 label = "reset";
50 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 };
53
54 wps {
55 label = "wps";
56 gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_WPS_BUTTON>;
58 };
59 };
60 };
61
62 &nand {
63 status = "okay";
64
65 partitions {
66 compatible = "fixed-partitions";
67 #address-cells = <1>;
68 #size-cells = <1>;
69
70 partition@0 {
71 label = "Bootloader";
72 reg = <0x0 0x80000>;
73 read-only;
74 };
75
76 partition@80000 {
77 label = "Nvram";
78 reg = <0x80000 0x40000>;
79 read-only;
80 };
81
82 partition@c0000 {
83 label = "Bdata";
84 reg = <0xc0000 0x40000>;
85 read-only;
86 };
87
88 factory: partition@100000 {
89 label = "Factory";
90 reg = <0x100000 0x80000>;
91 read-only;
92 };
93
94 partition@180000 {
95 label = "crash";
96 reg = <0x180000 0x40000>;
97 read-only;
98 };
99
100 partition@1c0000 {
101 label = "crash_log";
102 reg = <0x1c0000 0x40000>;
103 read-only;
104 };
105
106 /* "kernel" and "ubi" partition is the result of
107 * squashing next consecutive stock partitions:
108 * 1. firmware 0x0200000 - 0x2000000 (Stock firmware 0)
109 * 2. firmware1 0x2000000 - 0x3e00000 (Stock firmware 1)
110 * 3. overlay 0x3e00000 - 0x7000000 (Stock fw Ubi overlay)
111 * 4. obr 0x7000000 - 0x8000000 (Unallocated?)
112 */
113
114 partition@200000 {
115 label = "kernel";
116 reg = <0x200000 0x400000>;
117 };
118
119 partition@600000 {
120 label = "ubi";
121 reg = <0x600000 0x7980000>;
122 };
123
124 /*
125 * Leave 512 KiB for the bad block table
126 */
127 };
128 };
129
130 &pcie {
131 status = "okay";
132 };
133
134 &pcie1 {
135 wifi@0,0 {
136 compatible = "mediatek,mt76";
137 reg = <0x0000 0 0 0 0>;
138 mediatek,mtd-eeprom = <&factory 0x0>;
139 };
140 };
141
142 &gmac0 {
143 nvmem-cells = <&macaddr_factory_3fff4>;
144 nvmem-cell-names = "mac-address";
145 };
146
147 &gmac1 {
148 status = "okay";
149 label = "wan";
150 phy-handle = <&ethphy4>;
151
152 nvmem-cells = <&macaddr_factory_3fffa>;
153 nvmem-cell-names = "mac-address";
154 };
155
156 &mdio {
157 ethphy4: ethernet-phy@4 {
158 reg = <4>;
159 };
160 };
161
162 &switch0 {
163 ports {
164 port@0 {
165 status = "okay";
166 label = "lan1";
167 };
168
169 port@1 {
170 status = "okay";
171 label = "lan2";
172 };
173
174 port@2 {
175 status = "okay";
176 label = "lan3";
177 };
178 };
179 };
180
181 &state_default {
182 gpio {
183 groups = "jtag", "uart3", "wdt";
184 function = "gpio";
185 };
186 };
187
188 &factory {
189 compatible = "nvmem-cells";
190 #address-cells = <1>;
191 #size-cells = <1>;
192
193 macaddr_factory_3fff4: macaddr@3fff4 {
194 reg = <0x3fff4 0x6>;
195 };
196
197 macaddr_factory_3fffa: macaddr@3fffa {
198 reg = <0x3fffa 0x6>;
199 };
200 };