e77f83d354bb0c3411c31b7cdd14dfd22f9f3622
[openwrt/staging/stintel.git] / target / linux / mediatek / dts / mt7622-buffalo-wsr.dtsi
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/leds/common.h>
7
8 #include "mt7622.dtsi"
9 #include "mt6380.dtsi"
10
11 / {
12 aliases {
13 serial0 = &uart0;
14 led-boot = &power_green;
15 led-failsafe = &power_amber;
16 led-running = &power_green;
17 led-upgrade = &power_green;
18 };
19
20 chosen {
21 bootargs = "earlycon=uart8250,mmio32,0x11002000 console=ttyS0,115200n8 swiotlb=512";
22 };
23
24 leds {
25 compatible = "gpio-leds";
26
27 led-0 {
28 label = "amber:wireless";
29 gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
30 color = <LED_COLOR_ID_AMBER>;
31 function = LED_FUNCTION_WLAN;
32 };
33
34 power_amber: led-1 {
35 label = "amber:power";
36 gpios = <&pio 3 GPIO_ACTIVE_LOW>;
37 color = <LED_COLOR_ID_AMBER>;
38 function = LED_FUNCTION_POWER;
39 };
40
41 power_green: led-2 {
42 label = "green:power";
43 gpios = <&pio 4 GPIO_ACTIVE_LOW>;
44 color = <LED_COLOR_ID_GREEN>;
45 function = LED_FUNCTION_POWER;
46 };
47
48 led-3 {
49 label = "green:wireless";
50 gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
51 color = <LED_COLOR_ID_GREEN>;
52 function = LED_FUNCTION_WLAN;
53 };
54
55 led-4 {
56 label = "green:internet";
57 gpios = <&pio 19 GPIO_ACTIVE_HIGH>;
58 color = <LED_COLOR_ID_GREEN>;
59 function = LED_FUNCTION_WAN;
60 };
61
62 led-5 {
63 label = "green:router";
64 gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
65 color = <LED_COLOR_ID_GREEN>;
66 function = LED_FUNCTION_INDICATOR;
67 };
68 };
69
70 keys {
71 compatible = "gpio-keys";
72
73 key-reset {
74 label = "reset";
75 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
76 linux,code = <KEY_RESTART>;
77 };
78
79 /* GPIO 1 and 16 are a tri-state switch button with
80 * ROUTER / AP / WB.
81 */
82 key-router {
83 label = "router";
84 gpios = <&pio 1 GPIO_ACTIVE_LOW>;
85 linux,code = <BTN_0>;
86 linux,input-type = <EV_SW>;
87 };
88
89 key-bridge {
90 label = "wb";
91 gpios = <&pio 16 GPIO_ACTIVE_LOW>;
92 linux,code = <BTN_1>;
93 linux,input-type = <EV_SW>;
94 };
95
96 /* GPIO 18 is a switch button with AUTO / MANUAL. */
97 key-manual {
98 label = "manual";
99 gpios = <&pio 18 GPIO_ACTIVE_LOW>;
100 linux,code = <BTN_2>;
101 linux,input-type = <EV_SW>;
102 };
103
104 key-wps {
105 label = "wps";
106 gpios = <&pio 102 GPIO_ACTIVE_LOW>;
107 linux,code = <KEY_WPS_BUTTON>;
108 };
109 };
110 };
111
112 &cpu0 {
113 proc-supply = <&mt6380_vcpu_reg>;
114 sram-supply = <&mt6380_vm_reg>;
115 };
116
117 &cpu1 {
118 proc-supply = <&mt6380_vcpu_reg>;
119 sram-supply = <&mt6380_vm_reg>;
120 };
121
122 &pcie0 {
123 pinctrl-names = "default";
124 pinctrl-0 = <&pcie0_pins>;
125 status = "okay";
126 };
127
128 &slot0 {
129 status = "okay";
130
131 wifi@0,0 {
132 compatible = "mediatek,mt76";
133 reg = <0x0000 0 0 0 0>;
134 mediatek,mtd-eeprom = <&factory 0x5000>;
135 ieee80211-freq-limit = <5000000 6000000>;
136 };
137 };
138
139 &pio {
140 eth_pins: eth-pins {
141 mux {
142 function = "eth";
143 groups = "mdc_mdio", "rgmii_via_gmac2";
144 };
145 };
146
147 pcie0_pins: pcie0-pins {
148 mux {
149 function = "pcie";
150 groups = "pcie0_pad_perst",
151 "pcie0_1_waken",
152 "pcie0_1_clkreq";
153 };
154 };
155
156 pmic_bus_pins: pmic-bus-pins {
157 mux {
158 function = "pmic";
159 groups = "pmic_bus";
160 };
161 };
162
163 uart0_pins: uart0-pins {
164 mux {
165 function = "uart";
166 groups = "uart0_0_tx_rx" ;
167 };
168 };
169
170 watchdog_pins: watchdog-pins {
171 mux {
172 function = "watchdog";
173 groups = "watchdog";
174 };
175 };
176 };
177
178 &eth {
179 pinctrl-names = "default";
180 pinctrl-0 = <&eth_pins>;
181 status = "okay";
182
183 gmac0: mac@0 {
184 compatible = "mediatek,eth-mac";
185 reg = <0>;
186
187 phy-connection-type = "2500base-x";
188
189 fixed-link {
190 speed = <2500>;
191 full-duplex;
192 pause;
193 };
194 };
195
196 mdio: mdio-bus {
197 #address-cells = <1>;
198 #size-cells = <0>;
199 };
200 };
201
202 &bch {
203 status = "okay";
204 };
205
206 &pwm {
207 status = "okay";
208 };
209
210 &pwrap {
211 pinctrl-names = "default";
212 pinctrl-0 = <&pmic_bus_pins>;
213 status = "okay";
214 };
215
216 &uart0 {
217 pinctrl-names = "default";
218 pinctrl-0 = <&uart0_pins>;
219 status = "okay";
220 };
221
222 &watchdog {
223 pinctrl-names = "default";
224 pinctrl-0 = <&watchdog_pins>;
225 status = "okay";
226 };
227
228 &wmac {
229 status = "okay";
230
231 mediatek,mtd-eeprom = <&factory 0x0>;
232 };
233
234 &rtc {
235 status = "disabled";
236 };