ramips: fix switch setup for Xiaomi MiWiFi Nano
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_edimax_rg21s.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 = "edimax,rg21s", "mediatek,mt7621-soc";
11         model = "Edimax RG21S";
12
13         aliases {
14                 led-boot = &led_power;
15                 led-failsafe = &led_power;
16                 led-running = &led_power;
17                 led-upgrade = &led_power;
18                 label-mac-device = &ethernet;
19         };
20
21         chosen {
22                 bootargs = "console=ttyS0,57600";
23         };
24
25         keys {
26                 compatible = "gpio-keys";
27
28                 reset {
29                         label = "reset";
30                         gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
31                         linux,code = <KEY_RESTART>;
32                 };
33
34                 wps {
35                         label = "wps";
36                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
37                         linux,code = <KEY_WPS_BUTTON>;
38                 };
39         };
40
41         leds {
42                 compatible = "gpio-leds";
43
44                 led_power: led_1 {
45                         label = "rg21s:red:led1";
46                         gpios = <&gpio0 7 GPIO_ACTIVE_HIGH>;
47                 };
48
49                 led_2 {
50                         label = "rg21s:red:led2";
51                         gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
52                 };
53
54                 led_3 {
55                         label = "rg21s:red:led3";
56                         gpios = <&gpio0 14 GPIO_ACTIVE_HIGH>;
57                 };
58
59                 led_4 {
60                         label = "rg21s:red:led4";
61                         gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
62                 };
63         };
64 };
65
66 &spi0 {
67         status = "okay";
68
69         flash@0 {
70                 compatible = "jedec,spi-nor";
71                 reg = <0>;
72                 spi-max-frequency = <40000000>;
73
74                 partitions {
75                         compatible = "fixed-partitions";
76                         #address-cells = <1>;
77                         #size-cells = <1>;
78
79                         partition@0 {
80                                 label = "u-boot";
81                                 reg = <0x0 0x30000>;
82                                 read-only;
83                         };
84
85                         partition@30000 {
86                                 label = "u-boot-env";
87                                 reg = <0x30000 0x10000>;
88                                 read-only;
89                         };
90
91                         factory: partition@40000 {
92                                 label = "factory";
93                                 reg = <0x40000 0x10000>;
94                                 read-only;
95                         };
96
97                         partition@50000 {
98                                 compatible = "denx,uimage";
99                                 label = "firmware";
100                                 reg = <0x50000 0xfb0000>;
101                         };
102                 };
103         };
104 };
105
106 &pcie {
107         status = "okay";
108 };
109
110 &pcie0 {
111         wifi0: wifi@0,0 {
112                 compatible = "mediatek,mt76";
113                 reg = <0x0000 0 0 0 0>;
114                 mediatek,mtd-eeprom = <&factory 0x0000>;
115                 ieee80211-freq-limit = <2400000 2500000>;
116         };
117 };
118
119 &pcie1 {
120         wifi1: wifi@0,0 {
121                 compatible = "mediatek,mt76";
122                 reg = <0x0000 0 0 0 0>;
123                 mediatek,mtd-eeprom = <&factory 0x8000>;
124                 ieee80211-freq-limit = <5000000 6000000>;
125         };
126 };
127
128 &ethernet {
129         mtd-mac-address = <&factory 0x4>;
130
131         mediatek,portmap = "wllll";
132         port@5 {
133                 status = "disabled";
134         };
135 };
136
137 &state_default {
138         gpio {
139                 ralink,group = "uart3", "uart2", "jtag", "wdt";
140                 ralink,function = "gpio";
141         };
142 };
143
144 &xhci {
145         status = "disabled";
146 };