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