ramips: provide common definition for ELECOM WRC GS devices
[openwrt/openwrt.git] / target / linux / ramips / dts / mt7621_elecom_wrc-gs.dtsi
1 // SPDX-License-Identifier: GPL-2.0
2
3 #include "mt7621.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9 aliases {
10 led-boot = &led_power_green;
11 led-failsafe = &led_power_green;
12 led-running = &led_power_green;
13 led-upgrade = &led_power_green;
14 label-mac-device = &wan;
15 };
16
17 chosen {
18 bootargs = "console=ttyS0,57600";
19 };
20
21 leds {
22 compatible = "gpio-leds";
23
24 led_power_green: power_green {
25 label = "wrc-gst:green:power";
26 gpios = <&gpio 7 GPIO_ACTIVE_HIGH>;
27 };
28
29 power_blue {
30 label = "wrc-gst:blue:power";
31 gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
32 };
33
34 wps {
35 label = "wrc-gst:red:wps";
36 gpios = <&gpio 15 GPIO_ACTIVE_HIGH>;
37 };
38
39 power_red {
40 label = "wrc-gst:red:power";
41 gpios = <&gpio 16 GPIO_ACTIVE_HIGH>;
42 };
43 };
44
45 keys {
46 compatible = "gpio-keys";
47
48 reset {
49 label = "reset";
50 gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
51 linux,code = <KEY_RESTART>;
52 };
53
54 wps {
55 label = "wps";
56 gpios = <&gpio 18 GPIO_ACTIVE_LOW>;
57 linux,code = <KEY_WPS_BUTTON>;
58 };
59
60 client {
61 label = "client";
62 gpios = <&gpio 41 GPIO_ACTIVE_LOW>;
63 linux,code = <BTN_0>;
64 linux,input-type = <EV_SW>;
65 };
66
67 ap {
68 label = "ap";
69 gpios = <&gpio 42 GPIO_ACTIVE_LOW>;
70 linux,code = <BTN_0>;
71 linux,input-type = <EV_SW>;
72 };
73
74 extender {
75 label = "extender";
76 gpios = <&gpio 43 GPIO_ACTIVE_LOW>;
77 linux,code = <BTN_0>;
78 linux,input-type = <EV_SW>;
79 };
80
81 router {
82 label = "router";
83 gpios = <&gpio 44 GPIO_ACTIVE_LOW>;
84 linux,code = <BTN_0>;
85 linux,input-type = <EV_SW>;
86 };
87 };
88 };
89
90 &gmac0 {
91 mtd-mac-address = <&factory 0xe000>;
92 };
93
94 &switch0 {
95 ports {
96 wan: port@0 {
97 status = "okay";
98 label = "wan";
99 mtd-mac-address = <&factory 0xe006>;
100 };
101
102 port@1 {
103 status = "okay";
104 label = "lan4";
105 };
106
107 port@2 {
108 status = "okay";
109 label = "lan3";
110 };
111
112 port@3 {
113 status = "okay";
114 label = "lan2";
115 };
116
117 port@4 {
118 status = "okay";
119 label = "lan1";
120 };
121 };
122 };
123
124 &spi0 {
125 status = "okay";
126
127 flash@0 {
128 compatible = "jedec,spi-nor";
129 reg = <0>;
130 spi-max-frequency = <40000000>;
131
132 partitions: partitions {
133 compatible = "fixed-partitions";
134 #address-cells = <1>;
135 #size-cells = <1>;
136
137 partition@0 {
138 label = "u-boot";
139 reg = <0x0 0x30000>;
140 read-only;
141 };
142
143 partition@30000 {
144 label = "u-boot-env";
145 reg = <0x30000 0x10000>;
146 read-only;
147 };
148
149 factory: partition@40000 {
150 label = "factory";
151 reg = <0x40000 0x10000>;
152 read-only;
153 };
154 };
155 };
156 };
157
158 &state_default {
159 gpio {
160 groups = "uart3", "jtag", "wdt", "sdhci";
161 function = "gpio";
162 };
163 };
164
165 &pcie {
166 status = "okay";
167 };
168
169 &pcie0 {
170 wifi@0,0 {
171 compatible = "mediatek,mt76";
172 reg = <0x0000 0 0 0 0>;
173 mediatek,mtd-eeprom = <&factory 0x0000>;
174 ieee80211-freq-limit = <2400000 2500000>;
175
176 led {
177 led-sources = <0>;
178 led-active-low;
179 };
180 };
181 };
182
183 &pcie1 {
184 wifi@0,0 {
185 compatible = "mediatek,mt76";
186 reg = <0x0000 0 0 0 0>;
187 mediatek,mtd-eeprom = <&factory 0x8000>;
188 ieee80211-freq-limit = <5000000 6000000>;
189
190 led {
191 led-sources = <0>;
192 led-active-low;
193 };
194 };
195 };
196
197 &xhci {
198 status = "disabled";
199 };