ramips/mt762x: convert devices to interrupt-driven gpio-keys
[oweals/openwrt.git] / target / linux / ramips / dts / mt7621_elecom_wrc-gst.dtsi
1 // SPDX-License-Identifier: GPL-2.0
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         aliases {
11                 led-boot = &led_power_green;
12                 led-failsafe = &led_power_green;
13                 led-running = &led_power_green;
14                 led-upgrade = &led_power_green;
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 = <&gpio0 7 GPIO_ACTIVE_HIGH>;
27                 };
28
29                 power_blue {
30                         label = "wrc-gst:blue:power";
31                         gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
32                 };
33
34                 wps {
35                         label = "wrc-gst:red:wps";
36                         gpios = <&gpio0 15 GPIO_ACTIVE_HIGH>;
37                 };
38
39                 power_red {
40                         label = "wrc-gst:red:power";
41                         gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
42                 };
43         };
44
45         keys {
46                 compatible = "gpio-keys";
47
48                 reset {
49                         label = "reset";
50                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
51                         linux,code = <KEY_RESTART>;
52                 };
53
54                 wps {
55                         label = "wps";
56                         gpios = <&gpio0 18 GPIO_ACTIVE_LOW>;
57                         linux,code = <KEY_WPS_BUTTON>;
58                 };
59
60                 client {
61                         label = "client";
62                         gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
63                         linux,code = <BTN_0>;
64                         linux,input-type = <EV_SW>;
65                 };
66
67                 ap {
68                         label = "ap";
69                         gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
70                         linux,code = <BTN_0>;
71                         linux,input-type = <EV_SW>;
72                 };
73
74                 extender {
75                         label = "extender";
76                         gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
77                         linux,code = <BTN_0>;
78                         linux,input-type = <EV_SW>;
79                 };
80
81                 router {
82                         label = "router";
83                         gpios = <&gpio1 12 GPIO_ACTIVE_LOW>;
84                         linux,code = <BTN_0>;
85                         linux,input-type = <EV_SW>;
86                 };
87         };
88 };
89
90 &ethernet {
91         mtd-mac-address = <&factory 0xe000>;
92 };
93
94 &spi0 {
95         status = "okay";
96
97         m25p80@0 {
98                 compatible = "jedec,spi-nor";
99                 reg = <0>;
100                 spi-max-frequency = <10000000>;
101
102                 partitions {
103                         compatible = "fixed-partitions";
104                         #address-cells = <1>;
105                         #size-cells = <1>;
106
107                         partition@0 {
108                                 label = "u-boot";
109                                 reg = <0x0 0x30000>;
110                                 read-only;
111                         };
112
113                         partition@30000 {
114                                 label = "u-boot-env";
115                                 reg = <0x30000 0x10000>;
116                                 read-only;
117                         };
118
119                         factory: partition@40000 {
120                                 label = "factory";
121                                 reg = <0x40000 0x10000>;
122                                 read-only;
123                         };
124
125                         partition@50000 {
126                                 compatible = "denx,uimage";
127                                 label = "firmware";
128                                 reg = <0x50000 0xb00000>;
129                         };
130
131                         partition@b50000 {
132                                 label = "tm_pattern";
133                                 reg = <0xb50000 0x380000>;
134                                 read-only;
135                         };
136
137                         partition@ed0000 {
138                                 label = "tm_key";
139                                 reg = <0xed0000 0x80000>;
140                                 read-only;
141                         };
142
143                         partition@f50000 {
144                                 label = "art_block";
145                                 reg = <0xf50000 0x30000>;
146                                 read-only;
147                         };
148
149                         partition@f80000 {
150                                 label = "user_data";
151                                 reg = <0xf80000 0x80000>;
152                                 read-only;
153                         };
154                 };
155         };
156 };
157
158 &pinctrl {
159         state_default: pinctrl0 {
160                 gpio {
161                         ralink,group = "uart3", "jtag", "wdt", "sdhci";
162                         ralink,function = "gpio";
163                 };
164         };
165 };
166
167 &pcie {
168         status = "okay";
169         /* WRC-xxxxGST has MT7615 for 2.4/5 GHz wifi, but it's not supported */
170 };
171
172 &xhci {
173         status = "disabled";
174 };