0386865cc24457431d045ac734c40063010ff86f
[openwrt/staging/chunkeey.git] / target / linux / mediatek / dts / mt7622-totolink-a8000ru.dts
1 // SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2
3 /dts-v1/;
4 #include <dt-bindings/input/input.h>
5 #include <dt-bindings/gpio/gpio.h>
6
7 #include "mt7622.dtsi"
8 #include "mt6380.dtsi"
9
10 / {
11 model = "TOTOLINK A8000RU";
12 compatible = "totolink,a8000ru", "mediatek,mt7622";
13
14 aliases {
15 label-mac-device = &gmac0;
16 led-boot = &led_status;
17 led-failsafe = &led_status;
18 led-running = &led_status;
19 led-upgrade = &led_status;
20 serial0 = &uart0;
21 };
22
23 chosen {
24 stdout-path = "serial0:115200n8";
25 bootargs = "earlycon=uart8250,mmio32,0x11002000 swiotlb=512";
26 };
27
28 cpus {
29 cpu@0 {
30 proc-supply = <&mt6380_vcpu_reg>;
31 sram-supply = <&mt6380_vm_reg>;
32 };
33
34 cpu@1 {
35 proc-supply = <&mt6380_vcpu_reg>;
36 sram-supply = <&mt6380_vm_reg>;
37 };
38 };
39
40 gpio-keys {
41 compatible = "gpio-keys";
42
43 reset {
44 label = "reset";
45 linux,code = <KEY_RESTART>;
46 gpios = <&pio 0 GPIO_ACTIVE_LOW>;
47 };
48
49 wps {
50 label = "wps";
51 linux,code = <KEY_WPS_BUTTON>;
52 gpios = <&pio 102 GPIO_ACTIVE_LOW>;
53 };
54 };
55
56 gpio-leds {
57 compatible = "gpio-leds";
58
59 led_status: status_red {
60 label = "red:status";
61 gpios = <&pio 81 GPIO_ACTIVE_LOW>;
62 default-state = "on";
63 };
64 };
65
66 reg_1p8v: regulator-1p8v {
67 compatible = "regulator-fixed";
68 regulator-name = "fixed-1.8V";
69 regulator-min-microvolt = <1800000>;
70 regulator-max-microvolt = <1800000>;
71 regulator-always-on;
72 };
73
74 reg_3p3v: regulator-3p3v {
75 compatible = "regulator-fixed";
76 regulator-name = "fixed-3.3V";
77 regulator-min-microvolt = <3300000>;
78 regulator-max-microvolt = <3300000>;
79 regulator-boot-on;
80 regulator-always-on;
81 };
82
83 rtkgsw: rtkgsw@0 {
84 compatible = "mediatek,rtk-gsw";
85 mediatek,ethsys = <&ethsys>;
86 mediatek,mdio = <&mdio>;
87 mediatek,reset-pin = <&pio 54 0>;
88 status = "okay";
89 };
90 };
91
92 &pcie0 {
93 pinctrl-names = "default";
94 pinctrl-0 = <&pcie0_pins>;
95 status = "okay";
96 };
97
98 &slot0 {
99 mt7615@0,0 {
100 reg = <0x0000 0 0 0 0>;
101 mediatek,mtd-eeprom = <&factory 0x5000>;
102 ieee80211-freq-limit = <5490000 6000000>;
103 };
104 };
105
106 &pcie1 {
107 pinctrl-names = "default";
108 pinctrl-0 = <&pcie1_pins>;
109 status = "okay";
110 };
111
112 &slot1 {
113 mt7615@0,0 {
114 reg = <0x0000 0 0 0 0>;
115 mediatek,mtd-eeprom = <&factory 0x10000>;
116 ieee80211-freq-limit = <5000000 5490000>;
117 };
118 };
119
120 &pio {
121 eth_pins: eth-pins {
122 mux {
123 function = "eth";
124 groups = "mdc_mdio", "rgmii_via_gmac2";
125 };
126 };
127
128 pcie0_pins: pcie0-pins {
129 mux {
130 function = "pcie";
131 groups = "pcie0_pad_perst",
132 "pcie0_1_waken",
133 "pcie0_1_clkreq";
134 };
135 };
136
137 pcie1_pins: pcie1-pins {
138 mux {
139 function = "pcie";
140 groups = "pcie1_pad_perst",
141 "pcie1_0_waken",
142 "pcie1_0_clkreq";
143 };
144 };
145
146 pmic_bus_pins: pmic-bus-pins {
147 mux {
148 function = "pmic";
149 groups = "pmic_bus";
150 };
151 };
152
153 /* serial NAND is shared pin with SPI-NOR */
154 serial_nand_pins: serial-nand-pins {
155 mux {
156 function = "flash";
157 groups = "snfi";
158 };
159 };
160
161 uart0_pins: uart0-pins {
162 mux {
163 function = "uart";
164 groups = "uart0_0_tx_rx" ;
165 };
166 };
167
168 watchdog_pins: watchdog-pins {
169 mux {
170 function = "watchdog";
171 groups = "watchdog";
172 };
173 };
174
175 epa_elna_pins: epa-elna-pins {
176 mux {
177 function = "antsel";
178 groups = "antsel0", "antsel1", "antsel2", "antsel3",
179 "antsel4", "antsel5", "antsel6", "antsel7",
180 "antsel8", "antsel9", "antsel12", "antsel13",
181 "antsel14", "antsel15", "antsel16", "antsel17";
182 };
183 };
184 };
185
186 &eth {
187 status = "okay";
188 pinctrl-names = "default";
189 pinctrl-0 = <&eth_pins>;
190
191 gmac0: mac@0 {
192 compatible = "mediatek,eth-mac";
193 reg = <0>;
194 nvmem-cells = <&macaddr_factory_2a>;
195 nvmem-cell-names = "mac-address";
196 phy-connection-type = "2500base-x";
197 fixed-link {
198 speed = <2500>;
199 full-duplex;
200 pause;
201 };
202 };
203
204 gmac1: mac@1 {
205 compatible = "mediatek,eth-mac";
206 reg = <1>;
207 phy-mode = "rgmii";
208 nvmem-cells = <&macaddr_factory_24>;
209 nvmem-cell-names = "mac-address";
210 fixed-link {
211 speed = <1000>;
212 full-duplex;
213 pause;
214 };
215 };
216
217 mdio: mdio-bus {
218 #address-cells = <1>;
219 #size-cells = <0>;
220 };
221 };
222
223 &pwrap {
224 pinctrl-names = "default";
225 pinctrl-0 = <&pmic_bus_pins>;
226 status = "okay";
227 };
228
229 &snand {
230 mediatek,quad-spi;
231 pinctrl-names = "default";
232 pinctrl-0 = <&serial_nand_pins>;
233 status = "okay";
234 mediatek,bmt-v2;
235
236 partitions {
237 compatible = "fixed-partitions";
238 #address-cells = <1>;
239 #size-cells = <1>;
240
241 partition@0 {
242 label = "Preloader";
243 reg = <0x0 0x80000>;
244 read-only;
245 };
246
247 partition@80000 {
248 label = "ATF";
249 reg = <0x80000 0x40000>;
250 read-only;
251 };
252
253 partition@c0000 {
254 label = "u-boot";
255 reg = <0xc0000 0x80000>;
256 read-only;
257 };
258
259 partition@140000 {
260 label = "u-boot-env";
261 reg = <0x140000 0x80000>;
262 read-only;
263 };
264
265 factory: partition@1c0000 {
266 label = "factory";
267 reg = <0x1c0000 0x40000>;
268 read-only;
269 };
270
271 partition@200000 {
272 label = "ubi";
273 reg = <0x200000 0x6400000>;
274 };
275
276 partition@6600000 {
277 label = "User_data";
278 reg = <0x6600000 0x100000>;
279 };
280
281 /* size of this partition varies due to BMT & bad blocks. */
282 partition@6700000 {
283 label = "reserved";
284 reg = <0x6700000 0>;
285 };
286 };
287 };
288
289 &factory {
290 compatible = "nvmem-cells";
291 #address-cells = <1>;
292 #size-cells = <1>;
293
294 macaddr_factory_24: macaddr@24 {
295 reg = <0x24 0x6>;
296 };
297
298 macaddr_factory_2a: macaddr@2a {
299 reg = <0x2a 0x6>;
300 };
301 };
302
303 &ssusb {
304 vusb33-supply = <&reg_3p3v>;
305 status = "okay";
306 };
307
308 &u3phy {
309 status = "okay";
310 };
311
312 &uart0 {
313 pinctrl-names = "default";
314 pinctrl-0 = <&uart0_pins>;
315 status = "okay";
316 };
317
318 &watchdog {
319 pinctrl-names = "default";
320 pinctrl-0 = <&watchdog_pins>;
321 status = "okay";
322 };
323
324 &wmac {
325 pinctrl-names = "default";
326 pinctrl-0 = <&epa_elna_pins>;
327 mediatek,mtd-eeprom = <&factory 0x0>;
328 status = "okay";
329 };