ramips: use DT trigger for 2G WiFi on ASUS RT-AC51U
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7620a_edimax_ew-747x.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2
3 #include "mt7620a.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 compatible = "ralink,mt7620a-soc";
10
11 aliases {
12 led-boot = &led_power;
13 led-failsafe = &led_power;
14 led-running = &led_power;
15 led-upgrade = &led_power;
16 };
17
18 chosen {
19 bootargs = "console=ttyS0,57600";
20 };
21
22 keys {
23 compatible = "gpio-keys";
24
25 reset_wps {
26 label = "reset_wps";
27 gpios = <&gpio2 20 GPIO_ACTIVE_LOW>;
28 linux,code = <KEY_RESTART>;
29 };
30
31 switch_high {
32 label = "switch high";
33 gpios = <&gpio2 22 GPIO_ACTIVE_LOW>;
34 linux,code = <BTN_0>;
35 linux,input-type = <EV_SW>;
36 };
37
38 switch_off {
39 label = "switch off";
40 gpios = <&gpio2 23 GPIO_ACTIVE_LOW>;
41 linux,code = <BTN_1>;
42 linux,input-type = <EV_SW>;
43 };
44 };
45 };
46
47 &gpio1 {
48 status = "okay";
49 };
50
51 &gpio2 {
52 status = "okay";
53 };
54
55 &spi0 {
56 status = "okay";
57
58 flash@0 {
59 compatible = "jedec,spi-nor";
60 reg = <0>;
61 spi-max-frequency = <10000000>;
62
63 partitions {
64 compatible = "fixed-partitions";
65 #address-cells = <1>;
66 #size-cells = <1>;
67
68 partition@0 {
69 label = "u-boot";
70 reg = <0x0 0x30000>;
71 read-only;
72 };
73
74 partition@30000 {
75 label = "u-boot-env";
76 reg = <0x30000 0x10000>;
77 read-only;
78 };
79
80 factory: partition@40000 {
81 label = "factory";
82 reg = <0x40000 0x10000>;
83 read-only;
84 };
85
86 partition@50000 {
87 label = "cimage";
88 reg = <0x50000 0x20000>;
89 read-only;
90 };
91
92 partition@70000 {
93 compatible = "edimax,uimage";
94 label = "firmware";
95 reg = <0x00070000 0x00790000>;
96 };
97 };
98 };
99 };
100
101 &state_default {
102 gpio {
103 groups = "i2c", "uartf", "nd_sd", "rgmii2";
104 function = "gpio";
105 };
106 };
107
108 &pinctrl {
109 phy_reset_pins: phy-reset {
110 gpio {
111 groups = "spi refclk";
112 function = "gpio";
113 };
114 };
115 };
116
117 &ethernet {
118 pinctrl-names = "default";
119 pinctrl-0 = <&rgmii1_pins &mdio_pins &phy_reset_pins>;
120
121 mtd-mac-address = <&factory 0x4>;
122
123 mediatek,mdio-mode = <1>;
124
125 phy-reset-gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
126 phy-reset-duration = <30>;
127
128 port@5 {
129 status = "okay";
130 mediatek,fixed-link = <1000 1 1 1>;
131 phy-mode = "rgmii";
132 };
133
134 mdio-bus {
135 status = "okay";
136
137 phy0: ethernet-phy@0 {
138 status = "disabled";
139 reg = <0>;
140 phy-mode = "rgmii";
141 };
142
143 phy1: ethernet-phy@1 {
144 status = "disabled";
145 reg = <1>;
146 phy-mode = "rgmii";
147 };
148
149 phy2: ethernet-phy@2 {
150 status = "disabled";
151 reg = <2>;
152 phy-mode = "rgmii";
153 };
154
155 phy3: ethernet-phy@3 {
156 status = "disabled";
157 reg = <3>;
158 phy-mode = "rgmii";
159 };
160
161 phy4: ethernet-phy@4 {
162 status = "disabled";
163 reg = <4>;
164 phy-mode = "rgmii";
165 };
166 };
167 };
168
169 &gsw {
170 mediatek,port5 = "gmac";
171 };
172
173 &wmac {
174 ralink,mtd-eeprom = <&factory 0x0>;
175 };
176
177 &pcie {
178 status = "okay";
179 };
180
181 &pcie0 {
182 wifi@0,0 {
183 reg = <0x0000 0 0 0 0>;
184 mediatek,mtd-eeprom = <&factory 0x8000>;
185 mediatek,2ghz = <0>;
186 };
187 };