ramips: use DT trigger for 2G WiFi on ASUS RT-AC51U
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_xiaomi_mir3p.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include "mt7621.dtsi"
5
6 #include <dt-bindings/gpio/gpio.h>
7 #include <dt-bindings/input/input.h>
8
9 / {
10 compatible = "xiaomi,mir3p", "mediatek,mt7621-soc";
11 model = "Xiaomi Mi Router 3 Pro";
12
13 aliases {
14 led-boot = &led_status_yellow;
15 led-failsafe = &led_status_red;
16 led-running = &led_status_blue;
17 led-upgrade = &led_status_yellow;
18 label-mac-device = &gmac0;
19 };
20
21 chosen {
22 bootargs = "console=ttyS0,115200n8";
23 };
24
25 leds {
26 compatible = "gpio-leds";
27
28 led_status_red: status_red {
29 label = "mir3p:red:status";
30 gpios = <&gpio 6 GPIO_ACTIVE_LOW>;
31 };
32
33 led_status_blue: status_blue {
34 label = "mir3p:blue:status";
35 gpios = <&gpio 8 GPIO_ACTIVE_LOW>;
36 };
37
38 led_status_yellow: status_yellow {
39 label = "mir3p:yellow:status";
40 gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
41 };
42
43 wan_amber {
44 label = "mir3p:amber:wan";
45 gpios = <&gpio 14 GPIO_ACTIVE_LOW>;
46 linux,default-trigger = "dsa-0.0:04:1Gbps";
47 };
48
49 lan3_amber {
50 label = "mir3p:amber:lan3";
51 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
52 linux,default-trigger = "dsa-0.0:01:1Gbps";
53 };
54
55 lan2_amber {
56 label = "mir3p:amber:lan2";
57 gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
58 linux,default-trigger = "dsa-0.0:02:1Gbps";
59 };
60
61 lan1_amber {
62 label = "mir3p:amber:lan1";
63 gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
64 linux,default-trigger = "dsa-0.0:03:1Gbps";
65 };
66 };
67
68 keys {
69 compatible = "gpio-keys";
70
71 reset {
72 label = "reset";
73 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
74 linux,code = <KEY_RESTART>;
75 };
76 };
77
78 reg_usb_vbus: regulator {
79 compatible = "regulator-fixed";
80 regulator-name = "usb_vbus";
81 regulator-min-microvolt = <5000000>;
82 regulator-max-microvolt = <5000000>;
83 gpio = <&gpio 12 GPIO_ACTIVE_HIGH>;
84 enable-active-high;
85 };
86 };
87
88 &xhci {
89 vbus-supply = <&reg_usb_vbus>;
90 };
91
92 &nand {
93 status = "okay";
94
95 partitions {
96 compatible = "fixed-partitions";
97 #address-cells = <1>;
98 #size-cells = <1>;
99
100 partition@0 {
101 label = "Bootloader";
102 reg = <0x0 0x40000>;
103 read-only;
104 };
105
106 partition@40000 {
107 label = "Config";
108 reg = <0x40000 0x40000>;
109 };
110
111 partition@80000 {
112 label = "Bdata";
113 reg = <0x80000 0x40000>;
114 read-only;
115 };
116
117 factory: partition@c0000 {
118 label = "factory";
119 reg = <0x0c0000 0x40000>;
120 read-only;
121 };
122
123 partition@100000 {
124 label = "crash";
125 reg = <0x100000 0x40000>;
126 };
127
128 partition@140000 {
129 label = "crash_syslog";
130 reg = <0x140000 0x80000>;
131 };
132
133 partition@1c0000 {
134 label = "reserved0";
135 reg = <0x1c0000 0x40000>;
136 read-only;
137 };
138
139 /* We keep stock xiaomi firmware (kernel0) here */
140 partition@200000 {
141 label = "kernel_stock";
142 reg = <0x200000 0x400000>;
143 };
144
145 partition@600000 {
146 label = "kernel";
147 reg = <0x600000 0x400000>;
148 };
149
150 partition@a00000 {
151 label = "ubi";
152 reg = <0xa00000 0xf580000>;
153 };
154 };
155 };
156
157 &pcie {
158 status = "okay";
159 };
160
161 &pcie0 {
162 wifi@0,0 {
163 compatible = "mediatek,mt76";
164 reg = <0x0000 0 0 0 0>;
165 mediatek,mtd-eeprom = <&factory 0x0000>;
166 ieee80211-freq-limit = <2400000 2500000>;
167 };
168 };
169
170 &pcie1 {
171 wifi@0,0 {
172 compatible = "mediatek,mt76";
173 reg = <0x0000 0 0 0 0>;
174 mediatek,mtd-eeprom = <&factory 0x8000>;
175 ieee80211-freq-limit = <5000000 6000000>;
176 };
177 };
178
179 &gmac0 {
180 mtd-mac-address = <&factory 0xe006>;
181 };
182
183 &switch0 {
184 ports {
185 port@1 {
186 status = "okay";
187 label = "lan3";
188 };
189
190 port@2 {
191 status = "okay";
192 label = "lan2";
193 };
194
195 port@3 {
196 status = "okay";
197 label = "lan1";
198 };
199
200 port@4 {
201 status = "okay";
202 label = "wan";
203 mtd-mac-address = <&factory 0xe000>;
204 };
205 };
206 };
207
208 &state_default {
209 gpio {
210 groups = "jtag", "uart2", "uart3", "wdt";
211 function = "gpio";
212 };
213 };