ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_glinet_gl-mt1300.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 = "glinet,gl-mt1300", "mediatek,mt7621-soc";
10 model = "GL.iNet GL-MT1300";
11
12 aliases {
13 led-boot = &led_run;
14 led-failsafe = &led_run;
15 led-running = &led_run;
16 led-upgrade = &led_run;
17 label-mac-device = &gmac1;
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 18 GPIO_ACTIVE_LOW>;
30 linux,code = <KEY_RESTART>;
31 };
32
33 switch {
34 label = "switch";
35 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
36 linux,code = <BTN_0>;
37 linux,input-type = <EV_SW>;
38 };
39 };
40
41 leds {
42 compatible = "gpio-leds";
43
44 led_run: run {
45 label = "blue:run";
46 gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
47 };
48
49 system {
50 label = "white:system";
51 gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
52 };
53 };
54 };
55
56 &i2c {
57 status = "okay";
58 };
59
60 &sdhci {
61 status = "okay";
62 };
63
64 &spi0 {
65 status = "okay";
66
67 flash@0 {
68 compatible = "jedec,spi-nor";
69 reg = <0>;
70 spi-max-frequency = <80000000>;
71 m25p,fast-read;
72 broken-flash-reset;
73
74 partitions {
75 compatible = "fixed-partitions";
76 #address-cells = <1>;
77 #size-cells = <1>;
78
79 partition@0 {
80 label = "u-boot";
81 reg = <0x0 0x30000>;
82 read-only;
83 };
84
85 partition@30000 {
86 label = "u-boot-env";
87 reg = <0x30000 0x10000>;
88 read-only;
89 };
90
91 factory: partition@40000 {
92 label = "factory";
93 reg = <0x40000 0x10000>;
94 read-only;
95 };
96
97 partition@50000 {
98 compatible = "denx,uimage";
99 label = "firmware";
100 reg = <0x50000 0x1fb0000>;
101 };
102 };
103 };
104 };
105
106 &pcie {
107 status = "okay";
108 };
109
110 &pcie0 {
111 wifi@0,0 {
112 compatible = "mediatek,mt76";
113 reg = <0x0000 0 0 0 0>;
114 mediatek,mtd-eeprom = <&factory 0x0>;
115 };
116 };
117
118 &gmac0 {
119 nvmem-cells = <&macaddr_factory_4000>;
120 nvmem-cell-names = "mac-address";
121 mac-address-increment = <1>;
122 };
123
124 &gmac1 {
125 status = "okay";
126 label = "wan";
127 phy-handle = <&ethphy4>;
128
129 nvmem-cells = <&macaddr_factory_4000>;
130 nvmem-cell-names = "mac-address";
131 };
132
133 &mdio {
134 ethphy4: ethernet-phy@4 {
135 reg = <4>;
136 };
137 };
138
139 &switch0 {
140 ports {
141 port@2 {
142 status = "okay";
143 label = "lan1";
144 };
145
146 port@3 {
147 status = "okay";
148 label = "lan2";
149 };
150 };
151 };
152
153 &uartlite3 {
154 status = "okay";
155 };
156
157 &state_default {
158 gpio {
159 group = "wdt", "jtag";
160 function = "gpio";
161 };
162 };
163
164 &factory {
165 compatible = "nvmem-cells";
166 #address-cells = <1>;
167 #size-cells = <1>;
168
169 macaddr_factory_4000: macaddr@4000 {
170 reg = <0x4000 0x6>;
171 };
172 };