ramips: mt7621-dts: mux phy0/4 to gmac1
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_iptime_a3004t.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 #include <dt-bindings/leds/common.h>
8
9 / {
10 compatible = "iptime,a3004t", "mediatek,mt7621-soc";
11 model = "ipTIME A3004T";
12
13 aliases {
14 led-boot = &led_cpu;
15 led-failsafe = &led_cpu;
16 led-running = &led_cpu;
17 led-upgrade = &led_cpu;
18 };
19
20 leds {
21 compatible = "gpio-leds";
22
23 led_cpu: led-0 {
24 label = "amber:cpu";
25 color = <LED_COLOR_ID_AMBER>;
26 function = LED_FUNCTION_CPU;
27 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
28 };
29
30 led-1 {
31 color = <LED_COLOR_ID_AMBER>;
32 function = LED_FUNCTION_WLAN;
33 function-enumerator = <0>;
34 gpios = <&gpio 17 GPIO_ACTIVE_LOW>;
35 linux,default-trigger = "phy0radio";
36 };
37
38 led-2 {
39 color = <LED_COLOR_ID_AMBER>;
40 function = LED_FUNCTION_WLAN;
41 function-enumerator = <1>;
42 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
43 linux,default-trigger = "phy1radio";
44 };
45 };
46
47 keys {
48 compatible = "gpio-keys";
49
50 reset {
51 label = "reset";
52 gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
53 linux,code = <KEY_RESTART>;
54 };
55 };
56 };
57
58 &nand {
59 status = "okay";
60
61 partitions {
62 compatible = "fixed-partitions";
63 #address-cells = <1>;
64 #size-cells = <1>;
65
66 partition@0 {
67 label = "u-boot";
68 reg = <0x0 0x80000>;
69 read-only;
70 };
71
72 partition@80000 {
73 label = "config";
74 reg = <0x80000 0x20000>;
75 read-only;
76 };
77
78 factory: partition@a0000 {
79 label = "factory";
80 reg = <0xa0000 0x20000>;
81 read-only;
82
83 compatible = "nvmem-cells";
84 #address-cells = <1>;
85 #size-cells = <1>;
86
87 macaddr_factory_4: macaddr@4 {
88 reg = <0x4 0x6>;
89 };
90
91 macaddr_factory_8004: macaddr@8004 {
92 reg = <0x8004 0x6>;
93 };
94 };
95
96 partition@140000 {
97 label = "firmware";
98 reg = <0x140000 0x7e40000>;
99
100 compatible = "fixed-partitions";
101 #address-cells = <1>;
102 #size-cells = <1>;
103
104 partition@0 {
105 label = "kernel";
106 reg = <0x0 0x400000>;
107 };
108
109 partition@400000 {
110 label = "ubi";
111 reg = <0x400000 0x7a40000>;
112 };
113 };
114 };
115 };
116
117 &gmac0 {
118 nvmem-cells = <&macaddr_factory_4>;
119 nvmem-cell-names = "mac-address";
120 mac-address-increment = <(3)>;
121 };
122
123 &gmac1 {
124 status = "okay";
125 label = "wan";
126 phy-handle = <&ethphy0>;
127
128 nvmem-cells = <&macaddr_factory_4>;
129 nvmem-cell-names = "mac-address";
130 mac-address-increment = <(1)>;
131 };
132
133 &mdio {
134 ethphy0: ethernet-phy@0 {
135 reg = <0>;
136 };
137 };
138
139 &switch0 {
140 ports {
141 port@1 {
142 status = "okay";
143 label = "lan4";
144 };
145
146 port@2 {
147 status = "okay";
148 label = "lan3";
149 };
150
151 port@3 {
152 status = "okay";
153 label = "lan2";
154 };
155
156 port@4 {
157 status = "okay";
158 label = "lan1";
159 };
160 };
161 };
162
163 &pcie {
164 status = "okay";
165 };
166
167 &pcie0 {
168 wifi@0,0 {
169 compatible = "mediatek,mt76";
170 reg = <0x0000 0 0 0 0>;
171 mediatek,mtd-eeprom = <&factory 0x0>;
172 };
173 };
174
175 &state_default {
176 gpio {
177 groups = "i2c", "jtag", "wdt";
178 function = "gpio";
179 };
180 };